[java-idp-oidc] 02/02: Minor Checkstyle / Javadoc / logging improvements.

Henri Mikkonen henri.mikkonen at iki.fi
Mon Mar 8 07:41:57 UTC 2021


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

hjmikkon pushed a commit to branch main
in repository java-idp-oidc.

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

commit 8f6ab316541ea1c644eb58a6136e26474aa69c96
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Mon Mar 8 09:40:32 2021 +0200

    Minor Checkstyle / Javadoc / logging improvements.
---
 .../idp/plugin/oidc/op/audit/package-info.java      | 19 +++++++++++++++++++
 .../idp/plugin/oidc/op/storage/package-info.java    | 19 +++++++++++++++++++
 .../oidc/op/token/support/AccessTokenClaimsSet.java |  6 ++++++
 .../op/token/support/AuthorizeCodeClaimsSet.java    |  4 ++++
 .../oidc/op/token/support/TokenClaimsSet.java       | 21 +++++++++++++--------
 .../plugin/oidc/op/token/support/package-info.java  | 19 +++++++++++++++++++
 .../profile/impl/SetConsentToResponseContext.java   |  1 -
 7 files changed, 80 insertions(+), 9 deletions(-)

diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/package-info.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/package-info.java
new file mode 100644
index 00000000..5bc63152
--- /dev/null
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You 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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** Support classes for (OIDC-specific) auditing. */
+package net.shibboleth.idp.plugin.oidc.op.audit;
\ No newline at end of file
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/storage/package-info.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/storage/package-info.java
new file mode 100644
index 00000000..de3682f7
--- /dev/null
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/storage/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You 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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** Utilities exploiting storage services. */
+package net.shibboleth.idp.plugin.oidc.op.storage;
\ No newline at end of file
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AccessTokenClaimsSet.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AccessTokenClaimsSet.java
index de4adee0..07ba0c7f 100644
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AccessTokenClaimsSet.java
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AccessTokenClaimsSet.java
@@ -60,6 +60,7 @@ public final class AccessTokenClaimsSet extends TokenClaimsSet {
      * @param exp Expiration time of the token. Must not be NULL.
      * @throws RuntimeException if called with non allowed null parameters
      */
+    // Checkstyle: ParameterNumber OFF
     public AccessTokenClaimsSet(@Nonnull final TokenClaimsSet tokenClaimSet, @Nonnull final Scope scope,
             @Nullable final ClaimsSet dlClaims, @Nullable final ClaimsSet dlClaimsUI, @Nonnull final Instant iat,
             @Nonnull final Instant exp) {
@@ -71,6 +72,7 @@ public final class AccessTokenClaimsSet extends TokenClaimsSet {
                 tokenClaimSet.getClaimsRequest(), dlClaims, null, dlClaimsUI, tokenClaimSet.getConsentedClaims(),
                 null, tokenClaimSet.isConsentEnabled());
     }
+    // Checkstyle: ParameterNumber ON
 
     /**
      * Constructor for access token claims set.
@@ -94,6 +96,7 @@ public final class AccessTokenClaimsSet extends TokenClaimsSet {
      * @param consentEnabled Whether consent has been enabled.
      * @throws RuntimeException if called with nonallowed null parameters
      */
+    // Checkstyle: ParameterNumber OFF
     private AccessTokenClaimsSet(@Nonnull final IdentifierGenerationStrategy idGenerator,
             @Nonnull final ClientID clientID, @Nonnull final String issuer, @Nonnull final String userPrincipal,
             @Nonnull final String subject, @Nullable final ACR acr, @Nonnull final Instant iat,
@@ -105,6 +108,7 @@ public final class AccessTokenClaimsSet extends TokenClaimsSet {
                 nonce, authTime, redirectURI, scope, claims, dlClaims, null, dlClaimsUI, consentedClaims, null,
                 consentEnabled);
     }
+    // Checkstyle: ParameterNumber ON
 
     /**
      * Private constructor for the parser.
@@ -160,6 +164,7 @@ public final class AccessTokenClaimsSet extends TokenClaimsSet {
          * @param redirectURI Validated redirect URI of the authentication request. Must not be NULL.
          * @param scope Scope of the authentication request. Must not be NULL.
          */
+        // Checkstyle: ParameterNumber OFF
         public Builder(@Nonnull final IdentifierGenerationStrategy idGenerator, @Nonnull final ClientID clientID,
                 @Nonnull final String issuer, @Nonnull final String userPrincipal, @Nonnull final String subject,
                 @Nonnull final Instant issuedAt, @Nonnull final Instant expiresAt,
@@ -167,6 +172,7 @@ public final class AccessTokenClaimsSet extends TokenClaimsSet {
             super(idGenerator, clientID, issuer, userPrincipal, subject, issuedAt, expiresAt, authenticationTime,
                     redirectURI, scope);
         }
+        // Checkstyle: ParameterNumber ON
 
         /**
          * Builds AccessTokenClaimsSet.
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AuthorizeCodeClaimsSet.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AuthorizeCodeClaimsSet.java
index f081a17a..1850c7fa 100644
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AuthorizeCodeClaimsSet.java
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AuthorizeCodeClaimsSet.java
@@ -66,6 +66,7 @@ public final class AuthorizeCodeClaimsSet extends TokenClaimsSet {
      * @param consentEnabled Whether consent has been enabled.
      * @throws RuntimeException if called with nonallowed null parameters
      */
+    // Checkstyle: ParameterNumber OFF
     private AuthorizeCodeClaimsSet(@Nonnull final IdentifierGenerationStrategy idGenerator,
             @Nonnull final ClientID clientID, @Nonnull final String issuer, @Nonnull final String userPrincipal,
             @Nonnull final String subject, @Nonnull final ACR acr, @Nonnull final Instant iat,
@@ -78,6 +79,7 @@ public final class AuthorizeCodeClaimsSet extends TokenClaimsSet {
                 nonce, authTime, redirectURI, scope, claims, dlClaims, dlClaimsID, dlClaimsUI, consentedClaims,
                 codeChallenge, consentEnabled);
     }
+    // Checkstyle: ParameterNumber ON
 
     /**
      * Private constructor for the parser.
@@ -133,6 +135,7 @@ public final class AuthorizeCodeClaimsSet extends TokenClaimsSet {
          * @param redirectURI Validated redirect URI of the authentication request. Must not be NULL.
          * @param scope Scope of the authentication request. Must not be NULL.
          */
+        // Checkstyle: ParameterNumber OFF
         public Builder(@Nonnull final IdentifierGenerationStrategy idGenerator, @Nonnull final ClientID clientID,
                 @Nonnull final String issuer, @Nonnull final String userPrincipal, @Nonnull final String subject,
                 @Nonnull final Instant issuedAt, @Nonnull final Instant expiresAt,
@@ -140,6 +143,7 @@ public final class AuthorizeCodeClaimsSet extends TokenClaimsSet {
             super(idGenerator, clientID, issuer, userPrincipal, subject, issuedAt, expiresAt, authenticationTime,
                     redirectURI, scope);
         }
+        // Checkstyle: ParameterNumber ON
 
         /**
          * Builds AuthorizeCodeClaimsSet.
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenClaimsSet.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenClaimsSet.java
index 15e2345c..3a3298f1 100644
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenClaimsSet.java
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenClaimsSet.java
@@ -150,14 +150,15 @@ public class TokenClaimsSet {
      * @throws RuntimeException if called with not allowed null parameters
      */
     // Checkstyle: CyclomaticComplexity OFF
-    protected TokenClaimsSet(@Nonnull final String tokenType, @Nonnull final String tokenID, @Nonnull final ClientID clientID,
-            @Nonnull final String issuer, @Nonnull final String userPrincipal, @Nonnull final String subject,
-            @Nullable final ACR acr, @Nonnull final Instant iat, @Nonnull final Instant exp,
-            @Nullable final Nonce nonce, @Nonnull final Instant authTime, @Nonnull final URI redirectURI,
-            @Nonnull final Scope scope, @Nullable final OIDCClaimsRequest claims, @Nullable final ClaimsSet dlClaims,
-            @Nullable final ClaimsSet dlClaimsID, @Nullable final ClaimsSet dlClaimsUI,
-            @Nullable final List<Object> consentedClaims, @Nullable final String codeChallenge,
-            final boolean consentEnabled) {
+    // Checkstyle: ParameterNumber OFF
+    protected TokenClaimsSet(@Nonnull final String tokenType, @Nonnull final String tokenID,
+            @Nonnull final ClientID clientID, @Nonnull final String issuer, @Nonnull final String userPrincipal,
+            @Nonnull final String subject, @Nullable final ACR acr, @Nonnull final Instant iat,
+            @Nonnull final Instant exp, @Nullable final Nonce nonce, @Nonnull final Instant authTime,
+            @Nonnull final URI redirectURI, @Nonnull final Scope scope, @Nullable final OIDCClaimsRequest claims,
+            @Nullable final ClaimsSet dlClaims, @Nullable final ClaimsSet dlClaimsID,
+            @Nullable final ClaimsSet dlClaimsUI, @Nullable final List<Object> consentedClaims,
+            @Nullable final String codeChallenge, final boolean consentEnabled) {
         if (tokenType == null || tokenID == null || clientID == null || issuer == null || userPrincipal == null
                 || iat == null || exp == null || authTime == null || redirectURI == null || scope == null
                 || subject == null) {
@@ -179,6 +180,7 @@ public class TokenClaimsSet {
     }
 
     // Checkstyle: CyclomaticComplexity ON
+    // Checkstyle: ParameterNumber ON
 
     /**
      * Helper to verify parsed claims are what is expected.
@@ -630,6 +632,7 @@ public class TokenClaimsSet {
          * @param redirectURI Validated redirect URI of the authentication request. Must not be NULL.
          * @param scope Scope of the authentication request. Must not be NULL.
          */
+        // Checkstyle: ParameterNumber OFF
         protected Builder(@Nonnull final IdentifierGenerationStrategy idGenerator, @Nonnull final ClientID clientID,
                 @Nonnull final String issuer, @Nonnull final String userPrincipal, @Nonnull final String subject,
                 @Nonnull final Instant issuedAt, @Nonnull final Instant expiresAt,
@@ -647,6 +650,8 @@ public class TokenClaimsSet {
             reqScope = scope;
 
         }
+        // Checkstyle: ParameterNumber ON
+
 
         /**
          * Set authentication context class reference value of the authentication.
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/package-info.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/package-info.java
new file mode 100644
index 00000000..36540050
--- /dev/null
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You 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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** Support classes for dealing with claims sets in authorization code, access/refresh tokens. */
+package net.shibboleth.idp.plugin.oidc.op.token.support;
\ No newline at end of file
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/SetConsentToResponseContext.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/SetConsentToResponseContext.java
index 7fcb23be..e0ac0e40 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/SetConsentToResponseContext.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/SetConsentToResponseContext.java
@@ -143,7 +143,6 @@ public class SetConsentToResponseContext extends AbstractOIDCResponseAction {
 
         final ProfileConfiguration pc = rpCtx.getProfileConfig();
         if (pc != null && pc instanceof OIDCCoreProtocolConfiguration) {
-            log.debug("{} TODO Returning {}", ((OIDCCoreProtocolConfiguration) pc).isEncodeConsentInTokens(profileRequestContext));
             if (!((OIDCCoreProtocolConfiguration) pc).isEncodeConsentInTokens(profileRequestContext)) {
                 log.debug("{} The consent encoding to token has not been enabled, nothing to do", 
                         getLogPrefix());

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


More information about the commits mailing list