Skip to content
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

Clean up on Azure configuration #29482

Merged
merged 2 commits into from
Feb 4, 2025
Merged

Clean up on Azure configuration #29482

merged 2 commits into from
Feb 4, 2025

Conversation

Monkeychip
Copy link
Contributor

@Monkeychip Monkeychip commented Feb 3, 2025

  • ent tests pass

Description

TLDR: Root password TTL has to be moved from an Azure account access type to a generic one that can bet set be set alongside wif and non-wif attributes. See original PR #29047 description's, this change adds Root password TTL to both columns, like Environment.

Context: Root password TTL is only ever used when the user rotates their root credentials (not currently supported in this work), and is used to set an expiration date on the newly created credential. So a user could theoretically use WIF to set up Azure first (thereby using a zero-secret configuration for Vault), and then rotate root credentials to then start leveraging the Root password TTL to generate a new Client Secret value for future use.

Note: I updated the Azure Config form to match the newer designs proposed in the full Azure secret engine build out. Confirmed with Design this is this look is desired. This meant:

  1. Adding a "More options" toggle and moving Environment and Root password TTL under it.
  2. Updating Environment's helper text.

WITH UPDATES
image
(toggle to wif)
image

BEFORE
image
(toggle to wif)
image

@Monkeychip Monkeychip requested a review from a team as a code owner February 3, 2025 04:07
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Feb 3, 2025
@Monkeychip Monkeychip added this to the 1.19.0-rc milestone Feb 3, 2025
Copy link

github-actions bot commented Feb 3, 2025

Build Results:
All builds succeeded! ✅

Copy link

github-actions bot commented Feb 3, 2025

CI Results:
All Go tests succeeded! ✅

@@ -34,8 +40,10 @@ export default class AzureConfig extends Model {
@attr({
label: 'Root password TTL',
editType: 'ttl',
helperTextDisabled:
'Specifies how long the root password is valid for in Azure when rotate-root generates a new client secret. Defaults to 182 days or 6 months, 1 day and 13 hours.',
// default is 15768000 sec. The api docs say 182 days, but this should be updated to 182.5 days.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to ask the backend about this, but for now I wanted to leave the note in the code because it's confusing when we formate the returned default to 6 months 1 day 13 hours but if you pass in 182 days this is formatted to 6 months 1 day 1 hour.

environment: 'AZUREPUBLICCLOUD',
root_password_ttl: '1800000s',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have passed in seconds originally as that's what the api does.

@@ -112,7 +112,8 @@ module('Acceptance | Azure | configuration', function (hooks) {
});

module('create', function () {
test('it should save azure account accessType options', async function (assert) {
test('it should save azure account options', async function (assert) {
// there are no azure specific options that can be returned from the API so confirm the generic options are saved.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very similar acceptance tests that we do for GCP as it too cannot check if GCP specific options where set.


@attr('string', {
subText:
'This value can also be provided with the AZURE_ENVIRONMENT environment variable. If not specified, Vault will use Azure Public Cloud.',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text was in the full Azure build out designs, and it seemed helpful so I added.

await click(GENERAL.saveButton);
assert.true(
this.flashSuccessSpy.calledWith(`Successfully saved ${path}'s configuration.`),
'Success flash message is rendered showing the azure model configuration was saved.'
);
assert
.dom(GENERAL.infoRowValue('Root password TTL'))
.hasText(
'1 hour 26 minutes 40 seconds',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I messed around some with the secret-engine-helper.js method fillInAzureConfig so this value changed.

@@ -362,7 +363,7 @@ module('Acceptance | Azure | configuration', function (hooks) {

await click(SES.configTab);
await click(SES.configure);
await fillInAzureConfig('withWif');
await fillInAzureConfig(true);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed this method to match the feedback on similar method with fillInGcpConfig see here.

@Monkeychip Monkeychip merged commit c0ece88 into main Feb 4, 2025
32 of 33 checks passed
@Monkeychip Monkeychip deleted the ui/VAULT-azure-fix-wif branch February 4, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants