model

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	Id            string `json:"id"`
	Issuer        string `json:"iss"`
	ClientId      string `json:"client_id"`
	PrincipalName string `json:"principal_name"`
	Subject       string `json:"subject"`
	GrantType     string `json:"grant_type"`
	ResponseType  string `json:"response_type"`
	Scope         string `json:"scope"`
	//	Attributes          map[string]interface{} `json:"attributes"`
	Code                  string `json:"code"`
	Nonce                 string `json:"nonce"`
	AccessToken           string `json:"access_token"`
	RefreshToken          string `json:"refresh_token"`
	IDToken               string `json:"id_token"`
	CodeChallenge         string `json:"code_challenge"`
	CodeChallengeMethod   string `json:"code_challenge_method"`
	DeviceCode            string `json:"device_code"`
	ExpiresAt             int64  `json:"expires_at"` //Unix timestamp
	RefreshTokenExpiresAt int64  `json:"refresh_token_expires_at"`
	UserCode              string `json:"user_code"`
}

func (*Authorization) IncludeOpenId

func (a *Authorization) IncludeOpenId() bool

func (*Authorization) UpdateExiresAt

func (a *Authorization) UpdateExiresAt(lifeTime int64)

func (*Authorization) UpdateRefreshTokenExpiresAt

func (a *Authorization) UpdateRefreshTokenExpiresAt(lifeTime int64)

type Client

type Client struct {
	Id             string   `json:"id"`
	ClientId       string   `json:"client_id"`
	Secret         string   `json:"secret"`
	ClientScope    string   `json:"client_scope"`
	ClientName     string   `json:"client_name"`
	GrantTypes     []string `json:"grant_type"`
	RequireConsent bool     `json:"require_consent"`
	RequirePKCE    bool     `json:"require_pkce"`
	RedirectUris   []string `json:"redirect_uris"`
	WebOrigins     string   `json:"web_origins"`
	PostLogoutUris []string `json:"post_logout_uri"`
	// 创建时间
	CreatedAt string `json:"created_at"`
	// 更新时间
	UpdatedAt string `json:"updated_at"`
}

func (*Client) GetClientId

func (c *Client) GetClientId() string

func (*Client) GetClientName

func (c *Client) GetClientName() string

func (*Client) GetGrantTypes

func (c *Client) GetGrantTypes() []string

func (*Client) GetPostLogoutUris

func (c *Client) GetPostLogoutUris() []string

func (*Client) GetRedirectUris

func (c *Client) GetRedirectUris() []string

func (*Client) GetRequireConsent

func (c *Client) GetRequireConsent() bool

func (*Client) GetRequirePKCE

func (c *Client) GetRequirePKCE() bool

func (*Client) GetScopes

func (c *Client) GetScopes() []string

func (*Client) GetSecret

func (c *Client) GetSecret() []string

func (*Client) GetWebOrigins added in v0.12.1

func (c *Client) GetWebOrigins() []string

type IClient

type IClient interface {
	// GetScopes returns a list of scopes that the client is allowed to access.
	GetScopes() []string

	// GetClientId returns the unique identifier of the client.
	GetClientId() string

	// GetClientName returns the name of the client.
	GetClientName() string

	// GetGrantTypes returns a list of authorization types supported by the client.
	GetGrantTypes() []string

	// GetRequireConsent returns whether user consent is required.
	GetRequireConsent() bool

	// GetRequirePKCE returns whether PKCE (Proof Key for Code Exchange) is required.
	GetRequirePKCE() bool

	// GetRedirectUris returns a list of URIs to which the client redirects.
	GetRedirectUris() []string

	// GetPostLogoutUris returns a list of URIs to which the client redirects after logout.
	GetPostLogoutUris() []string

	// GetSecret returns a list of secrets associated with the client.
	GetSecret() []string
	// GetWebOrigins returns a list of web origins associated with the client.
	GetWebOrigins() []string
}

IClient defines the client interface, including a series of operations related to client configuration.

type IUser

type IUser interface {
	GetId() string
	GetUserName() string
	GetEmail() string
	GetPasswordHash() string
}

type User

type User struct {
	Id           string `json:"sub"`
	UserName     string `json:"preferred_username"`
	PasswordHash string `json:"-"`
	Email        string `json:"email"`
	Role         string `json:"role"`
}

func (*User) GetEmail

func (u *User) GetEmail() string

func (*User) GetId

func (u *User) GetId() string

func (*User) GetPasswordHash

func (u *User) GetPasswordHash() string

func (*User) GetUserName

func (u *User) GetUserName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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