macarooncompat

package module
v0.0.0-...-f1bfb7c Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: LGPL-3.0 Imports: 14 Imported by: 0

README

macarooncompat - compatibility checking for macaroons.

To run, first install the following:

Then run the tests with:

go test

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Implementations = []struct {
	Name Implementation
	Pkg  Package
}{{
	Name: ImplGoV1,
	Pkg:  goMacaroonV1Package{},
}, {
	Name: ImplGoV2,
	Pkg:  goMacaroonV2Package{},
}, {
	Name: ImplLibMacaroons2,
	Pkg: libMacaroonsPkg{
		// contains filtered or unexported fields
	},
}, {
	Name: ImplJSMacaroon,
	Pkg:  jsMacaroonPkg{},
}, {
	Name: ImplPyMacaroons2,
	Pkg: pyMacaroonsPkg{
		// contains filtered or unexported fields
	},
}, {
	Name: ImplPyMacaroons3,
	Pkg: pyMacaroonsPkg{
		// contains filtered or unexported fields
	},
}}

Functions

This section is empty.

Types

type Checker

type Checker map[string]bool

func (Checker) Check

func (c Checker) Check(cav string) error

type Implementation

type Implementation string
const (
	ImplGoV1          Implementation = "gov1"
	ImplGoV2          Implementation = "gov2"
	ImplLibMacaroons2 Implementation = "libmacaroons2"
	ImplJSMacaroon    Implementation = "jsmacaroon"
	ImplPyMacaroons2  Implementation = "pymacaroons2"
	ImplPyMacaroons3  Implementation = "pymacaroons3"
)

type Macaroon

type Macaroon interface {
	MarshalJSON() ([]byte, error)
	MarshalBinary() ([]byte, error)
	WithFirstPartyCaveat(caveatId string) (Macaroon, error)
	WithThirdPartyCaveat(rootKey []byte, caveatId string, loc string) (Macaroon, error)
	Bind(primary Macaroon) (Macaroon, error)
	Verify(rootKey []byte, check Checker, discharges []Macaroon) error
	Signature() []byte
}

type Package

type Package interface {
	UnmarshalJSON(data []byte) (Macaroon, error)
	UnmarshalBinary(data []byte) (Macaroon, error)
	New(rootKey []byte, id, loc string) (Macaroon, error)
}

Jump to

Keyboard shortcuts

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