auth

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePKCE

func GeneratePKCE() (verifier string, challenge string, err error)

GeneratePKCE generates a code verifier and code challenge for PKCE

func SignState

func SignState(key []byte, data StateData) (string, error)

SignState signs state data with HMAC and returns base64 encoded state

func ValidatePKCE

func ValidatePKCE(verifier, challenge string) bool

ValidatePKCE validates that a code verifier matches a code challenge

Types

type StateData

type StateData struct {
	WorkspaceID string    `json:"workspace_id"`
	ProviderID  string    `json:"provider_id"`
	Nonce       string    `json:"nonce"` // connection ID
	IAT         time.Time `json:"iat"`
}

func VerifyState

func VerifyState(key []byte, state string) (*StateData, error)

VerifyState verifies and unpacks the signed state

Jump to

Keyboard shortcuts

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