[java-identity-provider] branch main updated: Checkstyle and other warnings.

Scott Cantor cantor.2 at osu.edu
Thu Aug 3 16:29:41 UTC 2023


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

scantor pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=efb45a443276909405d53f88095a268d8f52b6dd

The following commit(s) were added to refs/heads/main by this push:
     new efb45a443 Checkstyle and other warnings.
efb45a443 is described below

commit efb45a443276909405d53f88095a268d8f52b6dd
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Aug 3 12:29:37 2023 -0400

    Checkstyle and other warnings.
---
 .../shibboleth/idp/authn/MultiFactorAuthenticationTransition.java  | 3 +--
 .../idp/authn/impl/DefaultAuthenticationResultSerializer.java      | 2 +-
 .../net/shibboleth/idp/authn/impl/DoLockoutManagerOperation.java   | 1 +
 .../net/shibboleth/idp/authn/impl/ExtractUserAgentIdentifier.java  | 3 +--
 .../idp/authn/impl/ExtractUsernamePasswordFromWSSToken.java        | 7 ++++++-
 .../idp/authn/impl/TransitionMultiFactorAuthentication.java        | 4 ++--
 .../java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java     | 2 --
 .../idp/authn/proxy/impl/DiscoveryProfileRequestFunction.java      | 2 +-
 .../idp/authn/revocation/impl/DoRevocationCacheOperation.java      | 4 ++++
 .../net/shibboleth/idp/authn/spnego/impl/GSSContextAcceptor.java   | 4 ----
 .../shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java    | 5 +++--
 11 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/MultiFactorAuthenticationTransition.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/MultiFactorAuthenticationTransition.java
index 446110609..d4eaf94c1 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/MultiFactorAuthenticationTransition.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/MultiFactorAuthenticationTransition.java
@@ -98,8 +98,7 @@ public class MultiFactorAuthenticationTransition {
                 if (entry.getValue() instanceof String) {
                     final String flowId = StringSupport.trimOrNull((String) entry.getValue());
                     if (flowId != null) {
-                        nextFlowStrategyMap.put(trimmed,
-                                FunctionSupport.<ProfileRequestContext,String>constant(flowId));
+                        nextFlowStrategyMap.put(trimmed, FunctionSupport.constant(flowId));
                     }
                 } else if (entry.getValue() instanceof Function) {
                     nextFlowStrategyMap.put(trimmed, (Function<ProfileRequestContext, String>) entry.getValue());
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializer.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializer.java
index e0279087a..baf2ac426 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializer.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializer.java
@@ -238,7 +238,7 @@ public class DefaultAuthenticationResultSerializer extends AbstractInitializable
                         gen.write(Base64Support.encode(x.getEncoded(), false));
                     } catch (final CertificateEncodingException|EncodingException e) {
                         log.warn("Unable to serialize X.509 certificate with subject: {}",
-                                x.getSubjectDN().toString());
+                                x.getSubjectX500Principal().getName().toString());
                     }
                 }
                 gen.writeEnd();
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DoLockoutManagerOperation.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DoLockoutManagerOperation.java
index a561ba7f5..a904cc33c 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DoLockoutManagerOperation.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DoLockoutManagerOperation.java
@@ -267,6 +267,7 @@ public class DoLockoutManagerOperation extends AbstractProfileAction {
      */
     @Nonnull private AccountLockoutManager getLockoutManager() {
         assert isPreExecuteCalled();
+        assert lockoutManager != null;
         return lockoutManager;
     }
 
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUserAgentIdentifier.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUserAgentIdentifier.java
index 076fb5ba2..8493efb74 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUserAgentIdentifier.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUserAgentIdentifier.java
@@ -46,7 +46,6 @@ public class ExtractUserAgentIdentifier extends AbstractExtractionAction {
     @Nonnull private final Logger log = LoggerFactory.getLogger(ExtractUserAgentIdentifier.class);
     
     /** {@inheritDoc} */
-    // CheckStyle: ReturnCount OFF
     @Override
     protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
             @Nonnull final AuthenticationContext authenticationContext) {
@@ -67,5 +66,5 @@ public class ExtractUserAgentIdentifier extends AbstractExtractionAction {
 
         authenticationContext.ensureSubcontext(UserAgentContext.class).setIdentifier(applyTransforms(agent));
     }
-    // CheckStyle: ReturnCount ON
+    
 }
\ No newline at end of file
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromWSSToken.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromWSSToken.java
index 757324e34..8110c4aff 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromWSSToken.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromWSSToken.java
@@ -61,6 +61,10 @@ public class ExtractUsernamePasswordFromWSSToken extends AbstractExtractionActio
     protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext,
             @Nonnull final AuthenticationContext authenticationContext) {
         
+        if (!super.doPreExecute(profileRequestContext, authenticationContext)) {
+            return false;
+        }
+        
         final MessageContext inCtx = profileRequestContext.getInboundMessageContext();
         if (inCtx == null || !(inCtx.getMessage() instanceof Envelope)) {
             log.debug("{} Inbound message context missing or doesn't contain a SOAP Envelope", getLogPrefix());
@@ -69,13 +73,14 @@ public class ExtractUsernamePasswordFromWSSToken extends AbstractExtractionActio
         }
         
         inboundMessage = (Envelope) inCtx.getMessage();
-        return super.doPreExecute(profileRequestContext, authenticationContext);
+        return true;
     }
 
     /** {@inheritDoc} */
     @Override
     protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
             @Nonnull final AuthenticationContext authenticationContext) {
+        assert inboundMessage != null;
         final Pair<String, String> usernamePassword = extractUsernamePassword(inboundMessage);
         if (usernamePassword == null) {
             log.debug("{} inbound message does not contain a username and password", getLogPrefix());
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java
index b7337ae9b..3cd8840fb 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/TransitionMultiFactorAuthentication.java
@@ -166,7 +166,7 @@ public class TransitionMultiFactorAuthentication extends AbstractAuthenticationA
         return true;
     }
 
-// Checkstyle: CyclomaticComplexity OFF
+// Checkstyle: CyclomaticComplexity|MethodLength OFF
     /** {@inheritDoc} */
     @Override
     protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
@@ -245,7 +245,7 @@ public class TransitionMultiFactorAuthentication extends AbstractAuthenticationA
             }
         }
     }
-// Checkstyle: CyclomaticComplexity ON
+// Checkstyle: CyclomaticComplexity|MethodLength ON
 
 // Checkstyle: CyclomaticComplexity OFF
     /**
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
index f13f889d5..80f54025a 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
@@ -182,8 +182,6 @@ public class ValidateRemoteUser extends AbstractAuditingValidationAction {
     /** {@inheritDoc} */
     @Override
     @Nonnull protected Subject populateSubject(@Nonnull final Subject subject) {
-        final UsernameContext usernameContext = this.usernameContext;
-        assert usernameContext != null;
         final String userName = usernameContext.getUsername();
         assert userName != null;
 
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunction.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunction.java
index e8270bf72..1ad8f773e 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunction.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunction.java
@@ -1,4 +1,4 @@
- /*
+/*
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java
index c0e810825..4d82d7bf2 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java
@@ -111,6 +111,7 @@ public class DoRevocationCacheOperation extends AbstractProfileAction {
      */
     @Nonnull private RevocationCache getRevocationCache() {
         assert isPreExecuteCalled();
+        assert revocationCache != null;
         return revocationCache;
     }
 
@@ -119,6 +120,7 @@ public class DoRevocationCacheOperation extends AbstractProfileAction {
      */
     @Nonnull private String getCacheId() {
         assert isPreExecuteCalled();
+        assert cacheId != null;
         return cacheId;
     }
 
@@ -127,6 +129,7 @@ public class DoRevocationCacheOperation extends AbstractProfileAction {
      */
     @Nonnull private String getKey() {
         assert isPreExecuteCalled();
+        assert key != null;
         return key;
     }
 
@@ -135,6 +138,7 @@ public class DoRevocationCacheOperation extends AbstractProfileAction {
      */
     @Nonnull private String getContext() {
         assert isPreExecuteCalled();
+        assert context != null;
         return context;
     }
 
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/GSSContextAcceptor.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/GSSContextAcceptor.java
index e110a2adc..0222ef537 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/GSSContextAcceptor.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/GSSContextAcceptor.java
@@ -49,9 +49,6 @@ public class GSSContextAcceptor {
 
     /** The Kerberos settings. */
     @Nonnull private KerberosSettings kerberosSettings;
-
-    /** The realm in use. Debug use only. */
-    @Nullable private KerberosRealmSettings realmSettings;
     
     /** The Kerberos login module and server login state. */
     @Nullable private GSSAcceptorLoginModule krbLoginModule;
@@ -177,7 +174,6 @@ public class GSSContextAcceptor {
                 createGSSContext(realm);
                 assert context != null;
                 final byte[] tokenOut = context.acceptSecContext(inToken, offset, len);
-                realmSettings = realm;
                 assert context != null;
                 if (context.isEstablished()) {
                     log.trace("Security context fully established");
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java
index 2b2dcb9fc..f9484960f 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java
@@ -229,8 +229,9 @@ public class SPNEGOAuthnController {
      * @throws ExternalAuthenticationException ...
      */
     @RequestMapping(value = "/{conversationKey}/error", method = RequestMethod.GET)
-    public void handleError(@PathVariable @Nonnull final String conversationKey, @Nonnull final HttpServletRequest httpRequest,
-            @Nonnull final HttpServletResponse httpResponse) throws ExternalAuthenticationException, IOException {
+    public void handleError(@PathVariable @Nonnull final String conversationKey,
+            @Nonnull final HttpServletRequest httpRequest, @Nonnull final HttpServletResponse httpResponse)
+                    throws ExternalAuthenticationException, IOException {
 
         log.warn("SPNEGO authentication problem signaled by client");
         finishWithError(conversationKey, httpRequest, httpResponse, SPNEGO_NOT_AVAILABLE);

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


More information about the commits mailing list