envelope

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package envelope defines the generic encapsulating format for torus objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialInf added in v0.22.0

type CredentialInf interface {
	Envelope
	GetVersion() uint8 // schema version

	Previous() *identity.ID
	CredentialVersion() int

	PathExp() *pathexp.PathExp
	Name() string

	Unset() bool
	Nonce() *base64.Value
	Credential() *primitive.CredentialValue

	OrgID() *identity.ID
	ProjectID() *identity.ID
}

CredentialInf is the common interface for all Credential schema versions.

type Envelope

type Envelope interface {
	GetID() *identity.ID // avoid field collision
}

Envelope is the interface implemented by objects that encapsulate 'true' torus objects.

type KeyringInf added in v0.22.0

type KeyringInf interface {
	Envelope
	PathExp() *pathexp.PathExp
	OrgID() *identity.ID
	GetVersion() uint8 // Return the schema version of the keyring
}

KeyringInf is the common interface for all keyring schema versions.

type Signed

type Signed struct {
	ID        *identity.ID        `json:"id"`
	Version   uint8               `json:"version"`
	Body      identity.Immutable  `json:"body"`
	Signature primitive.Signature `json:"sig"`
}

Signed is the generic format for encapsulating signed immutable request/response objects to/from torus.

func (*Signed) GetID

func (e *Signed) GetID() *identity.ID

GetID returns the ID of the object encapsulated in this envelope.

type Unsigned

type Unsigned struct {
	ID      *identity.ID     `json:"id"`
	Version uint8            `json:"version"`
	Body    identity.Mutable `json:"body"`
}

Unsigned is the generic format for encapsulating unsigned mutable request/response objects to/from torus.

func (*Unsigned) GetID

func (e *Unsigned) GetID() *identity.ID

GetID returns the ID of the object encapsulated in this envelope.

func (*Unsigned) GetVersion added in v0.22.0

func (e *Unsigned) GetVersion() uint8

GetVersion returns the Schema version of the object encapsulated in this envelope.

type UserInf added in v0.22.0

type UserInf interface {
	Envelope
	StructVersion() uint8
	Username() string
	Name() string
	Email() string
	Password() *primitive.UserPassword
	Master() *primitive.MasterKey
	State() string
}

UserInf is the common interface for all user schema versions.

func ConvertUser added in v0.22.0

func ConvertUser(e *Unsigned) (UserInf, error)

ConvertUser converts an unsigned envelope to a UserInf interface which provides a common interface for all user versions.

Jump to

Keyboard shortcuts

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