Skip to content

[jaxrs-spec][quarkus] - Add CLI flag (useQuarkusSecurityAnnotations) to enable emitting security annotation (@Authenticated, @RolesAllowed, @PermitAll)#23699

Merged
wing328 merged 3 commits intoOpenAPITools:masterfrom
Ignacio-Vidal:jaxrs-spec-quarkus-authentication-cli
May 6, 2026
Merged

[jaxrs-spec][quarkus] - Add CLI flag (useQuarkusSecurityAnnotations) to enable emitting security annotation (@Authenticated, @RolesAllowed, @PermitAll)#23699
wing328 merged 3 commits intoOpenAPITools:masterfrom
Ignacio-Vidal:jaxrs-spec-quarkus-authentication-cli

Conversation

@Ignacio-Vidal
Copy link
Copy Markdown
Contributor

@Ignacio-Vidal Ignacio-Vidal commented May 5, 2026

This is part of #23691 to improve the support for Authentication and Authorisation in the jaxrx-spec/quarkus server generator.

It introduces a new CLI flag to enable emitting the security annotations for Authentication and Authorisation in the jaxrs-spec/quarkus server. The flag useQuarkusSecurityAnnotations defaults to false to keep the current code generator behaviour. When true, it will allow the generator to add the security annotations as per #23691

The enhancements to emit the annotations will be added in subsequent PRs.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Adds an opt-in CLI flag to enable future emission of Quarkus security annotations in jaxrs-spec servers using the quarkus library. Default is off; no annotations are generated yet.

  • New Features

    • Registers useQuarkusSecurityAnnotations (boolean, quarkus only, default false) to gate @Authenticated, @RolesAllowed, @PermitAll.
    • Processes the flag only when library=quarkus; ignored for other libraries.
    • Updates docs to list the option and adds tests for registration and behavior.
  • Migration

    • To enable: pass -p useQuarkusSecurityAnnotations=true (or set in config) when using quarkus.

Written for commit 93390a5. Summary will update on new commits.

Registers a new boolean generator option (default false, quarkus library only)
that will gate emission of Quarkus security annotations (@authenticated,
@RolesAllowed, @permitAll) in subsequent PRs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Ignacio-Vidal Ignacio-Vidal force-pushed the jaxrs-spec-quarkus-authentication-cli branch from 55c47a9 to f4de345 Compare May 5, 2026 21:03
@Ignacio-Vidal Ignacio-Vidal changed the title Jaxrs spec quarkus authentication cli DRAFT: [jaxrs-spec][quarkus] - Add CLI flag to enable emitting security annotation (@Authenticated, @RolesAllowed, @PermitAll) May 5, 2026
Ignacio-Vidal and others added 2 commits May 5, 2026 22:11
…egistration

Covers: option registered with default false, readable as true for quarkus library,
and not processed for non-quarkus libraries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Ignacio-Vidal Ignacio-Vidal changed the title DRAFT: [jaxrs-spec][quarkus] - Add CLI flag to enable emitting security annotation (@Authenticated, @RolesAllowed, @PermitAll) DRAFT: [jaxrs-spec][quarkus] - Add CLI flag (useQuarkusSecurityAnnotations) to enable emitting security annotation (@Authenticated, @RolesAllowed, @PermitAll) May 5, 2026
@Ignacio-Vidal Ignacio-Vidal marked this pull request as ready for review May 5, 2026 22:10
@Ignacio-Vidal Ignacio-Vidal changed the title DRAFT: [jaxrs-spec][quarkus] - Add CLI flag (useQuarkusSecurityAnnotations) to enable emitting security annotation (@Authenticated, @RolesAllowed, @PermitAll) [jaxrs-spec][quarkus] - Add CLI flag (useQuarkusSecurityAnnotations) to enable emitting security annotation (@Authenticated, @RolesAllowed, @PermitAll) May 5, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@wing328
Copy link
Copy Markdown
Member

wing328 commented May 6, 2026

thanks for the PR

Have you updated the templates as well? If yes, can you please also commit those changes?

@Ignacio-Vidal
Copy link
Copy Markdown
Contributor Author

I haven't changed the templates because they will be added in future PRs like #23680.

Shall I update the templates with a no-op when the flag resolves to true in this PR?

This PR is the starting point for multiple PRs to deliver #23699

@wing328
Copy link
Copy Markdown
Member

wing328 commented May 6, 2026

I tested this feature and don't see any change in the output so this PR just add the option while the implementation will be done in future PRs instead, right?

@Ignacio-Vidal
Copy link
Copy Markdown
Contributor Author

I tested this feature and don't see any change in the output so this PR just add the option while the implementation will be done in future PRs instead, right?

Exactly. Can you see my previous comment and let me know your thoughts?

@wing328
Copy link
Copy Markdown
Member

wing328 commented May 6, 2026

we can go with this PR first. usually the PR introducing a new feature comes with the implementation as well.

@wing328 wing328 merged commit fc60f97 into OpenAPITools:master May 6, 2026
15 checks passed
@wing328 wing328 added this to the 7.23.0 milestone May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants