Documentation
¶
Index ¶
- Variables
- func NewSessionService() middlewares.SessionService
- type EdDSAKeyStrategy
- type KeyAlgorithmStrategy
- type KeyCache
- type KeyPair
- func (k *KeyPair) Algorithm() config.SigningAlgorithm
- func (k *KeyPair) CreatedAt() time.Time
- func (k *KeyPair) ExpiresAt() time.Time
- func (k *KeyPair) GetKid() string
- func (k *KeyPair) PrivateKey() any
- func (k *KeyPair) PrivateKeyBytes() []byte
- func (k *KeyPair) PublicKey() any
- func (k *KeyPair) PublicKeyBytes() []byte
- func (k *KeyPair) RotatesAt() time.Time
- type KeyService
- type KeyStore
- type MailService
- type RSAKeyStrategy
- type TemplateService
- type TokenService
- type TokenType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTokenNotFound = fmt.Errorf("token: %w", utils.ErrHttpNotFound)
Functions ¶
func NewSessionService ¶
func NewSessionService() middlewares.SessionService
Types ¶
type EdDSAKeyStrategy ¶
type EdDSAKeyStrategy struct{}
type KeyAlgorithmStrategy ¶
type KeyAlgorithmStrategy interface {
Generate(clockService clock.Service) (KeyPair, error)
Import(serializedPrivateKey string) (any, any, error)
Export(privateKey any) (string, error)
}
func GetKeyStrategy ¶
func GetKeyStrategy(algorithm config.SigningAlgorithm) KeyAlgorithmStrategy
type KeyPair ¶
type KeyPair struct {
// contains filtered or unexported fields
}
func (*KeyPair) Algorithm ¶
func (k *KeyPair) Algorithm() config.SigningAlgorithm
func (*KeyPair) PrivateKey ¶
func (*KeyPair) PrivateKeyBytes ¶
func (*KeyPair) PublicKeyBytes ¶
type KeyService ¶
type KeyService interface {
Generate(clockService clock.Service, virtualServerName string, algorithm config.SigningAlgorithm) (KeyPair, error)
GetKey(virtualServerName string, algorithm config.SigningAlgorithm) (KeyPair, error)
}
func NewKeyService ¶
func NewKeyService(cache KeyCache, store KeyStore) KeyService
type KeyStore ¶
type KeyStore interface {
Get(virtualServerName string, algorithm config.SigningAlgorithm, kid string) (*KeyPair, error)
GetAll(virtualServerName string) ([]KeyPair, error)
GetAllForAlgorithm(virtualServerName string, algorithm config.SigningAlgorithm) ([]KeyPair, error)
Add(virtualServerName string, keyPair KeyPair) error
Remove(virtualServerName string, algorithm config.SigningAlgorithm, kid string) error
}
func NewDirectoryKeyStore ¶
func NewDirectoryKeyStore() KeyStore
func NewMemoryKeyStore ¶
func NewMemoryKeyStore() KeyStore
func NewVaultKeyStore ¶
type MailService ¶
func NewMailService ¶
func NewMailService() MailService
type RSAKeyStrategy ¶
type RSAKeyStrategy struct{}
type TemplateService ¶
type TemplateService interface {
Template(ctx context.Context, virtualServerId uuid.UUID, templateType repositories.TemplateType, data any) (string, error)
}
func NewTemplateService ¶
func NewTemplateService() TemplateService
type TokenService ¶
type TokenService interface {
GenerateAndStoreToken(ctx context.Context, tokenType TokenType, value string, expiration time.Duration) (string, error)
UpdateToken(ctx context.Context, tokenType TokenType, token string, value string, expiration time.Duration) error
GetToken(ctx context.Context, tokenType TokenType, token string) (string, error)
DeleteToken(ctx context.Context, tokenType TokenType, token string) error
StoreToken(ctx context.Context, tokenType TokenType, token string, value string, expiration time.Duration) error
}
func NewTokenService ¶
func NewTokenService() TokenService
type TokenType ¶
type TokenType string
const ( EmailVerificationTokenType TokenType = "email_verification" LoginSessionTokenType TokenType = "login_session" OidcCodeTokenType TokenType = "oidc_code" OidcRefreshTokenTokenType TokenType = "oidc_refresh_token" OidcDeviceCodeTokenType TokenType = "oidc_device_code" OidcUserCodeTokenType TokenType = "oidc_user_code" )
Click to show internal directories.
Click to hide internal directories.