/micronaut-standards:securityfrom Micronaut Standards
OneLiteFeather's Micronaut Security baseline for REST APIs — deny-by-default access control with explicit per-endpoint @Secured annotations. Use this whenever adding a new controller endpoint and deciding who is allowed to call it, or when reviewing an existing endpoint that has no @Secured annotation at all. This is a foundational, prescriptive baseline rather than a pattern lifted from an existing reference codebase — neither of this plugin's two source repos has a security layer at all, which is itself the gap this skill exists to close. Does not cover a full auth/identity scheme (JWT issuance, OAuth2 flows, roles) — see this skill's own "Out of scope" note.
Ships in Micronaut Standards. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Every Micronaut backend enables Micronaut Security and configures it to deny access by default — an endpoint is locked down unless it explicitly opts out of that default. This is the opposite of the common failure mode of adding security "later" once a public-facing deployment forces the question, which almost always means auditing every existing endpoint retroactively instead of every new endpoint having to justify why it's open.
dependencies {
annotationProcessor(mn.micronaut.security.annotations)
implementation(mn.micronaut.security)
}
Both resolve through the mn.* platform catalog like every other Micronaut module dependency (see
dependency-management) — no separate version-catalog entry is needed.
# application.yml
micronaut:
security:
enabled: true
With Micronaut Security enabled and no further per-endpoint configuration, every controller method is
rejected with 401 Unauthorized by default — nothing is reachable until it's explicitly annotated.
@Secured@Controller("/font")
public class FontController implements FontApi {
@Override
@Get("/{id}")
@Secured(SecurityRule.IS_AUTHENTICATED)
public HttpResponse<FontModelResponseDTO> getById(@PathVariable UUID id) { /* ... */ }
}
For a genuinely public endpoint (health checks, a public read-only listing), open it explicitly and narrowly rather than disabling security for the whole controller:
@Override
@Get(uris = {"/"})
@Secured(SecurityRule.IS_ANONYMOUS)
public HttpResponse<Page<FontModelResponseDTO.FontModelDTO>> getAll(Pageable pageable) { /* ... */ }
@Secured can be placed at the class level (applies to every method that doesn't override it) or the
method level (overrides the class-level value for that one method) — prefer the most restrictive
sensible default at the class level, with individual methods opting into something looser
(IS_ANONYMOUS) only where that's a deliberate, reviewed decision, never as an oversight from a missing
annotation.
Ask, for each endpoint: does this need to be reachable without authentication at all (IS_ANONYMOUS),
does it need any authenticated caller regardless of role (IS_AUTHENTICATED), or does it need a specific
role/permission (a custom @Secured("ROLE_ADMIN")-style value, once the project defines its own roles)?
Document the answer as the @Secured value itself — the annotation is the documentation; there should be
no endpoint where the answer to "who can call this" requires reading application-wide security
configuration to figure out.
This skill establishes the deny-by-default baseline and the @Secured convention only. It does not cover
issuing or validating JWTs, configuring an OAuth2/OIDC provider, or designing a role/permission model —
those are project-specific decisions that depend on what identity provider (if any) a given backend
integrates with, and belong in that project's own documentation once decided.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub onelitefeathernet/onelitefeather-claude-marketplace --plugin micronaut-standards14 skills in this plugin
/configurationOneLiteFeather's convention for typed application configuration in a Micronaut REST API — one @ConfigurationProperties class per functional area in a dedicated config/ package, instead of ad-hoc properties scattered across the application entry point. Use this whenever a Micronaut backend needs a new piece of externalized configuration (a feature flag, an external service URL, a limit/threshold) and you're deciding where the corresponding Java type should live./dependency-managementOneLiteFeather's Gradle/Micronaut dependency-management conventions for REST API backends — the Micronaut Application and AOT plugins, reading the Micronaut version from gradle.properties instead of hardcoding it, the mn.* platform catalog, the private OneLiteFeather Maven repo, and the optional CycloneDX SBOM plugin. Use this whenever setting up or editing a Micronaut backend's build.gradle.kts/settings.gradle.kts. For the general OneLiteFeather Gradle/BOM mechanics that apply beyond Micronaut (private repo credential split, Java toolchain pattern), see minestom-knowledge:gradle/boms instead. For observability, database-migration, Testcontainers, and security dependencies specifically, see the observability, liquibase, testcontainers, and security skills — this skill only lists that those dependencies exist and where to look, not their coordinates; the one exception is structured-logging dependencies (Logstash encoder, OpenTelemetry MDC appender), whose coordinates live directly in this skill since `logging` covers only their usage./dtoOneLiteFeather's request-DTO conventions for Micronaut REST APIs — records with @Serdeable/@Introspected, one shared Create/Update DTO controlled by JSR-380 validation groups instead of separate DTO types per action, and entity conversion methods living on the DTO itself. Use this whenever adding a new request body type to a Micronaut controller. For the response side (success/error modeling), see the response-modeling skill; for endpoint-level OpenAPI documentation, see openapi — this skill covers only the incoming request DTO and its own field-level @Schema annotations./entity-designOneLiteFeather's JPA/Micronaut Data entity conventions for Micronaut REST APIs — entities as a pure persistence layer with no Bean Validation annotations, the internal-UUID-vs-external-identifier pattern, custom AttributeConverters for complex column types, and why entities are plain Java beans rather than records or Lombok classes. Use this whenever adding or reviewing a database/entity/ class in a Micronaut backend. For where entity validation actually lives, see the dto skill; for the optional pattern of publishing entities from a separate Maven module instead of keeping them in the backend, see references/separate-model-module.md in this skill./exception-handlingOneLiteFeather's global exception-handling convention for Micronaut REST APIs — exactly one org-wide ExceptionHandlerAdvice that maps exception types to the correct HTTP status code and returns the shared ErrorResponse type from response-modeling, plus dedicated domain exception classes instead of generic RuntimeExceptions. Use this whenever adding a new failure case a Micronaut backend needs to report, or reviewing an existing global exception handler that maps everything to one status code. This is an explicit correction of a mapping-everything-to-404 pattern seen in an early reference implementation — status-code mapping by exception type is mandatory./liquibaseOneLiteFeather's mandatory Liquibase database-migration convention for Micronaut REST APIs — always XML changelogs (never YAML/SQL/JSON), the master-changelog-plus-versioned-files structure, and why this replaces Hibernate's hbm2ddl.auto=update. Use this whenever a Micronaut backend needs a schema change, or when reviewing a project still relying on hbm2ddl.auto=update for schema management. For verifying a changelog actually works against both MariaDB and PostgreSQL, see the testcontainers skill.Other plugins' skills for the same job