envelope

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2017 License: BSD-3-Clause Imports: 6 Imported by: 38

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 Claim added in v0.23.0

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

Claim wraps primitive.Claim

func (*Claim) GetID added in v0.23.0

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

GetID returns the ID of the contained Claim.

type Credential added in v0.23.0

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

Credential wraps primitive.Credential

func (*Credential) Credential added in v0.23.0

func (c *Credential) Credential() *primitive.CredentialValue

Credential returns the encrypted CredentialValue for this Credential.

func (*Credential) CredentialVersion added in v0.23.0

func (c *Credential) CredentialVersion() int

CredentialVersion returns the monotomically incremented version of the Credential for this PathExp/Name pair.

func (*Credential) GetID added in v0.23.0

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

GetID returns the ID of the contained Credential.

func (*Credential) GetVersion added in v0.23.0

func (c *Credential) GetVersion() uint8

GetVersion returns the schema version of this Credential.

func (*Credential) Name added in v0.23.0

func (c *Credential) Name() string

Name returns this Credential's name.

func (*Credential) Nonce added in v0.23.0

func (c *Credential) Nonce() *base64.Value

Nonce returns the Nonce for this Credential's encrypted value.

func (*Credential) OrgID added in v0.23.0

func (c *Credential) OrgID() *identity.ID

OrgID returns the ID of the Org that this Credential belongs to.

func (*Credential) PathExp added in v0.23.0

func (c *Credential) PathExp() *pathexp.PathExp

PathExp returns the path expression for this Credential's location.

func (*Credential) Previous added in v0.23.0

func (c *Credential) Previous() *identity.ID

Previous returns the ID of the previous versino of this Credential, or nil if this Credential has no previous version.

func (*Credential) ProjectID added in v0.23.0

func (c *Credential) ProjectID() *identity.ID

ProjectID returns the ID of the Project that this Credential belongs to.

func (*Credential) Unset added in v0.23.0

func (c *Credential) Unset() bool

Unset returns a bool indicating if this Credential has been explicitly unset.

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 CredentialV1 added in v0.23.0

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

CredentialV1 wraps primitive.CredentialV1

func (*CredentialV1) Credential added in v0.23.0

func (c *CredentialV1) Credential() *primitive.CredentialValue

Credential returns the encrypted CredentialValue for this Credential.

func (*CredentialV1) CredentialVersion added in v0.23.0

func (c *CredentialV1) CredentialVersion() int

CredentialVersion returns the monotomically incremented version of the Credential for this PathExp/Name pair.

func (*CredentialV1) GetID added in v0.23.0

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

GetID returns the ID of the contained CredentialV1.

func (*CredentialV1) GetVersion added in v0.23.0

func (c *CredentialV1) GetVersion() uint8

GetVersion returns the schema version of this Credential.

func (*CredentialV1) Name added in v0.23.0

func (c *CredentialV1) Name() string

Name returns this Credential's name.

func (*CredentialV1) Nonce added in v0.23.0

func (c *CredentialV1) Nonce() *base64.Value

Nonce returns the Nonce for this Credential's encrypted value.

func (*CredentialV1) OrgID added in v0.23.0

func (c *CredentialV1) OrgID() *identity.ID

OrgID returns the ID of the Org that this Credential belongs to.

func (*CredentialV1) PathExp added in v0.23.0

func (c *CredentialV1) PathExp() *pathexp.PathExp

PathExp returns the path expression for this Credential's location.

func (*CredentialV1) Previous added in v0.23.0

func (c *CredentialV1) Previous() *identity.ID

Previous returns the ID of the previous versino of this Credential, or nil if this Credential has no previous version.

func (*CredentialV1) ProjectID added in v0.23.0

func (c *CredentialV1) ProjectID() *identity.ID

ProjectID returns the ID of the Project that this Credential belongs to.

func (CredentialV1) Unset added in v0.23.0

func (CredentialV1) Unset() bool

Unset returns a bool indicating if this Credential has been explicitly unset. Version 1 credentials do not track this, so it is always false.

type Envelope

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

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

type Environment added in v0.23.0

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

Environment wraps primitive.Environment

func (*Environment) GetID added in v0.23.0

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

GetID returns the ID of the contained Environment.

type Keyring added in v0.23.0

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

Keyring wraps primitive.Keyring

func (*Keyring) GetID added in v0.23.0

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

GetID returns the ID of the contained Keyring.

func (*Keyring) GetVersion added in v0.23.0

func (k *Keyring) GetVersion() uint8

GetVersion returns the schema version of this Keyring.

func (*Keyring) OrgID added in v0.23.0

func (k *Keyring) OrgID() *identity.ID

OrgID returns the ID of the Org that this Keyring belongs to.

func (*Keyring) PathExp added in v0.23.0

func (k *Keyring) PathExp() *pathexp.PathExp

PathExp returns the path expression that contains all Credentials in this Keyring.

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 KeyringMember added in v0.23.0

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

KeyringMember wraps primitive.KeyringMember

func (*KeyringMember) GetID added in v0.23.0

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

GetID returns the ID of the contained KeyringMember.

type KeyringMemberClaim added in v0.23.0

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

KeyringMemberClaim wraps primitive.KeyringMemberClaim

func (*KeyringMemberClaim) GetID added in v0.23.0

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

GetID returns the ID of the contained KeyringMemberClaim.

type KeyringMemberV1 added in v0.23.0

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

KeyringMemberV1 wraps primitive.KeyringMemberV1

func (*KeyringMemberV1) GetID added in v0.23.0

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

GetID returns the ID of the contained KeyringMemberV1.

type KeyringV1 added in v0.23.0

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

KeyringV1 wraps primitive.KeyringV1

func (*KeyringV1) GetID added in v0.23.0

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

GetID returns the ID of the contained KeyringV1.

func (*KeyringV1) GetVersion added in v0.23.0

func (k *KeyringV1) GetVersion() uint8

GetVersion returns the schema version of this Keyring.

func (*KeyringV1) OrgID added in v0.23.0

func (k *KeyringV1) OrgID() *identity.ID

OrgID returns the ID of the Org that this Keyring belongs to.

func (*KeyringV1) PathExp added in v0.23.0

func (k *KeyringV1) PathExp() *pathexp.PathExp

PathExp returns the path expression that contains all Credentials in this Keyring.

type MEKShare added in v0.23.0

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

MEKShare wraps primitive.MEKShare

func (*MEKShare) GetID added in v0.23.0

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

GetID returns the ID of the contained MEKShare.

type Machine added in v0.23.0

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

Machine wraps primitive.Machine

func (*Machine) GetID added in v0.23.0

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

GetID returns the ID of the contained Machine.

type MachineToken added in v0.23.0

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

MachineToken wraps primitive.MachineToken

func (*MachineToken) GetID added in v0.23.0

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

GetID returns the ID of the contained MachineToken.

type Membership added in v0.23.0

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

Membership wraps primitive.Membership

func (*Membership) GetID added in v0.23.0

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

GetID returns the ID of the contained Membership.

type Org added in v0.23.0

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

Org wraps primitive.Org

func (*Org) GetID added in v0.23.0

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

GetID returns the ID of the contained Org.

type OrgInvite added in v0.23.0

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

OrgInvite wraps primitive.OrgInvite

func (*OrgInvite) GetID added in v0.23.0

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

GetID returns the ID of the contained OrgInvite.

type Policy added in v0.23.0

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

Policy wraps primitive.Policy

func (*Policy) GetID added in v0.23.0

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

GetID returns the ID of the contained Policy.

type PolicyAttachment added in v0.23.0

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

PolicyAttachment wraps primitive.PolicyAttachment

func (*PolicyAttachment) GetID added in v0.23.0

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

GetID returns the ID of the contained PolicyAttachment.

type PrivateKey added in v0.23.0

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

PrivateKey wraps primitive.PrivateKey

func (*PrivateKey) GetID added in v0.23.0

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

GetID returns the ID of the contained PrivateKey.

type Project added in v0.23.0

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

Project wraps primitive.Project

func (*Project) GetID added in v0.23.0

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

GetID returns the ID of the contained Project.

type PublicKey added in v0.23.0

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

PublicKey wraps primitive.PublicKey

func (*PublicKey) GetID added in v0.23.0

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

GetID returns the ID of the contained PublicKey.

type Service added in v0.23.0

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

Service wraps primitive.Service

func (*Service) GetID added in v0.23.0

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

GetID returns the ID of the contained Service.

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.

func (*Signed) UnmarshalJSON

func (e *Signed) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Signed envelopes.

type Team added in v0.23.0

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

Team wraps primitive.Team

func (*Team) GetID added in v0.23.0

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

GetID returns the ID of the contained Team.

type Token added in v0.23.0

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

Token wraps primitive.Token

func (*Token) GetID added in v0.23.0

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

GetID returns the ID of the contained Token.

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.

func (*Unsigned) UnmarshalJSON

func (e *Unsigned) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Unsigned envelopes.

type User added in v0.23.0

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

User wraps primitive.User

func (*User) Email added in v0.23.0

func (u *User) Email() string

Email returns the current Email Address for this User.

func (*User) GetID added in v0.23.0

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

GetID returns the ID of the contained User.

func (*User) Master added in v0.23.0

func (u *User) Master() *primitive.MasterKey

Master returns the MasterKey for this User.

func (*User) Name added in v0.23.0

func (u *User) Name() string

Name returns the Full Name of this User.

func (*User) Password added in v0.23.0

func (u *User) Password() *primitive.UserPassword

Password returns the UserPassword for this User.

func (*User) StructVersion added in v0.25.0

func (u *User) StructVersion() uint8

StructVersion returns the version of the User object

func (*User) Username added in v0.23.0

func (u *User) Username() string

Username returns the username owned by this User.

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
}

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.

type UserV1 added in v0.23.0

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

UserV1 wraps primitive.UserV1

func (*UserV1) Email added in v0.23.0

func (u *UserV1) Email() string

Email returns the current Email Address for this User.

func (*UserV1) GetID added in v0.23.0

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

GetID returns the ID of the contained UserV1.

func (*UserV1) Master added in v0.23.0

func (u *UserV1) Master() *primitive.MasterKey

Master returns the MasterKey for this User.

func (*UserV1) Name added in v0.23.0

func (u *UserV1) Name() string

Name returns the Full Name of this User.

func (*UserV1) Password added in v0.23.0

func (u *UserV1) Password() *primitive.UserPassword

Password returns the UserPassword for this User.

func (*UserV1) StructVersion added in v0.25.0

func (u *UserV1) StructVersion() uint8

StructVersion returns the version of the user object

func (*UserV1) Username added in v0.23.0

func (u *UserV1) Username() string

Username returns the username owned by this User.

Jump to

Keyboard shortcuts

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