Skip to content

Commit 979258f

Browse files
committed
review up
1 parent 8a58495 commit 979258f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,8 +1761,8 @@ public void prefixedFunctionsInExpressions() throws Exception {
17611761
}
17621762

17631763
@Test
1764-
public void maskFunction() throws Exception {
1765-
deploy("maskFunction");
1764+
public void sensitiveFunction() throws Exception {
1765+
deploy("sensitiveFunction");
17661766

17671767
save(ProcessConfiguration.builder().build());
17681768

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ flows:
22
default:
33
- set:
44
regularValue: "regularValue"
5-
secretValue: "${mask(regularValue)}"
5+
secretValue: "${sensitive(regularValue)}"
66
- log: "The 'regularValue' is masked now"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727

2828
import static java.util.Objects.requireNonNull;
2929

30-
public class MaskFunction {
30+
public class MarkAsSensitiveFunction {
3131

3232
private static SensitiveDataHolder sensitiveData;
3333

3434
@Inject
35-
public MaskFunction(SensitiveDataHolder sensitiveData) {
36-
MaskFunction.sensitiveData = requireNonNull(sensitiveData);
35+
public MarkAsSensitiveFunction(SensitiveDataHolder sensitiveData) {
36+
MarkAsSensitiveFunction.sensitiveData = requireNonNull(sensitiveData);
3737
}
3838

3939
@ELFunction
40-
public static String mask(Object v) {
41-
if (MaskFunction.sensitiveData == null) {
40+
public static String sensitive(Object v) {
41+
if (MarkAsSensitiveFunction.sensitiveData == null) {
4242
throw new IllegalStateException("MaskFunction must be initialized first");
4343
}
4444

@@ -54,6 +54,6 @@ public static String mask(Object v) {
5454
return s;
5555
}
5656

57-
throw new IllegalArgumentException("Only string values can be masked. Got a " + v.getClass());
57+
throw new IllegalArgumentException("Only string values can be masked. Got a " + v.getClass() + " instead");
5858
}
5959
}

runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/guice/ExpressionSupportModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public <I> void hear(TypeLiteral<I> type, TypeEncounter<I> encounter) {
8484
binder.bind(HasVariableFunction.class).asEagerSingleton();
8585
binder.bind(IsDebugFunction.class).asEagerSingleton();
8686
binder.bind(IsDryRunFunction.class).asEagerSingleton();
87-
binder.bind(MaskFunction.class).asEagerSingleton();
87+
binder.bind(MarkAsSensitiveFunction.class).asEagerSingleton();
8888
binder.bind(OrDefaultFunction.class).asEagerSingleton();
8989
binder.bind(ThrowFunction.class).asEagerSingleton();
9090
binder.bind(UuidFunction.class).asEagerSingleton();

0 commit comments

Comments
 (0)