-
Notifications
You must be signed in to change notification settings - Fork 10
Fix login dependency issue with spring boot thymeleaf playground example #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix login dependency issue with spring boot thymeleaf playground example #171
Conversation
WalkthroughRemoved the com.kinde.spring:kinde-springboot-starter dependency from the playground POM, removed unused imports in KindeConfig, and added a new GET /edit endpoint secured with hasRole('edit') returning the "edit" view. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Browser as Browser
participant App as SpringApp
participant Auth as Security
Note over Browser,App #bde0f7: New flow for GET /edit
Browser->>App: GET /edit
App->>Auth: Check @PreAuthorize hasRole('edit')
alt Authorized
Auth-->>App: allowed
App-->>Browser: 200 OK (view: "edit")
else Forbidden
Auth-->>App: denied
App-->>Browser: 403 Forbidden
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
playground/kinde-springboot-thymeleaf-full-example/src/main/java/com/kinde/oauth/controller/KindeController.java (1)
85-89: Fix copy-paste in Javadoc: mentions 'read' instead of 'edit'.
Update role and view name in the comment to avoid confusion.- /** - * Handles requests to the read endpoint, restricted to users with the 'read' role. - * - * @return the name of the "read" view. - */ + /** + * Handles requests to the edit endpoint, restricted to users with the 'edit' role. + * + * @return the name of the "edit" view. + */
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (2)
playground/kinde-springboot-thymeleaf-full-example/.envis excluded by none and included by noneplayground/kinde-springboot-thymeleaf-full-example/src/main/resources/templates/edit.htmlis excluded by none and included by none
📒 Files selected for processing (2)
kinde-core/src/main/java/com/kinde/config/KindeConfig.java(0 hunks)playground/kinde-springboot-thymeleaf-full-example/src/main/java/com/kinde/oauth/controller/KindeController.java(1 hunks)
💤 Files with no reviewable changes (1)
- kinde-core/src/main/java/com/kinde/config/KindeConfig.java
🧰 Additional context used
📓 Path-based instructions (1)
**/*
⚙️ CodeRabbit configuration file
**/*: Please focus on:
- Code quality and best practices
- Security considerations
- Performance implications
- Test coverage and quality
- API design and consistency
- Error handling and edge cases
For Java code specifically:
- Check for proper exception handling
- Verify async method implementations
- Review builder pattern usage
- Validate test coverage
- Check for memory leaks in async operations
Ignore:
- Generated code files
- Build artifacts
- Configuration files
- Documentation formatting
Files:
playground/kinde-springboot-thymeleaf-full-example/src/main/java/com/kinde/oauth/controller/KindeController.java
⏰ 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). (1)
- GitHub Check: build
🔇 Additional comments (2)
playground/kinde-springboot-thymeleaf-full-example/src/main/java/com/kinde/oauth/controller/KindeController.java (2)
90-94: LGTM: New /edit endpoint matches existing pattern and view-return style.
Consistent with /admin and /read.
90-92: Method security and role prefix mapping are correctly configured
SecurityConfig includes @EnableMethodSecurity and CustomOidcUserService maps permissions to SimpleGrantedAuthority("ROLE_"+permission), so hasRole('edit') will match ROLE_edit.
Playground example app login fix
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.
Summary by CodeRabbit
New Features
Chores
Refactor