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

UI: Add missing auth config params #25646

Merged
merged 5 commits into from
Feb 28, 2024

Conversation

hellobontempo
Copy link
Contributor

I wanted to make adding these parameters as nonintrusive as possible so this could be backported. There MountConfig model is shared between secret engine and auth mounts and the options component inherits from the auth config.... so overall there's some untangling and updating that could happen here. But again, held off so this would be a small change to add these parameters

allowed_response_headers
plugin_version
user_lockout_config

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Feb 26, 2024

// token_type should not be tuneable for the token auth method.
if (this.model.methodType === 'token') {
delete data.token_type;
}

this.model.userLockoutConfig.apiParams.forEach((attr) => {
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 debated doing this in the serializer...but these models are already quite tangled up between tune actions, mount config relationships and auth mounts vs secret engine mounts.

Since there was already some data manipulation here (adding description) above this seemed like a reasonable place for this so that moving the logic when we refactor would be easier.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth maybe adding test coverage to make sure that the values are sent in the tune request as expected by triggering a save in the component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes! I was planning to add those but was waiting for folks to approve this logic happening here instead of the serializer.

@@ -68,19 +68,29 @@ export default class AuthMethodModel extends Model {
return this.local ? 'local' : 'replicated';
}

userLockoutConfig = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally I defined these in the component above, but old ember components are strict about what can be defined as a default and it didn't like objects or arrays as default variable values. Since I wanted to access these in the template, I defined them here.

Copy link

github-actions bot commented Feb 26, 2024

CI Results:
All Go tests succeeded! ✅

@@ -94,7 +104,7 @@ export default class AuthMethodModel extends Model {
'accessor',
'local',
'sealWrap',
'config.{listingVisibility,defaultLeaseTtl,maxLeaseTtl,tokenType,auditNonHmacRequestKeys,auditNonHmacResponseKeys,passthroughRequestHeaders}',
'config.{listingVisibility,defaultLeaseTtl,maxLeaseTtl,tokenType,auditNonHmacRequestKeys,auditNonHmacResponseKeys,passthroughRequestHeaders,allowedResponseHeaders,pluginVersion}',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

didn't add any user_lockout_config here because they are only listed under tune attrs in the docs

@hellobontempo hellobontempo added this to the 1.14.10 milestone Feb 26, 2024
@hellobontempo hellobontempo marked this pull request as ready for review February 26, 2024 22:49
@hellobontempo hellobontempo modified the milestones: 1.14.10, 1.17.0-rc Feb 26, 2024
Copy link

Build Results:
All builds succeeded! ✅

Copy link
Contributor

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

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

Very thoughtful approach for maximum backportability! I think the only things blocking me from approving are more test coverage around the expected new parameters. Otherwise looks great, thanks for this!


// token_type should not be tuneable for the token auth method.
if (this.model.methodType === 'token') {
delete data.token_type;
}

this.model.userLockoutConfig.apiParams.forEach((attr) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth maybe adding test coverage to make sure that the values are sent in the tune request as expected by triggering a save in the component?

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 ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants