[
https://issues.apache.org/jira/browse/ARTEMIS-5347?focusedWorklogId=961437&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-961437
]
ASF GitHub Bot logged work on ARTEMIS-5347:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 12/Mar/25 13:46
Start Date: 12/Mar/25 13:46
Worklog Time Spent: 10m
Work Description: jbertram commented on code in PR #5553:
URL: https://github.com/apache/activemq-artemis/pull/5553#discussion_r1991541233
##########
artemis-dto/src/main/java/org/apache/activemq/artemis/dto/XmlUtil.java:
##########
@@ -95,6 +95,7 @@ public static <T> T decode(Class<T> clazz,
unmarshaller.setSchema(schema);
Properties props = new Properties(System.getProperties());
+ props.putAll(System.getenv());
Review Comment:
That's a good point. I think it's worth flipping.
Issue Time Tracking
-------------------
Worklog Id: (was: 961437)
Time Spent: 40m (was: 0.5h)
> Support environment variable substitution in bootstrap.xml
> ----------------------------------------------------------
>
> Key: ARTEMIS-5347
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5347
> Project: ActiveMQ Artemis
> Issue Type: New Feature
> Components: Configuration
> Affects Versions: 2.38.0
> Reporter: Valeriy Ak
> Assignee: Justin Bertram
> Priority: Major
> Labels: bootstrap, pull-request-available
> Fix For: 2.40.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> {{bootstrap.xml}} supports TLS connections. For this option you should set
> {{keyStorePath}} and {{{}keyStorePassword{}}}, e.g.:
> {code:xml}
> <binding uri="https://0.0.0.0:8161"
> keyStorePath="keystore.jks"
> keyStorePassword="ENC("@#$%UIO")"
>
> passwordCodec="org.apache.activemq.artemis.utils.DefaultSensitiveStringCodec">{code}
> In this config you must set the encrypted password directly and placeholders
> are not supported. Below code for reading password:
> {code:java}
> //BindingDTO
> private String getPassword(String password) throws Exception {
> return PasswordMaskingUtil.resolveMask(password, this.passwordCodec);
> }
> //PasswordMaskingUtil
> public static String resolveMask(String password, String codecClass) throws
> Exception {
> return resolveMask(null, password, codecClass);
> }
> public static String resolveMask(Boolean maskPassword, String password,
> String codecClass) throws Exception {
> String plainText = password;
> if (maskPassword == null) {
> if (isEncMasked(password)) {
> //masked
> String bareMaskedPassword = unwrap(password);
> plainText = getCodec(codecClass).decode(bareMaskedPassword);
> }
> } else if (maskPassword) {
> plainText = getCodec(codecClass).decode(password);
> }
> return plainText;
> }{code}
> There is no way to get values from properties/envs, like it is done in
> {{{}broker.xml{}}}.
> In a cloud environment where credentials are passed by the pod environment
> this is a problem. It's annoying that only this config does not support
> values from env and requires additional actions to make it work.
> Can you support this? I see two way for this:
> # Add new sensitiveDataCode that will get vaule from env
> # Read this config by XMLUtil as others, this reader support both props and
> envs plaseholders
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact