token

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractUserID

func ExtractUserID(subject string) (string, error)

Types

type IDToken

type IDToken struct {
	Issuer        string    `json:"iss"`
	Subject       string    `json:"sub"`
	Audience      string    `json:"aud"`
	Expiry        time.Time `json:"exp"`
	IssuedAt      time.Time `json:"iat"`
	Email         string    `json:"email"`
	IsSystemAdmin bool      `json:"is_system_admin"`
}

type Signer

type Signer interface {
	Sign(*IDToken) (string, error)
}

func NewSigner

func NewSigner(keyPath string) (Signer, error)

func NewSignerWithPrivateKey

func NewSignerWithPrivateKey(privateKey *rsa.PrivateKey) (Signer, error)

type Verifier

type Verifier interface {
	Verify(string) (*IDToken, error)
}

func NewVerifier

func NewVerifier(keyPath, issuer, clientID string) (Verifier, error)

Jump to

Keyboard shortcuts

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