From 57f075b3b9b5805f792dc0783b0700bd6721510b Mon Sep 17 00:00:00 2001 From: Ludwig Schneider Date: Mon, 25 Mar 2024 17:17:20 -0500 Subject: [PATCH] Let's go --- .github/workflows/tests.yml | 22 ++++++++++++++++------ CONTRIBUTORS.md | 3 ++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ba088676..6a6081b6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,13 +37,17 @@ jobs: os: [ubuntu-latest, macos-latest] python-version: [3.8, 3.12] - env: - CRIPT_HOST: https://lb-stage.mycriptapp.org/ - CRIPT_TOKEN: 123456789 - CRIPT_STORAGE_TOKEN: 987654321 - CRIPT_TESTS: False - steps: + - name: Generate Cognito token + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + run: | + pip install awscli + OUTPUT=$(aws cognito-idp ${{ secrets.COGNITO_INIT }} --user-pool-id ${{ secrets.COGNITO_USER_POOL_ID }} --client-id ${{ secrets.COGNITO_CLIENT_ID }} --auth-flow ${{ secrets.COGNITO_AUTH_FLOW }} --auth-parameters USERNAME=${{ secrets.COGNITO_USERNAME }},PASSWORD=${{ secrets.COGNITO_PASSWORD }}) + export ACCESS_TOKEN=$(echo "$OUTPUT" | jq -r '.AuthenticationResult.AccessToken' | sed 's/^"\(.*\)"$/\1/') + export ID_TOKEN=$(echo "$OUTPUT" | jq -r '.AuthenticationResult.IdToken' | sed 's/^"\(.*\)"$/\1/') - name: Checkout uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -59,3 +63,9 @@ jobs: - name: Run pytest on tests/ run: python${{ matrix.python-version }} -m pytest ./tests/ + + env: + CRIPT_HOST: https://lb-stage.mycriptapp.org/ + CRIPT_TOKEN: ${{ steps.cognito.outputs.ID_TOKEN }} + CRIPT_STORAGE_TOKEN: ${{ steps.cognito.outputs.ACCESS_TOKEN }} + CRIPT_TESTS: True diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a0c15670..6d2f571a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,6 +1,7 @@ # CRIPT DEVELOPMENT TEAM + - [Ludwig Schneider](https://github.com/InnocentBug/) - [Dylan Walsh](https://github.com/dylanwal/) - [Brillant Kasami](https://github.com/brili) - [Fatjon Ismailaj](https://github.com/fatjon95) -- [Izaim Osmani](https://github.com/izaim) \ No newline at end of file +- [Izaim Osmani](https://github.com/izaim)