authmanager

package
v0.49.5 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package authmanager provides the authentication manager for the server to handle session issuance and validation

Index

Constants

View Source
const (
	AnonTrustcenterJWTPrefix   = "anon_trustcenter_"
	AnonQuestionnaireJWTPrefix = "anon_questionnaire_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.7.0

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

Client holds the necessary clients and configuration for the auth manager

func New

func New(db *generated.Client) *Client

New creates a new auth manager client with the provided database client

func (*Client) GenerateAnonymousQuestionnaireSession added in v0.46.3

func (a *Client) GenerateAnonymousQuestionnaireSession(ctx context.Context, w http.ResponseWriter, targetOrgID string, targetAssessmentID string, email string) (*models.AuthData, error)

GenerateAnonymousQuestionnaireSession creates a new auth session for the anonymous questionnaire user

func (*Client) GenerateAnonymousTrustCenterSession added in v0.20.5

func (a *Client) GenerateAnonymousTrustCenterSession(ctx context.Context, w http.ResponseWriter, targetOrgID string, targetTrustCenterID string) (*models.AuthData, error)

GenerateAnonymousTrustCenterSession creates a new auth session for the anonymous trust center user

func (*Client) GenerateOauthAuthSession added in v0.7.0

func (a *Client) GenerateOauthAuthSession(ctx context.Context, w http.ResponseWriter, user *generated.User, oauthRequest models.OauthTokenRequest) (*models.AuthData, error)

GenerateOauthAuthSession creates a new auth session for the oauth user and their default organization id

func (*Client) GenerateUserAuthSession added in v0.7.0

func (a *Client) GenerateUserAuthSession(ctx context.Context, w http.ResponseWriter, user *generated.User) (*models.AuthData, error)

GenerateUserAuthSession creates a new auth session for the user and their default organization id this is used during the login process

func (*Client) GenerateUserAuthSessionWithOrg added in v0.7.0

func (a *Client) GenerateUserAuthSessionWithOrg(ctx context.Context, w http.ResponseWriter, user *generated.User, targetOrgID string) (*models.AuthData, error)

GenerateUserAuthSessionWithOrg creates a new auth session for the user and the new target organization id this is used when the user is switching organizations, or when the user deletes their authorized organization and is automatically switched into another organization Before the sessions is issues, we check that the user still has access to the target organization if not, the user's default org (or personal org) is used

func (*Client) GetDBClient added in v0.7.0

func (a *Client) GetDBClient() *generated.Client

GetDBClient returns the database client

func (*Client) GetSessionConfig added in v0.7.0

func (a *Client) GetSessionConfig() *sessions.SessionConfig

GetSessionConfig returns the session config

func (*Client) SetDBClient added in v0.7.0

func (a *Client) SetDBClient(db *generated.Client)

SetDBClient sets the database client in the config

Jump to

Keyboard shortcuts

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