Skip to content

Commit e187ad7

Browse files
committed
review up
1 parent b25c5f2 commit e187ad7

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

runtime/v2/runner-test/src/test/java/com/walmartlabs/concord/runtime/v2/runner/tasks/Tasks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public Map<String, String> getSensitiveMapStrict(String str) {
305305
return result;
306306
}
307307

308-
@SensitiveData(paths = {"key.top-secret"})
308+
@SensitiveData(keys = {"key.top-secret"})
309309
public Map<String, Object> getSensitiveMapWithPath(String str) {
310310
Map<String, Object> inner = new LinkedHashMap<>();
311311
inner.put("top-secret", str);

runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/el/resolvers/SensitiveDataProcessor.java

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,18 @@ public void process(Object value, Method method) {
6161
}
6262

6363
private void collectFromMap(Map<String, Object> m, SensitiveData a) {
64-
// paths
65-
if (a.paths() != null && a.paths().length > 0) {
66-
for (var p : a.paths()) {
67-
var path = p.split("\\.");
64+
if (a.keys() != null && a.keys().length > 0) {
65+
for (var k : a.keys()) {
66+
var path = k.split("\\.");
6867
if (ConfigurationUtils.has(m, path)) {
6968
var v = ConfigurationUtils.get(m, path);
7069
collectValue(v, a);
7170
}
7271
}
73-
return;
74-
}
75-
76-
// all keys or specific keys
77-
var keys = (a.keys() != null && a.keys().length > 0)
78-
? new HashSet<>(Arrays.asList(a.keys()))
79-
: m.keySet();
80-
81-
for (var key : keys) {
82-
collectValue(m.get(key), a);
72+
} else {
73+
for (var key : m.keySet()) {
74+
collectValue(m.get(key), a);
75+
}
8376
}
8477
}
8578

runtime/v2/sdk/src/main/java/com/walmartlabs/concord/runtime/v2/sdk/SensitiveData.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,5 @@
5151

5252
String[] keys() default {};
5353

54-
String[] paths() default {};
55-
5654
boolean includeNestedValues() default false;
5755
}

0 commit comments

Comments
 (0)