feat: migrate JWT verification from HS256 shared secret to JWKS
Replace symmetric HS256 JWT verification with asymmetric RS256 using JWKS.
Backend now fetches and caches public keys from Supabase's JWKS endpoint
instead of using a shared secret.
- Add cryptography dependency for RS256 support
- Use PyJWKClient to fetch/cache JWKS from {SUPABASE_URL}/.well-known/jwks.json
- Remove SUPABASE_JWT_SECRET from config, docker-compose, deploy workflow, .env
- Update tests to use RS256 tokens with mocked JWKS client
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@@ -47,7 +47,7 @@ jobs:
|
||||
# Write .env from secrets (overwrites any existing file)
|
||||
printf '%s\n' \
|
||||
"POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" \
|
||||
"SUPABASE_JWT_SECRET=${{ secrets.SUPABASE_JWT_SECRET }}" \
|
||||
"SUPABASE_URL=${{ secrets.SUPABASE_URL }}" \
|
||||
| $SSH_CMD "cat > '${DEPLOY_DIR}/.env'"
|
||||
|
||||
$SCP_CMD docker-compose.prod.yml "root@192.168.1.10:${DEPLOY_DIR}/docker-compose.yml"
|
||||
|
||||
Reference in New Issue
Block a user