auth

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthCallbackEndpoint

func NewAuthCallbackEndpoint(authService Service) http.Handler

func NewAuthRefreshEndpoint

func NewAuthRefreshEndpoint(authService Service) http.Handler

func NewRouter

func NewRouter(authService Service, authMiddleware func(http.Handler) http.Handler) http.Handler

Types

type CallbackRequest

type CallbackRequest struct {
	Code         string `json:"code"`
	CodeVerifier string `json:"code_verifier"`
	RedirectURI  string `json:"redirect_uri"`
}

type CallbackResponse

type CallbackResponse struct {
	Token     string `json:"token"`
	ExpiresAt int64  `json:"expires_at"`
	UserID    int64  `json:"user_id"`
	UserName  string `json:"user_name"`
}

type Service

type Service interface {
	HandleCallback(ctx context.Context, code, codeVerifier, redirectURI string) (*auth.Result, error)
	HandleRefresh(ctx context.Context, userID int64, userName string, entitlements []string, refreshToken string) (*auth.Result, error)
}

Jump to

Keyboard shortcuts

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