-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Prep work for creating one WIF configuration component #29345
Changes from 2 commits
7d700aa
eff5b97
de30c7e
0d97240
bb8cfa9
94a9345
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,23 +45,33 @@ export default class AwsRootConfig extends Model { | |
iamEndpoint; | ||
@attr('string', { label: 'STS endpoint' }) stsEndpoint; | ||
@attr('number', { | ||
label: 'Maximum retries', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The api name for this is "Max retries". I'm going to opt out of overriding this because it makes it complicated for testing. |
||
subText: 'Number of max retries the client should use for recoverable errors. Default is -1.', | ||
}) | ||
maxRetries; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no functional changes, just restructuring to match azure and gcp models—see here. |
||
configurableParams = [ | ||
'roleArn', | ||
'identityTokenAudience', | ||
'identityTokenTtl', | ||
'accessKey', | ||
'secretKey', | ||
'region', | ||
'iamEndpoint', | ||
'stsEndpoint', | ||
'maxRetries', | ||
]; | ||
|
||
get isWifPluginConfigured() { | ||
return !!this.identityTokenAudience || !!this.identityTokenTtl || !!this.roleArn; | ||
} | ||
|
||
get isAccountPluginConfigured() { | ||
return !!this.accessKey; | ||
} | ||
|
||
get displayAttrs() { | ||
const keys = [ | ||
'roleArn', | ||
'identityTokenAudience', | ||
'identityTokenTtl', | ||
'accessKey', | ||
'region', | ||
'iamEndpoint', | ||
'stsEndpoint', | ||
'maxRetries', | ||
]; | ||
return expandAttributeMeta(this, keys); | ||
const formFields = expandAttributeMeta(this, this.configurableParams); | ||
return formFields.filter((attr) => attr.name !== 'secretKey'); | ||
} | ||
|
||
// "filedGroupsWif" and "fieldGroupsIam" are passed to the FormFieldGroups component to determine which group to show in the form (ex: @groupName="fieldGroupsWif") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,16 +38,15 @@ export default class SshCaConfig extends Model { | |
@attr('string') backend; // dynamic path of secret -- set on response from value passed to queryRecord | ||
@attr('string', { sensitive: true }) privateKey; // obfuscated, never returned by API | ||
@attr('string') publicKey; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no functional changes, just restructuring to match azure and gcp models—see here. |
||
@attr('boolean', { defaultValue: true }) | ||
generateSigningKey; | ||
@attr('boolean', { defaultValue: true }) generateSigningKey; | ||
|
||
configurableParams = ['privateKey', 'publicKey', 'generateSigningKey']; | ||
|
||
// do not return private key for configuration.index view | ||
get displayAttrs() { | ||
return this.formFields.filter((attr) => attr.name !== 'privateKey'); | ||
} | ||
// return private key for edit/create view | ||
|
||
get formFields() { | ||
const keys = ['privateKey', 'publicKey', 'generateSigningKey']; | ||
return expandAttributeMeta(this, keys); | ||
return expandAttributeMeta(this, this.configurableParams); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -185,7 +185,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}`); | ||||||
}); | ||||||
|
@@ -219,7 +219,6 @@ module('Acceptance | aws | configuration', function (hooks) { | |||||
}); | ||||||
|
||||||
test('it shows AWS mount configuration details', async function (assert) { | ||||||
assert.expect(12); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. assert.expect unnecessary because we'll get hit if one of the keys fails. |
||||||
const path = `aws-${this.uid}`; | ||||||
const type = 'aws'; | ||||||
this.server.get(`${path}/config/root`, (schema, req) => { | ||||||
|
@@ -231,6 +230,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)) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll see a couple of these exceptions added to these loops. This is because of a clean up work done on the secret-engine-helper. In that helper, I changed the method |
||||||
if (key === 'Secret key') return; // secret-key is not returned by the API | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Maybe
Suggested change
|
||||||
assert.dom(GENERAL.infoRowLabel(key)).exists(`${key} on the ${type} config details exists.`); | ||||||
const responseKeyAndValue = expectedValueOfConfigKeys(type, key); | ||||||
assert | ||||||
|
@@ -368,7 +368,7 @@ module('Acceptance | aws | configuration', function (hooks) { | |||||
.doesNotExist('Access type section does not render for a community user'); | ||||||
// check all the form fields are present | ||||||
await click(GENERAL.toggleGroup('Root config options')); | ||||||
for (const key of expectedConfigKeys('aws-root-create')) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the value passed into
|
||||||
for (const key of expectedConfigKeys('aws', true)) { | ||||||
assert.dom(GENERAL.inputByAttr(key)).exists(`${key} shows for root section.`); | ||||||
} | ||||||
for (const key of expectedConfigKeys('aws-lease')) { | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -94,6 +94,7 @@ module('Acceptance | Azure | configuration', function (hooks) { | |||||
}); | ||||||
await enablePage.enable(this.type, path); | ||||||
for (const key of expectedConfigKeys('azure')) { | ||||||
if (key === 'Client secret') return; // client-secret is not returned by the API | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
assert.dom(GENERAL.infoRowLabel(key)).exists(`${key} on the ${this.type} config details exists.`); | ||||||
const responseKeyAndValue = expectedValueOfConfigKeys(this.type, key); | ||||||
assert | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -68,6 +68,8 @@ module('Acceptance | GCP | configuration', function (hooks) { | |||||
service_account_email: 'service-email', | ||||||
identity_token_audience: 'audience', | ||||||
identity_token_ttl: 720000, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not originally tests these values on edit, but I am now. |
||||||
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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
const responseKeyAndValue = expectedValueOfConfigKeys(this.type, key); | ||||||
assert | ||||||
.dom(GENERAL.infoRowValue(key)) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no functional changes, just restructuring to match azure and gcp models—see here.