mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-25 20:00:14 -05:00
Compare commits
1 Commits
plugin/tem
...
fix/dont-n
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d2665ad08 |
@@ -203,7 +203,7 @@ public class FlowInputOutput {
|
||||
final Execution execution,
|
||||
final Map<String, ?> data
|
||||
) {
|
||||
Map<String, Object> resolved = this.resolveInputs(inputs, flow, execution, data)
|
||||
return this.resolveInputs(inputs, flow, execution, data)
|
||||
.stream()
|
||||
.filter(InputAndValue::enabled)
|
||||
.map(it -> {
|
||||
@@ -214,7 +214,6 @@ public class FlowInputOutput {
|
||||
return new AbstractMap.SimpleEntry<>(it.input().getId(), it.value());
|
||||
})
|
||||
.collect(HashMap::new, (m,v)-> m.put(v.getKey(), v.getValue()), HashMap::putAll);
|
||||
return MapUtils.flattenToNestedMap(resolved);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,6 +87,9 @@ public class InputsTest {
|
||||
@Inject
|
||||
private FlowInputOutput flowIO;
|
||||
|
||||
@Inject
|
||||
private FlowInputOutput flowInputOutput;
|
||||
|
||||
private Map<String, Object> typedInputs(Map<String, Object> map) {
|
||||
return typedInputs(map, flowRepository.findById(null, "io.kestra.tests", "inputs").get());
|
||||
}
|
||||
@@ -370,7 +373,7 @@ public class InputsTest {
|
||||
assertThat((String) execution.findTaskRunsByTaskId("jsonOutput").getFirst().getOutputs().get("value")).isEqualTo("{}");
|
||||
}
|
||||
|
||||
@RetryingTest(5) // it can happen that a log from another execution arrives first, so we enable retry
|
||||
@Test
|
||||
@LoadFlows({"flows/valids/input-log-secret.yaml"})
|
||||
void shouldNotLogSecretInput() throws TimeoutException, QueueException {
|
||||
Flux<LogEntry> receive = TestsUtils.receive(logQueue, l -> {});
|
||||
@@ -378,7 +381,9 @@ public class InputsTest {
|
||||
Execution execution = runnerUtils.runOne(
|
||||
null,
|
||||
"io.kestra.tests",
|
||||
"input-log-secret"
|
||||
"input-log-secret",
|
||||
null,
|
||||
(flow, exec) -> flowInputOutput.readExecutionInputs(flow, exec, Map.of("nested.key", "pass"))
|
||||
);
|
||||
|
||||
assertThat(execution.getTaskRunList()).hasSize(1);
|
||||
@@ -386,6 +391,6 @@ public class InputsTest {
|
||||
|
||||
var logEntry = receive.blockLast();
|
||||
assertThat(logEntry).isNotNull();
|
||||
assertThat(logEntry.getMessage()).isEqualTo("This is my secret: ********");
|
||||
assertThat(logEntry.getMessage()).isEqualTo("These are my secrets: **** - ********");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,11 @@ inputs:
|
||||
type: SECRET
|
||||
defaults: password
|
||||
|
||||
- id: nested.key
|
||||
type: SECRET
|
||||
defaults: password
|
||||
|
||||
tasks:
|
||||
- id: log-secret
|
||||
type: io.kestra.plugin.core.log.Log
|
||||
message: "This is my secret: {{inputs.secret}}"
|
||||
message: "These are my secrets: {{inputs['nested.key']}} - {{inputs.secret}}"
|
||||
Reference in New Issue
Block a user