Repository navigation
feat(auth): validate tokens against the platform pool with a validate-only client - #258
Merged
Merged
Conversation
…-only client - app.yaml auth: pool internal, client none. cupcake-backend only verifies tokens issued to frosting's client, so it needs no Cognito client of its own. - auth.env aliases COGNITO_WELL_KNOWN_URL to OIDC_WELL_KNOWN_URL, so the hardcoded pool URL is removed from environment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Terraform Plan🚧 Changes detected — Plan: 22 to add, 0 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟢 LOW Plan creates 22 new resources (no changes or destroys) for the cupcake-backend service: ECS Fargate service and task definition, ECR repo, ALB target group, listener rule and Route53 record, SSM SecureString parameters, IAM task role, CloudWatch log group and alarms.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The platform now supports validate-only auth (
client: none) and env aliases inapp.yamlauth:(javaBin/platform#138). cupcake-backend only verifies tokens that frosting's public client issued, so it doesn't need a Cognito client of its own. And the pool's discovery URL no longer has to be hardcoded inenvironment.What
auth: internal(which asked for a confidential client with a secret the backend never used) becomespool: internal,client: none.auth.env: {COGNITO_WELL_KNOWN_URL: OIDC_WELL_KNOWN_URL}. The app readsOIDC_WELL_KNOWN_URLthroughapplication.conf, so no code changes.OIDC_WELL_KNOWN_URLfromenvironment.Authorization doesn't change.
Security.ktalready validates the issuer and requireshelterincognito:groups. That check matters more now: aclient: noneAPI accepts tokens issued to any client in the pool. Internal-pool tokens now carry registry groups incognito:groups, soheltermembers pass.No
computeoverrides. The image runs fine as uid 1000 with a read-only root: the JRE and app files only need read access, and the JVM's temp files go to/tmp.Checks
./gradlew check(Temurin 25.0.5 via mise): pass.docker buildthendocker run --read-only --tmpfs /tmp --user 1000withOIDC_WELL_KNOWN_URLset to the pool: starts and loads discovery/JWKS./healthreturns 200, and/api/mewith no token returns 401. One harmless startup warning: jansi can't load its native lib because Docker mounts--tmpfsnoexec. It falls back to plain console output, and the platform's/tmpvolume is not a noexec tmpfs.scripts/generate-modules.pyfrom platform main) accepts the newapp.yaml. The generatedmain.tfhasclient_type = "none"and, inenvironment,COGNITO_USER_POOL_ID,COGNITO_DOMAIN,COGNITO_ISSUER_URL,COGNITO_WELL_KNOWN_URLandOIDC_WELL_KNOWN_URL = module.auth.well_known_url. As expected fornone, there is no client ID or secret, and the onlysecretsentries are the existing SP/Bring ones.Depends on
client/env.provision-groupshaving run, soheltershows up incognito:groups.nonedeletes the old Cognito clientcupcake-cupcake-backendand its SSM credentials. Nothing in cupcake uses them.🤖 Generated with Claude Code