Skip to content

Commit

Permalink
Reenable custom auth integration tests and add to CI (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
bretambrose authored Jul 9, 2021
1 parent 9c0b4db commit fda92f8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fail-fast: false
matrix:
node-version: [10.x]
test-type: [websocket, certificate]
test-type: [websocket, certificate, custom-auth]

steps:
- uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,20 @@ then
PROC2_PID=$!
$NODE $INT_TEST_DIR/jobs-integration-test.js -H $HOSTNAME -f $CERT_DIR -t1 --debug=true -T $TEST_TAG | tee $PROC1_OUTFILE &
PROC1_PID=$!
else
elif [ $AUTHENTICATION_TYPE"" == "websocket" ]
then
echo "###################################################################"
echo ${0##*/}": running jobs integration test (websocket/sigv4)"
echo "###################################################################"
$NODE $INT_TEST_DIR/jobs-integration-test.js -H $HOSTNAME -P=wss -t2 --debug=true -T $TEST_TAG | tee $PROC2_OUTFILE &
PROC2_PID=$!
$NODE $INT_TEST_DIR/jobs-integration-test.js -H $HOSTNAME -P=wss -t1 --debug=true -T $TEST_TAG | tee $PROC1_OUTFILE &
PROC1_PID=$!
else
echo "###################################################################"
echo ${0##*/}": skipping jobs integration test (custom_auth)"
echo "###################################################################"
exit 0
fi
#
# Wait on the two partner processes and record their exit codes.
Expand Down
21 changes: 18 additions & 3 deletions integration-testing/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# PARAMETERS
#
# <authentication-type> : [websocket|certificate]
# <authentication-type> : [websocket|certificate|custom-auth]
#
# This program will first validate the given parameters, then attempt to
# retrieve required secrets from AWS secrets manager; if both are successful, it
Expand Down Expand Up @@ -53,9 +53,10 @@ then
export AUTHENTICATION_TYPE=$1

if [ $AUTHENTICATION_TYPE"" != "websocket" ] && \
[ $AUTHENTICATION_TYPE"" != "certificate" ]
[ $AUTHENTICATION_TYPE"" != "certificate" ] && \
[ $AUTHENTICATION_TYPE"" != "custom-auth" ]
then
echo ${0##*/}": authentication-type must be one of [websocket|certificate]"
echo ${0##*/}": authentication-type must be one of [websocket|certificate|custom-auth]"
exit 2
fi
export LONG_RUNNING_TEST=""
Expand Down Expand Up @@ -166,6 +167,20 @@ case $AUTHENTICATION_TYPE"" in
exit $?
;;

custom-auth)
echo "###################################################################"
echo ${0##*/}": setting custom-auth credentials"
echo "###################################################################"

export CUSTOM_AUTH_HEADERS="{ \"X-Amz-CustomAuthorizer-Name\": \"SDKTestAuthorizer\", \"X-Amz-CustomAuthorizer-Signature\": \"vHPdrbNsr24wR+OcR45el1xh14MtJu5zLPp5ZhoJo9mGCmWQcFj9wPhgYWmgX/900T3NFhB+c7fN8Cln7r6ZszMQP48fjFiF95FmqlXPENlEDWuLN8kCVE3BRr12fcvXDNo9gPEWYE71KkWDLTrqtuOIDFAp39zduEPhzN3bj0yn+0RCMA7X9Q3BNxJji+Rq1U68jCWTjGay9cz3P+PnxfL5zqnoeJhg7baJG+xf7b1kmDw9lMzUSXNGs6FTxO66TzOscZ6I8oOWrMUvTSe24j4POs00bROOTWc0XXoCvX/v4W+TI/Oe3jnJXfXcmOqLXLPqapgWL2XobiOnFjl0PA==\", \"SDKTestAuthorizerToken\": \"abc123\" }"

# Make sure it won't reject the internal cert used by Gamma PDX. Once we switch to prod, remove this line
export NODE_TLS_REJECT_UNAUTHORIZED=0

$RUN_INTEGRATION_TESTS
exit $?
;;

certificate)
export JOBS_AWS_ACCESS_KEY_ID=$principal
export JOBS_AWS_SECRET_ACCESS_KEY=$credential
Expand Down

0 comments on commit fda92f8

Please sign in to comment.