Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ Environment variable | Description | Required | Example value
`VAULT_NAMESPACE` | The namespace to use for pre-configured secrets. Ignored by proxy server | No | `education`
`VAULT_DEFAULT_CACHE_TTL` | The time to live configuration (aka, TTL) of the cache used by proxy server. Must have a unit and be parsable as a time.Duration. Required for caching to be enabled. | No | `15m`
`VAULT_DEFAULT_CACHE_ENABLED` | Enable caching for all requests, without needing to set the X-Vault-Cache-Control header for each request. Must be set to a boolean value. | No | `true`
`VAULT_SECRET_DATA_JSON` | If set to `true`, the extension will return just the data portion of the secret, instead of the entire nested JSON structure. | No | `true`

### AWS STS client configuration

Expand Down
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,12 @@ func writePreconfiguredSecrets(client *api.Client) error {
if err != nil {
return fmt.Errorf("error reading secret: %w", err)
}

content, err := json.MarshalIndent(secret, "", " ")
var data interface{}
data = secret
if os.Getenv("VAULT_SECRET_DATA_JSON") == "true" {
data = secret.Data
}
content, err := json.MarshalIndent(data, "", " ")
if err != nil {
return err
}
Expand Down