Skip to content

Commit 90a8424

Browse files
committed
Refactor sensitive fields handling in ApiServer to use a class-level constant
1 parent c69adf6 commit 90a8424

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

server/src/main/java/com/cloud/api/ApiServer.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
245245
@Inject
246246
private MessageBus messageBus;
247247

248+
private static final Set<String> sensitiveFields = new HashSet<>(Arrays.asList(
249+
"password", "secretkey", "apikey", "token",
250+
"sessionkey", "accesskey", "signature",
251+
"authorization", "credential", "secret"
252+
));
253+
248254
private static final ConfigKey<Integer> IntegrationAPIPort = new ConfigKey<>(ConfigKey.CATEGORY_ADVANCED
249255
, Integer.class
250256
, "integration.api.port"
@@ -611,11 +617,6 @@ public String handleRequest(final Map params, final String responseType, final S
611617
logger.error("invalid request, no command sent");
612618
if (logger.isTraceEnabled()) {
613619
logger.trace("dumping request parameters");
614-
Set<String> sensitiveFields = new HashSet<>(Arrays.asList(
615-
"password", "secretkey", "apikey", "token",
616-
"sessionkey", "accesskey", "signature",
617-
"authorization", "credential", "secret"
618-
));
619620

620621
for (final Object key : params.keySet()) {
621622
final String keyStr = (String) key;

0 commit comments

Comments
 (0)