You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/03 08:30:41 UTC
[PR] [ISSUE #821] Redact datasource test credentials in toString [rocketmq-dashboard]
Aias00 opened a new pull request, #822:
URL: https://github.com/apache/rocketmq-dashboard/pull/822
## What is changed
- Exclude datasource test password and bearer token fields from Lombok-generated toString output.
- Add a regression test that verifies the plaintext credentials do not appear in DTO diagnostics.
## Why
- Fixes #821.
## Verification
- JAVA_HOME=/Users/aias/Library/Java/JavaVirtualMachines/openjdk-21.0.2/Contents/Home mvn -Dtest=DataSourceTestDTOTest test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #821] Redact datasource test credentials in toString [rocketmq-dashboard]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on PR #822:
URL: https://github.com/apache/rocketmq-dashboard/pull/822#issuecomment-5174153795
Superseded by consolidated PR #928, which contains this change and has passing checks. Closing this narrower PR to keep review focused.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #821] Redact datasource test credentials in toString [rocketmq-dashboard]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed pull request #822: [ISSUE #821] Redact datasource test credentials in toString
URL: https://github.com/apache/rocketmq-dashboard/pull/822
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #821] Redact datasource test credentials in toString [rocketmq-dashboard]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #822:
URL: https://github.com/apache/rocketmq-dashboard/pull/822#discussion_r3702469678
##########
server/src/test/java/org/apache/rocketmq/studio/settings/DataSourceTestDTOTest.java:
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.rocketmq.studio.settings;
+
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class DataSourceTestDTOTest {
+
+ @Test
+ void toStringShouldNotExposeCredentials() {
+ DataSourceTestDTO request = DataSourceTestDTO.builder()
+ .url("http://prometheus:9090")
+ .type("prometheus")
+ .auth("bearer token")
+ .username("prometheus-user")
+ .password("plain-password")
+ .bearerToken("plain-token")
+ .build();
+
+ String value = request.toString();
+
+ assertThat(value).contains("url=http://prometheus:9090");
+ assertThat(value).contains("username=prometheus-user");
+ assertThat(value).doesNotContain("plain-password");
+ assertThat(value).doesNotContain("plain-token");
Review Comment:
The regression test only asserts that the plaintext credential values are absent. To align with the PR’s stated intent (“exclude password/bearerToken fields from Lombok-generated toString”), it should also assert the field names (e.g., `password=` / `bearerToken=`) are not present so a future change that masks values but still prints the fields doesn’t silently change the behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org