We are not doing anything with the configuration, just take a plain
client instead. This removes a dependency on the actual implementation.
Change-Id: I398b1bf40237788c52d28c01ac5c4117ae40e0ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
a4b7bcf22c7f39884d1398c2017e88ea9dbacfc9)
<artifactId>aaa-idm-store-h2</artifactId>
</dependency>
- <!-- jersey client for moon authN -->
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-client</artifactId>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.aaa</groupId>
<artifactId>aaa-cert</artifactId>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.http</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <optional>true</optional>
+ </dependency>
<dependency>
<groupId>com.guicedee.services</groupId>
<artifactId>javax.inject</artifactId>
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
-import org.glassfish.jersey.client.ClientConfig;
import org.opendaylight.aaa.shiro.moon.MoonPrincipal;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
public MoonPrincipal moonAuthenticate(final String username, final String password, final String domain) {
- final ClientConfig config = new ClientConfig();
- final Client client = ClientBuilder.newClient(config);
+ final Client client = ClientBuilder.newClient();
final String hostFromShiro = moonServerURL != null ? moonServerURL.getHost() : null;
final String server;
import javax.net.ssl.SSLContext;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
-import org.glassfish.jersey.client.ClientConfig;
/**
* An utility that represents an HTTP client that allows to make
* @return the client.
*/
public SimpleHttpClient build() {
- final ClientConfig clientConfig = new ClientConfig();
- providers.forEach(clientConfig::register);
- Client client = ClientBuilder.newBuilder().sslContext(sslContext).hostnameVerifier(hostnameVerifier)
- .withConfig(clientConfig).build();
- return new SimpleHttpClient(client);
+ final ClientBuilder clientBuilder = ClientBuilder.newBuilder()
+ .sslContext(sslContext)
+ .hostnameVerifier(hostnameVerifier);
+
+ providers.forEach(clientBuilder::register);
+
+ return new SimpleHttpClient(clientBuilder.build());
}
}