Documentation
¶
Index ¶
- Constants
- func Builder(_ context.Context, c any) (secrets.Keeper, error)
- type Config
- type Keyring
- func (k Keyring) CopySecret(context.Context, string, string) (secrets.Secret, error)
- func (k Keyring) DeleteSecret(_ context.Context, id string) error
- func (k Keyring) GetSecret(_ context.Context, id string) (secrets.Secret, error)
- func (k Keyring) GetSecretsByName(_ context.Context, name string) ([]secrets.Secret, error)
- func (k Keyring) ListLocations(_ context.Context) ([]string, error)
- func (k Keyring) ListSecrets(context.Context, string) ([]string, error)
- func (k Keyring) MoveSecret(context.Context, string, string) (secrets.Secret, error)
- func (k Keyring) SetSecret(_ context.Context, secret secrets.Secret) (secrets.Secret, error)
- type Secret
- func (s *Secret) Fields() map[string]string
- func (s *Secret) GetField(name string) string
- func (s *Secret) ID() string
- func (s *Secret) LastModified() time.Time
- func (s *Secret) Location() string
- func (s *Secret) Name() string
- func (s *Secret) Password() string
- func (s *Secret) Type() string
- func (s *Secret) Url() *url.URL
- func (s *Secret) Username() string
Constants ¶
const ConfigType = "keyring"
ConfigType is the name of the config type for the keyring secret keeper.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// ServiceName is the name of the service to use in the keyring.
ServiceName string `mapstructure:"service_name" yaml:"service_name"`
}
Config is the configuration for the keyring secret keeper.
type Keyring ¶
type Keyring struct {
// contains filtered or unexported fields
}
Keyring is a Keeper with access to the system keyring.
func (Keyring) CopySecret ¶
CopySecret copies the secret with the given ID to the new name.
func (Keyring) DeleteSecret ¶
DeleteSecret deletes the secret with the given ID.
func (Keyring) GetSecretsByName ¶
GetSecretsByName returns a list of secrets in the given location with the given name.
func (Keyring) ListLocations ¶
ListLocations returns a list of locations that this Keeper can access.
func (Keyring) ListSecrets ¶
ListSecrets returns a list of secrets in the given location.
func (Keyring) MoveSecret ¶
MoveSecret moves the secret with the given ID to the new name.
type Secret ¶
type Secret struct {
// contains filtered or unexported fields
}
Secret is a secrets.Secret implementation that wraps a keyring entry. This implementation is unique in that the ID, name, and username are all treated the same.
func FromKeyring ¶
FromKeyring creates a new Secret from the given keyring entry.
func FromSecret ¶
FromSecret creates a new Secret from the given secret.
func (*Secret) LastModified ¶
LastModified returns the last modified time of the secret.