Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APPS-1383 Support Secret Agent keys for GCP and Azure credentials configuration #281

Merged
merged 11 commits into from
Dec 9, 2024
Prev Previous commit
update docs
korotkov-aerospike committed Dec 9, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tvdeyen Thomas von Deyen
commit 449423baef9ee4dd5358532f7508d6c84047f7d1
8 changes: 4 additions & 4 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -2020,12 +2020,12 @@ const docTemplate = `{
"description": "Alternative url.\nIt is not recommended to use an alternate URL in a production environment.",
"type": "string"
},
"key-file-path": {
"description": "Path to file containing Service Account JSON Key.",
"key": {
"description": "Key is the service account key in JSON format.\nThis is sensitive information. Can be a path in secret agent or an actual value.",
"type": "string"
},
"key-json": {
"description": "KeyJSON is the contents of Service Account JSON Key.\nThis is sensitive information. Can be a path in secret agent or an actual value.",
"key-file-path": {
"description": "Path to the file containing the service account key in JSON format.",
"type": "string"
},
"path": {
8 changes: 4 additions & 4 deletions docs/openapi.json
Original file line number Diff line number Diff line change
@@ -2153,12 +2153,12 @@
"description" : "Alternative url.\nIt is not recommended to use an alternate URL in a production environment.",
"type" : "string"
},
"key-file-path" : {
"description" : "Path to file containing Service Account JSON Key.",
"key" : {
"description" : "Key is the service account key in JSON format.\nThis is sensitive information. Can be a path in secret agent or an actual value.",
"type" : "string"
},
"key-json" : {
"description" : "KeyJSON is the contents of Service Account JSON Key.\nThis is sensitive information. Can be a path in secret agent or an actual value.",
"key-file-path" : {
"description" : "Path to the file containing the service account key in JSON format.",
"type" : "string"
},
"path" : {
11 changes: 6 additions & 5 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1737,14 +1737,15 @@ components:
Alternative url.
It is not recommended to use an alternate URL in a production environment.
type: string
key-file-path:
description: Path to file containing Service Account JSON Key.
type: string
key-json:
key:
description: |-
KeyJSON is the contents of Service Account JSON Key.
Key is the service account key in JSON format.
This is sensitive information. Can be a path in secret agent or an actual value.
type: string
key-file-path:
description: Path to the file containing the service account key in JSON
format.
type: string
path:
description: "The root path for the backup repository. If not specified,\
\ backups will be saved in the bucket's root."
2 changes: 1 addition & 1 deletion pkg/dto/convert_test.go
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ func TestConfigModelConversionIsLossless(t *testing.T) {
},
"gcp2": {
GcpStorage: &GcpStorage{
KeyJSON: "key-json",
Key: "key-json",
BucketName: "bucket",
Path: "path",
Endpoint: "http://localhost",
12 changes: 6 additions & 6 deletions pkg/dto/storage_gcp.go
Original file line number Diff line number Diff line change
@@ -9,11 +9,11 @@ import (
// GcpStorage represents the configuration for GCP storage.
type GcpStorage struct {
SecretAgentConfig `yaml:",inline"`
// Path to file containing Service Account JSON Key.
// Path to the file containing the service account key in JSON format.
KeyFile string `yaml:"key-file-path" json:"key-file-path"`
// KeyJSON is the contents of Service Account JSON Key.
// Key is the service account key in JSON format.
// This is sensitive information. Can be a path in secret agent or an actual value.
KeyJSON string `yaml:"key-json" json:"key-json"`
Key string `yaml:"key" json:"key"`
// GCP storage bucket name.
BucketName string `yaml:"bucket-name" json:"bucket-name" validate:"required"`
// The root path for the backup repository. If not specified, backups will be saved in the bucket's root.
@@ -28,7 +28,7 @@ func (s *GcpStorage) Validate() error {
if s.BucketName == "" {
return errors.New("GCP bucket name is not specified")
}
if s.KeyFile != "" && s.KeyJSON != "" {
if s.KeyFile != "" && s.Key != "" {
return errors.New("key-file-path and key-json are mutually exclusive")
}
return nil
@@ -45,7 +45,7 @@ func (s *GcpStorage) toModel(config *model.Config) (model.Storage, error) {
BucketName: s.BucketName,
Path: s.Path,
Endpoint: s.Endpoint,
KeyJSON: s.KeyJSON,
KeyJSON: s.Key,
SecretAgent: agent,
}, nil
}
@@ -56,7 +56,7 @@ func newGcpStorageFromModel(s *model.GcpStorage, config *model.Config) *GcpStora
BucketName: s.BucketName,
Path: s.Path,
Endpoint: s.Endpoint,
KeyJSON: s.KeyJSON,
Key: s.KeyJSON,
SecretAgentConfig: ResolveSecretAgentFromModel(s.SecretAgent, config),
}
}