Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSessionUserID ¶
GetUserID returns the user ID from the session if any
Types ¶
type AuthenticationSession ¶
type AuthenticationSession struct {
UserID string
OrgID string
OrgSlug string
OrgRole string
OrgPermissions []string
}
AuthenticationSession represents the authentication session for a user
func GetActiveSession ¶
func GetActiveSession(ctx context.Context) *AuthenticationSession
GetActiveSession returns the active session from the context if it exists
func NewAuthenticationSession ¶
func NewAuthenticationSession(orgID, orgSlug, orgRole, userID string, orgPermissions []string) (*AuthenticationSession, error)
NewAuthenticationSession creates a new authentication session
func (AuthenticationSession) Validate ¶
func (s AuthenticationSession) Validate() error
Validate validates the session.
func (AuthenticationSession) WithLogger ¶
func (s AuthenticationSession) WithLogger(logger *slog.Logger) *slog.Logger
WithLogger returns a new logger with the session context
type AuthenticatorContextKey ¶
type AuthenticatorContextKey string
const (
AuthenticationSessionKey AuthenticatorContextKey = "active_organization_id"
)
Click to show internal directories.
Click to hide internal directories.