zift 0.2.2

Scan codebases for embedded authorization logic and generate Policy as Code (Rego/OPA today)
Documentation
[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