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

Replace Boilerplate Logging with Quarkus Log Class #859

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import jakarta.ws.rs.client.ClientRequestContext;
import jakarta.ws.rs.core.HttpHeaders;

import org.jboss.logging.Logger;
import org.jboss.resteasy.reactive.client.spi.ResteasyReactiveClientRequestContext;
import org.jboss.resteasy.reactive.client.spi.ResteasyReactiveClientRequestFilter;

import io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider;
import io.quarkus.logging.Log;
import io.quarkus.oidc.client.Tokens;
import io.quarkus.oidc.client.runtime.AbstractTokensProducer;
import io.quarkus.oidc.client.runtime.DisabledOidcClientException;
Expand All @@ -24,8 +24,6 @@
public class ReactiveOidcClientRequestFilterDelegate extends AbstractTokensProducer
implements ResteasyReactiveClientRequestFilter, OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate {

private static final Logger LOG = Logger
.getLogger(ReactiveOidcClientRequestFilterDelegate.class);
private static final String BEARER_SCHEME_WITH_SPACE = OidcConstants.BEARER_SCHEME + " ";

final String clientId;
Expand All @@ -45,7 +43,7 @@ protected java.util.Optional<String> clientId() {
@Override
protected void initTokens() {
if (earlyTokenAcquisition) {
LOG.debug("Token acquisition will be delayed until this filter is executed to avoid blocking an IO thread");
Log.debug("Token acquisition will be delayed until this filter is executed to avoid blocking an IO thread");
}
}

Expand All @@ -69,10 +67,10 @@ public void accept(Tokens tokens) {
@Override
public void accept(Throwable t) {
if (t instanceof DisabledOidcClientException) {
LOG.debug("Client is disabled, acquiring and propagating the token is not necessary");
Log.debug("Client is disabled, acquiring and propagating the token is not necessary");
requestContext.resume();
} else {
LOG.debugf("Access token is not available, cause: %s, aborting the request", t.getMessage());
Log.debugf("Access token is not available, cause: %s, aborting the request", t.getMessage());
requestContext.resume((t instanceof RuntimeException) ? t : new RuntimeException(t));
}
}
Expand Down