key

package
v0.0.0-...-4515e61 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2019 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCreateEndpoint

func MakeCreateEndpoint(l *zap.Logger, e encode.Encoder, publicKey *rsa.PublicKey, m Manager, rb rbac.Control) http.HandlerFunc

MakeCreateEndpoint creates a new http endpoint for the creation of service account keys

func MakeDeleteEndpoint

func MakeDeleteEndpoint(l *zap.Logger, e encode.Encoder, publicKey *rsa.PublicKey, m Manager, rb rbac.Control) http.HandlerFunc

MakeDeleteEndpoint create a new http endpoint to delete service account keys

func MakeGetEndpoint

func MakeGetEndpoint(l *zap.Logger, e encode.Encoder, publicKey *rsa.PublicKey, m Manager, rb rbac.Control) http.HandlerFunc

MakeGetEndpoint creates a new http endpoint for the return of service account keys

func MakeSetEndpoint

func MakeSetEndpoint(l *zap.Logger, e encode.Encoder, publicKey *rsa.PublicKey, m Manager, rb rbac.Control) http.HandlerFunc

MakeSetEndpoint creates a new http endpoint for updating the service account key info

func NewGRPCServer

func NewGRPCServer(m Manager) pb.ManagerServer

NewGRPCServer creates a new instance of a grpc server interface to register

Types

type ClientKey

type ClientKey struct {
	ServiceAccountGUID string          `json:"service_account_guid"`
	GUID               string          `json:"guid"`
	PrivateKey         *rsa.PrivateKey `json:"-"`
}

ClientKey represents the private key a client receives when creating a service account keypair

func (*ClientKey) MarshalJSON

func (k *ClientKey) MarshalJSON() ([]byte, error)

MarshalJSON marshals the client key to presentable data

func (*ClientKey) UnmarshalJSON

func (k *ClientKey) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals incoming JSON

type Complete

type Complete interface {
	Identifier
	Incomplete
}

Complete represents a complete service account keypair object

type Identifier

type Identifier interface {
	GUID() string
}

Identifier of a service account keypair

func NewIdentifier

func NewIdentifier(g string) Identifier

NewIdentifier creates a new identifier object

type Incomplete

type Incomplete interface {
	Provider
}

Incomplete represents an incomplete service account keypair

func NewIncomplete

func NewIncomplete(name, description string) Incomplete

NewIncomplete creates a new incomplete service account keypair object

type Manager

Manager for service account keys

func NewGRPCClient

func NewGRPCClient(c *grpc.ClientConn) Manager

NewGRPCClient creates a new grpc client for serviceaccount keys

func NewManager

func NewManager(r Repository, s serviceaccount.Manager) Manager

NewManager creates a new service account key manager

type Provider

type Provider interface {
	Data() *data
}

Provider provides data of a service account keypair

type Repository

type Repository interface {
	Get(context.Context, Identifier) (Complete, error)
	Update(context.Context, Complete) error
	Create(context.Context, Incomplete) (Complete, error)
	Delete(context.Context, Identifier) error
}

Repository represents methods to save and read data regarding keys

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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