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

Support using configKey for authentication configuration #554

Closed
ismailBsd opened this issue Nov 2, 2023 · 4 comments · Fixed by #598
Closed

Support using configKey for authentication configuration #554

ismailBsd opened this issue Nov 2, 2023 · 4 comments · Fixed by #598
Labels
added to backlog The issue was added to backlog

Comments

@ismailBsd
Copy link

Currently, as the readme file indicates, to provide the credentials, the configuration key is composed using this template.: quarkus.openapi-generator.[filename].auth.[security_scheme_name].[auth_property_name]. Where:

filename is the sanitized name of file containing the OpenAPI spec, for example petstore_json.

It would be nice if we could use the config key if present instead of the openapi spec file.

For example if I set the config key to:
quarkus.openapi-generator.codegen.spec.petstore_json.config-key=petstore

I would like my configuration keys for authentication to look like this:

for api key authentication:
quarkus.openapi-generator.**petstore**.auth.api_key.api-key

for basic http authentication

quarkus.openapi-generator.petstore.auth.basic_auth.username
quarkus.openapi-generator.petstore.auth.basic_auth.password

and for bearer token authentication

quarkus.openapi-generator.petstore.auth.bearer.bearer-token

looking at the code I found that to implement it, {quarkus-generator.openApiSpecId} in the compositeAuthenticationProvider.qute template file must be replaced with {configKey} like in the api.qute file

@hbelmiro
Copy link
Contributor

If I'm not mistaken this feature was added in #457.
@ismailBsd have you tried that with the latest version?

@ismailBsd
Copy link
Author

ismailBsd commented Nov 21, 2023

@hbelmiro Sorry for the late reply, yes I tried with v1.3.13, I think it may be a template bug because compositeAuthenticationProvider.qute still uses {quarkus-generator.openApiSpecId} instead of {configKey}

@mcruzdev
Copy link
Member

Hi @ismailBsd and @hbelmiro, really the compositeAuthenticationProvider.qute uses quarkus-generator.openApiSpecId.

@ismailBsd, are you willing to send a PR?

@mcruzdev
Copy link
Member

mcruzdev commented Dec 21, 2023

Hi @hbelmiro I am working on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added to backlog The issue was added to backlog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants