Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [java-micronaut-server] security annotation always @Secured({SecurityRule.IS_AUTHENTICATED}) #16537

Open
menesty opened this issue Sep 8, 2023 · 1 comment

Comments

@menesty
Copy link

menesty commented Sep 8, 2023

Description

Have configures security for endpoint but code always generate with annotation
@secured({SecurityRule.IS_AUTHENTICATED})

expected with annotation @secured({"client")

Micronaut version 4.1.0

openapi-generator version

7.0.0

OpenAPI declaration file content or url

openapi: 3.0.0
info:
title: Client Service API
description: Business response for management companies, places, menus API.
contact:
name: test
url: test
email: test
version: 1.0.0
security:

  • BearerAuth:
    • client
    • ADMIN
      paths:
      /v1/me:
      get:
      security:
      • BearerAuth: [ client ]
        tags:
      • serviceAccount
        operationId: me
        summary: Return list of accessed account
        responses:
        "200":
        description: Return list of accessed account
        content:
        application/json:
        schema:
        type: array
        uniqueItems: true
        items:
        type: string
        "401":
        description: Unauthorized.
@altro3
Copy link
Contributor

altro3 commented Aug 27, 2024

@menesty Fixed it here: micronaut-projects/micronaut-openapi#1733

Just use official micronaut generator for java and kotlin by micronaut-opeanpi gradle or maven plugin from this repo: https://github.com/micronaut-projects/micronaut-openapi

Look to this guide: https://guides.micronaut.io/latest/micronaut-openapi-generator-server.html

Also, please describe problems and suggestions here: https://github.com/micronaut-projects/micronaut-openapi/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants