auth

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 16 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider added in v1.3.0

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

Provider implements providers.AuthProvider with dynamic config. It reads OIDC/MagicLink configuration from configProvider on each call, supporting hot-reload of authentication settings.

func NewAuthProvider added in v1.3.0

func NewAuthProvider(cfg ProviderConfig) *Provider

NewAuthProvider creates a new dynamic auth provider.

func (*Provider) CreateReminderAuthToken added in v1.3.0

func (p *Provider) CreateReminderAuthToken(ctx context.Context, email, docID string) (string, error)

func (*Provider) GetCurrentUser added in v1.3.0

func (p *Provider) GetCurrentUser(r *http.Request) (*types.User, error)

func (*Provider) GetOIDCLogoutURL added in v1.3.0

func (p *Provider) GetOIDCLogoutURL() string

func (*Provider) HandleOIDCCallback added in v1.3.0

func (p *Provider) HandleOIDCCallback(ctx context.Context, w http.ResponseWriter, r *http.Request, code, state string) (*types.User, string, error)

func (*Provider) IsAllowedDomain added in v1.3.0

func (p *Provider) IsAllowedDomain(email string) bool

func (*Provider) IsConfigured added in v1.3.0

func (p *Provider) IsConfigured() bool

func (*Provider) IsMagicLinkEnabled added in v1.3.0

func (p *Provider) IsMagicLinkEnabled() bool

func (*Provider) IsOIDCEnabled added in v1.3.0

func (p *Provider) IsOIDCEnabled() bool

func (*Provider) Logout added in v1.3.0

func (p *Provider) Logout(w http.ResponseWriter, r *http.Request)
func (p *Provider) RequestMagicLink(ctx context.Context, email, redirectTo, ip, userAgent, locale string) error

func (*Provider) SetCurrentUser added in v1.3.0

func (p *Provider) SetCurrentUser(w http.ResponseWriter, r *http.Request, user *types.User) error

func (*Provider) StartOIDC added in v1.3.0

func (p *Provider) StartOIDC(w http.ResponseWriter, r *http.Request, nextURL string) string
func (p *Provider) VerifyMagicLink(ctx context.Context, token, ip, userAgent string) (*providers.MagicLinkResult, error)

func (*Provider) VerifyOIDCState added in v1.3.0

func (p *Provider) VerifyOIDCState(w http.ResponseWriter, r *http.Request, stateToken string) bool

func (*Provider) VerifyReminderAuthToken added in v1.3.0

func (p *Provider) VerifyReminderAuthToken(ctx context.Context, token, ip, userAgent string) (*providers.MagicLinkResult, error)

type ProviderConfig added in v1.3.0

type ProviderConfig struct {
	ConfigProvider   configProvider
	SessionService   *infraAuth.SessionService
	MagicLinkService magicLinkService
	BaseURL          string
}

ProviderConfig holds a configuration for creating a Provider.

type SimpleAuthorizer

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

SimpleAuthorizer is an authorization implementation based on a list of admin emails. This is the default authorizer for Community Edition.

func NewSimpleAuthorizer

func NewSimpleAuthorizer(adminEmails []string, onlyAdminCanCreate bool) *SimpleAuthorizer

NewSimpleAuthorizer creates a new simple authorizer.

func (*SimpleAuthorizer) CanCreateDocument

func (a *SimpleAuthorizer) CanCreateDocument(ctx context.Context, userEmail string) bool

CanCreateDocument implements providers.Authorizer.

func (*SimpleAuthorizer) IsAdmin

func (a *SimpleAuthorizer) IsAdmin(_ context.Context, userEmail string) bool

IsAdmin implements providers.Authorizer.

Jump to

Keyboard shortcuts

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