tokens

package
v0.0.0-...-fb78454 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommonJWTClaimIssuer          = "iss"
	CommonJWTClaimAudience        = "aud"
	CommonJWTClaimSubject         = "sub"
	CommonJWTClaimIssuedAt        = "iat"
	CommonJWTClaimExpirationTime  = "exp"
	CommonJWTClaimDeviceUUID      = "deviceUUID"
	CommonJWTClaimDeviceUserAgent = "deviceUserAgent"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken interface {
	QueryAccessToken
	MutableAccessToken
}

type AccessTokenBuilder

type AccessTokenBuilder interface {
	New() AccessTokenBuilder
	NewFromJwtString(string) (AccessTokenBuilder, error)
	Build() (AccessToken, error)
	BuildToJwt() (*JwtAccessToken, error)
	SetIssuer(string) AccessTokenBuilder
	SetAudience(string) AccessTokenBuilder
	SetSubject(string) AccessTokenBuilder
	SetDeviceUUID(string) AccessTokenBuilder
	SetDeviceUserAgent(string) AccessTokenBuilder
	SetIssuedAt(int) AccessTokenBuilder
	SetExpirationTime(int) AccessTokenBuilder
}

type JwtAccessToken

type JwtAccessToken struct {
	// contains filtered or unexported fields
}

func (*JwtAccessToken) GetAudience

func (receiver *JwtAccessToken) GetAudience() string

func (*JwtAccessToken) GetDeviceUUID

func (receiver *JwtAccessToken) GetDeviceUUID() string

func (*JwtAccessToken) GetDeviceUserAgent

func (receiver *JwtAccessToken) GetDeviceUserAgent() string

func (*JwtAccessToken) GetExpirationTime

func (receiver *JwtAccessToken) GetExpirationTime() int

func (*JwtAccessToken) GetIssuedAt

func (receiver *JwtAccessToken) GetIssuedAt() int

func (*JwtAccessToken) GetIssuer

func (receiver *JwtAccessToken) GetIssuer() string

func (*JwtAccessToken) GetSubject

func (receiver *JwtAccessToken) GetSubject() string

func (*JwtAccessToken) SetAudience

func (receiver *JwtAccessToken) SetAudience(value string)

func (*JwtAccessToken) SetDeviceUUID

func (receiver *JwtAccessToken) SetDeviceUUID(value string)

func (*JwtAccessToken) SetDeviceUserAgent

func (receiver *JwtAccessToken) SetDeviceUserAgent(value string)

func (*JwtAccessToken) SetExpirationTime

func (receiver *JwtAccessToken) SetExpirationTime(value int)

func (*JwtAccessToken) SetIssuedAt

func (receiver *JwtAccessToken) SetIssuedAt(value int)

func (*JwtAccessToken) SetIssuer

func (receiver *JwtAccessToken) SetIssuer(value string)

func (*JwtAccessToken) SetSubject

func (receiver *JwtAccessToken) SetSubject(value string)

func (*JwtAccessToken) ToString

func (receiver *JwtAccessToken) ToString() (string, error)

type JwtAccessTokenBuilder

type JwtAccessTokenBuilder struct {
	// contains filtered or unexported fields
}

func NewJwtAccessTokenBuilder

func NewJwtAccessTokenBuilder(config configs.TokenConfig) *JwtAccessTokenBuilder

func (*JwtAccessTokenBuilder) Build

func (receiver *JwtAccessTokenBuilder) Build() (AccessToken, error)

func (*JwtAccessTokenBuilder) BuildToJwt

func (receiver *JwtAccessTokenBuilder) BuildToJwt() (*JwtAccessToken, error)

func (*JwtAccessTokenBuilder) New

func (receiver *JwtAccessTokenBuilder) New() AccessTokenBuilder

func (*JwtAccessTokenBuilder) NewFromJwtString

func (receiver *JwtAccessTokenBuilder) NewFromJwtString(token string) (AccessTokenBuilder, error)

func (*JwtAccessTokenBuilder) SetAudience

func (receiver *JwtAccessTokenBuilder) SetAudience(value string) AccessTokenBuilder

func (*JwtAccessTokenBuilder) SetDeviceUUID

func (receiver *JwtAccessTokenBuilder) SetDeviceUUID(value string) AccessTokenBuilder

func (*JwtAccessTokenBuilder) SetDeviceUserAgent

func (receiver *JwtAccessTokenBuilder) SetDeviceUserAgent(value string) AccessTokenBuilder

func (*JwtAccessTokenBuilder) SetExpirationTime

func (receiver *JwtAccessTokenBuilder) SetExpirationTime(value int) AccessTokenBuilder

func (*JwtAccessTokenBuilder) SetIssuedAt

func (receiver *JwtAccessTokenBuilder) SetIssuedAt(value int) AccessTokenBuilder

func (*JwtAccessTokenBuilder) SetIssuer

func (receiver *JwtAccessTokenBuilder) SetIssuer(value string) AccessTokenBuilder

func (*JwtAccessTokenBuilder) SetSubject

func (receiver *JwtAccessTokenBuilder) SetSubject(value string) AccessTokenBuilder

type MutableAccessToken

type MutableAccessToken interface {
	SetIssuer(string)
	SetAudience(string)
	SetSubject(string)
	SetDeviceUUID(string)
	SetDeviceUserAgent(string)
	SetIssuedAt(int)
	SetExpirationTime(int)
}

type QueryAccessToken

type QueryAccessToken interface {
	ToString() (string, error)
	GetIssuer() string
	GetAudience() string
	GetSubject() string
	GetDeviceUUID() string
	GetDeviceUserAgent() string
	GetIssuedAt() int
	GetExpirationTime() int
}

Jump to

Keyboard shortcuts

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