auth

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMiddleware

func GetMiddleware() gin.HandlerFunc

func Register

func Register(item Authenticator) error

Types

type Authenticator

type Authenticator interface {
	GetID() string
	Authenticate(c *gin.Context) (*models.User, error)
}

func GetAuthenticators

func GetAuthenticators() []Authenticator

type AuthenticatorRegistry

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

type LocalAuthenticator

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

func GetLocalAuthenticator

func GetLocalAuthenticator() (*LocalAuthenticator, error)

func NewLocalAuthenticator

func NewLocalAuthenticator(secret string, register string) (*LocalAuthenticator, error)

func (*LocalAuthenticator) AllowRegistration

func (a *LocalAuthenticator) AllowRegistration(register string) bool

func (*LocalAuthenticator) Authenticate

func (a *LocalAuthenticator) Authenticate(c *gin.Context) (*models.User, error)

func (*LocalAuthenticator) GenerateToken

func (a *LocalAuthenticator) GenerateToken(userID string) (string, error)

func (*LocalAuthenticator) GetID

func (a *LocalAuthenticator) GetID() string

func (*LocalAuthenticator) HashPassword

func (a *LocalAuthenticator) HashPassword(password string) (string, error)

func (*LocalAuthenticator) VerifyPassword

func (a *LocalAuthenticator) VerifyPassword(password, hash string) error

type OIDCAuthenticator

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

func NewOIDCAuthenticator

func NewOIDCAuthenticator(issuer, clientID string) (*OIDCAuthenticator, error)

func (*OIDCAuthenticator) Authenticate

func (a *OIDCAuthenticator) Authenticate(c *gin.Context) (*models.User, error)

func (*OIDCAuthenticator) GetID

func (a *OIDCAuthenticator) GetID() string

Jump to

Keyboard shortcuts

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