504-frameworks-micronaut-security
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMicronaut Security Guidelines
Micronaut安全指南
Apply Micronaut security best practices with secure-by-default API boundaries.
What is covered in this Skill?
- Micronaut security configuration and authentication setup
- Authorization with @Secured and role-based policies
- Endpoint and route protection strategy
- Least-privilege design and policy boundaries
- Secure error/denial behavior
- Sensitive data handling in logs and responses
Scope: Apply recommendations based on the reference rules and good/bad examples.
应用默认安全的API边界,遵循Micronaut安全最佳实践。
本Skill涵盖哪些内容?
- Micronaut安全配置与认证设置
- 使用@Secured和基于角色的策略进行授权
- 端点与路由保护策略
- 最小权限设计与策略边界
- 安全错误/拒绝行为
- 日志与响应中的敏感数据处理
范围: 根据参考规则和正反示例应用建议。
Constraints
约束条件
Before applying security changes, ensure the project compiles. After improvements, run full verification.
- MANDATORY: Run or
./mvnw compilebefore applying any changemvn compile - SAFETY: If compilation fails, stop immediately
- VERIFY: Run or
./mvnw clean verifyafter applying improvementsmvn clean verify - BEFORE APPLYING: Read the reference for detailed rules and examples
在应用安全变更之前,确保项目可编译。改进完成后,运行完整验证。
- 强制要求:在应用任何变更前运行或
./mvnw compilemvn compile - 安全准则:如果编译失败,立即停止操作
- 验证要求:在应用改进后运行或
./mvnw clean verifymvn clean verify - 应用前须知:阅读参考文档了解详细规则和示例
When to use this skill
何时使用本Skill
- Add Micronaut security support
- Review Micronaut security configuration
- Improve API authorization in Micronaut
- Add JWT security in Micronaut
- Harden Micronaut route authorization rules
- Implement @Secured policies in Micronaut controllers
- 添加Micronaut安全支持
- 审查Micronaut安全配置
- 改进Micronaut中的API授权
- 在Micronaut中添加JWT安全
- 强化Micronaut路由授权规则
- 在Micronaut控制器中实现@Secured策略
Workflow
工作流程
- Read reference and assess project context
Read and inspect the current project setup before proposing changes.
references/504-frameworks-micronaut-security.md- Gather scope and decide target improvements
Identify requested outcomes, constraints, and the minimum safe set of changes to apply.
- Apply framework-aligned changes
Implement or refactor security-related configuration/code following the reference patterns and project conventions.
- Run verification and report results
Execute appropriate build/tests and summarize what changed, what was verified, and any follow-up actions.
- 阅读参考文档并评估项目上下文
在提出变更之前,阅读并检查当前项目设置。
references/504-frameworks-micronaut-security.md- 确定范围并决定目标改进方向
明确预期结果、约束条件,以及需要应用的最小安全变更集。
- 应用符合框架要求的变更
遵循参考模式和项目约定,实现或重构安全相关的配置/代码。
- 运行验证并报告结果
执行适当的构建/测试,总结变更内容、验证情况以及后续行动建议。
Reference
参考文档
For detailed guidance, examples, and constraints, see references/504-frameworks-micronaut-security.md.
如需详细指导、示例和约束条件,请查看references/504-frameworks-micronaut-security.md。