Documentation ¶
Index ¶
- type Client
- func (c *Client) GetAccount() string
- func (c *Client) GetDomain() string
- func (c *Client) GetGrantType() oauth2.GrantType
- func (c *Client) GetID() string
- func (c *Client) GetSecret() string
- func (c *Client) GetUserID() string
- func (c *Client) IsPublic() bool
- func (c *Client) VerifyPassword(password string) bool
- type ClientPassword
- func (c *ClientPassword) GetAccount() string
- func (c *ClientPassword) GetDomain() string
- func (c *ClientPassword) GetGrantType() oauth2.GrantType
- func (c *ClientPassword) GetID() string
- func (c *ClientPassword) GetSecret() string
- func (c *ClientPassword) GetUserID() string
- func (c *ClientPassword) IsPublic() bool
- func (c *ClientPassword) VerifyPassword(password string) bool
- type ClientPermission
- type Token
- func (t *Token) GetAccess() string
- func (t *Token) GetAccessCreateAt() time.Time
- func (t *Token) GetAccessExpiresIn() time.Duration
- func (t *Token) GetClientID() string
- func (t *Token) GetCode() string
- func (t *Token) GetCodeChallenge() string
- func (t *Token) GetCodeChallengeMethod() oauth2.CodeChallengeMethod
- func (t *Token) GetCodeCreateAt() time.Time
- func (t *Token) GetCodeExpiresIn() time.Duration
- func (t *Token) GetRedirectURI() string
- func (t *Token) GetRefresh() string
- func (t *Token) GetRefreshCreateAt() time.Time
- func (t *Token) GetRefreshExpiresIn() time.Duration
- func (t *Token) GetScope() string
- func (t *Token) GetUserID() string
- func (t *Token) New() oauth2.TokenInfo
- func (t *Token) SetAccess(access string)
- func (t *Token) SetAccessCreateAt(createAt time.Time)
- func (t *Token) SetAccessExpiresIn(exp time.Duration)
- func (t *Token) SetClientID(clientID string)
- func (t *Token) SetCode(code string)
- func (t *Token) SetCodeChallenge(code string)
- func (t *Token) SetCodeChallengeMethod(method oauth2.CodeChallengeMethod)
- func (t *Token) SetCodeCreateAt(createAt time.Time)
- func (t *Token) SetCodeExpiresIn(exp time.Duration)
- func (t *Token) SetRedirectURI(redirectURI string)
- func (t *Token) SetRefresh(refresh string)
- func (t *Token) SetRefreshCreateAt(createAt time.Time)
- func (t *Token) SetRefreshExpiresIn(exp time.Duration)
- func (t *Token) SetScope(scope string)
- func (t *Token) SetUserID(userID string)
- type TokenParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ID string Secret string Domain string Public bool UserID string Password string Account string GrantType oauth2.GrantType }
Client client model
func (*Client) GetGrantType ¶ added in v1.1.24
func (*Client) VerifyPassword ¶ added in v1.1.18
type ClientPassword ¶
type ClientPassword struct { ID string Secret string Domain string Public bool UserID string Password string Account string GrantType oauth2.GrantType }
Client client model
func (*ClientPassword) GetAccount ¶ added in v1.1.15
func (c *ClientPassword) GetAccount() string
GetUserID user id
func (*ClientPassword) GetDomain ¶
func (c *ClientPassword) GetDomain() string
GetDomain client domain
func (*ClientPassword) GetGrantType ¶ added in v1.1.24
func (c *ClientPassword) GetGrantType() oauth2.GrantType
func (*ClientPassword) GetSecret ¶
func (c *ClientPassword) GetSecret() string
GetSecret client secret
func (*ClientPassword) VerifyPassword ¶
func (c *ClientPassword) VerifyPassword(password string) bool
type ClientPermission ¶ added in v1.1.0
Client client model
func (ClientPermission) GetApiModule ¶ added in v1.1.0
func (c ClientPermission) GetApiModule() string
GetDomain client domain
func (ClientPermission) GetApiUrl ¶ added in v1.1.0
func (c ClientPermission) GetApiUrl() string
IsPublic public
func (ClientPermission) GetClientId ¶ added in v1.1.0
func (c ClientPermission) GetClientId() string
GetID client id
func (ClientPermission) GetUserID ¶ added in v1.1.0
func (c ClientPermission) GetUserID() string
GetSecret client secret
type Token ¶
type Token struct { ClientID string `bson:"ClientID"` UserID string `bson:"UserID"` RedirectURI string `bson:"RedirectURI"` Scope string `bson:"Scope"` Code string `bson:"Code"` CodeChallenge string `bson:"CodeChallenge"` CodeChallengeMethod string `bson:"CodeChallengeMethod"` CodeCreateAt time.Time `bson:"CodeCreateAt"` CodeExpiresIn time.Duration `bson:"CodeExpiresIn"` Access string `bson:"Access"` AccessCreateAt time.Time `bson:"AccessCreateAt"` AccessExpiresIn time.Duration `bson:"AccessExpiresIn"` Refresh string `bson:"Refresh"` RefreshCreateAt time.Time `bson:"RefreshCreateAt"` RefreshExpiresIn time.Duration `bson:"RefreshExpiresIn"` }
Token token model
func (*Token) GetAccessCreateAt ¶
GetAccessCreateAt create Time
func (*Token) GetAccessExpiresIn ¶
GetAccessExpiresIn the lifetime in seconds of the access token
func (*Token) GetCodeChallenge ¶
GetCodeChallenge challenge code
func (*Token) GetCodeChallengeMethod ¶
func (t *Token) GetCodeChallengeMethod() oauth2.CodeChallengeMethod
GetCodeChallengeMethod challenge method
func (*Token) GetCodeCreateAt ¶
GetCodeCreateAt create Time
func (*Token) GetCodeExpiresIn ¶
GetCodeExpiresIn the lifetime in seconds of the authorization code
func (*Token) GetRefreshCreateAt ¶
GetRefreshCreateAt create Time
func (*Token) GetRefreshExpiresIn ¶
GetRefreshExpiresIn the lifetime in seconds of the refresh token
func (*Token) SetAccessCreateAt ¶
SetAccessCreateAt create Time
func (*Token) SetAccessExpiresIn ¶
SetAccessExpiresIn the lifetime in seconds of the access token
func (*Token) SetCodeChallenge ¶
SetCodeChallenge challenge code
func (*Token) SetCodeChallengeMethod ¶
func (t *Token) SetCodeChallengeMethod(method oauth2.CodeChallengeMethod)
SetCodeChallengeMethod challenge method
func (*Token) SetCodeCreateAt ¶
SetCodeCreateAt create Time
func (*Token) SetCodeExpiresIn ¶
SetCodeExpiresIn the lifetime in seconds of the authorization code
func (*Token) SetRedirectURI ¶
SetRedirectURI redirect URI
func (*Token) SetRefreshCreateAt ¶
SetRefreshCreateAt create Time
func (*Token) SetRefreshExpiresIn ¶
SetRefreshExpiresIn the lifetime in seconds of the refresh token
type TokenParams ¶ added in v1.1.12
type TokenParams struct { GrantType string `json:"grant_type"` ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` Scope string `json:"scope"` Username string `json:"userName"` Password string `json:"password"` RedirectURI string `json:"redirect_uri"` Code string `json:"code"` CodeVerifier string `json:"code_verifier"` RefreshToken string `json:"refresh_token"` AccessToken string `json:"access_token"` }