tokens

package
v0.1.120-pre-1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tokens

type Tokens struct {
	FromConfigFile bool
	// contains filtered or unexported fields
}

Tokens is a collection of tokens belonging to the user. This includes macaroon tokens (per-org) and OAuth tokens (per-user).

It is normal for this to include just macaroons, just oauth tokens, or a combination of the two. The GraphQL API is the only service that accepts macaroons and OAuth tokens in the same request. For other service, macaroons are preferred.

func Parse

func Parse(token string) *Tokens

Parse extracts individual tokens from a token string. The input token may include an authorization scheme (`Bearer` or `FlyV1`) and/or a set of comma-separated macaroon and user tokens.

func (*Tokens) All

func (t *Tokens) All() string

func (*Tokens) DischargeThirdPartyCaveats

func (t *Tokens) DischargeThirdPartyCaveats(ctx context.Context) (bool, error)

DischargeThirdPartyCaveats attempts to fetch any necessary discharge tokens for 3rd party caveats found within macaroon tokens.

See https://github.com/superfly/macaroon/blob/main/tp/README.md

func (*Tokens) Docker

func (t *Tokens) Docker() string

func (*Tokens) Flaps

func (t *Tokens) Flaps() string

func (*Tokens) GraphQL

func (t *Tokens) GraphQL() string

func (*Tokens) Macaroons

func (t *Tokens) Macaroons() string

func (*Tokens) NATS

func (t *Tokens) NATS() string

func (*Tokens) PruneBadMacaroons

func (t *Tokens) PruneBadMacaroons() bool

PruneBadMacaroons removes expired and invalid macaroon tokens.

Jump to

Keyboard shortcuts

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