[java-idp-oidc] 02/02: Fix credential factory move

Phil Smart philip.smart at jisc.ac.uk
Tue Mar 28 16:03:06 UTC 2023


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch dev/JCOMOIDC-66
in repository java-idp-oidc.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-oidc.git;a=commit;h=470aedc1cd1e3658ac369ce286c5a08b47ae6c69

commit 470aedc1cd1e3658ac369ce286c5a08b47ae6c69
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Mar 28 16:20:02 2023 +0100

    Fix credential factory move
---
 .../oidc/op/profile/flow/AbstractOidcFlowTest.java     | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/AbstractOidcFlowTest.java b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/AbstractOidcFlowTest.java
index fb58934d..23522c4c 100644
--- a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/AbstractOidcFlowTest.java
+++ b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/AbstractOidcFlowTest.java
@@ -37,7 +37,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 
-import javax.crypto.spec.SecretKeySpec;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -92,14 +91,13 @@ import com.nimbusds.openid.connect.sdk.claims.ClaimsSet;
 import com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation;
 import com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata;
 
-import net.shibboleth.idp.plugin.oidc.op.profile.impl.BaseOIDCResponseActionTest;
 import net.shibboleth.idp.plugin.oidc.op.token.support.AccessTokenClaimsSet;
 import net.shibboleth.idp.plugin.oidc.op.token.support.TokenClaimsSet;
 import net.shibboleth.idp.test.flows.AbstractFlowTest;
 import net.shibboleth.oidc.metadata.impl.BaseStorageServiceClientInformationComponent;
 import net.shibboleth.oidc.security.credential.BasicJWKCredential;
+import net.shibboleth.oidc.security.credential.BasicJWKCredentialFactoryBean;
 import net.shibboleth.oidc.security.credential.JWKCredentialSupport;
-import net.shibboleth.oidc.security.credential.impl.BasicJWKCredentialFactoryBean;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.net.HttpServletRequestResponseContext;
 import net.shibboleth.utilities.java.support.security.DataSealer;
@@ -142,6 +140,7 @@ public abstract class AbstractOidcFlowTest extends AbstractFlowTest {
     /**
      * Initialize mock request, response, and external context. Overrides to remove authorization header.
      */
+    @Override
     @BeforeMethod public void initializeMocks() {
         overrideEndStateOutput(flowId, endStateId);
 
@@ -155,8 +154,9 @@ public abstract class AbstractOidcFlowTest extends AbstractFlowTest {
     /**
      * {@link HttpServletRequestResponseContext#loadCurrent(HttpServletRequest, HttpServletResponse)}
      */
+    @Override
     @BeforeMethod public void initializeThreadLocals() {
-        HttpServletRequestResponseContext.loadCurrent((HttpServletRequest) request, (HttpServletResponse) response);
+        HttpServletRequestResponseContext.loadCurrent(request, response);
     }
 
     @BeforeClass
@@ -170,7 +170,7 @@ public abstract class AbstractOidcFlowTest extends AbstractFlowTest {
     protected ECKey initializeECKey(final Curve curve, final String kid) {
         try {
             return new ECKeyGenerator(curve).keyID(kid).generate();
-        } catch (JOSEException e) {
+        } catch (final JOSEException e) {
             Assert.fail();
             return null;
         }
@@ -382,7 +382,7 @@ public abstract class AbstractOidcFlowTest extends AbstractFlowTest {
     protected static void storeMetadataObject(final StorageService storageService, final String clientId, final String secret,
             final OIDCClientMetadata metadata) throws IOException {
 
-        metadata.setGrantTypes(new HashSet<GrantType>(List.of(GrantType.AUTHORIZATION_CODE,
+        metadata.setGrantTypes(new HashSet<>(List.of(GrantType.AUTHORIZATION_CODE,
                 GrantType.REFRESH_TOKEN, GrantType.CLIENT_CREDENTIALS)));
         final OIDCClientInformation information = new OIDCClientInformation(new ClientID(clientId), new Date(),
                     metadata, secret != null ? new Secret(secret) : null);
@@ -392,7 +392,7 @@ public abstract class AbstractOidcFlowTest extends AbstractFlowTest {
 
     protected static OIDCClientMetadata buildMetadataSkeleton() {
         final OIDCClientMetadata metadata = new OIDCClientMetadata();
-        metadata.setGrantTypes(new HashSet<GrantType>(List.of(GrantType.AUTHORIZATION_CODE,
+        metadata.setGrantTypes(new HashSet<>(List.of(GrantType.AUTHORIZATION_CODE,
                 GrantType.REFRESH_TOKEN, GrantType.CLIENT_CREDENTIALS)));
         final HashSet<ResponseType> responseTypes = new HashSet<>();
         responseTypes.add(new ResponseType("code"));
@@ -514,7 +514,7 @@ public abstract class AbstractOidcFlowTest extends AbstractFlowTest {
 
     protected static EncryptedJWT createEncryptedJWT(final String contents, final JWEAlgorithm algorithm,
             final EncryptionMethod method, final BasicJWKCredential credential, final String clientSecret,
-            boolean setKid) throws JOSEException, ParseException {
+            final boolean setKid) throws JOSEException, ParseException {
         final JWEObject jweObject = new JWEObject(new JWEHeader.Builder(algorithm, method)
                 .contentType("JWT").keyID(setKid ? credential.getKid() : null).build(),
             new Payload(contents));
@@ -564,7 +564,7 @@ public abstract class AbstractOidcFlowTest extends AbstractFlowTest {
         try {
             factory.afterPropertiesSet();
             return factory.getObject();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             Assert.fail();
             return null;
         }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list