Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type BundleSelector
- type ConfigProvider
- type CreateKeyIn
- type CreateSecretIn
- type CreateVaultIn
- type DecryptIn
- type EncryptIn
- type ExportIn
- type GenerateDEKIn
- type Handler
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Shutdown(ctx context.Context)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- type ImportKeyIn
- type ImportKeyVersionIn
- type InMemoryBackend
- func (b *InMemoryBackend) CancelKeyDeletion(vaultID, keyID, ifMatch string) (keyWire, string, error)
- func (b *InMemoryBackend) CancelKeyVersionDeletion(vaultID, keyID, versionID string) (keyVersionWire, string, error)
- func (b *InMemoryBackend) CancelSecretDeletion(id, ifMatch string) error
- func (b *InMemoryBackend) CancelSecretVersionDeletion(id string, n int64, ifMatch string) error
- func (b *InMemoryBackend) CancelVaultDeletion(id, ifMatch, hostPort string) (vaultWire, string, error)
- func (b *InMemoryBackend) ChangeKeyCompartment(vaultID, keyID, ifMatch, compartment string) error
- func (b *InMemoryBackend) ChangeSecretCompartment(id, ifMatch, compartment string) error
- func (b *InMemoryBackend) ChangeVaultCompartment(id, ifMatch, compartment string) error
- func (b *InMemoryBackend) Compartments() []string
- func (b *InMemoryBackend) CreateKey(vaultID string, in CreateKeyIn) (keyWire, string, error)
- func (b *InMemoryBackend) CreateKeyVersion(vaultID, keyID string) (keyVersionWire, string, error)
- func (b *InMemoryBackend) CreateSecret(in CreateSecretIn) (secretWire, string, error)
- func (b *InMemoryBackend) CreateVault(in CreateVaultIn, hostPort string) (vaultWire, string, error)
- func (b *InMemoryBackend) Decrypt(vaultID string, in DecryptIn) (decryptedWire, error)
- func (b *InMemoryBackend) DisableKey(vaultID, keyID, ifMatch string) (keyWire, string, error)
- func (b *InMemoryBackend) EnableKey(vaultID, keyID, ifMatch string) (keyWire, string, error)
- func (b *InMemoryBackend) Encrypt(vaultID string, in EncryptIn) (encryptedWire, error)
- func (b *InMemoryBackend) ExportKey(vaultID string, in ExportIn) (exportedWire, error)
- func (b *InMemoryBackend) GenerateDataEncryptionKey(vaultID string, in GenerateDEKIn) (generatedWire, error)
- func (b *InMemoryBackend) GetKey(vaultID, keyID string) (keyWire, string, error)
- func (b *InMemoryBackend) GetKeyVersion(vaultID, keyID, versionID string) (keyVersionWire, string, error)
- func (b *InMemoryBackend) GetSecret(id string) (secretWire, string, error)
- func (b *InMemoryBackend) GetSecretBundle(id string, sel BundleSelector) (secretBundleWire, string, error)
- func (b *InMemoryBackend) GetSecretBundleByName(vaultID, name string, sel BundleSelector) (secretBundleWire, error)
- func (b *InMemoryBackend) GetSecretVersion(id string, n int64) (secretVersionWire, string, error)
- func (b *InMemoryBackend) GetVault(id, hostPort string) (vaultWire, string, error)
- func (b *InMemoryBackend) GetVaultUsage(id string) (vaultUsageWire, error)
- func (b *InMemoryBackend) GetWrappingKey(vaultID string) (wrappingKeyWire, error)
- func (b *InMemoryBackend) ImportKey(vaultID string, in ImportKeyIn) (keyWire, string, error)
- func (b *InMemoryBackend) ImportKeyVersion(vaultID, keyID string, in ImportKeyVersionIn) (keyVersionWire, string, error)
- func (b *InMemoryBackend) KeyState(keyID string) (string, bool)
- func (b *InMemoryBackend) ListKeyVersions(vaultID, keyID string, o ListOpts) (page.Page[keyVersionSummaryWire], error)
- func (b *InMemoryBackend) ListKeys(vaultID, compartment string, f KeyFilter, o ListOpts) (page.Page[keySummaryWire], error)
- func (b *InMemoryBackend) ListSecretBundleVersions(id string, o ListOpts) (page.Page[bundleVersionSummaryWire], error)
- func (b *InMemoryBackend) ListSecretVersions(id string, o ListOpts) (page.Page[secretVersionSummaryWire], error)
- func (b *InMemoryBackend) ListSecrets(f SecretFilter, o ListOpts) (page.Page[secretSummaryWire], error)
- func (b *InMemoryBackend) ListVaults(compartment, hostPort string, o ListOpts) (page.Page[vaultSummaryWire], error)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) ScheduleKeyDeletion(vaultID, keyID, ifMatch string, at *time.Time) (keyWire, string, error)
- func (b *InMemoryBackend) ScheduleKeyVersionDeletion(vaultID, keyID, versionID string, at *time.Time) (keyVersionWire, string, error)
- func (b *InMemoryBackend) ScheduleSecretDeletion(id, ifMatch string, at *time.Time) error
- func (b *InMemoryBackend) ScheduleSecretVersionDeletion(id string, n int64, ifMatch string, at *time.Time) error
- func (b *InMemoryBackend) ScheduleVaultDeletion(id, ifMatch, hostPort string, at *time.Time) (vaultWire, string, error)
- func (b *InMemoryBackend) SetClock(now func() time.Time)
- func (b *InMemoryBackend) Sign(vaultID string, in SignIn) (signedWire, error)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) Sweep()
- func (b *InMemoryBackend) UpdateKey(vaultID, keyID, ifMatch string, in UpdateKeyIn) (keyWire, string, error)
- func (b *InMemoryBackend) UpdateSecret(id, ifMatch string, in UpdateSecretIn) (secretWire, string, error)
- func (b *InMemoryBackend) UpdateVault(id, ifMatch, hostPort string, in UpdateVaultIn) (vaultWire, string, error)
- func (b *InMemoryBackend) VaultIDForHost(hint string) (string, *APIError)
- func (b *InMemoryBackend) Verify(vaultID string, in VerifyIn) (verifiedWire, error)
- type Key
- type KeyFilter
- type KeyShape
- type KeyVersion
- type ListOpts
- type Provider
- type RotationDetails
- type Secret
- type SecretContent
- type SecretFilter
- type SecretVersion
- type Settings
- type SignIn
- type UpdateKeyIn
- type UpdateSecretIn
- type UpdateVaultIn
- type Vault
- type VerifyIn
- type WrappedImportKey
Constants ¶
const DefaultPort = 8151
DefaultPort is the dedicated listener's default TCP port.
const (
// Region is the fixed region baked into emulated OCIDs.
Region = "us-ashburn-1"
)
Variables ¶
var ErrNilAppContext = errors.New("ocivault: nil app context")
ErrNilAppContext is returned when Init is called with a nil AppContext.
var ErrSnapshotNull = errors.New("ocivault: null entry in snapshot")
ErrSnapshotNull is returned when a snapshot contains a null entry.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.
type BundleSelector ¶
BundleSelector picks the secret version GetSecretBundle returns.
type ConfigProvider ¶
type ConfigProvider interface {
GetOCIVaultSettings() Settings
}
ConfigProvider extracts OCI Vault configuration from the AppContext Config.
type CreateKeyIn ¶
type CreateKeyIn struct {
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]any `json:"definedTags"`
AutoKeyRotationDetails *RotationDetails `json:"autoKeyRotationDetails"`
CompartmentID string `json:"compartmentId"`
DisplayName string `json:"displayName"`
ProtectionMode string `json:"protectionMode"`
KeyShape KeyShape `json:"keyShape"`
IsAutoRotationEnabled bool `json:"isAutoRotationEnabled"`
}
CreateKeyIn is the CreateKey request body.
type CreateSecretIn ¶
type CreateSecretIn struct {
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]any `json:"definedTags"`
Metadata map[string]any `json:"metadata"`
SecretContent *SecretContent `json:"secretContent"`
ReplicationConfig json.RawMessage `json:"replicationConfig"`
RotationConfig json.RawMessage `json:"rotationConfig"`
SecretGenerationContext json.RawMessage `json:"secretGenerationContext"`
EnableAutoGeneration *bool `json:"enableAutoGeneration"`
CompartmentID string `json:"compartmentId"`
KeyID string `json:"keyId"`
SecretName string `json:"secretName"`
VaultID string `json:"vaultId"`
Description string `json:"description"`
SecretRules []json.RawMessage `json:"secretRules"`
}
CreateSecretIn is the CreateSecret request body.
type CreateVaultIn ¶
type CreateVaultIn struct {
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]any `json:"definedTags"`
CompartmentID string `json:"compartmentId"`
DisplayName string `json:"displayName"`
VaultType string `json:"vaultType"`
}
CreateVaultIn is the CreateVault request body.
type DecryptIn ¶
type DecryptIn struct {
AssociatedData map[string]string `json:"associatedData"`
KeyID string `json:"keyId"`
Ciphertext string `json:"ciphertext"`
KeyVersionID string `json:"keyVersionId"`
Algorithm string `json:"encryptionAlgorithm"`
}
DecryptIn is the Decrypt request body.
type EncryptIn ¶
type EncryptIn struct {
AssociatedData map[string]string `json:"associatedData"`
KeyID string `json:"keyId"`
Plaintext string `json:"plaintext"`
KeyVersionID string `json:"keyVersionId"`
Algorithm string `json:"encryptionAlgorithm"`
}
EncryptIn is the Encrypt request body.
type ExportIn ¶
type ExportIn struct {
KeyID string `json:"keyId"`
Algorithm string `json:"algorithm"`
PublicKey string `json:"publicKey"`
KeyVersionID string `json:"keyVersionId"`
}
ExportIn is the ExportKey request body.
type GenerateDEKIn ¶
type GenerateDEKIn struct {
AssociatedData map[string]string `json:"associatedData"`
KeyID string `json:"keyId"`
KeyShape KeyShape `json:"keyShape"`
IncludePlaintextKey bool `json:"includePlaintextKey"`
}
GenerateDEKIn is the GenerateDataEncryptionKey request body.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
Port int
EnforceAuth bool
// contains filtered or unexported fields
}
Handler serves OCI Vault: KMS vaults, keys and crypto, vault secrets and secret retrieval.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a Handler; callers override Port and EnforceAuth from Settings.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name for metrics.
func (*Handler) ExtractResource ¶
ExtractResource returns the addressed resource id for metrics.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists the supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler for all OCI Vault requests.
func (*Handler) MatchPriority ¶
MatchPriority is irrelevant because RouteMatcher never matches.
func (*Handler) RouteMatcher ¶
RouteMatcher never matches: OCI Vault runs on its own listener.
type ImportKeyIn ¶
type ImportKeyIn struct {
WrappedImportKey WrappedImportKey `json:"wrappedImportKey"`
CreateKeyIn
}
ImportKeyIn is the ImportKey request body.
type ImportKeyVersionIn ¶
type ImportKeyVersionIn struct {
WrappedImportKey WrappedImportKey `json:"wrappedImportKey"`
}
ImportKeyVersionIn is the ImportKeyVersion request body.
type InMemoryBackend ¶
InMemoryBackend holds every vault, key and secret under one lock.
func NewInMemoryBackend ¶
func NewInMemoryBackend() *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) CancelKeyDeletion ¶
func (b *InMemoryBackend) CancelKeyDeletion(vaultID, keyID, ifMatch string) (keyWire, string, error)
CancelKeyDeletion restores the state a key had before deletion was scheduled.
func (*InMemoryBackend) CancelKeyVersionDeletion ¶
func (b *InMemoryBackend) CancelKeyVersionDeletion(vaultID, keyID, versionID string) (keyVersionWire, string, error)
CancelKeyVersionDeletion returns a PENDING_DELETION version to ENABLED.
func (*InMemoryBackend) CancelSecretDeletion ¶
func (b *InMemoryBackend) CancelSecretDeletion(id, ifMatch string) error
CancelSecretDeletion returns a PENDING_DELETION secret to ACTIVE.
func (*InMemoryBackend) CancelSecretVersionDeletion ¶
func (b *InMemoryBackend) CancelSecretVersionDeletion(id string, n int64, ifMatch string) error
CancelSecretVersionDeletion cancels a scheduled version deletion.
func (*InMemoryBackend) CancelVaultDeletion ¶
func (b *InMemoryBackend) CancelVaultDeletion(id, ifMatch, hostPort string) (vaultWire, string, error)
CancelVaultDeletion returns a PENDING_DELETION vault to ACTIVE.
func (*InMemoryBackend) ChangeKeyCompartment ¶
func (b *InMemoryBackend) ChangeKeyCompartment(vaultID, keyID, ifMatch, compartment string) error
ChangeKeyCompartment moves a key.
func (*InMemoryBackend) ChangeSecretCompartment ¶
func (b *InMemoryBackend) ChangeSecretCompartment(id, ifMatch, compartment string) error
ChangeSecretCompartment moves a secret.
func (*InMemoryBackend) ChangeVaultCompartment ¶
func (b *InMemoryBackend) ChangeVaultCompartment(id, ifMatch, compartment string) error
ChangeVaultCompartment moves a vault; its keys and secrets follow.
func (*InMemoryBackend) Compartments ¶
func (b *InMemoryBackend) Compartments() []string
Compartments lists the distinct compartments that hold vaults, keys or secrets.
func (*InMemoryBackend) CreateKey ¶
func (b *InMemoryBackend) CreateKey(vaultID string, in CreateKeyIn) (keyWire, string, error)
CreateKey creates a key with its first version; the response reports ENABLING like OCI.
func (*InMemoryBackend) CreateKeyVersion ¶
func (b *InMemoryBackend) CreateKeyVersion(vaultID, keyID string) (keyVersionWire, string, error)
CreateKeyVersion rotates the key: new material becomes the current version.
func (*InMemoryBackend) CreateSecret ¶
func (b *InMemoryBackend) CreateSecret(in CreateSecretIn) (secretWire, string, error)
CreateSecret creates a secret and, when content is given, version 1.
func (*InMemoryBackend) CreateVault ¶
func (b *InMemoryBackend) CreateVault(in CreateVaultIn, hostPort string) (vaultWire, string, error)
CreateVault creates an ACTIVE vault; the response reports CREATING like OCI.
func (*InMemoryBackend) Decrypt ¶
func (b *InMemoryBackend) Decrypt(vaultID string, in DecryptIn) (decryptedWire, error)
Decrypt reverses Encrypt; rotated key versions keep decrypting their own ciphertext.
func (*InMemoryBackend) DisableKey ¶
func (b *InMemoryBackend) DisableKey(vaultID, keyID, ifMatch string) (keyWire, string, error)
DisableKey moves an ENABLED key to DISABLED.
func (*InMemoryBackend) EnableKey ¶
func (b *InMemoryBackend) EnableKey(vaultID, keyID, ifMatch string) (keyWire, string, error)
EnableKey moves a DISABLED key to ENABLED.
func (*InMemoryBackend) Encrypt ¶
func (b *InMemoryBackend) Encrypt(vaultID string, in EncryptIn) (encryptedWire, error)
Encrypt encrypts base64 plaintext with an AES or RSA key.
func (*InMemoryBackend) ExportKey ¶
func (b *InMemoryBackend) ExportKey(vaultID string, in ExportIn) (exportedWire, error)
ExportKey wraps a SOFTWARE key version's material with the caller's RSA public key.
func (*InMemoryBackend) GenerateDataEncryptionKey ¶
func (b *InMemoryBackend) GenerateDataEncryptionKey(vaultID string, in GenerateDEKIn) (generatedWire, error)
GenerateDataEncryptionKey returns a fresh data key wrapped by the master key.
func (*InMemoryBackend) GetKey ¶
func (b *InMemoryBackend) GetKey(vaultID, keyID string) (keyWire, string, error)
GetKey returns one key.
func (*InMemoryBackend) GetKeyVersion ¶
func (b *InMemoryBackend) GetKeyVersion(vaultID, keyID, versionID string) (keyVersionWire, string, error)
GetKeyVersion returns one key version including its public key.
func (*InMemoryBackend) GetSecret ¶
func (b *InMemoryBackend) GetSecret(id string) (secretWire, string, error)
GetSecret returns secret metadata.
func (*InMemoryBackend) GetSecretBundle ¶
func (b *InMemoryBackend) GetSecretBundle(id string, sel BundleSelector) (secretBundleWire, string, error)
GetSecretBundle returns decrypted secret content by id.
func (*InMemoryBackend) GetSecretBundleByName ¶
func (b *InMemoryBackend) GetSecretBundleByName(vaultID, name string, sel BundleSelector) (secretBundleWire, error)
GetSecretBundleByName returns decrypted secret content by name within a vault.
func (*InMemoryBackend) GetSecretVersion ¶
func (b *InMemoryBackend) GetSecretVersion(id string, n int64) (secretVersionWire, string, error)
GetSecretVersion returns one version's metadata.
func (*InMemoryBackend) GetVault ¶
func (b *InMemoryBackend) GetVault(id, hostPort string) (vaultWire, string, error)
GetVault returns one vault.
func (*InMemoryBackend) GetVaultUsage ¶
func (b *InMemoryBackend) GetVaultUsage(id string) (vaultUsageWire, error)
GetVaultUsage counts the keys and key versions of a vault.
func (*InMemoryBackend) GetWrappingKey ¶
func (b *InMemoryBackend) GetWrappingKey(vaultID string) (wrappingKeyWire, error)
GetWrappingKey returns the vault's public RSA wrapping key.
func (*InMemoryBackend) ImportKey ¶
func (b *InMemoryBackend) ImportKey(vaultID string, in ImportKeyIn) (keyWire, string, error)
ImportKey creates a key from wrapped external key material.
func (*InMemoryBackend) ImportKeyVersion ¶
func (b *InMemoryBackend) ImportKeyVersion( vaultID, keyID string, in ImportKeyVersionIn, ) (keyVersionWire, string, error)
ImportKeyVersion adds wrapped external key material as a new current version.
func (*InMemoryBackend) KeyState ¶
func (b *InMemoryBackend) KeyState(keyID string) (string, bool)
KeyState reports the lifecycle state of a key by OCID, for services that reference Vault keys.
func (*InMemoryBackend) ListKeyVersions ¶
func (b *InMemoryBackend) ListKeyVersions(vaultID, keyID string, o ListOpts) (page.Page[keyVersionSummaryWire], error)
ListKeyVersions lists a key's versions.
func (*InMemoryBackend) ListKeys ¶
func (b *InMemoryBackend) ListKeys( vaultID, compartment string, f KeyFilter, o ListOpts, ) (page.Page[keySummaryWire], error)
ListKeys lists a vault's keys in a compartment.
func (*InMemoryBackend) ListSecretBundleVersions ¶
func (b *InMemoryBackend) ListSecretBundleVersions(id string, o ListOpts) (page.Page[bundleVersionSummaryWire], error)
ListSecretBundleVersions lists version summaries without content.
func (*InMemoryBackend) ListSecretVersions ¶
func (b *InMemoryBackend) ListSecretVersions(id string, o ListOpts) (page.Page[secretVersionSummaryWire], error)
ListSecretVersions lists a secret's versions (oldest first unless DESC).
func (*InMemoryBackend) ListSecrets ¶
func (b *InMemoryBackend) ListSecrets(f SecretFilter, o ListOpts) (page.Page[secretSummaryWire], error)
ListSecrets lists secrets in a compartment.
func (*InMemoryBackend) ListVaults ¶
func (b *InMemoryBackend) ListVaults(compartment, hostPort string, o ListOpts) (page.Page[vaultSummaryWire], error)
ListVaults lists the vaults of a compartment.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a snapshot.
func (*InMemoryBackend) ScheduleKeyDeletion ¶
func (b *InMemoryBackend) ScheduleKeyDeletion(vaultID, keyID, ifMatch string, at *time.Time) (keyWire, string, error)
ScheduleKeyDeletion moves an ENABLED or DISABLED key to PENDING_DELETION.
func (*InMemoryBackend) ScheduleKeyVersionDeletion ¶
func (b *InMemoryBackend) ScheduleKeyVersionDeletion( vaultID, keyID, versionID string, at *time.Time, ) (keyVersionWire, string, error)
ScheduleKeyVersionDeletion schedules deletion of a non-current key version.
func (*InMemoryBackend) ScheduleSecretDeletion ¶
func (b *InMemoryBackend) ScheduleSecretDeletion(id, ifMatch string, at *time.Time) error
ScheduleSecretDeletion moves an ACTIVE secret to PENDING_DELETION.
func (*InMemoryBackend) ScheduleSecretVersionDeletion ¶
func (b *InMemoryBackend) ScheduleSecretVersionDeletion(id string, n int64, ifMatch string, at *time.Time) error
ScheduleSecretVersionDeletion schedules deletion of a version that is not current.
func (*InMemoryBackend) ScheduleVaultDeletion ¶
func (b *InMemoryBackend) ScheduleVaultDeletion( id, ifMatch, hostPort string, at *time.Time, ) (vaultWire, string, error)
ScheduleVaultDeletion moves an ACTIVE vault to PENDING_DELETION.
func (*InMemoryBackend) SetClock ¶
func (b *InMemoryBackend) SetClock(now func() time.Time)
SetClock injects the time source used for deletion schedules and rotation.
func (*InMemoryBackend) Sign ¶
func (b *InMemoryBackend) Sign(vaultID string, in SignIn) (signedWire, error)
Sign signs a message or digest with an RSA or ECDSA key version.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state, including registered API keys.
func (*InMemoryBackend) Sweep ¶
func (b *InMemoryBackend) Sweep()
Sweep applies elapsed deletion schedules and due key auto-rotations against the backend clock.
func (*InMemoryBackend) UpdateKey ¶
func (b *InMemoryBackend) UpdateKey(vaultID, keyID, ifMatch string, in UpdateKeyIn) (keyWire, string, error)
UpdateKey changes display name, tags and the auto-rotation schedule.
func (*InMemoryBackend) UpdateSecret ¶
func (b *InMemoryBackend) UpdateSecret(id, ifMatch string, in UpdateSecretIn) (secretWire, string, error)
UpdateSecret edits metadata, adds a version on content change, or promotes a version.
func (*InMemoryBackend) UpdateVault ¶
func (b *InMemoryBackend) UpdateVault(id, ifMatch, hostPort string, in UpdateVaultIn) (vaultWire, string, error)
UpdateVault changes display name and tags.
func (*InMemoryBackend) VaultIDForHost ¶
func (b *InMemoryBackend) VaultIDForHost(hint string) (string, *APIError)
VaultIDForHost resolves a per-vault endpoint label ("<prefix>") or OCID to a vault id; with no hint a lone non-deleted vault is used.
type Key ¶
type Key struct {
TimeCreated time.Time `json:"timeCreated"`
TimeOfDeletion *time.Time `json:"timeOfDeletion,omitempty"`
Rotation *RotationDetails `json:"rotation,omitempty"`
FreeformTags map[string]string `json:"freeformTags,omitempty"`
DefinedTags map[string]map[string]any `json:"definedTags,omitempty"`
ID string `json:"id"`
VaultID string `json:"vaultId"`
CompartmentID string `json:"compartmentId"`
DisplayName string `json:"displayName"`
State string `json:"state"`
ProtectionMode string `json:"protectionMode"`
CurrentVersion string `json:"currentVersion"`
PrevState string `json:"prevState,omitempty"`
Etag string `json:"etag"`
Shape KeyShape `json:"shape"`
Versions []*KeyVersion `json:"versions"`
Seq int64 `json:"seq"`
AutoRotation bool `json:"autoRotation"`
}
Key is a master encryption key.
type KeyShape ¶
type KeyShape struct {
Algorithm string `json:"algorithm"`
CurveID string `json:"curveId,omitempty"`
Length int `json:"length"`
}
KeyShape is the algorithm/length/curve triple of a key.
type KeyVersion ¶
type KeyVersion struct {
TimeCreated time.Time `json:"timeCreated"`
TimeOfDeletion *time.Time `json:"timeOfDeletion,omitempty"`
ID string `json:"id"`
State string `json:"state"`
Origin string `json:"origin"`
Material []byte `json:"material"`
AutoRotated bool `json:"autoRotated,omitempty"`
}
KeyVersion is one version of a key's material.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for OCI Vault. It runs on its own listener (see Handler.StartWorker) and never matches on the shared AWS router.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init creates the backend and handler; the port is bound in StartWorker.
type RotationDetails ¶
type RotationDetails struct {
ScheduleStart *time.Time `json:"timeOfScheduleStart,omitempty"`
NextRotation *time.Time `json:"timeOfNextRotation,omitempty"`
LastRotation *time.Time `json:"timeOfLastRotation,omitempty"`
LastStatus string `json:"lastRotationStatus,omitempty"`
LastMessage string `json:"lastRotationMessage,omitempty"`
IntervalDays int `json:"rotationIntervalInDays,omitempty"`
}
RotationDetails is a key's auto-rotation schedule.
type Secret ¶
type Secret struct {
TimeCreated time.Time `json:"timeCreated"`
TimeOfDeletion *time.Time `json:"timeOfDeletion,omitempty"`
FreeformTags map[string]string `json:"freeformTags,omitempty"`
DefinedTags map[string]map[string]any `json:"definedTags,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
ID string `json:"id"`
VaultID string `json:"vaultId"`
CompartmentID string `json:"compartmentId"`
Name string `json:"name"`
KeyID string `json:"keyId"`
Description string `json:"description,omitempty"`
State string `json:"state"`
Etag string `json:"etag"`
Rules []json.RawMessage `json:"rules,omitempty"`
Versions []*SecretVersion `json:"versions"`
Seq int64 `json:"seq"`
Current int64 `json:"current"`
Previous int64 `json:"previous"`
Pending int64 `json:"pending"`
}
Secret is a vault secret.
type SecretContent ¶
type SecretContent struct {
ContentType string `json:"contentType"`
Name string `json:"name"`
Content string `json:"content"`
Stage string `json:"stage"`
}
SecretContent is the polymorphic secretContent body (only BASE64 exists).
type SecretFilter ¶
SecretFilter narrows ListSecrets.
type SecretVersion ¶
type SecretVersion struct {
TimeCreated time.Time `json:"timeCreated"`
TimeOfDeletion *time.Time `json:"timeOfDeletion,omitempty"`
TimeOfExpiry *time.Time `json:"timeOfExpiry,omitempty"`
Name string `json:"name,omitempty"`
Ciphertext string `json:"ciphertext"`
Number int64 `json:"number"`
}
SecretVersion is one stored (KMS-encrypted) version of a secret.
type Settings ¶
type Settings struct {
Port int `` //nolint:lll // config struct tags are intentionally verbose
/* 217-byte string literal not displayed */
EnforceAuth bool `` //nolint:lll // config struct tags are intentionally verbose
/* 221-byte string literal not displayed */
}
Settings holds service-level configuration, embedded in the root CLI command as CLI.OCIVault.
func DefaultSettings ¶
func DefaultSettings() Settings
DefaultSettings returns the settings used when no ConfigProvider is available.
type SignIn ¶
type SignIn struct {
KeyID string `json:"keyId"`
Message string `json:"message"`
Algorithm string `json:"signingAlgorithm"`
KeyVersionID string `json:"keyVersionId"`
MessageType string `json:"messageType"`
}
SignIn is the Sign request body.
type UpdateKeyIn ¶
type UpdateKeyIn struct {
DisplayName *string `json:"displayName"`
IsAutoRotationEnabled *bool `json:"isAutoRotationEnabled"`
AutoKeyRotationDetails *RotationDetails `json:"autoKeyRotationDetails"`
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]any `json:"definedTags"`
}
UpdateKeyIn is the UpdateKey request body.
type UpdateSecretIn ¶
type UpdateSecretIn struct {
CurrentVersionNumber *int64 `json:"currentVersionNumber"`
Description *string `json:"description"`
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]any `json:"definedTags"`
Metadata map[string]any `json:"metadata"`
SecretContent *SecretContent `json:"secretContent"`
ReplicationConfig json.RawMessage `json:"replicationConfig"`
RotationConfig json.RawMessage `json:"rotationConfig"`
SecretGenerationContext json.RawMessage `json:"secretGenerationContext"`
EnableAutoGeneration *bool `json:"enableAutoGeneration"`
SecretRules []json.RawMessage `json:"secretRules"`
}
UpdateSecretIn is the UpdateSecret request body.
type UpdateVaultIn ¶
type UpdateVaultIn struct {
DisplayName *string `json:"displayName"`
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]any `json:"definedTags"`
}
UpdateVaultIn is the UpdateVault request body.
type Vault ¶
type Vault struct {
TimeCreated time.Time `json:"timeCreated"`
TimeOfDeletion *time.Time `json:"timeOfDeletion,omitempty"`
WrappingKeyCreated *time.Time `json:"wrappingKeyCreated,omitempty"`
FreeformTags map[string]string `json:"freeformTags,omitempty"`
DefinedTags map[string]map[string]any `json:"definedTags,omitempty"`
ID string `json:"id"`
Prefix string `json:"prefix"`
CompartmentID string `json:"compartmentId"`
DisplayName string `json:"displayName"`
VaultType string `json:"vaultType"`
State string `json:"state"`
WrappingKeyID string `json:"wrappingKeyId"`
Etag string `json:"etag"`
WrappingKeyDER []byte `json:"wrappingKeyDer,omitempty"`
Seq int64 `json:"seq"`
}
Vault is a KMS vault.
type VerifyIn ¶
type VerifyIn struct {
KeyID string `json:"keyId"`
KeyVersionID string `json:"keyVersionId"`
Signature string `json:"signature"`
Message string `json:"message"`
Algorithm string `json:"signingAlgorithm"`
MessageType string `json:"messageType"`
}
VerifyIn is the Verify request body.
type WrappedImportKey ¶
type WrappedImportKey struct {
KeyMaterial string `json:"keyMaterial"`
WrappingAlgorithm string `json:"wrappingAlgorithm"`
}
WrappedImportKey is the wrapped key material of an import request.