Documentation
¶
Overview ¶
Package sessionstorage implements database storage for session data. There are implementations for both Spanner and Postgres for each session type (i.e. OIDC, Username/Password, etc)
Index ¶
- type Base
- type OIDCAzure
- type PostgresOIDC
- func (p *PostgresOIDC) DestroySession(ctx context.Context, sessionID ccc.UUID) error
- func (p *PostgresOIDC) DestroySessionOIDC(ctx context.Context, oidcSID string) error
- func (p *PostgresOIDC) NewSession(ctx context.Context, username, oidcSID string) (ccc.UUID, error)
- func (p *PostgresOIDC) Session(ctx context.Context, sessionID ccc.UUID) (*sessioninfo.SessionInfo, error)
- func (p *PostgresOIDC) UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error
- type PostgresPreauth
- func (p *PostgresPreauth) DestroySession(ctx context.Context, sessionID ccc.UUID) error
- func (p *PostgresPreauth) NewSession(ctx context.Context, username string) (ccc.UUID, error)
- func (p *PostgresPreauth) Session(ctx context.Context, sessionID ccc.UUID) (*sessioninfo.SessionInfo, error)
- func (p *PostgresPreauth) UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error
- type Preauth
- type SpannerOIDC
- func (p *SpannerOIDC) DestroySession(ctx context.Context, sessionID ccc.UUID) error
- func (p *SpannerOIDC) DestroySessionOIDC(ctx context.Context, oidcSID string) error
- func (p *SpannerOIDC) NewSession(ctx context.Context, username, oidcSID string) (ccc.UUID, error)
- func (p *SpannerOIDC) Session(ctx context.Context, sessionID ccc.UUID) (*sessioninfo.SessionInfo, error)
- func (p *SpannerOIDC) UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error
- type SpannerPreauth
- func (p *SpannerPreauth) DestroySession(ctx context.Context, sessionID ccc.UUID) error
- func (p *SpannerPreauth) NewSession(ctx context.Context, username string) (ccc.UUID, error)
- func (p *SpannerPreauth) Session(ctx context.Context, sessionID ccc.UUID) (*sessioninfo.SessionInfo, error)
- func (p *SpannerPreauth) UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base interface {
DestroySession(ctx context.Context, sessionID ccc.UUID) error
UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error
Session(ctx context.Context, sessionID ccc.UUID) (*sessioninfo.SessionInfo, error)
}
Base defines an interface for managing session storage.
type OIDCAzure ¶
type OIDCAzure interface {
DestroySessionOIDC(ctx context.Context, oidcSID string) error
NewSession(ctx context.Context, username, oidcSID string) (ccc.UUID, error)
// shared storage methods
Base
}
OIDCAzure defines an interface for managing OIDC sessions.
type PostgresOIDC ¶
type PostgresOIDC struct {
// contains filtered or unexported fields
}
PostgresOIDC is the session storage implementation for PostgreSQL with OIDC support.
func NewPostgresOIDC ¶
func NewPostgresOIDC(db postgres.Queryer) *PostgresOIDC
NewPostgresOIDC creates a new PostgresOIDC instance.
func (*PostgresOIDC) DestroySession ¶
DestroySession marks the session as expired
func (*PostgresOIDC) DestroySessionOIDC ¶
func (p *PostgresOIDC) DestroySessionOIDC(ctx context.Context, oidcSID string) error
DestroySessionOIDC marks the session as expired
func (*PostgresOIDC) NewSession ¶
NewSession inserts SessionInfo into database
func (*PostgresOIDC) Session ¶
func (p *PostgresOIDC) Session(ctx context.Context, sessionID ccc.UUID) (*sessioninfo.SessionInfo, error)
Session returns the session information from the database for given sessionID
func (*PostgresOIDC) UpdateSessionActivity ¶
UpdateSessionActivity updates the database with the current time for the session activity
type PostgresPreauth ¶
type PostgresPreauth struct {
// contains filtered or unexported fields
}
PostgresPreauth is what you use to create / update sessions inside of the handlers or as a standalone if you don't want the handlers
func NewPostgresPreauth ¶
func NewPostgresPreauth(db postgres.Queryer) *PostgresPreauth
NewPostgresPreauth is the function that you use to create the session manager that handles the session creation and updates
func (*PostgresPreauth) DestroySession ¶
DestroySession marks the session as expired
func (*PostgresPreauth) NewSession ¶
NewSession inserts SessionInfo into the spanner database
func (*PostgresPreauth) Session ¶
func (p *PostgresPreauth) Session(ctx context.Context, sessionID ccc.UUID) (*sessioninfo.SessionInfo, error)
Session returns the session information from the database for given sessionID
func (*PostgresPreauth) UpdateSessionActivity ¶
UpdateSessionActivity updates the database with the current time for the session activity
type Preauth ¶
type Preauth interface {
NewSession(ctx context.Context, username string) (ccc.UUID, error)
// shared storage methods
Base
}
Preauth defines an interface for managing pre-authenticated sessions.
type SpannerOIDC ¶
type SpannerOIDC struct {
// contains filtered or unexported fields
}
SpannerOIDC is the session storage implementation for Spanner with OIDC support.
func NewSpannerOIDC ¶
func NewSpannerOIDC(db *cloudspanner.Client) *SpannerOIDC
NewSpannerOIDC creates a new SpannerOIDCSessionStorage instance.
func (*SpannerOIDC) DestroySession ¶
DestroySession marks the session as expired
func (*SpannerOIDC) DestroySessionOIDC ¶
func (p *SpannerOIDC) DestroySessionOIDC(ctx context.Context, oidcSID string) error
DestroySessionOIDC marks the session as expired
func (*SpannerOIDC) NewSession ¶
NewSession inserts SessionInfo into database
func (*SpannerOIDC) Session ¶
func (p *SpannerOIDC) Session(ctx context.Context, sessionID ccc.UUID) (*sessioninfo.SessionInfo, error)
Session returns the session information from the database for given sessionID
func (*SpannerOIDC) UpdateSessionActivity ¶
UpdateSessionActivity updates the database with the current time for the session activity
type SpannerPreauth ¶
type SpannerPreauth struct {
// contains filtered or unexported fields
}
SpannerPreauth is what you use to create / update sessions inside of the handlers or as a standalone if you don't want the handlers
func NewSpannerPreauth ¶
func NewSpannerPreauth(db *cloudspanner.Client) *SpannerPreauth
NewSpannerPreauth is the function that you use to create the session manager that handles the session creation and updates
func (*SpannerPreauth) DestroySession ¶
DestroySession marks the session as expired
func (*SpannerPreauth) NewSession ¶
NewSession inserts SessionInfo into the spanner database
func (*SpannerPreauth) Session ¶
func (p *SpannerPreauth) Session(ctx context.Context, sessionID ccc.UUID) (*sessioninfo.SessionInfo, error)
Session returns the session information from the database for given sessionID
func (*SpannerPreauth) UpdateSessionActivity ¶
UpdateSessionActivity updates the database with the current time for the session activity
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
dbtype
Package dbtype contains types used by the database driver packages for session storage.
|
Package dbtype contains types used by the database driver packages for session storage. |
|
postgres
Package postgres implements the session storage driver for PostgreSQL.
|
Package postgres implements the session storage driver for PostgreSQL. |
|
spanner
Package spanner provides the session storage driver for Spanner.
|
Package spanner provides the session storage driver for Spanner. |
|
mock
|
|
|
mock_sessionstorage
Package mock_sessionstorage is a generated GoMock package.
|
Package mock_sessionstorage is a generated GoMock package. |