tokens

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(ctx context.Context, key ed25519.PrivateKey,
	issuer v1.Token_Issuer,
	account string, expires time.Time, scopes ...v1.Token_Scope) (string, *jwt.RegisteredClaims)

func Get added in v0.0.32

func Get(ctx context.Context) *jwt.RegisteredClaims

func GetAccount added in v0.0.32

func GetAccount(ctx context.Context) *v1.Account

func Set added in v0.0.32

func Set(ctx context.Context, claims *jwt.RegisteredClaims) context.Context

func SetAccount added in v0.0.32

func SetAccount(ctx context.Context, a *v1.Account) context.Context

func Valid added in v0.0.24

func Valid(priv ed25519.PrivateKey, token string) (ok bool)

func ValidWithClaims added in v0.0.26

func ValidWithClaims(priv ed25519.PrivateKey, token string) (claims *jwt.RegisteredClaims, ok bool)

Types

type Basic added in v0.0.32

type Basic struct {
	Username string
	Password string
}

func (Basic) GetRequestMetadata added in v0.0.32

func (b Basic) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error)

func (Basic) RequireTransportSecurity added in v0.0.32

func (Basic) RequireTransportSecurity() bool

type Source added in v0.0.32

type Source string

func (Source) GetRequestMetadata added in v0.0.32

func (s Source) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (Source) RequireTransportSecurity added in v0.0.32

func (Source) RequireTransportSecurity() bool

Jump to

Keyboard shortcuts

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