diff --git a/ui/app/models/aws/root-config.js b/ui/app/models/aws/root-config.js index 178f3ca2cf55..405718ac9633 100644 --- a/ui/app/models/aws/root-config.js +++ b/ui/app/models/aws/root-config.js @@ -45,7 +45,6 @@ export default class AwsRootConfig extends Model { iamEndpoint; @attr('string', { label: 'STS endpoint' }) stsEndpoint; @attr('number', { - label: 'Maximum retries', subText: 'Number of max retries the client should use for recoverable errors. Default is -1.', }) maxRetries; diff --git a/ui/app/models/gcp/config.js b/ui/app/models/gcp/config.js index 3bdbcb18abe7..93d7504dc808 100644 --- a/ui/app/models/gcp/config.js +++ b/ui/app/models/gcp/config.js @@ -25,6 +25,7 @@ export default class GcpConfig extends Model { }) maxTtl; + /* GCP credential config field */ @attr('string', { label: 'JSON credentials', subText: diff --git a/ui/tests/acceptance/secrets/backend/aws/aws-configuration-test.js b/ui/tests/acceptance/secrets/backend/aws/aws-configuration-test.js index 466568261ba5..791b0ed95928 100644 --- a/ui/tests/acceptance/secrets/backend/aws/aws-configuration-test.js +++ b/ui/tests/acceptance/secrets/backend/aws/aws-configuration-test.js @@ -188,7 +188,7 @@ module('Acceptance | aws | configuration', function (hooks) { assert .dom(GENERAL.infoRowValue('Identity token TTL')) .doesNotExist('Identity token TTL does not show.'); - assert.dom(GENERAL.infoRowValue('Maximum retries')).doesNotExist('Maximum retries does not show.'); + assert.dom(GENERAL.infoRowValue('Max retries')).doesNotExist('Max retries does not show.'); // cleanup await runCmd(`delete sys/mounts/${path}`); }); @@ -233,7 +233,7 @@ module('Acceptance | aws | configuration', function (hooks) { createConfig(this.store, path, type); // create the aws root config in the store await click(SES.configTab); for (const key of expectedConfigKeys(type)) { - if (key === 'Secret Key' || key === 'Client Secret') return; // these keys are not returned by the API so they will not show up on the details page + if (key === 'Secret key') return; // secret-key is not returned by the API assert.dom(GENERAL.infoRowLabel(key)).exists(`${key} on the ${type} config details exists.`); const responseKeyAndValue = expectedValueOfConfigKeys(type, key); assert diff --git a/ui/tests/acceptance/secrets/backend/azure/azure-configuration-test.js b/ui/tests/acceptance/secrets/backend/azure/azure-configuration-test.js index f5564957c64f..04a58373d8ee 100644 --- a/ui/tests/acceptance/secrets/backend/azure/azure-configuration-test.js +++ b/ui/tests/acceptance/secrets/backend/azure/azure-configuration-test.js @@ -93,7 +93,9 @@ module('Acceptance | Azure | configuration', function (hooks) { return { data: { id: path, type: this.type, ...azureAccountAttrs } }; }); await enablePage.enable(this.type, path); - for (const key of expectedConfigKeys('azure-details')) { + + for (const key of expectedConfigKeys('azure')) { + if (key === 'Client secret') return; // client-secret is not returned by the API assert.dom(GENERAL.infoRowLabel(key)).exists(`${key} on the ${this.type} config details exists.`); const responseKeyAndValue = expectedValueOfConfigKeys(this.type, key); assert diff --git a/ui/tests/acceptance/secrets/backend/gcp/gcp-configuration-test.js b/ui/tests/acceptance/secrets/backend/gcp/gcp-configuration-test.js index 288f0a61eeaf..06b122b2e408 100644 --- a/ui/tests/acceptance/secrets/backend/gcp/gcp-configuration-test.js +++ b/ui/tests/acceptance/secrets/backend/gcp/gcp-configuration-test.js @@ -68,6 +68,8 @@ module('Acceptance | GCP | configuration', function (hooks) { service_account_email: 'service-email', identity_token_audience: 'audience', identity_token_ttl: 720000, + max_ttl: 14400, + ttl: 3600, }; this.server.get(`${path}/config`, () => { assert.ok(true, 'request made to config when navigating to the configuration page.'); @@ -102,6 +104,7 @@ module('Acceptance | GCP | configuration', function (hooks) { }); await enablePage.enable(this.type, path); for (const key of expectedConfigKeys(this.type)) { + if (key === 'Credentials') return; // not returned by the API const responseKeyAndValue = expectedValueOfConfigKeys(this.type, key); assert .dom(GENERAL.infoRowValue(key)) diff --git a/ui/tests/helpers/secret-engine/secret-engine-helpers.js b/ui/tests/helpers/secret-engine/secret-engine-helpers.js index e6d2a621e1e5..06cd1c7d3a11 100644 --- a/ui/tests/helpers/secret-engine/secret-engine-helpers.js +++ b/ui/tests/helpers/secret-engine/secret-engine-helpers.js @@ -274,14 +274,18 @@ export const fillInAzureConfig = async (situation = 'azure') => { const genericWifKeys = ['Identity token audience', 'Identity token TTL']; // AWS specific keys const awsLeaseKeys = ['Default Lease TTL', 'Max Lease TTL']; -const awsKeys = ['Access key', 'Secret Key', 'Region', 'IAM Endpoint', 'STS Endpoint', 'Max Retries']; +const awsKeys = ['Access key', 'Secret key', 'Region', 'IAM endpoint', 'STS endpoint', 'Max retries']; const awsWifKeys = ['Issuer', 'Role ARN', ...genericWifKeys]; // Azure specific keys const genericAzureKeys = ['Subscription ID', 'Tenant ID', 'Client ID', 'Environment']; -const azureKeys = [...genericAzureKeys, 'Client Secret', 'Root password TTL']; +const azureKeys = [...genericAzureKeys, 'Client secret', 'Root password TTL']; const azureWifKeys = [...genericAzureKeys, ...genericWifKeys]; +// GCP specific keys +const genericGcpKeys = ['Config TTL', 'Max TTL']; +const gcpKeys = [...genericGcpKeys, 'Credentials']; +const gcpWifKeys = [...genericGcpKeys, ...genericWifKeys, 'Service account email']; // SSH specific keys -const sshKeys = ['Private Key', 'Public Key', 'Generate Signing Key']; +const sshKeys = ['Private key', 'Public key', 'Generate signing key']; export const expectedConfigKeys = (type, camelCase = false) => { switch (type) { @@ -295,6 +299,10 @@ export const expectedConfigKeys = (type, camelCase = false) => { return camelCase ? stringToCamelCase(azureKeys) : azureKeys; case 'azure-wif': return camelCase ? stringToCamelCase(azureWifKeys) : azureWifKeys; + case 'gcp': + return camelCase ? stringToCamelCase(gcpKeys) : gcpKeys; + case 'gcp-wif': + return camelCase ? stringToCamelCase(gcpWifKeys) : gcpWifKeys; case 'ssh': return camelCase ? stringToCamelCase(sshKeys) : sshKeys; } @@ -310,7 +318,7 @@ const valueOfAwsKeys = (string) => { return 'iam-endpoint'; case 'STS endpoint': return 'sts-endpoint'; - case 'Maximum retries': + case 'Max retries': return '1'; } }; diff --git a/ui/tests/integration/components/secret-engine/configuration-details-test.js b/ui/tests/integration/components/secret-engine/configuration-details-test.js index b849e16fd0d4..2d8ba658d54a 100644 --- a/ui/tests/integration/components/secret-engine/configuration-details-test.js +++ b/ui/tests/integration/components/secret-engine/configuration-details-test.js @@ -38,7 +38,7 @@ module('Integration | Component | SecretEngine/ConfigurationDetails', function ( }); for (const type of CONFIGURABLE_SECRET_ENGINES) { - test(`it shows config details if configModel(s) are passed in for type: ${type}`, async function (assert) { + test(`${type}: it shows config details if configModel(s) are passed in`, async function (assert) { const backend = `test-${type}`; this.configModels = createConfig(this.store, backend, type); this.typeDisplay = allEnginesArray.find((engine) => engine.type === type).displayName; @@ -48,16 +48,29 @@ module('Integration | Component | SecretEngine/ConfigurationDetails', function ( ); for (const key of expectedConfigKeys(type)) { - assert.dom(GENERAL.infoRowLabel(key)).exists(`${key} on the ${type} config details exists.`); - const responseKeyAndValue = expectedValueOfConfigKeys(type, key); - assert - .dom(GENERAL.infoRowValue(key)) - .hasText(responseKeyAndValue, `${key} value for the ${type} config details exists.`); - // make sure the ones that should be masked are masked, and others are not. - if (key === 'private_key' || key === 'public_key') { - assert.dom(GENERAL.infoRowValue(key)).hasClass('masked-input', `${key} is masked`); + if ( + key === 'Secret key' || + key === 'Client secret' || + key === 'Private key' || + key === 'Credentials' + ) { + // these keys are not returned by the API and should not show on the details page + assert + .dom(GENERAL.infoRowLabel(key)) + .doesNotExist(`${key} on the ${type} config details does NOT exists.`); } else { - assert.dom(GENERAL.infoRowValue(key)).doesNotHaveClass('masked-input', `${key} is not masked`); + assert.dom(GENERAL.infoRowLabel(key)).exists(`${key} on the ${type} config details exists.`); + const responseKeyAndValue = expectedValueOfConfigKeys(type, key); + assert + .dom(GENERAL.infoRowValue(key)) + .hasText(responseKeyAndValue, `${key} value for the ${type} config details exists.`); + // make sure the ones that should be masked are masked, and others are not. + + if (key === 'Public Key') { + assert.dom(GENERAL.infoRowValue(key)).hasClass('masked-input', `${key} is masked`); + } else { + assert.dom(GENERAL.infoRowValue(key)).doesNotHaveClass('masked-input', `${key} is not masked`); + } } } }); diff --git a/ui/tests/integration/components/secret-engine/configure-create-edit-test.js b/ui/tests/integration/components/secret-engine/configure-create-edit-test.js index 34dc5fedd1d0..dd9f0737163f 100644 --- a/ui/tests/integration/components/secret-engine/configure-create-edit-test.js +++ b/ui/tests/integration/components/secret-engine/configure-create-edit-test.js @@ -678,7 +678,7 @@ module('Integration | Component | SecretEngine/ConfigureCreateEdit', function (h .hasValue('**********', 'clientSecret is masked on edit the value'); }); - test('it requires a double click to change the client secret meep', async function (assert) { + test('it requires a double click to change the client secret', async function (assert) { this.id = `azure-${this.uid}`; this.config = createConfig(this.store, this.id, 'azure'); await render(hbs`