session

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProjectID            string
	JWTIssuer            string
	JwksURI              string
	JWKSRefreshInterval  time.Duration
	JWKSRefreshRateLimit time.Duration
	JWKSRefreshTimeout   time.Duration
}

type Impl

type Impl struct {
	// contains filtered or unexported fields
}

func New

func New(client *api.ClientWithResponses, config *Config) (*Impl, error)

New returns new user client

func (*Impl) ConfigGet

func (i *Impl) ConfigGet(ctx context.Context, params *api.SessionConfigGetParams, editors ...api.RequestEditorFn) (*api.SessionConfigGetRsp, error)

ConfigGet retrieves session config by projectID inferred from authentication

func (*Impl) GetCurrentUser

func (i *Impl) GetCurrentUser(shortSession string) (*entities2.User, error)

func (*Impl) LongSessionGet

func (i *Impl) LongSessionGet(ctx context.Context, sessionID string, editors ...api.RequestEditorFn) (*api.LongSessionGetRsp, error)

LongSessionGet gets a long session by sessionID

func (*Impl) LongSessionRevoke

func (i *Impl) LongSessionRevoke(ctx context.Context, sessionID string, req api.LongSessionRevokeReq, editors ...api.RequestEditorFn) error

LongSessionRevoke revokes an active long session by sessionID

func (*Impl) ValidateShortSessionValue

func (i *Impl) ValidateShortSessionValue(shortSession string) (*entities2.User, error)

type Session

type Session interface {
	ValidateShortSessionValue(shortSession string) (*entities2.User, error)
	GetCurrentUser(shortSession string) (*entities2.User, error)
	ConfigGet(ctx context.Context, params *api.SessionConfigGetParams, editors ...api.RequestEditorFn) (*api.SessionConfigGetRsp, error)
	LongSessionRevoke(ctx context.Context, sessionID string, req api.LongSessionRevokeReq, editors ...api.RequestEditorFn) error
	LongSessionGet(ctx context.Context, sessionID string, editors ...api.RequestEditorFn) (*api.LongSessionGetRsp, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL