mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 10:12:35 +00:00
* starting * add the details functionality * test coverage * welp, friday fingers * small small changes * Update ui/app/models/gcp/config.js Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com> * Update ui/app/helpers/mountable-secret-engines.js Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com> * update small changes on model * reorder loop on configuration details * Update ui/tests/integration/components/secret-engine/configuration-details-test.js Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com> * Update ui/app/models/gcp/config.js Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com> * Update ui/app/models/gcp/config.js Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com> * Update ui/app/routes/vault/cluster/secrets/backend/configuration/index.js Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com> * add comment --------- Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
72 lines
2.0 KiB
JavaScript
72 lines
2.0 KiB
JavaScript
/**
|
||
* 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');
|
||
}
|
||
}
|