asl-java-implement-rule-authz
Guidelines for implementing secure RBAC and authz in Java/Spring.
Install
mkdir -p .claude/skills/asl-java-implement-rule-authz && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18019" && unzip -o skill.zip -d .claude/skills/asl-java-implement-rule-authz && rm skill.zipInstalls to .claude/skills/asl-java-implement-rule-authz
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when: 需要在 LeaveSystem_Backend_Java 中实现认证与鉴权规则,覆盖 Header/JWT、RBAC、资源归属和默认拒绝。关键词: Java 鉴权, Spring Boot, RBAC, Authorization, 资源级权限Key capabilities
- →Implement authentication constraints for protected interfaces
- →Enforce authorization rules based on role matrices
- →Perform resource-level authorization checks in the Service layer or authentication chain
- →Ensure default rejection for unauthorized requests, missing headers, invalid tokens, or unknown users
- →Maintain consistent role literals between documentation, Java enums, and API headers
- →Return stable error codes for unauthorized responses without leaking internal details
How it works
The skill implements authentication and authorization rules in Spring Boot APIs, covering header/JWT validation, RBAC, resource ownership, and default-deny principles. It ensures that both authentication and authorization are enforced, with resource-level checks performed in the service layer.
Inputs & outputs
When to use asl-java-implement-rule-authz
- →Implement API authentication
- →Apply resource-level RBAC
- →Review authz failure responses
About this skill
Java 认证与鉴权子 Skill
意图
确保 Spring Boot API 具备清晰认证与授权边界,防止接口级和资源级越权。
输入
- 目标接口或服务
- 角色矩阵来源,默认
docs/Req.md和docs/api_design.md
规则
- 认证与鉴权都必须覆盖;不得只依赖前端隐藏按钮或路由不可见。
- 默认拒绝: 未明确授权的角色、缺失 Header、非法 Token、未知用户必须拒绝。
- 角色权限按文档执行,当前模拟登录优先核对
X-User-Name与X-User-Role,如代码已启用 JWT 则按认证链路执行。 - 资源级授权必须在 Service 层或认证链路中二次校验,例如员工只能访问本人请假单。
- 管理员、经理、员工权限边界不能混用;审批、额度调整、删除、撤回属于危险动作,必须校验操作者身份。
- 未授权返回稳定错误码,如
FORBIDDEN或项目约定错误码。
最小验证清单
- 受保护接口有认证约束。
- 已做资源级权限校验。
- 默认拒绝未授权请求。
- 角色字面量与 Java enum / API Header 保持一致。
- 未授权响应结构稳定且不泄露内部细节。
When not to use it
- →When only relying on front-end hidden buttons or invisible routes for security
- →When authentication and authorization are not both covered
- →When administrator, manager, and employee permissions are mixed
Limitations
- →Authentication and authorization must both be covered
- →Default rejection is required for unauthorized requests, missing headers, illegal tokens, or unknown users
- →Resource-level authorization must be checked in the Service layer or authentication chain
How it compares
This approach systematically enforces clear authentication and authorization boundaries, including resource-level checks and default-deny patterns, providing a reliable security framework unlike relying on client-side controls or incomplete a
Compared to similar skills
asl-java-implement-rule-authz side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| asl-java-implement-rule-authz (this skill) | 0 | 1mo | No flags | Advanced |
| springboot-security | 5 | 5mo | No flags | Intermediate |
| spring-authorization-server | 0 | 5mo | No flags | Advanced |
| spring-boot-security | 1 | 13d | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
springboot-security
affaan-m
Spring Security best practices for authn/authz, validation, CSRF, secrets, headers, rate limiting, and dependency security in Java Spring Boot services.
spring-authorization-server
claude-dev-suite
|
spring-boot-security
HoangNguyen0403
Spring Security 6+ standards, Lambda DSL, and Hardening
security-owasp
navikt
OWASP Top 10:2025 kodenivå-mønstre for Kotlin, Go, Java og Node.js — tilgangskontroll, forsyningskjede, injeksjon og feilhåndtering
java-pro
sickn33
Master Java 21+ with modern features like virtual threads, pattern matching, and Spring Boot 3.x. Expert in the latest Java ecosystem including GraalVM, Project Loom, and cloud-native patterns. Use PROACTIVELY for Java development, microservices architecture, or performance optimization.
java-coding-standards
affaan-m
Java coding standards for Spring Boot services: naming, immutability, Optional usage, streams, exceptions, generics, and project layout.