store

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusNeedToken = iota
	StatusTokenReady
)

Iota token.

Variables

This section is empty.

Functions

func ConvertToByte

func ConvertToByte(s *OIDCState) []byte

ConvertToByte Convert State to Byte.

Types

type OIDCState

type OIDCState struct {
	Status       int    `json:"status"`
	AccessToken  string `json:"access-token"`
	IDToken      string `json:"id-token"`
	RefreshToken string `json:"refresh-token"`

	RequestID   string `json:"req-id"`
	RequestPath string `json:"req-path"`
	OAuthState  string `json:"oauth-state"`
	Scheme      string `json:"scheme"`
}

OIDCState defines the values kept in state.

func ConvertToType

func ConvertToType(value []byte) *OIDCState

ConvertToType Convert Byte to State.

func NewState

func NewState() *OIDCState

NewState create new state to store token for OIDC.

func (*OIDCState) GenerateOauthState

func (s *OIDCState) GenerateOauthState() string

GenerateOauthState generates a new Oauth State from random bytes. The state define a unique request from a particular user and used to identity user during callback or subsequent calls.

func (*OIDCState) IsNewToken

func (s *OIDCState) IsNewToken() bool

IsNewToken check if current state is new and token from idp is needed.

func (*OIDCState) IsTokenReady

func (s *OIDCState) IsTokenReady() bool

IsTokenReady check if token is ready.

Jump to

Keyboard shortcuts

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