types

package
v0.0.0-...-4cf50c0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidJwtToken          = errors.New("invalid JWT token")
	ErrKeyIDNotFound            = errors.New("key ID not found")
	ErrInvalidGrantToken        = errors.New("invalid grant token")
	ErrInvalidRegistrationToken = errors.New("invalid registration token")
	ErrExpiredRegistrationToken = errors.New("registration token is expired")
	ErrInvalidAddress           = errors.New("invalid address")
	ErrInvalidKeyID             = errors.New("invalid key ID")
	ErrInvalidPublicKey         = errors.New("invalid public key")
	ErrInvalidPrivateKey        = errors.New("invalid private key")
	ErrInvalidIssuer            = errors.New("invalid issuer")
	ErrUnknownIssuer            = errors.New("no corresponding key pair for issuer")
	ErrNoIssuerInClaim          = errors.New("no issuer was provided in the claim")
	ErrBadIssuer                = errors.New("the issuer provided in the claim does not match the trust")
	ErrNoKeyIDInHeader          = errors.New("no key ID (kid) found in token header")
)

Errors

Functions

This section is empty.

Types

type KeyPair

type KeyPair struct {
	ID         string `json:"id"          yaml:"id"`
	KeyID      string `json:"key_id"      yaml:"key_id"`
	Issuer     string `json:"issuer"      yaml:"issuer"`
	PrivateKey string `json:"private_key" yaml:"private_key"`
	PublicKey  string `json:"public_key"  yaml:"public_key"`
}

KeyPair a file containing the trust information

func (*KeyPair) Validate

func (c *KeyPair) Validate() error

Validate validates the trust

type Notification

type Notification struct {
	ID        string
	Topic     string
	Event     string
	Data      string
	Source    string
	ExpiresAt int64
}

Notification an event message

type StoredData

type StoredData struct {
	ID        string
	Data      interface{}
	Encrypted bool
}

StoredData data stored in the store

type Trust

type Trust struct {
	ID          string `json:"id"           yaml:"id"`
	KeyID       string `json:"key_id"       yaml:"key_id"`
	TrusteeAddr string `json:"trustee_addr" yaml:"trustee_addr"`
	Disabled    bool   `json:"disabled"     yaml:"disabled"`
	Issuer      string `json:"issuer"       yaml:"issuer"`
}

Trust a trust record

func (*Trust) Validate

func (c *Trust) Validate() error

Validate validates the trust

type TrustGrantToken

type TrustGrantToken struct {
	ID         string `json:"id"          yaml:"id"`
	GrantToken string `json:"grant_token" yaml:"grant_token"`
	ExpiresAt  int64  `json:"expires_at"  yaml:"expires_at"`
	Issuer     string `json:"issuer"      yaml:"issuer"`
}

TrustGrantToken a trust grant token

func (*TrustGrantToken) Validate

func (c *TrustGrantToken) Validate() error

Validate the registration token

type TrustRequest

type TrustRequest struct {
	GrantToken  string `json:"grant_token"  yaml:"grant_token"`
	KeyID       string `json:"key_id"       yaml:"key_id"`
	TrusteeAddr string `json:"trustee_addr" yaml:"trustee_addr"`
	Issuer      string `json:"issuer"       yaml:"issuer"`
}

TrustRequest a request for a trust to be granted

func (*TrustRequest) Validate

func (c *TrustRequest) Validate() error

Validate validates a trust request

Jump to

Keyboard shortcuts

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