Skip to content

Commit

Permalink
fix: add credentials field to the task schema (#117)
Browse files Browse the repository at this point in the history
* fix: add `credentials` field to the `task` schema

* fix: add test for the `credentials` field. change to `_asl_payload_template` definition

* test: remove invalid-task-credentials test for primitive types
  • Loading branch information
spcape authored Jan 28, 2023
1 parent da9b2da commit a66ea51
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/__tests__/definitions/invalid-task-credentials-null.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Comment": "https://states-language.net/spec.html#task-state",
"StartAt": "X",
"States": {
"X": {
"Type": "Task",
"Resource": "arn:aws:swf:us-east-1:123456789012:task:X",
"Credentials": null,
"End": true
}
}
}
16 changes: 16 additions & 0 deletions src/__tests__/definitions/invalid-task-credentials-object.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"Comment": "https://states-language.net/spec.html#task-state",
"StartAt": "X",
"States": {
"X": {
"Type": "Task",
"Resource": "arn:aws:swf:us-east-1:123456789012:task:X",
"Credentials": {
"flag": true,
"expectPath.$": "not a path",
"baz": 5
},
"End": true
}
}
}
19 changes: 19 additions & 0 deletions src/__tests__/definitions/valid-task-credentials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"Comment": "https://states-language.net/spec.html#task-state",
"StartAt": "X",
"States": {
"X": {
"Type": "Task",
"Resource": "arn:aws:swf:us-east-1:123456789012:task:X",
"Credentials": {
"flag": true,
"parts": {
"foo.$": "$.vals[0]",
"bar.$": "$.vals[3]"
},
"baz": 5
},
"End": true
}
}
}
3 changes: 3 additions & 0 deletions src/schemas/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
},
"Parameters": {
"$ref": "paths.json#/definitions/asl_payload_template"
},
"Credentials": {
"$ref": "paths.json#/definitions/asl_payload_template"
}
},
"oneOf": [{
Expand Down

0 comments on commit a66ea51

Please sign in to comment.