macaroon

package
v1.3.0-rc Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ActionRead specifies a read operation
	ActionRead = macaroon.ActionRead
	// ActionWrite specifies a read operation
	ActionWrite = macaroon.ActionWrite
	// ActionList specifies a read operation
	ActionList = macaroon.ActionList
	// ActionDelete specifies a read operation
	ActionDelete = macaroon.ActionDelete
	// ActionProjectInfo requests project-level information
	ActionProjectInfo = macaroon.ActionProjectInfo
)

Variables

This section is empty.

Functions

func NewSecret

func NewSecret() (secret []byte, err error)

NewSecret generates cryptographically random 32 bytes

Types

type APIKey

type APIKey = macaroon.APIKey

APIKey implements a Macaroon-backed Storj-v3 API key.

func NewAPIKey

func NewAPIKey(secret []byte) (*APIKey, error)

NewAPIKey generates a brand new unrestricted API key given the provided server project secret

func ParseAPIKey

func ParseAPIKey(key string) (*APIKey, error)

ParseAPIKey parses a given api key string and returns an APIKey if the APIKey was correctly formatted. It does not validate the key.

func ParseRawAPIKey added in v0.15.0

func ParseRawAPIKey(data []byte) (*APIKey, error)

ParseRawAPIKey parses raw api key data and returns an APIKey if the APIKey was correctly formatted. It does not validate the key.

type Action

type Action = macaroon.Action

Action specifies the specific operation being performed that the Macaroon will validate

type ActionType

type ActionType = macaroon.ActionType

ActionType specifies the operation type being performed that the Macaroon will validate

type AllowedBuckets added in v0.15.0

type AllowedBuckets = macaroon.AllowedBuckets

AllowedBuckets stores information about which buckets are allowed to be accessed, where `Buckets` stores names of buckets that are allowed and `All` is a bool that indicates if all buckets are allowed or not

type Caveat

type Caveat = macaroon.Caveat

Caveat is a caveat.

func NewCaveat added in v0.12.0

func NewCaveat() (Caveat, error)

NewCaveat returns a Caveat with a random generated nonce.

type Caveat_Path added in v0.12.0

type Caveat_Path = macaroon.Caveat_Path //nolint alias to generated code

Caveat_Path is a path for caveat. If any entries exist, require all access to happen in at least one of them.

type Macaroon

type Macaroon = macaroon.Macaroon

Macaroon is a struct that determine contextual caveats and authorization

func NewUnrestricted

func NewUnrestricted(secret []byte) (*Macaroon, error)

NewUnrestricted creates Macaroon with random Head and generated Tail

func ParseMacaroon

func ParseMacaroon(data []byte) (_ *Macaroon, err error)

ParseMacaroon converts binary to macaroon

Jump to

Keyboard shortcuts

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