From 8ec48433bab4215578c41ee0a5f6cb43367c4417 Mon Sep 17 00:00:00 2001 From: Izaim Date: Wed, 3 Apr 2024 01:08:03 +0200 Subject: [PATCH 1/2] Add Cognito Tokens using SecretsManager --- .github/workflows/test_coverage.yaml | 24 +++++++++++++++++------- CONTRIBUTORS.md | 4 ++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test_coverage.yaml b/.github/workflows/test_coverage.yaml index 95654e7ba..f27ac7545 100644 --- a/.github/workflows/test_coverage.yaml +++ b/.github/workflows/test_coverage.yaml @@ -10,6 +10,7 @@ on: - main - develop - trunk-merge/** + - pipeline/* pull_request: branches: - main @@ -23,6 +24,11 @@ concurrency: # Cancel in-progress runs when a new workflow with the same group name is triggered cancel-in-progress: true +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 }} + jobs: test-coverage: runs-on: ubuntu-latest @@ -30,13 +36,6 @@ jobs: matrix: os: [ubuntu-latest] python-version: [3.12] - - env: - CRIPT_HOST: https://lb-stage.mycriptapp.org/ - CRIPT_TOKEN: 125433546 - CRIPT_STORAGE_TOKEN: 987654321 - CRIPT_TESTS: False - steps: - uses: actions/checkout@v4 @@ -54,5 +53,16 @@ jobs: - name: Install requirements_dev.txt run: pip install -r requirements_dev.txt + - name: Retrieve Cognito Tokens from AWS Secrets Manager + run: | + echo "CRIPT_TOKEN=$(aws secretsmanager get-secret-value --secret-id Pipelines_CognitoAccessToken --query SecretString --output text)" >> $GITHUB_ENV + echo "CRIPT_STORAGE_TOKEN=$(aws secretsmanager get-secret-value --secret-id Pipelines_CognitoIdToken --query SecretString --output text)" >> $GITHUB_ENV + - name: Test Coverage + run: pytest --cov --cov-fail-under=85 + env: + CRIPT_HOST: https://lb-stage.mycriptapp.org/ + CRIPT_TOKEN: ${{ env.CRIPT_TOKEN }} + CRIPT_STORAGE_TOKEN: ${{ env.CRIPT_STORAGE_TOKEN }} + CRIPT_TESTS: True \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ad5e9e92d..443de50c4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,7 +1,7 @@ # CRIPT DEVELOPMENT TEAM -- [Navid Hariri](https://github.com/nh916) - [Ludwig Schneider](https://github.com/InnocentBug/) - [Dylan Walsh](https://github.com/dylanwal/) -- [Brillant Kasami](https://github.com/brili) +- [Brilant Kasami](https://github.com/brili) +- [Izaim Osmani](https://github.com/izaim) - [Fatjon Ismailaj](https://github.com/fatjon95) From 89cebd1d88bd46d479fcbc407f42561d87ad8bc1 Mon Sep 17 00:00:00 2001 From: Izaim Date: Thu, 11 Apr 2024 00:56:52 +0200 Subject: [PATCH 2/2] revert changes on contributors.md --- CONTRIBUTORS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 443de50c4..eca918971 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,7 +1,8 @@ # CRIPT DEVELOPMENT TEAM +- [Navid Hariri](https://github.com/nh916) - [Ludwig Schneider](https://github.com/InnocentBug/) - [Dylan Walsh](https://github.com/dylanwal/) - [Brilant Kasami](https://github.com/brili) - [Izaim Osmani](https://github.com/izaim) -- [Fatjon Ismailaj](https://github.com/fatjon95) +- [Fatjon Ismailaj](https://github.com/fatjon95) \ No newline at end of file