You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[8.19] (backport #17351) Improve the key validation in secret identifier. (#17587)
* Improve the key validation in secret identifier. (#17351)
* Improve the key validation in secret identifier.
* Restrict adding invalid (from ConfigVariableExpander point of view) key names to the keystore through keystore CLI. Keystore now warns on invalid keys if they were already added.
* Key pattern is moved to a central config expander class with its description.
Co-authored-by: Rye Biesemeyer <[email protected]>
(cherry picked from commit d24675a)
# Conflicts:
# docs/reference/keystore.md
* Adjust docs against 8.x
---------
Co-authored-by: Mashhur <[email protected]>
Co-authored-by: Mashhur <[email protected]>
NOTE: Key values are limited to ASCII characters. It includes digits, letters, and a few special symbols.
162
+
NOTE: Key values are limited to ASCII letters (`a`-`z`, `A`-`Z`), numbers (`0`-`9`), underscores (`_`), and dots (`.`); they must be at least one character long and cannot begin with a number.
* @param key The unique part of the identifier. This is the key to reference the secret, and the key itself should not be sensitive. For example: {@code db.pass}
41
48
*/
42
-
publicSecretIdentifier(Stringkey) {
49
+
publicSecretIdentifier(finalStringkey) {
43
50
this.key = validateWithTransform(key, "key");
44
51
}
45
52
@@ -49,28 +56,14 @@ public SecretIdentifier(String key) {
49
56
* @param urn The {@link String} formatted identifier obtained originally from {@link SecretIdentifier#toExternalForm()}
50
57
* @return The {@link SecretIdentifier} object used to identify secrets, null if not valid external form.
@@ -189,9 +199,10 @@ public SecretStoreCli(Terminal terminal){
189
199
190
200
/**
191
201
* Entry point to issue a command line command.
202
+
*
192
203
* @param primaryCommand The string representation of a {@link SecretStoreCli.Command}, if the String does not map to a {@link SecretStoreCli.Command}, then it will show the help menu.
193
-
* @param config The configuration needed to work a secret store. May be null for help.
194
-
* @param allArguments This can be either identifiers for a secret, or a sub command like --help. May be null.
204
+
* @param config The configuration needed to work a secret store. May be null for help.
205
+
* @param allArguments This can be either identifiers for a secret, or a sub command like --help. May be null.
0 commit comments