Documentation
¶
Overview ¶
Much of the content of this file is copied from getsops/sops project at the following source with minor modifications: https://github.com/getsops/sops/blob/d7c2d7d30f1e3991c8646c1ad829a1c34263e05c/keyservice/server.go Per the terms of the MPL-2.0, the following applies: - The file (and the projct) retains the same license. - The file (and the project) retains the copyright notice. The source does not contain copyright notice, but the copyright of this code is assigned to original authors.
Index ¶
- type Age
- type GCPKMS
- type KeyGroupProvider
- type KeyServiceClientProvider
- type Local
- func (Local) CaddyModule() caddy.ModuleInfo
- func (ks Local) Decrypt(ctx context.Context, req *keyservice.DecryptRequest) (*keyservice.DecryptResponse, error)
- func (s *Local) Encrypt(ctx context.Context, req *keyservice.EncryptRequest) (*keyservice.EncryptResponse, error)
- func (s *Local) KeyGroup() []sops.KeyGroup
- func (l *Local) KeyServiceClient() keyservice.KeyServiceClient
- func (s *Local) Provision(ctx caddy.Context) error
- func (s *Local) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- type MasterkeyConverter
- type Remote
- type Storage
- func (Storage) CaddyModule() caddy.ModuleInfo
- func (s *Storage) CertMagicStorage() (certmagic.Storage, error)
- func (s *Storage) Delete(ctx context.Context, key string) error
- func (s *Storage) Exists(ctx context.Context, key string) bool
- func (s *Storage) List(ctx context.Context, path string, recursive bool) ([]string, error)
- func (s *Storage) Load(ctx context.Context, key string) ([]byte, error)
- func (s *Storage) Lock(ctx context.Context, name string) error
- func (s *Storage) Provision(ctx caddy.Context) error
- func (s *Storage) Stat(ctx context.Context, key string) (certmagic.KeyInfo, error)
- func (s *Storage) Store(ctx context.Context, key string, value []byte) error
- func (s *Storage) Unlock(ctx context.Context, name string) error
- func (s *Storage) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Age ¶
type Age struct {
// The public key generated by `age`
Recipient string `json:"recipient,omitempty"`
// The private keys generated by `age`
Identities []string `json:"identities,omitempty"`
// contains filtered or unexported fields
}
Age is a key type to be used with encryption provider. This key type uses age(age-encryption.org) key-pair for encryption/decryption. See more: [https://github.com/getsops/sops#encrypting-using-age](https://github.com/getsops/sops#encrypting-using-age)
func (Age) CaddyModule ¶
func (a Age) CaddyModule() caddy.ModuleInfo
CaddyModule implements caddy.Module.
func (*Age) ToMasterkey ¶
ToMasterkey implements Masterkeyer.
type GCPKMS ¶
type GCPKMS struct {
// The subject resource ID as obtained from the GCP console.
ResourceID string `json:"resource_id,omitempty"`
// The raw JSON credentials as obtained from GCP
Credentials json.RawMessage `json:"credentials,omitempty"`
// contains filtered or unexported fields
}
GCPKMS uses GCPKMS (Google Cloud Platform KMS) for the encryption/decryption. See more: [https://github.com/getsops/sops#encrypting-using-gcp-kms](https://github.com/getsops/sops#encrypting-using-gcp-kms)
func (GCPKMS) CaddyModule ¶
func (GCPKMS) CaddyModule() caddy.ModuleInfo
CaddyModule implements caddy.Module.
func (*GCPKMS) ToMasterkey ¶
ToMasterkey implements Masterkeyer.
type KeyGroupProvider ¶
KeyGroupProvider allows the `encrypted` storage module to obtain the keys from the encryption provider
type KeyServiceClientProvider ¶
type KeyServiceClientProvider interface {
KeyServiceClient() keyservice.KeyServiceClient
}
KeyServiceClientProvider allows the `encrypted` storage module to obtain the encryption/decryption client conforming to the provider.
type Local ¶
type Local struct {
// The encryption/decryption keyset
Keys []json.RawMessage `json:"keys,omitempty" caddy:"namespace=caddy.storage.encrypted.key inline_key=type"`
// contains filtered or unexported fields
}
Local encryption provider avails in-process encryption/decryption capabilities
func (Local) CaddyModule ¶
func (Local) CaddyModule() caddy.ModuleInfo
CaddyModule implements caddy.Module.
func (Local) Decrypt ¶
func (ks Local) Decrypt(ctx context.Context, req *keyservice.DecryptRequest) (*keyservice.DecryptResponse, error)
Decrypt takes a decrypt request and decrypts the provided ciphertext with the provided key, returning the decrypted result
func (*Local) Encrypt ¶
func (s *Local) Encrypt(ctx context.Context, req *keyservice.EncryptRequest) (*keyservice.EncryptResponse, error)
Encrypt implements keyservice.KeyServiceServer.
func (*Local) KeyServiceClient ¶
func (l *Local) KeyServiceClient() keyservice.KeyServiceClient
KeyServiceClient implements KeyServiceClientProvider.
type MasterkeyConverter ¶
MasterkeyConverter allows conversion from the custom key type to SOPS `keys.MasterKey` interface type
type Remote ¶
type Remote struct {
Address string `json:"address,omitempty"`
Keys []json.RawMessage `json:"keys,omitempty" caddy:"namespace=caddy.storage.encrypted.key inline_key=type"`
// contains filtered or unexported fields
}
func (Remote) CaddyModule ¶
func (Remote) CaddyModule() caddy.ModuleInfo
CaddyModule implements caddy.Module.
func (*Remote) KeyServiceClient ¶
func (r *Remote) KeyServiceClient() keyservice.KeyServiceClient
KeyServiceClient implements KeyServiceClientProvider.
type Storage ¶
type Storage struct {
// The backing storage where the encrypted data is stored.
RawBackend json.RawMessage `json:"backend,omitempty" caddy:"namespace=caddy.storage inline_key=module"`
// The encryption provider: local, remote. Although this is an array, current support is for 1 provider.
// TODO: implemented the `remote` provider.
// TODO: multiple providers
Encryption []json.RawMessage `json:"encryption,omitempty" caddy:"namespace=caddy.storage.encrypted.provider inline_key=provider"`
// contains filtered or unexported fields
}
Storage is the impelementation of certmagic.Storage interface for Caddy with encryption/decryption layer using [SOPS](https://github.com/getsops/sops). The module accepts any Caddy storage module as the backend.
func (Storage) CaddyModule ¶
func (Storage) CaddyModule() caddy.ModuleInfo
CaddyModule implements caddy.Module.
func (*Storage) CertMagicStorage ¶
CertMagicStorage implements caddy.StorageConverter.