internal

package
v0.0.0-...-ba1c585 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

NewService returns a new clusterAgentService.

Types

type AgentStorage

type AgentStorage interface {
	// Get retrieves the blessings associated with secret. It returns an
	// error if the secret doesn't exist.
	Get(secret string) (blessings security.Blessings, err error)
	// Put stores the blessings and associates them with secret. It
	// returns an error if the secret already exists.
	Put(secret string, blessings security.Blessings) (err error)
	// Delete deletes the secret and its associated blessings. It returns
	// an error is there was a problem deleting the secret.
	Delete(secret string) error
}

The interface for storing secrets and their associated blessings.

func NewFileStorage

func NewFileStorage(dir string) AgentStorage

NewFileStorage returns an AgentStore implementation that uses the local file system, with all files placed under the directory 'dir'.

type ClusterAgent

type ClusterAgent struct {
	// contains filtered or unexported fields
}

The Cluster Agent keeps a list of Secret Keys and Blessings associated with them. It issues new Blessings when presented with a valid Secret Key. The new Blessings are extensions of the Blessings associated with the Secret Key.

func NewAgent

func NewAgent(principal security.Principal, storage AgentStorage) *ClusterAgent

func (*ClusterAgent) Bless

func (a *ClusterAgent) Bless(secret string, publicKey security.PublicKey, name string) (security.Blessings, error)

Bless creates new blessing extensions using the blessings associated with the given secret key.

func (*ClusterAgent) ForgetSecret

func (a *ClusterAgent) ForgetSecret(secret string) error

ForgetSecret forgets the secret key and its associated blessings.

func (*ClusterAgent) NewSecret

func (a *ClusterAgent) NewSecret(blessings security.Blessings) (string, error)

NewSecret creates a new secret key and associates it with the given blessings. The blessings must be bound to the principal of the Cluster Agent.

Jump to

Keyboard shortcuts

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