From 02addbbc9aaf79bb982451f4bb81d742ae4c255c Mon Sep 17 00:00:00 2001 From: Helber Belmiro Date: Fri, 10 Nov 2023 16:54:30 -0300 Subject: [PATCH 1/2] Fixed compilation error (#561) Signed-off-by: Helber Belmiro --- .../auth/compositeAuthenticationProvider.qute | 20 +++++++++++++++---- .../OAuth2AuthenticationProvider.java | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute b/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute index bab9347d..16436bd7 100644 --- a/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute +++ b/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute @@ -198,11 +198,22 @@ public class CompositeAuthenticationProvider extends AbstractCompositeAuthentica {#for auth in oauthMethods.orEmpty} @javax.enterprise.context.Dependent {#if is-resteasy-reactive} - static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.reactive.filter.OidcClientRequestReactiveFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { - {#else} - static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.filter.OidcClientRequestFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { - {/if} + static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.reactive.filter.OidcClientRequestReactiveFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { + + private final String clientId = io.quarkiverse.openapi.generator.OpenApiGeneratorConfig.getSanitizedSecuritySchemeName("{auth.name}"); + + @Override + protected Optional clientId() { + return Optional.of(clientId); + } + @Override + public void filter(jakarta.ws.rs.client.ClientRequestContext requestContext) throws java.io.IOException { + filter((org.jboss.resteasy.reactive.client.spi.ResteasyReactiveClientRequestContext)requestContext); + } + } + {#else} + static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.filter.OidcClientRequestFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { private final String clientId = io.quarkiverse.openapi.generator.OpenApiGeneratorConfig.getSanitizedSecuritySchemeName("{auth.name}"); @Override @@ -210,5 +221,6 @@ public class CompositeAuthenticationProvider extends AbstractCompositeAuthentica return Optional.of(clientId); } } + {/if} {/for} } \ No newline at end of file diff --git a/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java b/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java index 95e198b5..01af7238 100644 --- a/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java +++ b/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java @@ -57,7 +57,7 @@ private void validateConfig() { } } - public interface OidcClientRequestFilterDelegate { - void filter(T requestContext) throws IOException; + public interface OidcClientRequestFilterDelegate { + void filter(ClientRequestContext requestContext) throws IOException; } } From 13ccce447be0f8f046b419535bd58aa48d8658b9 Mon Sep 17 00:00:00 2001 From: Helber Belmiro Date: Fri, 10 Nov 2023 16:56:42 -0300 Subject: [PATCH 2/2] Replaced jakarta with javax --- .../microprofile/auth/compositeAuthenticationProvider.qute | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute b/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute index 16436bd7..a10cb86a 100644 --- a/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute +++ b/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute @@ -208,7 +208,7 @@ public class CompositeAuthenticationProvider extends AbstractCompositeAuthentica } @Override - public void filter(jakarta.ws.rs.client.ClientRequestContext requestContext) throws java.io.IOException { + public void filter(javax.ws.rs.client.ClientRequestContext requestContext) throws java.io.IOException { filter((org.jboss.resteasy.reactive.client.spi.ResteasyReactiveClientRequestContext)requestContext); } } @@ -223,4 +223,4 @@ public class CompositeAuthenticationProvider extends AbstractCompositeAuthentica } {/if} {/for} -} \ No newline at end of file +}