www

package
v0.0.0-...-bbdcbae Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSessionID = errors.New("no session ID found")

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	Provider *oidc.Provider
	Config   oauth2.Config
}

Authenticator is used to authenticate our users.

func NewAuthenticator

func NewAuthenticator(ctx context.Context, req NewAuthenticatorRequest) (*Authenticator, error)

NewAuthenticator instantiates the *Authenticator.

func (*Authenticator) VerifyIDToken

func (a *Authenticator) VerifyIDToken(ctx context.Context, token *oauth2.Token) (*oidc.IDToken, error)

VerifyIDToken verifies that an *oauth2.Token is a valid *oidc.IDToken.

type Handler

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

func NewHandler

func NewHandler(
	baseURL string,
	env string,
	cookieStore *sessions.CookieStore,
	sessionRepo SessionRepository,
	auth *Authenticator,
	oidcLogoutRedirectURL string,
	csrfAuthKey []byte,
	authzSvc *authorization.Service,
	fileManagerSvc filemanager.Service,
	listingSvc listing.Service,
) (*Handler, error)

func (*Handler) BaseURL

func (h *Handler) BaseURL() string

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type NewAuthenticatorRequest

type NewAuthenticatorRequest struct {
	OIDCIssuerURL    string
	OIDCClientID     string
	OIDCClientSecret string
	OIDCRedirectURL  string
}

type Session

type Session struct {
	ID           string
	AccessToken  string
	TokenType    string
	RefreshToken string
	Expiry       time.Time
	ExpiresIn    int64
}

type SessionAlreadyExistsError

type SessionAlreadyExistsError struct {
	ID string
}

func (SessionAlreadyExistsError) Error

func (err SessionAlreadyExistsError) Error() string

type SessionNotFoundError

type SessionNotFoundError struct {
	ID string
}

func (SessionNotFoundError) Error

func (err SessionNotFoundError) Error() string

type SessionRepository

type SessionRepository interface {
	Insert(ctx context.Context, session *Session) (err error)
	Get(ctx context.Context, id string) (session *Session, err error)
	Replace(ctx context.Context, id string, session *Session) (err error)
}

Directories

Path Synopsis
templ: version: v0.3.857
templ: version: v0.3.857
components
templ: version: v0.3.857
templ: version: v0.3.857
icons
templ: version: v0.3.857
templ: version: v0.3.857

Jump to

Keyboard shortcuts

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