primitive

package
v0.6.2-rc Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2016 License: MIT Imports: 4 Imported by: 33

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           *pathexp.PathExp `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 Environment

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

Environment is an entity that represents a group of processes

func (*Environment) Type

func (t *Environment) Type() byte

Type returns the enumerated byte representation of Environment

func (*Environment) Version

func (v *Environment) Version() int

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

type Keyring

type Keyring struct {
	Created        time.Time        `json:"created_at"`
	OrgID          *identity.ID     `json:"org_id"`
	PathExp        *pathexp.PathExp `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 Policy

type Policy struct {
	PolicyType string       `json:"type"`
	Previous   *identity.ID `json:"previous"`
	OrgID      *identity.ID `json:"org_id"`
	Policy     *struct {
		Name        string            `json:"name"`
		Description string            `json:"description"`
		Statements  []PolicyStatement `json:"statements"`
	} `json:"policy"`
	// contains filtered or unexported fields
}

Policy is an entity that represents a group of statements for acl

func (*Policy) Type

func (t *Policy) Type() byte

Type returns the enumerated byte representation of Policy

func (*Policy) Version

func (v *Policy) Version() int

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

type PolicyAttachment

type PolicyAttachment struct {
	OwnerID  *identity.ID `json:"owner_id"`
	PolicyID *identity.ID `json:"policy_id"`
	OrgID    *identity.ID `json:"org_id"`
	// contains filtered or unexported fields
}

PolicyAttachment is an entity that represents the link between policies and teams

func (*PolicyAttachment) Type

func (t *PolicyAttachment) Type() byte

Type returns the enumerated byte representation of PolicyAttchment

func (*PolicyAttachment) Version

func (v *PolicyAttachment) Version() int

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

type PolicyStatement

type PolicyStatement struct {
	Effect   string   `json:"effect"`
	Action   []string `json:"action"` // XXX: This could potentially be a string and not []string
	Resource string   `json:"resource"`
}

PolicyStatement is an acl statement on a policy object

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 Project

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

Project is an entity that represents a group of services

func (*Project) Type

func (t *Project) Type() byte

Type returns the enumerated byte representation of Project

func (*Project) Version

func (v *Project) Version() int

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

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 Service

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

Service is an entity that represents a group of processes

func (*Service) Type

func (t *Service) Type() byte

Type returns the enumerated byte representation of Service

func (*Service) Version

func (v *Service) Version() int

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

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 {
	Username string        `json:"username"`
	Name     string        `json:"name"`
	Email    string        `json:"email"`
	State    string        `json:"state"`
	Password *UserPassword `json:"password"`
	Master   *UserMaster   `json:"master"`
	// contains filtered or unexported fields
}

User is the body of a user object

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.

type UserMaster

type UserMaster struct {
	Value *base64.Value `json:"value"`
	Alg   string        `json:"alg"`
}

UserMaster is the body.master object for a user

type UserPassword

type UserPassword struct {
	Salt  string        `json:"salt"`
	Value *base64.Value `json:"value"`
	Alg   string        `json:"alg"`
}

UserPassword is the body.password object for a user

Jump to

Keyboard shortcuts

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