Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTry an optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/test/io/flow/play/controllers/AuthorizationSpec.scala (1)
20-26:⚠️ Potential issue | 🔴 CriticalFix test helper to use fallback pattern for JWT salt configuration.
The test helper calls
mockConfig.requiredString("jwt.salt")butMockConfigonly provides the legacy key"JWT_SALT"(seeMockConfig.scalaline 33). This will cause the test to fail at runtime with a missing configuration error.Either update
MockConfigto include"jwt.salt", or match the production code pattern by usingmockConfig.optionalString("jwt.salt").getOrElse(mockConfig.requiredString("JWT_SALT"))in the test helper.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/test/io/flow/play/controllers/AuthorizationSpec.scala` around lines 20 - 26, The test helper createJWTHeader currently calls mockConfig.requiredString("jwt.salt") which fails because MockConfig only exposes the legacy "JWT_SALT"; change the call to use the same fallback pattern as production: call mockConfig.optionalString("jwt.salt").getOrElse(mockConfig.requiredString("JWT_SALT")) to retrieve the salt, then use that value when encoding the token in createJWTHeader so tests won’t crash due to a missing "jwt.salt" key.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@lib/test/io/flow/play/controllers/AuthorizationSpec.scala`:
- Around line 20-26: The test helper createJWTHeader currently calls
mockConfig.requiredString("jwt.salt") which fails because MockConfig only
exposes the legacy "JWT_SALT"; change the call to use the same fallback pattern
as production: call
mockConfig.optionalString("jwt.salt").getOrElse(mockConfig.requiredString("JWT_SALT"))
to retrieve the salt, then use that value when encoding the token in
createJWTHeader so tests won’t crash due to a missing "jwt.salt" key.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
lib/app/io/flow/play/controllers/Authorization.scalalib/app/io/flow/play/util/AuthHeaders.scalalib/test/io/flow/play/controllers/AuthorizationSpec.scala
|
Click here for code coverage report: https://jenkins.flo.pub/job/flowcommerce/job/lib-play/job/PR-645/3/scoverage-report/ |
The previous commit only updated FlowActionInvokeBlockHelper to try
jwt.salt before falling back to JWT_SALT. This applies the same pattern
to AuthorizationImpl and AuthHeaders, which were still using
requiredString("JWT_SALT") directly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test calls requiredString directly on MockConfig which only has JWT_SALT set, not jwt.salt. The fallback logic lives in the production code, not in the test helper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Click here for code coverage report: https://jenkins.flo.pub/job/flowcommerce/job/lib-play/job/PR-645/4/scoverage-report/ |
Summary
jwt.saltwithJWT_SALTfallback pattern toAuthorizationImplandAuthHeaders, matching the change already made inFlowActionInvokeBlockHelperAuthorizationSpectest helper to referencejwt.saltas the preferred config keyAuthHeadersdocstring to document both config keysTest plan
sbt testpasses — all existing JWT auth tests continue to work withJWT_SALTvia fallbackjwt.saltconfig will now work across all three JWT lookup sites🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests