auth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AudienceAuth       = "auth"
	AudienceDiscover   = "discover"
	AudienceTunnel     = "tunnel"
	AudienceAuthorizer = "authorizer"
)

Variables

This section is empty.

Functions

func ParseUserID

func ParseUserID(v string) (project, auth, userID string, err error)

Types

type ClientClaims

type ClientClaims struct {
	Audience       StringList             `json:"aud,omitempty"`
	UserId         string                 `json:"user_id,omitempty"`
	InstallationId string                 `json:"installation_id,omitempty"`
	PlatformType   string                 `json:"platform_type,omitempty"`
	Entitlements   map[string]interface{} `json:"entitlements,omitempty"`
	jwt.StandardClaims
}

type JWTChecker

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

func NewJWTChecker

func NewJWTChecker(keyKeeper KeyStore) (*JWTChecker, error)

NewJWTChecker creates new JWT validator that uses keys from a given keystore

func (*JWTChecker) Parse

func (instance *JWTChecker) Parse(tokenString string, claims jwt.Claims) error

type JWTMaster

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

func NewJWTMaster

func NewJWTMaster(private *rsa.PrivateKey, privateId *uuid.UUID) (*JWTMaster, error)

func (*JWTMaster) Parse

func (instance *JWTMaster) Parse(tokenString string, claims jwt.Claims) error

func (*JWTMaster) Token

func (instance *JWTMaster) Token(claims jwt.Claims) (*string, error)

type KeyStore

type KeyStore interface {
	GetKey(keyUUID uuid.UUID) (*rsa.PublicKey, error)
}

type KeyStoreWrapper

type KeyStoreWrapper struct {
	Fn func(keyUUID uuid.UUID) (*rsa.PublicKey, error)
}

KeyStoreWrapper wraps any type into its closure func `fn` and provides the KeyStore interface.

func (*KeyStoreWrapper) GetKey

func (w *KeyStoreWrapper) GetKey(keyUUID uuid.UUID) (*rsa.PublicKey, error)

type StringList

type StringList []string

func (StringList) Has

func (l StringList) Has(entry string) bool

Jump to

Keyboard shortcuts

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