-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #639 from crim-ca/add-cwl-secrets
- Loading branch information
Showing
20 changed files
with
522 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# YAML representation supported by WeaverClient | ||
processDescription: | ||
process: | ||
id: EchoSecrets | ||
executionUnit: | ||
# note: This does not work by itself! The test suite injects the file dynamically. | ||
- href: "tests/functional/application-packages/EchoSecrets/package.cwl" | ||
deploymentProfileName: "http://www.opengis.net/profiles/eoc/dockerizedApplication" |
2 changes: 2 additions & 0 deletions
2
tests/functional/application-packages/EchoSecrets/execute.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
inputs: | ||
message: "secret message" |
37 changes: 37 additions & 0 deletions
37
tests/functional/application-packages/EchoSecrets/package.cwl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
cwlVersion: "v1.2" | ||
class: CommandLineTool | ||
# WARNING: | ||
# Use a script instead of using 'echo' command, which would write to the secret to stdout and be displayed! | ||
# A script using secrets could have other standard output messages that are relevant to log. | ||
# It is up to the application developer to make sure they do no echo their own secrets... | ||
# baseCommand: echo | ||
baseCommand: python | ||
arguments: ["echo.py"] | ||
requirements: | ||
DockerRequirement: | ||
dockerPull: "docker.io/python:3-slim" | ||
InitialWorkDirRequirement: | ||
listing: | ||
- entryname: echo.py | ||
entry: | | ||
import sys | ||
with open("out.txt", mode="w", encoding="utf-8") as f: | ||
f.write(sys.argv[1]) | ||
print("OK!") # print on purpose to test stdout includes only this, and not the secret input | ||
hints: | ||
cwltool:Secrets: | ||
secrets: | ||
- message | ||
$namespaces: | ||
cwltool: http://commonwl.org/cwltool# | ||
inputs: | ||
message: | ||
type: string | ||
inputBinding: | ||
position: 1 | ||
outputs: | ||
output: | ||
type: File | ||
outputBinding: | ||
glob: "out.txt" | ||
stdout: "stdout.log" |
7 changes: 7 additions & 0 deletions
7
tests/functional/application-packages/WorkflowEchoSecrets/deploy.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
processDescription: | ||
process: | ||
id: WorkflowEchoSecrets | ||
executionUnit: | ||
# note: This does not work by itself! The test suite injects the file dynamically. | ||
- test: "tests/functional/application-packages/WorkflowEchoSecrets/package.cwl" | ||
deploymentProfileName: "http://www.opengis.net/profiles/eoc/workflow" |
2 changes: 2 additions & 0 deletions
2
tests/functional/application-packages/WorkflowEchoSecrets/execute.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
inputs: | ||
message: "secret message" |
23 changes: 23 additions & 0 deletions
23
tests/functional/application-packages/WorkflowEchoSecrets/package.cwl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env cwl-runner | ||
cwlVersion: v1.2 | ||
class: Workflow | ||
doc: Workflow that calls the echo process with secrets feature applied on the input. | ||
hints: | ||
cwltool:Secrets: | ||
secrets: | ||
- message | ||
$namespaces: | ||
cwltool: http://commonwl.org/cwltool# | ||
inputs: | ||
message: string | ||
outputs: | ||
output: | ||
type: File | ||
outputSource: echo/output | ||
steps: | ||
echo: | ||
run: EchoSecrets.cwl | ||
in: | ||
message: message | ||
out: | ||
- output |
Oops, something went wrong.