webappoauth

package
v0.0.0-...-09efcc3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencySet = wire.NewSet(
	wire.Struct(new(Store), "*"),
)
View Source
var ErrOAuthStateInvalid = apierrors.NewInvalid("invalid state")

Functions

func NewStateToken

func NewStateToken() (stateToken string, stateTokenHash string)

Types

type Store

type Store struct {
	Redis *appredis.Handle
	AppID config.AppID
}

func (*Store) GenerateState

func (s *Store) GenerateState(ctx context.Context, state *WebappOAuthState) (stateToken string, err error)

func (*Store) PopAndRecoverState

func (s *Store) PopAndRecoverState(ctx context.Context, stateToken string) (state *WebappOAuthState, err error)

type WebappOAuthState

type WebappOAuthState struct {
	UIImplementation config.UIImplementation `json:"ui_implementation"`
	WebSessionID     string                  `json:"web_session_id"`

	// authflow, authflowv2 specific fields
	XStep            string `json:"x_step"`
	ErrorRedirectURI string `json:"error_redirect_uri"`

	// account management specific fields
	AccountManagementToken string `json:"account_management_token,omitempty"`
}

Jump to

Keyboard shortcuts

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