svckey

package
v0.0.0-...-c16e2ab Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provisioner

type Provisioner struct {
	Service *iam.Service
	// contains filtered or unexported fields
}

Provisioner is a GCP service account key provisioner. It creates new svc-keys and deletes old svc-keys if enabled.

func NewProvisioner

func NewProvisioner(enableDeletion bool) (*Provisioner, error)

NewProvisioner creates a new svc-key provisioner with a new iam service. The argument 'enableDeletion' specifies if deletion of old svc-keys is enabled. It returns a pointer to the new provisioner and any error if encountered.

func (*Provisioner) CreateNew

func (p *Provisioner) CreateNew(labels map[string]string) (string, []byte, error)

CreateNew provisions a new service account key, returns the key-id and private-key data of the created key if successful, otherwise returns error

func (*Provisioner) Deactivate

func (p *Provisioner) Deactivate(labels map[string]string, version string) error

Deactivate deletes an existing service account key specified by labels and version, returns nil if successful, otherwise error

type ServiceAccountKeySpec

type ServiceAccountKeySpec struct {
	Project        string `yaml:"project"`
	ServiceAccount string `yaml:"serviceAccount"`
}

func (ServiceAccountKeySpec) Labels

func (svc ServiceAccountKeySpec) Labels() map[string]string

Labels is used to obtain the labels needed for the provisioner of the ServiceAccountKey

func (ServiceAccountKeySpec) String

func (svc ServiceAccountKeySpec) String() string

func (ServiceAccountKeySpec) Type

func (svc ServiceAccountKeySpec) Type() string

Type is used to obtain the provisioner of the ServiceAccountKey

func (*ServiceAccountKeySpec) Validate

func (svc *ServiceAccountKeySpec) Validate() error

Validate return error if 'project' and/or 'service-account' fields are missing

Jump to

Keyboard shortcuts

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