Skip to content

Commit

Permalink
fix(quarkus): cannot include camel-quarkus-cxf-soap
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Dec 24, 2024
1 parent 56ad7bd commit a28869a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class HawtioConfigCustomizer implements SmallRyeConfigBuilderCustomizer {
public void configBuilder(SmallRyeConfigBuilder builder) {
Map<String, String> props = Map.of(
// If proactive authentication is enabled, Quarkus security always intercepts
// unauthenticated requests before they reach HawtioQuarkusAutneticator,
// unauthenticated requests before they reach HawtioQuarkusAuthenticator,
// and thus authentication throttling doesn't take effect.
"quarkus.http.auth.proactive", "false"
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package io.hawt.quarkus;

import io.hawt.web.auth.Redirector;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Singleton;

import io.hawt.web.auth.Redirector;
import io.quarkus.arc.DefaultBean;
import io.quarkus.security.identity.IdentityProviderManager;
import io.quarkus.security.identity.SecurityIdentity;
import io.quarkus.security.identity.request.AuthenticationRequest;
import io.smallrye.mutiny.Uni;

@Singleton
public class HawtioProducers {

Expand All @@ -16,4 +22,30 @@ public Redirector initializeRedirector() {
return redirector;
}

/**
* Default no-op identity provider manager.
* <p>
* It is used only when Hawtio authentication is disabled, but should never
* be invoked from anywhere at runtime.
* <p>
* When Hawtio authentication is enabled a security capability is required,
* so the user will need to provide a proper identity provider manager other
* than this no-op one to boot the application.
*/
@Produces
@DefaultBean
@ApplicationScoped
public IdentityProviderManager noopIdentityProviderManager() {
return new IdentityProviderManager() {
@Override
public Uni<SecurityIdentity> authenticate(AuthenticationRequest request) {
return null;
}

@Override
public SecurityIdentity authenticateBlocking(AuthenticationRequest request) {
return null;
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@
import java.util.Optional;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Inject;

import io.hawt.system.AuthenticateResult;
import io.hawt.util.Strings;
import io.hawt.web.auth.AuthenticationConfiguration;
import io.hawt.web.auth.AuthenticationThrottler;
import io.quarkus.arc.DefaultBean;
import io.quarkus.security.AuthenticationFailedException;
import io.quarkus.security.credential.PasswordCredential;
import io.quarkus.security.identity.IdentityProviderManager;
import io.quarkus.security.identity.SecurityIdentity;
import io.quarkus.security.identity.request.AuthenticationRequest;
import io.quarkus.security.identity.request.UsernamePasswordAuthenticationRequest;
import io.smallrye.mutiny.Uni;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -80,30 +76,4 @@ private static boolean verifyRole(SecurityIdentity identity, String roleConfig)
String[] roles = roleConfig.split(",");
return Arrays.stream(roles).anyMatch(identity.getRoles()::contains);
}

/**
* Default no-op identity provider manager.
* <p>
* It is used only when Hawtio authentication is disabled, but should never
* be invoked from anywhere at runtime.
* <p>
* When Hawtio authentication is enabled a security capability is required,
* so the user will need to provide a proper identity provider manager other
* than this no-op one to boot the application.
*/
@Produces
@DefaultBean
public IdentityProviderManager noopIdentityProviderManager() {
return new IdentityProviderManager() {
@Override
public Uni<SecurityIdentity> authenticate(AuthenticationRequest request) {
return null;
}

@Override
public SecurityIdentity authenticateBlocking(AuthenticationRequest request) {
return null;
}
};
}
}

0 comments on commit a28869a

Please sign in to comment.