-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(stepfunctions): task token integration cannot be used with API Gateway #18595
Conversation
…teway To pass the Task Token in headers to an API Gateway, the token must be wrapped in an array (because that's the value type of headers). Because JSONPath evaluation needs to happen to resolve the token, we need to use the `States.Array()` function in a `JsonPathToken` to properly resolve this. However, doing that makes the existing validation code fail the validation checking that you are passing the task token somewhere. Add convenience methods for the intrinsics, and update the checker to also find paths referenced inside intrinsic functions. Fixes #14184, fixes #14181.
9351516
to
22c439b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good; some nits, mostly questions. And I think the intrinsics deserves mentioning in the readme.
@@ -305,6 +305,25 @@ const invokeTask = new tasks.CallApiGatewayRestApiEndpoint(this, 'Call REST API' | |||
}); | |||
``` | |||
|
|||
Be aware that the header values must be arrays. When passing the Task Token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like the native intrinsic function support is a feature in itself and deserves to be mentioned in the readme too.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…teway (aws#18595) To pass the Task Token in headers to an API Gateway, the token must be wrapped in an array (because that's the value type of headers). Because JSONPath evaluation needs to happen to resolve the token, we need to use the `States.Array()` function in a `JsonPathToken` to properly resolve this. However, doing that makes the existing validation code fail the validation checking that you are passing the task token somewhere. Add convenience methods for the intrinsics, and update the checker to also find paths referenced inside intrinsic functions. Fixes aws#14184, fixes aws#14181. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…teway (aws#18595) To pass the Task Token in headers to an API Gateway, the token must be wrapped in an array (because that's the value type of headers). Because JSONPath evaluation needs to happen to resolve the token, we need to use the `States.Array()` function in a `JsonPathToken` to properly resolve this. However, doing that makes the existing validation code fail the validation checking that you are passing the task token somewhere. Add convenience methods for the intrinsics, and update the checker to also find paths referenced inside intrinsic functions. Fixes aws#14184, fixes aws#14181. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
To pass the Task Token in headers to an API Gateway, the token must
be wrapped in an array (because that's the value type of headers).
Because JSONPath evaluation needs to happen to resolve the token,
we need to use the
States.Array()
function in aJsonPathToken
to properly resolve this. However, doing that makes the existing
validation code fail the validation checking that you are passing
the task token somewhere.
Add convenience methods for the intrinsics, and update the checker
to also find paths referenced inside intrinsic functions.
Fixes #14184, fixes #14181.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license