[localserver] add placeholders for JWT routes#298
Conversation
WalkthroughRegisters a new authenticated /auth route by adding an AuthRoutes class with placeholder token endpoints (/token POST and /token/{jti} DELETE) that currently respond with 501 Not Implemented; WebService mounts AuthRoutes inside the authenticated routing scope. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/src/main/java/me/capcom/smsgateway/modules/localserver/routes/AuthRoutes.kt (1)
11-12: Remove the empty default constructor.Per detekt's
EmptyDefaultConstructorrule, the empty parentheses can be omitted for cleaner syntax.-class AuthRoutes( -) { +class AuthRoutes {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/src/main/java/me/capcom/smsgateway/modules/localserver/WebService.kt(2 hunks)app/src/main/java/me/capcom/smsgateway/modules/localserver/routes/AuthRoutes.kt(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/src/main/java/me/capcom/smsgateway/modules/localserver/routes/AuthRoutes.kt (1)
app/src/main/java/me/capcom/smsgateway/modules/orchestrator/EventsRouter.kt (1)
route(20-46)
🪛 detekt (1.23.8)
app/src/main/java/me/capcom/smsgateway/modules/localserver/routes/AuthRoutes.kt
[warning] 11-12: An empty default constructor can be removed.
(detekt.empty-blocks.EmptyDefaultConstructor)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build release / build-apk
- GitHub Check: Build insecure / build-apk
🔇 Additional comments (2)
app/src/main/java/me/capcom/smsgateway/modules/localserver/routes/AuthRoutes.kt (1)
13-28: Placeholder implementation looks good.The route structure is consistent with existing route classes in the codebase, and returning
HttpStatusCode.NotImplemented(501) is appropriate for placeholder endpoints. The{jti}path parameter follows JWT conventions for token identifiers.app/src/main/java/me/capcom/smsgateway/modules/localserver/WebService.kt (1)
40-40: Integration follows existing patterns.The AuthRoutes import and registration are consistent with other route classes in this file. The routes are properly protected under the
auth-basicauthentication scope, and the registration pattern matchesLogsRoutesandSettingsRoutes.Also applies to: 180-182
🤖 Pull request artifacts
|
596466b to
ef8cdb2
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/src/main/java/me/capcom/smsgateway/modules/localserver/routes/AuthRoutes.kt (1)
21-28: Optional: make placeholders more self-describing for clientsThe 501 status codes are appropriate for “not implemented yet”, but clients will currently get an empty body. Consider adding a minimal message (or TODO) to make it clearer during integration/debugging, e.g.:
post { call.respond(HttpStatusCode.NotImplemented, "JWT /auth/token endpoint not implemented yet") } delete("/{jti}") { call.respond(HttpStatusCode.NotImplemented, "JWT /auth/token/{jti} revocation not implemented yet") }Purely cosmetic, can wait until you start wiring real JWT logic.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/src/main/java/me/capcom/smsgateway/modules/localserver/WebService.kt(2 hunks)app/src/main/java/me/capcom/smsgateway/modules/localserver/routes/AuthRoutes.kt(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/src/main/java/me/capcom/smsgateway/modules/localserver/WebService.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build insecure / build-apk
- GitHub Check: Build release / build-apk
🔇 Additional comments (1)
app/src/main/java/me/capcom/smsgateway/modules/localserver/routes/AuthRoutes.kt (1)
11-19: Auth route registration structure looks good
AuthRoutes.registercleanly scopes everything under atokensub-route on whatever authenticatedRouteyou pass in, which matches the PR goal of adding JWT-related placeholders without affecting unrelated paths. No functional issues from this structure.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.