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

[WFCORE-1274] CLI resolve-parameter-values set to true does not recognize vaulted strings #1346

Closed
wants to merge 1 commit into from

Conversation

gaol
Copy link
Contributor

@gaol gaol commented Jan 7, 2016

Jira: https://issues.jboss.org/browse/WFCORE-1274

The format of security vault: ${VAULT::xxx::yyy::zzz} is like system property: ${propName:defaultValue}. I prefer to let user send escaped string: $\{VAULT::xxx::yyy::zzz\}, instead of let CLI distinguish the input for this special case.

@@ -48,6 +49,9 @@
/** Environment variable prefix */
private static final String ENV_PREFIX = "env.";

/** Security Vault pattern */
private static final Pattern VAULT_PATTERN = Pattern.compile("VAULT::.*::.*::.*");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bstansberry
Copy link
Contributor

@aloubyansky please approve

@aloubyansky
Copy link
Contributor

Not ok. First of all this change makes a decision to return too early. If the line in the added test was e.g. "the value is ${VAULT::text::password::1} ${os.name}" then ${os.name} wouldn't be resolved.

Second, there is actually a way to escape expressions like that by adding the extra '$' in front. (I copied this from some other expression parser David wrote for DMR or something). That's not very obvious but I remember it was a better idea than messing with backslash escaping in a case like this one.

@gaol
Copy link
Contributor Author

gaol commented Jan 11, 2016

@aloubyansky

there is actually a way to escape expressions like that by adding the extra '$' in front"
Since there is an existing way to escape the expression, this should NOT be a problem then, I tested that user can use $${VAULT::text::password::1} to escape the expression, which gets the expected: ${VAULT::text::password::1} in standalone.xml

@gaol
Copy link
Contributor Author

gaol commented Jan 11, 2016

Close it as it should not be a problem.

@gaol gaol closed this Jan 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants