-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Java language support with 18 authz detection rules #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
25d0c3f
feat: add Java language support with 18 authz detection rules
boorad 5da4a33
fix: address PR review feedback
boorad 67fddc2
chore: update address-pr-feedback command with bot prefixes and pagin…
boorad 11f7a05
fix: address CodeRabbit nitpick feedback
boorad c80e585
chore: add .coderabbit.yaml to prevent trickle reviews
boorad 0b776ed
fix: remove contains from role-equals-check predicate
boorad 8244127
fix: address PR review feedback round 3
boorad 52c74b1
fix: add scoped_type_identifier pattern and document granted_authority
boorad b53b8cc
chore: enable request_changes_workflow in CodeRabbit config
boorad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # .coderabbit.yaml | ||
| reviews: | ||
| request_changes_workflow: true | ||
| instructions: | | ||
| - Surface ALL findings in round 1. Never trickle comments across multiple rounds. | ||
| If uncertain whether something is worth flagging, include it in round 1 or skip it entirely. | ||
| - Do NOT generate new review comments on incremental pushes to a PR once the maintainer | ||
| has addressed or declined a suggestion. Respect final decisions. | ||
| - Files under `.claude/` are planning/agentic documents, not production code. | ||
| A single high-level pass only — no iterative feedback. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| [rule] | ||
| id = "java-access-decision-voter" | ||
| languages = ["java"] | ||
| category = "custom" | ||
| confidence = "medium" | ||
| description = "Custom AccessDecisionVoter or security interceptor implementation" | ||
| query = """ | ||
| (class_declaration | ||
| (superclass | ||
| (type_identifier) @parent_class) | ||
| ) @match | ||
|
|
||
| (class_declaration | ||
| (super_interfaces | ||
| (type_list | ||
| (type_identifier) @parent_class)) | ||
| ) @match | ||
| """ | ||
|
|
||
| [rule.predicates.parent_class] | ||
| match = "^(AccessDecisionVoter|AbstractAccessDecisionManager|SecurityInterceptor|AbstractSecurityInterceptor|PermissionEvaluator)$" | ||
|
|
||
| [[rule.tests]] | ||
| input = """ | ||
| public class CustomVoter extends AbstractAccessDecisionManager { | ||
| public int vote() { return 0; } | ||
| } | ||
| """ | ||
| expect_match = true | ||
|
|
||
| [[rule.tests]] | ||
| input = """ | ||
| public class CustomVoter implements AccessDecisionVoter<Object> { | ||
| public int vote() { return 0; } | ||
| } | ||
| """ | ||
| expect_match = true | ||
|
|
||
| [[rule.tests]] | ||
| input = """ | ||
| public class MyService extends BaseService { | ||
| public void doWork() { } | ||
| } | ||
| """ | ||
| expect_match = false | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| [rule] | ||
| id = "java-authenticated-check" | ||
| languages = ["java"] | ||
| category = "middleware" | ||
| confidence = "medium" | ||
| description = "Authentication status check (isAuthenticated, isAnonymous, etc.)" | ||
| query = """ | ||
| (method_invocation | ||
| name: (identifier) @method_name | ||
| arguments: (argument_list) | ||
| ) @match | ||
| """ | ||
|
|
||
| [rule.predicates.method_name] | ||
| match = "^(isAuthenticated|isAnonymous|isFullyAuthenticated|isRememberMe)$" | ||
|
|
||
| [[rule.tests]] | ||
| input = """ | ||
| public class Service { | ||
| public void check() { | ||
| if (authentication.isAuthenticated()) { allow(); } | ||
| } | ||
| } | ||
| """ | ||
| expect_match = true | ||
|
|
||
| [[rule.tests]] | ||
| input = """ | ||
| public class Service { | ||
| public void check() { | ||
| if (request.isSecure()) { allow(); } | ||
| } | ||
| } | ||
| """ | ||
| expect_match = false |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.