models

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 4 Imported by: 2

Documentation

Index

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) GetAccount added in v1.1.15

func (c *Client) GetAccount() string

GetUserID user id

func (*Client) GetDomain

func (c *Client) GetDomain() string

GetDomain client domain

func (*Client) GetGrantType added in v1.1.24

func (c *Client) GetGrantType() oauth2.GrantType

func (*Client) GetID

func (c *Client) GetID() string

GetID client id

func (*Client) GetSecret

func (c *Client) GetSecret() string

GetSecret client secret

func (*Client) GetUserID

func (c *Client) GetUserID() string

GetUserID user id

func (*Client) IsPublic

func (c *Client) IsPublic() bool

IsPublic public

func (*Client) VerifyPassword added in v1.1.18

func (c *Client) VerifyPassword(password string) bool

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) GetID

func (c *ClientPassword) GetID() string

GetID client id

func (*ClientPassword) GetSecret

func (c *ClientPassword) GetSecret() string

GetSecret client secret

func (*ClientPassword) GetUserID

func (c *ClientPassword) GetUserID() string

GetUserID user id

func (*ClientPassword) IsPublic

func (c *ClientPassword) IsPublic() bool

IsPublic public

func (*ClientPassword) VerifyPassword

func (c *ClientPassword) VerifyPassword(password string) bool

type ClientPermission added in v1.1.0

type ClientPermission struct {
	ClientID  string
	UserID    string
	ApiModule string
	ApiUrl    string
}

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 NewToken

func NewToken() *Token

NewToken create to token model instance

func (*Token) GetAccess

func (t *Token) GetAccess() string

GetAccess access Token

func (*Token) GetAccessCreateAt

func (t *Token) GetAccessCreateAt() time.Time

GetAccessCreateAt create Time

func (*Token) GetAccessExpiresIn

func (t *Token) GetAccessExpiresIn() time.Duration

GetAccessExpiresIn the lifetime in seconds of the access token

func (*Token) GetClientID

func (t *Token) GetClientID() string

GetClientID the client id

func (*Token) GetCode

func (t *Token) GetCode() string

GetCode authorization code

func (*Token) GetCodeChallenge

func (t *Token) GetCodeChallenge() string

GetCodeChallenge challenge code

func (*Token) GetCodeChallengeMethod

func (t *Token) GetCodeChallengeMethod() oauth2.CodeChallengeMethod

GetCodeChallengeMethod challenge method

func (*Token) GetCodeCreateAt

func (t *Token) GetCodeCreateAt() time.Time

GetCodeCreateAt create Time

func (*Token) GetCodeExpiresIn

func (t *Token) GetCodeExpiresIn() time.Duration

GetCodeExpiresIn the lifetime in seconds of the authorization code

func (*Token) GetRedirectURI

func (t *Token) GetRedirectURI() string

GetRedirectURI redirect URI

func (*Token) GetRefresh

func (t *Token) GetRefresh() string

GetRefresh refresh Token

func (*Token) GetRefreshCreateAt

func (t *Token) GetRefreshCreateAt() time.Time

GetRefreshCreateAt create Time

func (*Token) GetRefreshExpiresIn

func (t *Token) GetRefreshExpiresIn() time.Duration

GetRefreshExpiresIn the lifetime in seconds of the refresh token

func (*Token) GetScope

func (t *Token) GetScope() string

GetScope get scope of authorization

func (*Token) GetUserID

func (t *Token) GetUserID() string

GetUserID the user id

func (*Token) New

func (t *Token) New() oauth2.TokenInfo

New create to token model instance

func (*Token) SetAccess

func (t *Token) SetAccess(access string)

SetAccess access Token

func (*Token) SetAccessCreateAt

func (t *Token) SetAccessCreateAt(createAt time.Time)

SetAccessCreateAt create Time

func (*Token) SetAccessExpiresIn

func (t *Token) SetAccessExpiresIn(exp time.Duration)

SetAccessExpiresIn the lifetime in seconds of the access token

func (*Token) SetClientID

func (t *Token) SetClientID(clientID string)

SetClientID the client id

func (*Token) SetCode

func (t *Token) SetCode(code string)

SetCode authorization code

func (*Token) SetCodeChallenge

func (t *Token) SetCodeChallenge(code string)

SetCodeChallenge challenge code

func (*Token) SetCodeChallengeMethod

func (t *Token) SetCodeChallengeMethod(method oauth2.CodeChallengeMethod)

SetCodeChallengeMethod challenge method

func (*Token) SetCodeCreateAt

func (t *Token) SetCodeCreateAt(createAt time.Time)

SetCodeCreateAt create Time

func (*Token) SetCodeExpiresIn

func (t *Token) SetCodeExpiresIn(exp time.Duration)

SetCodeExpiresIn the lifetime in seconds of the authorization code

func (*Token) SetRedirectURI

func (t *Token) SetRedirectURI(redirectURI string)

SetRedirectURI redirect URI

func (*Token) SetRefresh

func (t *Token) SetRefresh(refresh string)

SetRefresh refresh Token

func (*Token) SetRefreshCreateAt

func (t *Token) SetRefreshCreateAt(createAt time.Time)

SetRefreshCreateAt create Time

func (*Token) SetRefreshExpiresIn

func (t *Token) SetRefreshExpiresIn(exp time.Duration)

SetRefreshExpiresIn the lifetime in seconds of the refresh token

func (*Token) SetScope

func (t *Token) SetScope(scope string)

SetScope get scope of authorization

func (*Token) SetUserID

func (t *Token) SetUserID(userID string)

SetUserID the user id

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"`
}

Jump to

Keyboard shortcuts

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