diff --git a/changelog/15573.txt b/changelog/15573.txt new file mode 100644 index 000000000..49f1d267f --- /dev/null +++ b/changelog/15573.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fixed unsupported revocation statements field for DB roles +``` \ No newline at end of file diff --git a/ui/app/models/database/role.js b/ui/app/models/database/role.js index e8fc3a67a..71d0445d2 100644 --- a/ui/app/models/database/role.js +++ b/ui/app/models/database/role.js @@ -3,7 +3,7 @@ import { computed } from '@ember/object'; import { alias } from '@ember/object/computed'; import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; import { expandAttributeMeta } from 'vault/utils/field-to-attrs'; -import { getRoleFields } from '../../utils/database-helpers'; +import { getRoleFields } from 'vault/utils/database-helpers'; export default Model.extend({ idPrefix: 'role/', @@ -91,7 +91,11 @@ export default Model.extend({ get showFields() { let fields = ['name', 'database', 'type']; - fields = fields.concat(getRoleFields(this.type)).concat(['creation_statements', 'revocation_statements']); + fields = fields.concat(getRoleFields(this.type)).concat(['creation_statements']); + // elasticsearch does not support revocation statements: https://www.vaultproject.io/api-docs/secret/databases/elasticdb#parameters-1 + if (this.database[0] !== 'elasticsearch') { + fields = fields.concat(['revocation_statements']); + } return expandAttributeMeta(this, fields); },