504-frameworks-micronaut-security

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Micronaut 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
    ./mvnw compile
    or
    mvn compile
    before applying any change
  • SAFETY: If compilation fails, stop immediately
  • VERIFY: Run
    ./mvnw clean verify
    or
    mvn clean verify
    after applying improvements
  • BEFORE APPLYING: Read the reference for detailed rules and examples
在应用安全变更之前,确保项目可编译。改进完成后,运行完整验证。
  • 强制要求:在应用任何变更前运行
    ./mvnw compile
    mvn compile
  • 安全准则:如果编译失败,立即停止操作
  • 验证要求:在应用改进后运行
    ./mvnw clean verify
    mvn 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

工作流程

  1. Read reference and assess project context
Read
references/504-frameworks-micronaut-security.md
and inspect the current project setup before proposing changes.
  1. Gather scope and decide target improvements
Identify requested outcomes, constraints, and the minimum safe set of changes to apply.
  1. Apply framework-aligned changes
Implement or refactor security-related configuration/code following the reference patterns and project conventions.
  1. Run verification and report results
Execute appropriate build/tests and summarize what changed, what was verified, and any follow-up actions.
  1. 阅读参考文档并评估项目上下文
在提出变更之前,阅读
references/504-frameworks-micronaut-security.md
并检查当前项目设置。
  1. 确定范围并决定目标改进方向
明确预期结果、约束条件,以及需要应用的最小安全变更集。
  1. 应用符合框架要求的变更
遵循参考模式和项目约定,实现或重构安全相关的配置/代码。
  1. 运行验证并报告结果
执行适当的构建/测试,总结变更内容、验证情况以及后续行动建议。

Reference

参考文档

For detailed guidance, examples, and constraints, see references/504-frameworks-micronaut-security.md.
如需详细指导、示例和约束条件,请查看references/504-frameworks-micronaut-security.md