authz

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResult

type AuthResult struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
	User      *UserInfo `json:"user"`
}

AuthResult is the result of a successful authentication.

type AuthService

type AuthService interface {
	GetLoginURL(state string) string
	GetSignupURL() string
	GetLogoutURL(casdoorAccessToken string) string
	HandleCallback(code string) (*AuthResult, error)
	GenerateState() string
	Logout(ctx context.Context, userID string) error
	GetCasdoorToken(ctx context.Context, userID string) (string, error)
}

AuthService is the authentication service interface.

func NewAuthService

func NewAuthService(casdoorClient *casdoor.Client, jwtConfig *config.JWTConfig, sessionService session.SessionService) (AuthService, error)

NewAuthService creates an authentication service.

type UserInfo

type UserInfo struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Email       string `json:"email"`
	Avatar      string `json:"avatar"`
}

UserInfo holds user information.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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