provider

package
v1.2.2-0...-18e1836 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenArgsKey                        = "token"
	ProviderArgsKey                     = "provider"
	CategoryIDArgsKey                   = "category_id"
	RequestBodyArgsKey                  = "request_body"
	RedirectArgsKey                     = "redirect"
	FormUsernameArgsKey                 = "form_username"
	FormPasswordArgsKey                 = "form_password"
	HTTPRequest         HTTPRequestType = "req"
)
View Source
const (
	ACSRoute      = "/saml/acs"
	MetadataRoute = "/saml/metadata"
	SLORoute      = "/saml/slo"
)

Variables

View Source
var (
	ErrInternal           = errors.New("internal server error")
	ErrInvalidCredentials = errors.New("invalid credentials")
	ErrUserDisabled       = errors.New("disabled user")
	ErrUserDisallowed     = errors.New("user can't use IsardVDI")
	ErrUnknownIDP         = errors.New("unknown identity provider")
)

Functions

This section is empty.

Types

type CallbackArgs

type CallbackArgs struct {
	Oauth2Code *string
}

type External

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

func (External) AutoRegister

func (External) AutoRegister(*model.User) bool

func (External) Healthcheck

func (External) Healthcheck() error

func (*External) Login

func (External) String

func (External) String() string

type Form

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

func InitForm

func InitForm(cfg cfg.Authentication, log *zerolog.Logger, db r.QueryExecutor) *Form

func (*Form) AutoRegister

func (f *Form) AutoRegister(u *model.User) bool

func (*Form) Healthcheck

func (f *Form) Healthcheck() error

func (*Form) Login

func (f *Form) Login(ctx context.Context, categoryID string, args LoginArgs) (*model.Group, *types.ProviderUserData, string, string, *ProviderError)

func (*Form) Providers

func (f *Form) Providers() []string

func (*Form) String

func (f *Form) String() string

type Google

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

func InitGoogle

func InitGoogle(cfg cfg.Authentication) *Google

func (Google) AutoRegister

func (Google) AutoRegister(*model.User) bool

func (*Google) Callback

func (*Google) Healthcheck

func (g *Google) Healthcheck() error

func (*Google) Login

func (g *Google) Login(ctx context.Context, categoryID string, args LoginArgs) (*model.Group, *types.ProviderUserData, string, string, *ProviderError)

func (*Google) String

func (g *Google) String() string

type HTTPRequestType

type HTTPRequestType string

type LDAP

type LDAP struct {
	ReUID      *regexp.Regexp
	ReCategory *regexp.Regexp
	ReGroup    *regexp.Regexp
	ReUsername *regexp.Regexp
	ReName     *regexp.Regexp
	ReEmail    *regexp.Regexp
	RePhoto    *regexp.Regexp
	ReRole     *regexp.Regexp
	// contains filtered or unexported fields
}

func InitLDAP

func InitLDAP(cfg cfg.AuthenticationLDAP, secret string, log *zerolog.Logger, db r.QueryExecutor) *LDAP

func (*LDAP) AutoRegister

func (l *LDAP) AutoRegister(u *model.User) bool

func (*LDAP) Healthcheck

func (l *LDAP) Healthcheck() error

func (*LDAP) Login

func (l *LDAP) Login(ctx context.Context, categoryID string, args LoginArgs) (*model.Group, *types.ProviderUserData, string, string, *ProviderError)

func (*LDAP) String

func (l *LDAP) String() string

type Local

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

func InitLocal

func InitLocal(db r.QueryExecutor) *Local

func (Local) AutoRegister

func (Local) AutoRegister(*model.User) bool

func (*Local) Healthcheck

func (l *Local) Healthcheck() error

func (*Local) Login

func (l *Local) Login(ctx context.Context, categoryID string, args LoginArgs) (*model.Group, *types.ProviderUserData, string, string, *ProviderError)

func (*Local) String

func (l *Local) String() string

type LoginArgs

type LoginArgs struct {
	Token    *string
	Redirect *string

	FormUsername *string
	FormPassword *string
}

type Provider

type Provider interface {
	Login(ctx context.Context, categoryID string, args LoginArgs) (g *model.Group, u *types.ProviderUserData, redirect string, tkn string, err *ProviderError)
	Callback(ctx context.Context, claims *token.CallbackClaims, args CallbackArgs) (g *model.Group, u *types.ProviderUserData, redirect string, tkn string, err *ProviderError)
	AutoRegister(u *model.User) bool
	String() string
	Healthcheck() error
}

type ProviderError

type ProviderError struct {
	// The error that will be shown to the user
	User error
	// Detail of the error that will be logged in debug
	Detail error
}

func (*ProviderError) Error

func (p *ProviderError) Error() string

func (*ProviderError) Is

func (p *ProviderError) Is(target error) bool

func (*ProviderError) Unwrap

func (p *ProviderError) Unwrap() error

type SAML

type SAML struct {
	Cfg cfg.Authentication

	Middleware *samlsp.Middleware

	ReUID      *regexp.Regexp
	ReUsername *regexp.Regexp
	ReName     *regexp.Regexp
	ReEmail    *regexp.Regexp
	RePhoto    *regexp.Regexp
	ReCategory *regexp.Regexp
	ReGroup    *regexp.Regexp
	ReRole     *regexp.Regexp
	// contains filtered or unexported fields
}

func InitSAML

func InitSAML(cfg cfg.Authentication, log *zerolog.Logger, db r.QueryExecutor) *SAML

func (*SAML) AutoRegister

func (s *SAML) AutoRegister(u *model.User) bool

func (*SAML) Callback

func (*SAML) Healthcheck

func (s *SAML) Healthcheck() error

func (*SAML) Login

func (s *SAML) Login(ctx context.Context, categoryID string, args LoginArgs) (*model.Group, *types.ProviderUserData, string, string, *ProviderError)

func (SAML) String

func (SAML) String() string

type Unknown

type Unknown struct{}

func (Unknown) AutoRegister

func (Unknown) AutoRegister(*model.User) bool

func (Unknown) Healthcheck

func (Unknown) Healthcheck() error

func (Unknown) String

func (Unknown) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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