creds

package
v6.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ManagerFactories

func ManagerFactories() map[string]ManagerFactory

func NewVariables

func NewVariables(secrets Secrets, teamName string, pipelineName string, allowRootPath bool) vars.Variables

func Register

func Register(name string, managerFactory ManagerFactory)

Types

type CacheEntry

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

type CachedSecrets

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

func NewCachedSecrets

func NewCachedSecrets(secrets Secrets, cacheConfig SecretCacheConfig) *CachedSecrets

func (*CachedSecrets) Get

func (cs *CachedSecrets) Get(secretPath string) (interface{}, *time.Time, bool, error)

func (*CachedSecrets) NewSecretLookupPaths

func (cs *CachedSecrets) NewSecretLookupPaths(teamName string, pipelineName string, allowRootPath bool) []SecretLookupPath

type CredentialManagementConfig

type CredentialManagementConfig struct {
	RetryConfig SecretRetryConfig
	CacheConfig SecretCacheConfig
}

type HealthResponse

type HealthResponse struct {
	Response interface{} `json:"response,omitempty"`
	Error    string      `json:"error,omitempty"`
	Method   string      `json:"method,omitempty"`
}

type Manager

type Manager interface {
	IsConfigured() bool
	Validate() error
	Health() (*HealthResponse, error)
	Init(lager.Logger) error
	Close(logger lager.Logger)

	NewSecretsFactory(lager.Logger) (SecretsFactory, error)
}

type ManagerFactory

type ManagerFactory interface {
	AddConfig(*flags.Group) Manager
	NewInstance(interface{}) (Manager, error)
}

type Managers

type Managers map[string]Manager

type Params

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

func NewParams

func NewParams(variables vars.Variables, params atc.Params) Params

func (Params) Evaluate

func (p Params) Evaluate() (atc.Params, error)

type RetryableSecrets

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

func (RetryableSecrets) Get

func (rs RetryableSecrets) Get(secretPath string) (interface{}, *time.Time, bool, error)

Get retrieves the value and expiration of an individual secret

func (RetryableSecrets) NewSecretLookupPaths

func (rs RetryableSecrets) NewSecretLookupPaths(teamName string, pipelineName string, allowRootPath bool) []SecretLookupPath

NewSecretLookupPaths defines how variables will be searched in the underlying secret manager

type SecretCacheConfig

type SecretCacheConfig struct {
	Enabled          bool          `long:"secret-cache-enabled" description:"Enable in-memory cache for secrets"`
	Duration         time.Duration `` /* 204-byte string literal not displayed */
	DurationNotFound time.Duration `` /* 150-byte string literal not displayed */
	PurgeInterval    time.Duration `` /* 134-byte string literal not displayed */
}

type SecretLookupPath

type SecretLookupPath interface {
	VariableToSecretPath(vars.VariableReference) (vars.VariableReference, error)
}

SecretLookupPath transforms variable name into full secret path

func NewSecretLookupWithPrefix

func NewSecretLookupWithPrefix(prefix string) SecretLookupPath

func NewSecretLookupWithTemplate

func NewSecretLookupWithTemplate(pathTemplate *SecretTemplate, teamName string, pipelineName string) SecretLookupPath

type SecretLookupWithPrefix

type SecretLookupWithPrefix struct {
	Prefix string
}

SecretLookupWithPrefix is an implementation which returns [prefix][separator][varName]

func (SecretLookupWithPrefix) VariableToSecretPath

func (sl SecretLookupWithPrefix) VariableToSecretPath(ref vars.VariableReference) (vars.VariableReference, error)

type SecretLookupWithTemplate

type SecretLookupWithTemplate struct {
	PathTemplate *SecretTemplate
	TeamName     string
	PipelineName string
}

func (SecretLookupWithTemplate) VariableToSecretPath

type SecretRetryConfig

type SecretRetryConfig struct {
	Attempts int           `` /* 151-byte string literal not displayed */
	Interval time.Duration `long:"secret-retry-interval" default:"1s" description:"The interval between secret retry retrieval attempts."`
}

type SecretTemplate

type SecretTemplate struct {
	*template.Template
	// contains filtered or unexported fields
}

SecretLookupWithTemplate uses the given template to construct a lookup path specific to a team and (optionally) pipeline

func BuildSecretTemplate

func BuildSecretTemplate(name, tmpl string) (*SecretTemplate, error)

type Secrets

type Secrets interface {
	// Every credential manager needs to be able to return (secret, secret_expiration_time, exists, error) based on the secret path
	Get(string) (interface{}, *time.Time, bool, error)

	// NewSecretLookupPaths returns an instance of lookup policy, which can transform pipeline ((var)) into one or more secret paths, based on team name and pipeline name
	NewSecretLookupPaths(string, string, bool) []SecretLookupPath
}

func NewRetryableSecrets

func NewRetryableSecrets(secrets Secrets, retryConfig SecretRetryConfig) Secrets

type SecretsFactory

type SecretsFactory interface {
	// NewSecrets returns an instance of a secret manager, capable of retrieving individual secrets
	NewSecrets() Secrets
}

type SetPipelinePlan

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

func NewSetPipelinePlan

func NewSetPipelinePlan(variables vars.Variables, plan atc.SetPipelinePlan) SetPipelinePlan

func (SetPipelinePlan) Evaluate

func (s SetPipelinePlan) Evaluate() (atc.SetPipelinePlan, error)

type Source

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

func NewSource

func NewSource(variables vars.Variables, source atc.Source) Source

func (Source) Evaluate

func (s Source) Evaluate() (atc.Source, error)

type String

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

func NewString

func NewString(variables vars.Variables, credString string) String

func (String) Evaluate

func (s String) Evaluate() (string, error)

type TaskParamsValidator

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

func NewTaskParamsValidator

func NewTaskParamsValidator(variables vars.Variables, params atc.Params) TaskParamsValidator

func (TaskParamsValidator) Validate

func (s TaskParamsValidator) Validate() error

type TaskVarsValidator

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

func NewTaskVarsValidator

func NewTaskVarsValidator(variables vars.Variables, taskVars atc.Params) TaskVarsValidator

func (TaskVarsValidator) Validate

func (s TaskVarsValidator) Validate() error

type VarSourcePool

type VarSourcePool interface {
	FindOrCreate(lager.Logger, map[string]interface{}, ManagerFactory) (Secrets, error)
	Size() int
	Close()
}

func NewVarSourcePool

func NewVarSourcePool(
	logger lager.Logger,
	ttl time.Duration,
	collectInterval time.Duration,
	clock clock.Clock,
) VarSourcePool

type VariableLookupFromSecrets

type VariableLookupFromSecrets struct {
	Secrets     Secrets
	LookupPaths []SecretLookupPath
}

func (VariableLookupFromSecrets) Get

func (sl VariableLookupFromSecrets) Get(varDef vars.VariableDefinition) (interface{}, bool, error)

func (VariableLookupFromSecrets) List

type VersionedResourceType

type VersionedResourceType struct {
	atc.VersionedResourceType

	Source Source
}

type VersionedResourceTypes

type VersionedResourceTypes []VersionedResourceType

func NewVersionedResourceTypes

func NewVersionedResourceTypes(variables vars.Variables, rawTypes atc.VersionedResourceTypes) VersionedResourceTypes

func (VersionedResourceTypes) Evaluate

func (VersionedResourceTypes) Lookup

func (VersionedResourceTypes) Without

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