-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into sgm/mldsa-ed25519-ce
- Loading branch information
Showing
26 changed files
with
545 additions
and
758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import ApplicationAdapter from '../application'; | ||
import { encodePath } from 'vault/utils/path-encoding-helpers'; | ||
|
||
export default class GcpConfig extends ApplicationAdapter { | ||
namespace = 'v1'; | ||
|
||
_url(backend) { | ||
return `${this.buildURL()}/${encodePath(backend)}/config`; | ||
} | ||
|
||
queryRecord(store, type, query) { | ||
const { backend } = query; | ||
return this.ajax(this._url(backend), 'GET').then((resp) => { | ||
return { | ||
...resp, | ||
id: backend, | ||
backend, | ||
}; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import Model, { attr } from '@ember-data/model'; | ||
import { expandAttributeMeta } from 'vault/utils/field-to-attrs'; | ||
|
||
export default class GcpConfig extends Model { | ||
@attr('string') backend; // dynamic path of secret -- set on response from value passed to queryRecord | ||
|
||
/* GCP config fields */ | ||
@attr({ | ||
label: 'Config TTL', | ||
editType: 'ttl', | ||
helperTextDisabled: 'The TTL (time-to-live) of generated tokens.', | ||
}) | ||
ttl; | ||
|
||
@attr({ | ||
label: 'Max TTL', | ||
editType: 'ttl', | ||
helperTextDisabled: | ||
'Specifies the maximum config TTL (time-to-live) for long-lived credentials (i.e. service account keys).', | ||
}) | ||
maxTtl; | ||
|
||
@attr('string', { | ||
label: 'JSON credentials', | ||
subText: | ||
'If empty, Vault will use the GOOGLE_APPLICATION_CREDENTIALS environment variable if configured.', | ||
editType: 'file', | ||
docLink: '/vault/docs/secrets/gcp#authentication', | ||
}) | ||
credentials; // obfuscated, never returned by API. | ||
|
||
/* WIF config fields */ | ||
@attr('string', { | ||
subText: | ||
'The audience claim value for plugin identity tokens. Must match an allowed audience configured for the target IAM OIDC identity provider.', | ||
}) | ||
identityTokenAudience; | ||
|
||
@attr({ | ||
label: 'Identity token TTL', | ||
helperTextDisabled: | ||
'The TTL of generated tokens. Defaults to 1 hour, toggle on to specify a different value.', | ||
helperTextEnabled: 'The TTL of generated tokens.', | ||
editType: 'ttl', | ||
}) | ||
identityTokenTtl; | ||
|
||
@attr('string', { | ||
subText: 'Email ID for the Service Account to impersonate for Workload Identity Federation.', | ||
}) | ||
serviceAccountEmail; | ||
|
||
configurableParams = [ | ||
'credentials', | ||
'serviceAccountEmail', | ||
'ttl', | ||
'maxTtl', | ||
'identityTokenAudience', | ||
'identityTokenTtl', | ||
]; | ||
|
||
get displayAttrs() { | ||
const formFields = expandAttributeMeta(this, this.configurableParams); | ||
return formFields.filter((attr) => attr.name !== 'credentials'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import ApplicationSerializer from '../application'; | ||
|
||
export default class GcpConfigSerializer extends ApplicationSerializer { | ||
normalizeResponse(store, primaryModelClass, payload, id, requestType) { | ||
if (!payload.data) { | ||
return super.normalizeResponse(...arguments); | ||
} | ||
|
||
const normalizedPayload = { | ||
id: payload.id, | ||
backend: payload.backend, | ||
data: { | ||
...payload.data, | ||
}, | ||
}; | ||
return super.normalizeResponse(store, primaryModelClass, normalizedPayload, id, requestType); | ||
} | ||
} |
Oops, something went wrong.