Skip to content

configKey instead of openApiSpecId in the CompositeAuthenticationProvider #855

@alexo134

Description

@alexo134

Basic authentication provider bean cannot be found after upgrading from 2.4.7 to 2.6.0-lts

What I've found in the sources:
compositeAuthenticationProvider.qute:

//...
@io.quarkiverse.openapi.generator.markers.BasicAuthenticationMarker(name="{auth.name}", openApiSpecId="{quarkus-generator.openApiSpecId}")
//...
class CompositeAuthenticationProvider implements jakarta.ws.rs.client.ClientRequestFilter {

    @jakarta.inject.Inject
    @io.quarkiverse.openapi.generator.OpenApiSpec(openApiSpecId="{configKey}")
    io.quarkiverse.openapi.generator.providers.CompositeAuthenticationProvider compositeProvider;

The marker uses spec-id, but the required bean uses configKey

Then in the GeneratorProcessor.produceBasicAuthentication() method CDI ban is created with qualifier that is using spec-id, therefore bean cannot be found when application is starting:

            beanProducer.produce(SyntheticBeanBuildItem.configure(AuthProvider.class)
                     // ...
                    .addQualifier()
                    .annotation(OpenApiSpec.class)
                    .addValue("openApiSpecId", openApiSpecId)
                    .done()
                    .createWith(recorder.recordBasicAuthProvider(
                            sanitizeAuthName(name),
                            openApiSpecId,
                            operations))
                    // ...

Versions used:

  • quarkus-openapi-generator: 2.6.0-lts
  • Quarkus: 3.15.1
  • Java: 21
  • Maven: 3.8.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions