-
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
One WIF configuration component #29367
Conversation
…the two components and associated files the new component replaces
CI Results: |
@@ -3,54 +3,14 @@ | |||
* SPDX-License-Identifier: BUSL-1.1 | |||
*/ | |||
|
|||
import { isPresent } from '@ember/utils'; |
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.
definitely forget to remove this after the original aws/ssh configuration work. Double checked and because the save actions are now happening for all configurable secret engines within components, this controller and it's methods were not being hit. However, now I'm using it to add two attributes I want to use in the route template and pass down to the components.
Build Results: |
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.
Great work making this component more flexible. Mostly cleanup suggestions that are non-blocking. The only blocking comment is about the errorMessage as I'm not sure the error handling is working as expected.
Also it'd be great if we can remove assert.ok
usage. Let me know if you want me to DM you the team pattern discussion I remembered that from! 😄
ui/tests/integration/components/secret-engine/configure-wif-test.js
Outdated
Show resolved
Hide resolved
ui/tests/integration/components/secret-engine/configure-wif-test.js
Outdated
Show resolved
Hide resolved
ui/tests/integration/components/secret-engine/configure-wif-test.js
Outdated
Show resolved
Hide resolved
ui/tests/integration/components/secret-engine/configure-wif-test.js
Outdated
Show resolved
Hide resolved
ui/tests/integration/components/secret-engine/configure-wif-test.js
Outdated
Show resolved
Hide resolved
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
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.
interesting.. gh now shows this as a new file instead of changes on configure-azure.ts —that's why the file count jump in this last push.
{{#if @secondModel}} | ||
<h2 class="title is-5 has-bottom-padding-s has-top-margin-l" data-test-second-model-title> | ||
{{! additionalConfigModel fields show regardless of the vault version or what access type is selected }} | ||
{{#if @additionalConfigModel}} |
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.
This rename already makes things much clearer! Thanks for the update.
// create a key that corresponds with the configs model order | ||
// ex: adapterPath = ssh/ca-config, convert to: first-model so that you can pass to component @model={{this.model.first-model}} | ||
const standardizedKey = this.standardizedModelName(type, adapterPath); | ||
for (const modelName of MOUNT_CONFIG_MODEL_NAMES[type] as string[]) { |
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.
Thanks for the rename, this is easier to parse (but also grrr Ember data, I will not miss you when you're gone)
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.
agree!
assert.false( | ||
true, | ||
'post request was made to config/lease when no data was changed. test should fail.' | ||
throw new Error( |
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.
👏 This is much easier for me to follow what's happening here! Thanks for updating
@@ -196,37 +194,12 @@ module('Acceptance | aws | configuration', function (hooks) { | |||
await runCmd(`delete sys/mounts/${path}`); | |||
}); | |||
|
|||
test('it does not save lease AWS configuration if root configuration errored on save', async function (assert) { |
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.
Is this the behavior that changed that you mentioned?
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.
correct!
ui/tests/acceptance/secrets/backend/aws/aws-configuration-test.js
Outdated
Show resolved
Hide resolved
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.
Great work! I think it may be worth checking with design about the error message display, I don't feel qualified to decide that 😂
ui/tests/integration/components/secret-engine/configure-wif-test.js
Outdated
Show resolved
Hide resolved
}); | ||
|
||
module('Azure specific', function (hooks) { | ||
hooks.beforeEach(function () { |
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.
👏 👏
|
||
assert | ||
.dom(SES.configureNote('azure')) | ||
.doesNotExist('Note specific to AWS does not show for Azure secret engine when configuring.'); |
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.
Thanks for adding this assertion!
@@ -144,7 +144,7 @@ module('Integration | Component | SecretEngine::ConfigureWif', function (hooks) | |||
assert.true(this.flashDangerSpy.notCalled, 'No danger flash messages called.'); | |||
assert.true(this.flashSuccessSpy.notCalled, 'No success flash messages called.'); | |||
|
|||
assert.ok( | |||
assert.true( |
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.
😍
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.
Great work! Thanks for addressing all of those cleanup items! ✨
Description
GCP is the next WIF engine to allow create/edit configuration. While creating it, I noticed it was a near identical copy/paste of the
configure-azure
component. Thus, I decided to create a shared create/edit configure component calledconfigure-wif
for all WIF configurable engines. Short-term this includes: AWS, Azure and soon GCP. Long-term this may include more 🤷♀️.All of these WIF configurations include shared workflows:
Notes