vault

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CUSTOM_SECRETS    = "secrets"
	CUSTOM_CONSUMERID = "consumerId"
)
View Source
const (
	Type   = "HashiCorpVault"
	TypeV1 = Type + runtime.VersionSeparator + "v1"
)
View Source
const ATTR_REPOS = "github.com/open-component-model/ocm/pkg/contexts/credentials/repositories/vault"
View Source
const PROVIDER = "ocm.software/credentialprovider/" + Type

Variables

View Source
var (
	REALM = ocmlog.DefineSubRealm("HashiCorp Vault Access", "credentials", "vault")
)

Functions

func RegisterAuthMethod

func RegisterAuthMethod(m AuthMethod)

Types

type AuthMethod

type AuthMethod interface {
	GetName() string
	Validate(creds cpi.Credentials) error
	GetToken(ctx context.Context, client *vault.Client, ns string, creds cpi.Credentials) (string, error)
}

type AuthMethods

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

func NewAuthMethods

func NewAuthMethods() *AuthMethods

func (*AuthMethods) Get

func (r *AuthMethods) Get(name string) AuthMethod

func (*AuthMethods) Names

func (r *AuthMethods) Names() []string

func (*AuthMethods) Register

func (r *AuthMethods) Register(m AuthMethod)

type ConsumerProvider

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

func NewConsumerProvider

func NewConsumerProvider(repo *Repository) (*ConsumerProvider, error)

func (*ConsumerProvider) ExistsCredentials

func (c *ConsumerProvider) ExistsCredentials(name string) (bool, error)

func (*ConsumerProvider) Get

func (*ConsumerProvider) LookupCredentials

func (c *ConsumerProvider) LookupCredentials(name string) (cpi.Credentials, error)

func (*ConsumerProvider) Unregister

func (p *ConsumerProvider) Unregister(id cpi.ProviderIdentity)

type Option

type Option = optionutils.Option[*Options]

func WithNamespace

func WithNamespace(s string) Option

func WithPath

func WithPath(s string) Option

func WithPropagation

func WithPropagation(b ...bool) Option

func WithSecrets

func WithSecrets(s ...string) Option

func WithSecretsEngine

func WithSecretsEngine(s string) Option

type Options

type Options struct {
	Namespace                string   `json:"namespace,omitempty"`
	SecretsEngine            string   `json:"secretsEngine,omitempty"`
	Path                     string   `json:"path,omitempty"`
	Secrets                  []string `json:"secrets,omitempty"`
	PropgateConsumerIdentity bool     `json:"propagateConsumerIdentity,omitempty"`
}

func (*Options) ApplyTo

func (o *Options) ApplyTo(opts *Options)

type Repositories

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

func (*Repositories) GetRepository

func (r *Repositories) GetRepository(ctx cpi.Context, spec *RepositorySpec) (*Repository, error)

type Repository

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

func NewRepository

func NewRepository(ctx cpi.Context, spec *RepositorySpec) (*Repository, error)

func (*Repository) ExistsCredentials

func (r *Repository) ExistsCredentials(name string) (bool, error)

func (*Repository) GetConsumerId

func (r *Repository) GetConsumerId(uctx ...internal.UsageContext) internal.ConsumerIdentity

func (*Repository) GetIdentityMatcher

func (r *Repository) GetIdentityMatcher() string

func (*Repository) LookupCredentials

func (r *Repository) LookupCredentials(name string) (cpi.Credentials, error)

func (*Repository) WriteCredentials

func (r *Repository) WriteCredentials(name string, creds cpi.Credentials) (cpi.Credentials, error)

type RepositorySpec

type RepositorySpec struct {
	runtime.ObjectVersionedType `json:",inline"`
	ServerURL                   string `json:"serverURL"`
	Options                     `json:",inline"`
}

RepositorySpec describes a docker config based credential repository interface.

func NewRepositorySpec

func NewRepositorySpec(url string, opts ...Option) *RepositorySpec

NewRepositorySpec creates a new memory RepositorySpec.

func (*RepositorySpec) GetConsumerId added in v0.6.0

func (a *RepositorySpec) GetConsumerId(uctx ...internal.UsageContext) internal.ConsumerIdentity

func (*RepositorySpec) GetIdentityMatcher added in v0.6.0

func (a *RepositorySpec) GetIdentityMatcher() string

func (*RepositorySpec) GetKey

func (a *RepositorySpec) GetKey() cpi.ProviderIdentity

func (*RepositorySpec) GetType

func (a *RepositorySpec) GetType() string

func (*RepositorySpec) Repository

func (a *RepositorySpec) Repository(ctx cpi.Context, creds cpi.Credentials) (cpi.Repository, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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