Documentation
¶
Overview ¶
Package auth
Index ¶
- Constants
- func CallbackURL(appURL string) string
- func Register(db *gorm.DB) error
- func RegisterActor(conf config.Auth, callbackURL string, host *local.Host, ...) error
- type Auth
- type AuthenticateResult
- type CompleteLoginRequest
- type LoginResponse
- type LoginTransaction
- type OIDCResponse
- type Token
- type TokenRepository
- func (r *TokenRepository) Create(ctx context.Context, name string) (string, Token, error)
- func (r *TokenRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (r *TokenRepository) List(ctx context.Context) ([]Token, error)
- func (r *TokenRepository) Validate(ctx context.Context, token string) error
Constants ¶
const ( Authenticate = "authenticate" Session = "session" BeginLogin = "begin_login" CompleteLogin = "complete_login" )
const (
Actor = "auth"
)
Variables ¶
This section is empty.
Functions ¶
func CallbackURL ¶
Types ¶
type AuthenticateResult ¶
type AuthenticateResult struct {
Subject string `json:"subject"`
Email string `json:"email"`
Name string `json:"name"`
Groups []string `json:"groups"`
ExpiresAt time.Time `json:"expires_at"`
}
AuthenticateResult is safe to return to callers. In particular, it does not expose the issuer's access, refresh, or ID tokens.
type CompleteLoginRequest ¶
type LoginResponse ¶
type LoginResponse struct {
RedirectURL string
}
type LoginTransaction ¶
LoginTransaction is persisted only until the OIDC callback is completed. Its verifier and nonce must never be sent to the browser.
type OIDCResponse ¶
type OIDCResponse struct {
AccessToken string
TokenType string
RefreshToken string
IDToken string
Scope string
ExpiresAt time.Time
Subject string
Email string
Name string
Groups []string
}
OIDCResponse is the already-validated response received from an OIDC issuer. The HTTP callback is responsible for exchanging the authorization code and verifying the ID token before it invokes this actor.