primitive

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package primitive contains definitions of the primitive types used in ag.

Index

Constants

View Source
const (
	SignatureClaimType  = "signature"
	RevocationClaimType = "revocation"
)

Types of claims that can be made against public keys.

View Source
const (
	OrgInvitePendingState    = "pending"
	OrgInviteAssociatedState = "associated"
	OrgInviteAcceptedState   = "accepted"
	OrgInviteApprovedState   = "approved"
)

Org Invitations exist in four states: pending, associated, accepted, and approved.

View Source
const (
	SystemTeam = "system"
	UserTeam   = "user"
)

There are two types of teams: system and user. System teams are managed by the Arigato registry.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim struct {
	Created     time.Time    `json:"created_at"`
	OrgID       *identity.ID `json:"org_id"`
	OwnerID     *identity.ID `json:"owner_id"`
	Previous    *identity.ID `json:"previous"`
	PublicKeyID *identity.ID `json:"public_key_id"`
	KeyType     string       `json:"type"`
	// contains filtered or unexported fields
}

Claim is a signature or revocation claim against a public key.

func NewClaim

func NewClaim(orgID, ownerID, previous, pubKeyID *identity.ID,
	keyType string) *Claim

NewClaim returns a new Claim, with the created time set to now

func (*Claim) Type

func (c *Claim) Type() byte

Type returns the enumerated byte representation of Claim.

func (*Claim) Version

func (v *Claim) Version() int

Version returns the schema version of structs that embed this type.

type Credential

type Credential struct {
	Credential        *CredentialValue `json:"credential"`
	KeyringID         *identity.ID     `json:"keyring_id"`
	Name              string           `json:"name"`
	Nonce             *base64.Value    `json:"nonce"`
	OrgID             *identity.ID     `json:"org_id"`
	PathExp           string           `json:"pathexp"`
	Previous          *identity.ID     `json:"previous"`
	ProjectID         *identity.ID     `json:"project_id"`
	CredentialVersion int              `json:"version"`
	// contains filtered or unexported fields
}

Credential is a secret value shared between a group of services based on users identity, operating environment, project, and organization

func (*Credential) Type

func (c *Credential) Type() byte

Type returns the enumerated byte representation of Credential

func (*Credential) Version

func (v *Credential) Version() int

Version returns the schema version of structs that embed this type.

type CredentialValue

type CredentialValue struct {
	Algorithm string        `json:"alg"`
	Nonce     *base64.Value `json:"nonce"`
	Value     *base64.Value `json:"value"`
}

CredentialValue is the secretbox encrypted value of the containing Credential.

type Keyring

type Keyring struct {
	Created        time.Time    `json:"created_at"`
	OrgID          *identity.ID `json:"org_id"`
	PathExp        string       `json:"pathexp"`
	Previous       *identity.ID `json:"previous"`
	ProjectID      *identity.ID `json:"project_id"`
	KeyringVersion int          `json:"version"`
	// contains filtered or unexported fields
}

Keyring is a mechanism for sharing a shared secret between many different users and machines at a position in the credential path.

Credentials belong to Keyrings

func (*Keyring) Type

func (k *Keyring) Type() byte

Type returns the enumerated byte representation of Keyring

func (*Keyring) Version

func (v *Keyring) Version() int

Version returns the schema version of structs that embed this type.

type KeyringMember

type KeyringMember struct {
	Created         time.Time         `json:"created_at"`
	EncryptingKeyID *identity.ID      `json:"encrypting_key_id"`
	Key             *KeyringMemberKey `json:"key"`
	KeyringID       *identity.ID      `json:"keyring_id"`
	OrgID           *identity.ID      `json:"org_id"`
	OwnerID         *identity.ID      `json:"owner_id"`
	ProjectID       *identity.ID      `json:"project_id"`
	PublicKeyID     *identity.ID      `json:"public_key_id"`
	// contains filtered or unexported fields
}

KeyringMember is a record of sharing a master secret key with a user or machine.

KeyringMember belongs to a Keyring

func (*KeyringMember) Type

func (km *KeyringMember) Type() byte

Type returns the enumerated byte representation of KeyringMember

func (*KeyringMember) Version

func (v *KeyringMember) Version() int

Version returns the schema version of structs that embed this type.

type KeyringMemberKey

type KeyringMemberKey struct {
	Algorithm string        `json:"alg"`
	Nonce     *base64.Value `json:"nonce"`
	Value     *base64.Value `json:"value"`
}

KeyringMemberKey is the keyring master encryption key, encrypted for the owner of a KeyringMember

type Membership

type Membership struct {
	OrgID   *identity.ID `json:"org_id"`
	OwnerID *identity.ID `json:"owner_id"`
	TeamID  *identity.ID `json:"team_id"`
	// contains filtered or unexported fields
}

Membership is an entity that represents whether a user or machine is a part of a team in an organization.

func (*Membership) Type

func (m *Membership) Type() byte

Type returns the enumerated byte representation of Membership

func (*Membership) Version

func (v *Membership) Version() int

Version returns the schema version of structs that embed this type.

type Org

type Org struct {
	Name string `json:"name"`
	// contains filtered or unexported fields
}

Org is a grouping of users that collaborate with each other

func (*Org) Type

func (o *Org) Type() byte

Type returns the enumerated byte representation of Org

func (*Org) Version

func (v *Org) Version() int

Version returns the schema version of structs that embed this type.

type OrgInvite

type OrgInvite struct {
	OrgID      *identity.ID `json:"org_id"`
	Email      string       `json:"email"`
	InviterID  *identity.ID `json:"inviter_id"`
	InviteeID  *identity.ID `json:"invitee_id"`
	ApproverID *identity.ID `json:"approver_id"`
	State      string       `json:"state"`
	Code       *struct {
		Alg   string        `json:"alg"`
		Salt  *base64.Value `json:"salt"`
		Value *base64.Value `json:"value"`
	} `json:"code"`
	PendingTeams []identity.ID `json:"pending_teams"`
	Created      *time.Time    `json:"created_at"`
	Accepted     *time.Time    `json:"accepted_at"`
	Approved     *time.Time    `json:"approved_at"`
	// contains filtered or unexported fields
}

OrgInvite is an invitation for an individual to join an organization

func (*OrgInvite) Type

func (o *OrgInvite) Type() byte

Type returns the numerated byte representation of OrgInvite

func (*OrgInvite) Version

func (v *OrgInvite) Version() int

Version returns the schema version of structs that embed this type.

type PrivateKey

type PrivateKey struct {
	Key         PrivateKeyValue `json:"key"`
	OrgID       *identity.ID    `json:"org_id"`
	OwnerID     *identity.ID    `json:"owner_id"`
	PNonce      *base64.Value   `json:"pnonce"`
	PublicKeyID *identity.ID    `json:"public_key_id"`
	// contains filtered or unexported fields
}

PrivateKey is the private portion of an asymetric key.

func (*PrivateKey) Type

func (pk *PrivateKey) Type() byte

Type returns the enumerated byte representation of PrivateKey.

func (*PrivateKey) Version

func (v *PrivateKey) Version() int

Version returns the schema version of structs that embed this type.

type PrivateKeyValue

type PrivateKeyValue struct {
	Algorithm string        `json:"alg"`
	Value     *base64.Value `json:"value"`
}

PrivateKeyValue holds the encrypted value of the PrivateKey.

type PublicKey

type PublicKey struct {
	Algorithm string         `json:"alg"`
	Created   time.Time      `json:"created_at"`
	Expires   time.Time      `json:"expires_at"`
	Key       PublicKeyValue `json:"key"`
	OrgID     *identity.ID   `json:"org_id"`
	OwnerID   *identity.ID   `json:"owner_id"`
	KeyType   string         `json:"type"`
	// contains filtered or unexported fields
}

PublicKey is the public portion of an asymetric key.

func (*PublicKey) Type

func (pk *PublicKey) Type() byte

Type returns the enumerated byte representation of PublicKey.

func (*PublicKey) Version

func (v *PublicKey) Version() int

Version returns the schema version of structs that embed this type.

type PublicKeyValue

type PublicKeyValue struct {
	Value *base64.Value `json:"value"`
}

PublicKeyValue is the actual value of a PublicKey.

type Signature

type Signature struct {
	Algorithm   string        `json:"alg"`
	PublicKeyID *identity.ID  `json:"public_key_id"`
	Value       *base64.Value `json:"value"`
}

Signature is an immutable object, but not technically a payload. Its fields must be ordered properly so that ID generation is correct.

If PublicKeyID is nil, the signature is self-signed.

type Team

type Team struct {
	Name     string       `json:"name"`
	OrgID    *identity.ID `json:"org_id"`
	TeamType string       `json:"type"`
	// contains filtered or unexported fields
}

Team is an entity that represents a group of users

func (*Team) Type

func (t *Team) Type() byte

Type returns the enumerated byte representation of Team

func (*Team) Version

func (v *Team) Version() int

Version returns the schema version of structs that embed this type.

type User

type User struct {
	Master *struct {
		Alg   string        `json:"alg"`
		Value *base64.Value `json:"value"`
	} `json:"master"`
	// contains filtered or unexported fields
}

User holds the details of a user, including their encrypted master key.

func (*User) Type

func (u *User) Type() byte

Type returns the enumerated byte representation of User.

func (*User) Version

func (v *User) Version() int

Version returns the schema version of structs that embed this type.

Jump to

Keyboard shortcuts

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