[java-idp-plugin-duo] branch main updated: Fix Nimbus client object mapper injection
Phil Smart
philip.smart at jisc.ac.uk
Mon Oct 5 13:16:31 UTC 2020
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch main
in repository java-idp-plugin-duo.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=f2d5c90b19fce9254ebe7d3e00f19a732ed08a73
The following commit(s) were added to refs/heads/main by this push:
new f2d5c90 Fix Nimbus client object mapper injection
f2d5c90 is described below
commit f2d5c90b19fce9254ebe7d3e00f19a732ed08a73
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Mon Oct 5 14:16:25 2020 +0100
Fix Nimbus client object mapper injection
---
.../idp/plugin/authn/duo/nimbus/NimbusClient.java | 15 +++------------
.../idp/plugin/authn/duo/nimbus/NimbusClientFactory.java | 2 +-
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClient.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClient.java
index a9f9666..6ab0dc4 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClient.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClient.java
@@ -89,26 +89,17 @@ final class NimbusClient implements DuoOIDCClient{
* @param integration the integration to create the client for, never {@code null}
* @param client the Http client to use to execute HTTP requests, never {@code null}
* @param params any security parameters to use for the Http client, can be {@code null}.
+ * @param oMapper the JSON object mapper, never {@code null}.
*/
protected NimbusClient(@Nonnull final DuoOIDCIntegration integration, @Nonnull final HttpClient client,
- @Nullable final HttpClientSecurityParameters params) {
+ @Nullable final HttpClientSecurityParameters params, @Nonnull final ObjectMapper oMapper) {
duoIntegration = Constraint.isNotNull(integration,"Nimbus Client requires a non-null Duo Integration");
httpClient = Constraint.isNotNull(client,"Nimbus Client requires a non-null http client");
httpClientSecurityParameters = params;
- objectMapper = new ObjectMapper();
+ objectMapper = oMapper;
clientId = UUID.randomUUID().toString();
//TODO: should we validate the integration here e.g. secret key length, or when being set etc.
}
-
- /**
- * Set the JSON {@link ObjectMapper}.
- *
- * @param mapper object mapper
- */
- //TODO: should be set once before init and not after?
- public void setObjectMapper(@Nonnull final ObjectMapper mapper) {
- objectMapper = Constraint.isNotNull(mapper, "Object mapper cannot be null");
- }
/** {@inheritDoc} */
@Override
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactory.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactory.java
index c4bee67..1aab225 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactory.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactory.java
@@ -56,7 +56,7 @@ public class NimbusClientFactory extends AbstractInitializableComponent implemen
@Override
public DuoOIDCClient createInstance(@Nonnull final DuoOIDCIntegration integration) throws DuoClientException {
- return new NimbusClient(integration, httpClient, httpClientSecurityParameters);
+ return new NimbusClient(integration, httpClient, httpClientSecurityParameters,objectMapper);
}
/** {@inheritDoc} */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list