diff --git a/changelog/12921.txt b/changelog/12921.txt
new file mode 100644
index 0000000000000..77bb465c67661
--- /dev/null
+++ b/changelog/12921.txt
@@ -0,0 +1,3 @@
+```release-note:improvement
+ui: Adds warning about white space in KV secret engine.
+```
diff --git a/ui/app/components/secret-create-or-update.js b/ui/app/components/secret-create-or-update.js
index 0afbad0b99024..310996389b9cb 100644
--- a/ui/app/components/secret-create-or-update.js
+++ b/ui/app/components/secret-create-or-update.js
@@ -44,6 +44,7 @@ export default class SecretCreateOrUpdate extends Component {
@tracked codemirrorString = null;
@tracked error = null;
@tracked secretPaths = null;
+ @tracked pathWhiteSpaceWarning = false;
@tracked validationErrorCount = 0;
@tracked validationMessages = null;
@@ -82,6 +83,8 @@ export default class SecretCreateOrUpdate extends Component {
}
checkValidation(name, value) {
if (name === 'path') {
+ // check for whitespace
+ this.pathHasWhiteSpace(value);
!value
? set(this.validationMessages, name, `${name} can't be blank.`)
: set(this.validationMessages, name, '');
@@ -106,6 +109,10 @@ export default class SecretCreateOrUpdate extends Component {
this.transitionToRoute(LIST_ROOT_ROUTE);
}
}
+ pathHasWhiteSpace(value) {
+ let validation = new RegExp('\\s', 'g'); // search for whitespace
+ this.pathWhiteSpaceWarning = validation.test(value);
+ }
// successCallback is called in the context of the component
persistKey(successCallback) {
let secret = this.args.model;
diff --git a/ui/app/models/secret-engine.js b/ui/app/models/secret-engine.js
index c40e6b0b83344..ffb31428847d1 100644
--- a/ui/app/models/secret-engine.js
+++ b/ui/app/models/secret-engine.js
@@ -52,7 +52,7 @@ export default Model.extend(Validations, {
defaultValue: 0,
label: 'Maximum number of versions',
subText:
- 'The number of versions to keep per key. Once the number of keys exceeds the maximum number set here, the oldest version will be permanently deleted. This value applies to all keys, but a key’s metadata settings can overwrite this value.',
+ 'The number of versions to keep per key. Once the number of keys exceeds the maximum number set here, the oldest version will be permanently deleted. This value applies to all keys, but a key’s metadata settings can overwrite this value. When 0 is used or the value is unset, Vault will keep 10 versions.',
}),
casRequired: attr('boolean', {
defaultValue: false,
diff --git a/ui/app/templates/components/secret-create-or-update.hbs b/ui/app/templates/components/secret-create-or-update.hbs
index 357ecce3e7555..965a4039371aa 100644
--- a/ui/app/templates/components/secret-create-or-update.hbs
+++ b/ui/app/templates/components/secret-create-or-update.hbs
@@ -28,6 +28,16 @@
The secret path may not end in /