access_token_dto

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenTypeBearer            = "bearer"
	GrantTypeClientCredentials = "client_credentials"
	GrantTypeRefreshToken      = "refresh_token"
	GrantTypePassword          = "password"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Token       string `json:"token"`
	DateCreated string `json:"date_created"`
	Expires     int64  `json:"expires"`
	DateRevoked string `json:"date_revoked,omitempty"`
}

func GetNewAccessToken added in v1.7.0

func GetNewAccessToken() *AccessToken

func (AccessToken) IsExpired

func (at AccessToken) IsExpired() bool

func (*AccessToken) UpdateExpirationTime

func (at *AccessToken) UpdateExpirationTime()

func (*AccessToken) Validate

func (at *AccessToken) Validate() *rest_errors.RestErr

type AccessTokenRequest

type AccessTokenRequest struct {
	TokenType string `json:"token_type"`
	GrantType string `json:"grant_type"`
	Scope     string `json:"scope"`

	// User for password grant type
	Username string `json:"username"`
	Password string `json:"password"`

	// User for client_credentials_repo grant type
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`

	// User for refresh_token grant type
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

func (*AccessTokenRequest) Validate

func (request *AccessTokenRequest) Validate() *rest_errors.RestErr

Jump to

Keyboard shortcuts

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