From a44c85ad71f50b33041640c30a22b06c3fe35b6d Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Tue, 25 Oct 2022 15:22:04 -0500 Subject: [PATCH] Handle dash character for MacOS Signed-off-by: Peter Nied --- .../java/org/opensearch/security/support/SecurityUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opensearch/security/support/SecurityUtils.java b/src/main/java/org/opensearch/security/support/SecurityUtils.java index cfe0f3f271..1a09c5cbf2 100644 --- a/src/main/java/org/opensearch/security/support/SecurityUtils.java +++ b/src/main/java/org/opensearch/security/support/SecurityUtils.java @@ -46,7 +46,7 @@ public final class SecurityUtils { protected final static Logger log = LogManager.getLogger(SecurityUtils.class); - private static final String ENV_PATTERN_SUFFIX = "\\.([\\w=():]+)((\\:\\-)?[\\w=():]*)\\}"; + private static final String ENV_PATTERN_SUFFIX = "\\.([\\w=():\\-_]+)((\\:\\-)?[\\w=():\\-_]*)\\}"; static final Pattern ENV_PATTERN = Pattern.compile("\\$\\{env" + ENV_PATTERN_SUFFIX); static final Pattern ENVBC_PATTERN = Pattern.compile("\\$\\{envbc" + ENV_PATTERN_SUFFIX); static final Pattern ENVBASE64_PATTERN = Pattern.compile("\\$\\{envbase64" + ENV_PATTERN_SUFFIX);