Repository navigation
Add CI that tests the step-up authentication flow - #7
Merged
Merged
Conversation
Add test.sh and a workflow that deploys the stacks and walks the step-up flow through the API: token checks, a STEP_UP_REQUIRED rule, a TOTP challenge and the completed session. Move the Lambdas to Node.js 22, disable authorizer caching and await the session update. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
The build scripts use `[ "$1" == ... ]`, which dash rejects. On Ubuntu, where /bin/sh is dash, the compressed module step was skipped and the Lambda build failed. macOS runs /bin/sh as bash, so it worked there. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
resultsCacheTtl expects a Duration from a different @aws-cdk/core copy than the one the app imports, so the stack failed to compile. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo had no CI and no test.
New
test.sh(make test) walks the step-up flow through the deployed API:USER_PASSWORD_AUTHGET /inforeturns 401 without a token, 403 with a malformed token, and 200 with the access tokenSTEP_UP_REQUIREDrule for/transferinstep-up-auth-setting,POST /transferreturns 401 and the authorizer records aSTEP_UP_REQUIREDsession instep-up-auth-session/initiate-authreturnsMAYBE_SOFTWARE_TOKEN_STEP_UPfor a user without MFA/respond-to-challengerejects a malformed code and accepts a generated TOTP codeSTEP_UP_COMPLETEDandPOST /transferreturns 200Sample fixes:
nodejs18.xtonodejs22.x.AuthorizerResultTtlInSeconds: 0, set on the L1 resource becauseresultsCacheTtlexpects aDurationfrom a different@aws-cdk/corecopy and the stack failed to compile. The decision depends on the step-up session, which changes between requests with the same token, and the returned policy only covers the called method. With the default 5 minute cache, the step-up result could not take effect and calls to other methods reused the wrong policy.#!/bin/shbut use[ "$1" == ... ], which dash rejects. On Linux the compressed module step was silently skipped andmake buildfailed. They now use#!/bin/bash.make installalso installs the CDK CLI and yarn, whichmake deployneeds. Newmake testtarget, and the README documents it.New workflow: Node 22,
make install,make build,make start,make deploy,make test, and LocalStack logs on failure.https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM