Skip to content

Commit

Permalink
fixed getting JWT from secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
chernser committed Jan 14, 2025
1 parent a2a6a0a commit 88fbe0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,17 @@ jobs:
EOF
- name: Install Java client
run: mvn --also-make --batch-mode --no-transfer-progress -DskipTests install
- name: Generate JWT
env:
JWT_K_PEM: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_PRIVATE_KEY }}
run: |
npm install jsonwebtoken &&
echo "CLIENT_JWT=$(node jwt-gen.js)" >> "$GITHUB_ENV"
# - name: Generate JWT
# env:
# JWT_K_PEM: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_PRIVATE_KEY }}
# run: |
# npm install jsonwebtoken &&
# echo "CLIENT_JWT=$(node jwt-gen.js)" >> "$GITHUB_ENV"
- name: Test http client
env:
CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}
CLIENT_JWT: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_DESERT_VM_43 }}
run: |
mvn --batch-mode --no-transfer-progress --projects ${{ matrix.project }} -DclickhouseVersion=${{ matrix.clickhouse }} -Dprotocol=http verify
- name: Upload test results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ public void testJWTWithCloud() throws Exception {
if (!isCloud()) {
return; // only for cloud
}
String jwt = System.getenv("INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_DESERT_VM_43");
String jwt = System.getenv("CLIENT_JWT");
Assert.assertTrue(jwt != null && !jwt.trim().isEmpty(), "JWT is missing");
Assert.assertFalse(jwt.contains("\n") || jwt.contains("-----"), "JWT should be single string ready for HTTP header");
try (Client client = newClient().useBearerTokenAuth(jwt).build()) {
Expand Down

0 comments on commit 88fbe0d

Please sign in to comment.