You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2021/09/15 14:48:42 UTC
[brooklyn-server] 02/11: return the sensitive field settings to the
UI
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit 373e575d89dd27107e975d8c77a5f816635e049c
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Tue Sep 14 22:52:37 2021 +0100
return the sensitive field settings to the UI
---
.../src/main/java/org/apache/brooklyn/rest/api/ServerApi.java | 3 ++-
.../java/org/apache/brooklyn/rest/resources/ServerResource.java | 8 +++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/ServerApi.java b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/ServerApi.java
index 096a928..868f0f2 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/ServerApi.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/ServerApi.java
@@ -108,7 +108,8 @@ public interface ServerApi {
@GET
@Path("/up/extended")
@ApiOperation(value = "Returns extended server-up information, a map including up (/up), shuttingDown (/shuttingDown), healthy (/healthy), and ha (/ha/states) (qv)"
- + "; also forces a session, so a useful general-purpose call for a UI client to do when starting")
+ + " as well as selected settings such as sensitive field treatment"
+ + "; also forces a session, so a useful general-purpose call for a UI client to do when starting")
public Map<String,Object> getUpExtended();
@GET
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
index 835ff39..1706b80 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
@@ -48,6 +48,7 @@ import org.apache.brooklyn.api.mgmt.rebind.mementos.BrooklynMementoRawData;
import org.apache.brooklyn.config.ConfigKey;
import org.apache.brooklyn.core.BrooklynVersion;
import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.config.Sanitizer;
import org.apache.brooklyn.core.entity.Attributes;
import org.apache.brooklyn.core.entity.Entities;
import org.apache.brooklyn.core.entity.StartableApplication;
@@ -395,7 +396,12 @@ public class ServerResource extends AbstractBrooklynRestResource implements Serv
"up", isUp(),
"shuttingDown", isShuttingDown(),
"healthy", isHealthy(),
- "ha", getHighAvailabilityPlaneStates());
+ "ha", getHighAvailabilityPlaneStates(),
+ "brooklyn.security.sensitive.fields",
+ MutableMap.of(
+ "tokens", Sanitizer.getSensitiveFieldsTokens(),
+ "plaintext.blocked", Sanitizer.isSensitiveFieldsPlaintextBlocked()
+ ));
}
@Override