account_managers

package
v4.0.0-rc+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServiceAccountBindInputVariables

func ServiceAccountBindInputVariables(roleWhitelist []string) []broker.BrokerVariable

func ServiceAccountBindOutputVariables

func ServiceAccountBindOutputVariables() []broker.BrokerVariable

Variables output by all brokers that return service account info

func ServiceAccountName

func ServiceAccountName(bindingId string) string

XXX names are truncated to 20 characters because of a bug in the IAM service

Types

type ServiceAccountInfo

type ServiceAccountInfo struct {
	// the bits to save
	Name      string `json:"Name"`
	Email     string `json:"Email"`
	UniqueId  string `json:"UniqueId"`
	ProjectId string `json:"ProjectId"`

	// the bit to return
	PrivateKeyData string `json:"PrivateKeyData"`
}

type ServiceAccountManager

type ServiceAccountManager struct {
	ProjectId  string
	HttpConfig *jwt.Config
}

func (*ServiceAccountManager) BuildInstanceCredentials

func (b *ServiceAccountManager) BuildInstanceCredentials(bindRecord models.ServiceBindingCredentials, instanceRecord models.ServiceInstanceDetails) (map[string]string, error)

func (*ServiceAccountManager) CreateAccountWithRoles

func (sam *ServiceAccountManager) CreateAccountWithRoles(bindingID string, roles []string) (models.ServiceBindingCredentials, error)

CreateAccountWithRoles creates a service account with a name based on bindingID, JSON key and grants it zero or more roles the roles MUST be missing the roles/ prefix.

func (*ServiceAccountManager) CreateCredentials

func (sam *ServiceAccountManager) CreateCredentials(instanceID string, bindingID string, details brokerapi.BindDetails, instance models.ServiceInstanceDetails) (models.ServiceBindingCredentials, error)

If roleWhitelist is specified, then the extracted role is validated against it and an error is returned if the role is not contained within the whitelist

func (*ServiceAccountManager) DeleteCredentials

func (sam *ServiceAccountManager) DeleteCredentials(binding models.ServiceBindingCredentials) error

deletes the given service account from Google

type SqlAccountInfo

type SqlAccountInfo struct {
	// the bits to return
	Username   string `json:"Username"`
	Password   string `json:"Password"`
	CaCert     string `json:"CaCert"`
	ClientCert string `json:"ClientCert"`
	ClientKey  string `json:"ClientKey"`

	// the bits to save
	Sha1Fingerprint string `json:"Sha1Fingerprint"`
}

type SqlAccountManager

type SqlAccountManager struct {
	HttpConfig *jwt.Config
	ProjectId  string
}

func (*SqlAccountManager) BuildInstanceCredentials

func (b *SqlAccountManager) BuildInstanceCredentials(bindRecord models.ServiceBindingCredentials, instanceRecord models.ServiceInstanceDetails) (map[string]string, error)

func (*SqlAccountManager) CreateCredentials

func (sam *SqlAccountManager) CreateCredentials(instanceID string, bindingID string, details brokerapi.BindDetails, instance models.ServiceInstanceDetails) (models.ServiceBindingCredentials, error)

inserts a new user into the database and creates new ssl certs

func (*SqlAccountManager) DeleteCredentials

func (sam *SqlAccountManager) DeleteCredentials(binding models.ServiceBindingCredentials) error

deletes the user from the database and invalidates the associated ssl certs

type StringSet

type StringSet map[string]bool

StringSet is a set data structure for strings

func NewStringSet

func NewStringSet(contents ...string) StringSet

NewStringSet creates a new string set with the given contents.

func (StringSet) Add

func (set StringSet) Add(str ...string)

Add puts one or more elements into the set.

func (StringSet) Contains

func (set StringSet) Contains(other string) bool

Contains performs a set membership check.

func (StringSet) Equals

func (set StringSet) Equals(other StringSet) bool

Equals compares the contents of the two sets and returns true if they are the same.

func (StringSet) IsEmpty

func (set StringSet) IsEmpty() bool

IsEmpty determines if the set has zero elements.

func (StringSet) ToSlice

func (set StringSet) ToSlice() []string

ToSlice converts the set to a slice with undefined contents order.

Jump to

Keyboard shortcuts

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