Skip to content

Commit

Permalink
Backport of Custom tooltip for Generated Token Policies form field on…
Browse files Browse the repository at this point in the history
… auth methods into release/1.8.x (#15052)

* backport of commit f83a08b

* add changelog

* spacing

* Update generated-item.js

Co-authored-by: Angel Garbarino <argarbarino@gmail.com>
Co-authored-by: Angel Garbarino <Monkeychip@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 18, 2022
1 parent 539c266 commit e0d01f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/15046.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix Generated Token's Policies helpText to clarify that comma separated values are not excepted in this field.
```
10 changes: 10 additions & 0 deletions ui/app/components/generated-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ export default Component.extend({
init() {
this._super(...arguments);
this.set('validationMessages', {});
this.model.fieldGroups.forEach((element) => {
// overwriting the helpText for Token Polices.
// HelpText from the backend says add a comma separated list, which works on the CLI but not here on the UI.
// This affects the TLS Certificates, Userpass, Kubernetes. These are the ones the bug had been reported about. https://github.com/hashicorp/vault/issues/10346
if (element.Tokens) {
element.Tokens.find((attr) => attr.name === 'tokenPolicies').options.helpText =
'Add policies that will apply to the generated token for this user. One policy per row.';
}
});

if (this.mode === 'edit') {
// For validation to work in edit mode,
// reconstruct the model values from field group
Expand Down

0 comments on commit e0d01f0

Please sign in to comment.