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: k8s auth openapi update #25218

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ui/app/models/auth-config/kubernetes.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default AuthConfig.extend({
helpText:
'A service account JWT used to access the TokenReview API to validate other JWTs during login. If not set the JWT used for login will be used to access the API',
}),
useAnnotationsAsAliasMetadata: attr('boolean'),

pemKeys: attr({
editType: 'stringArray',
Expand All @@ -37,7 +38,7 @@ export default AuthConfig.extend({
default: ['kubernetesHost', 'kubernetesCaCert'],
},
{
'Kubernetes Options': ['tokenReviewerJwt', 'pemKeys'],
'Kubernetes Options': ['tokenReviewerJwt', 'pemKeys', 'useAnnotationsAsAliasMetadata'],
},
];
if (this.newFields) {
Expand Down
8 changes: 8 additions & 0 deletions ui/tests/helpers/openapi/auth-model-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,14 @@ const kubernetes = {
label: 'Token Reviewer JWT',
type: 'string',
},
useAnnotationsAsAliasMetadata: {
editType: 'boolean',
fieldGroup: 'default',
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the fieldGroup above is Kubernetes Options. I can't remember how this openAPI test is setup, does this need to match above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch -- the fieldGroup is coming from the OpenAPI response, so if it's default from there maybe that means the checkmark needs to be in the main fields instead. I'll check with eco

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confirmed that the option should be in this section -- the kubernetes plugin authors probably don't know that the fieldgroup value is for organizing the options in the form

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for confirming and following up!

helpText:
'Use annotations from the client token\'s associated service account as alias metadata for the Vault entity. Only annotations with the prefix "vault.hashicorp.com/alias-metadata-" will be used. Note that Vault will need permission to read service accounts from the Kubernetes API.',
label: 'Use annotations of JWT service account as alias metadata',
type: 'boolean',
},
},
role: {
name: {
Expand Down
Loading