[java-idp-plugin-webauthn] branch main updated: Fix all checkstyle issues
Phil Smart
philip.smart at jisc.ac.uk
Tue Aug 13 08:47:01 UTC 2024
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch main
in repository java-idp-plugin-webauthn.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-webauthn.git;a=commit;h=b918232ec567707fcaa6850e83e8607f3aa66a1e
The following commit(s) were added to refs/heads/main by this push:
new b918232 Fix all checkstyle issues
b918232 is described below
commit b918232ec567707fcaa6850e83e8607f3aa66a1e
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Aug 13 09:46:58 2024 +0100
Fix all checkstyle issues
---
.../admin/CredentialCreationOptionsParameters.java | 20 ++++++++--------
.../authn/webauthn/admin/RegistrationResult.java | 17 ++++++-------
.../admin/WebAuthnRegistrationEventIds.java | 12 +++++-----
.../authn/webauthn/audit/WebAuthnAuditFields.java | 16 +++++++------
.../authn/webauthn/authn/AssertionResult.java | 26 ++++++++++----------
.../webauthn/authn/BaseOptionsParameters.java | 18 +++++++-------
.../authn/CredentialRequestOptionsParameters.java | 19 ++++++++-------
.../authn/WebAuthnAuthenticationEventIds.java | 9 ++++---
.../client/WebAuthnAuthenticationClient.java | 14 +++++++++++
.../WebAuthnAuthenticationClientFactory.java | 14 +++++++++++
.../webauthn/context/BaseWebAuthnContext.java | 2 +-
.../context/WebAuthnAuthenticationContext.java | 14 +++++++++++
.../context/WebAuthnRegistrationContext.java | 16 ++++++++++++-
.../logic/IsDiscoverableCredentialRequired.java | 4 ++--
.../webauthn/context/logic/IsSecondFactor.java | 4 ++--
.../logic/IsUsernameCollectionRequired.java | 3 ++-
...stractAttributeContextUserIdentityStrategy.java | 4 ++--
.../WebAuthnAuthenticationClientException.java | 14 +++++++++++
.../principal/WebAuthnUserIdPrinicpal.java | 2 +-
.../webauthn/storage/CredentialRegistration.java | 28 +++++++++++-----------
.../idp/plugin/authn/webauthn/WebAuthnModule.java | 1 -
.../authn/webauthn/admin/impl/AddDisplayName.java | 9 +++----
.../authn/webauthn/admin/impl/AddUserId.java | 21 +++++++---------
.../admin/impl/AdminDeletePublicKeyCredential.java | 9 +++----
.../impl/AllowCurrentUserAccessPredicate.java | 4 ++--
.../CreatePublicKeyCredentialCreationOptions.java | 4 +++-
.../admin/impl/DeletePublicKeyCredential.java | 21 +++++++---------
...xtractKeyRemovalInformationFromFormRequest.java | 11 ++++-----
...licKeyCredentialAttestationFromFormRequest.java | 10 +++-----
.../impl/ExtractUsernameSearchFromFormRequest.java | 9 +++----
.../admin/impl/LookupCredentialsForUser.java | 10 ++++----
...ManagementContextCredentialRemovalConsumer.java | 3 ++-
...gistrationContextCredentialRemovalConsumer.java | 4 ++--
.../admin/impl/StorePublicKeyCredential.java | 23 +++++++++---------
.../ValidateAuthenticatorAttestationResponse.java | 9 +++----
.../audit/impl/AbstractWebAuthnAuditingAction.java | 2 ++
.../impl/YubicoWebAuthnAuthenticationClient.java | 5 ++--
.../client/impl/YubicoWebauthnClientFactory.java | 2 ++
.../webauthn/impl/AbstractWebAuthnAction.java | 2 ++
...ublicKeyCredentialAssertionFromFormRequest.java | 16 ++++++-------
.../webauthn/impl/GenerateServerChallenge.java | 9 +++----
.../webauthn/impl/LookupRegisteredCredentials.java | 16 ++++++-------
.../LookupRegisteredCredentialsFromUserHandle.java | 19 ++++++++-------
.../webauthn/impl/ValidateWebAuthnAssertion.java | 14 +++++++++++
.../metadata/FidoMetadataServiceFactory.java | 4 +++-
.../impl/CredentialRegistrationSerializer.java | 6 ++---
.../IdPStorageServiceCredentialRespository.java | 8 +++----
47 files changed, 291 insertions(+), 216 deletions(-)
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java
index 80beb8d..8525973 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java
@@ -38,33 +38,33 @@ import net.shibboleth.shared.logic.Constraint;
*/
@ThreadSafe
@Immutable
-public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
+public final class CredentialCreationOptionsParameters extends BaseOptionsParameters {
/**
* Credentials that have already been registered with the IdP. The authenticator should use these to avoid creating
* duplicate credentials during registration.
*/
- @Nonnull @NonnullElements final Set<PublicKeyCredentialDescriptor> excludeCredentials;
+ @Nonnull @NonnullElements private final Set<PublicKeyCredentialDescriptor> excludeCredentials;
/**
* The username (user.name) of the user that is the subject of this authentication.
*/
- @Nonnull @NotEmpty final String username;
+ @Nonnull @NotEmpty private final String username;
/**
* The user.displayName supplied to the authenticator during registration. A human-palatable name for the user
* account, intended only for display
*/
- @Nonnull @NotEmpty final String displayName;
+ @Nonnull @NotEmpty private final String displayName;
/** The authenticator attachment requirement. {@code null} would represent either possibility.*/
- @Nullable final AuthenticatorAttachment authenticatorAttachment;
+ @Nullable private final AuthenticatorAttachment authenticatorAttachment;
/** The requirement on registering a ResidentKey. Also know as a discoverable credential.*/
- @Nonnull final ResidentKeyRequirement residentKeyRequirement;
+ @Nonnull private final ResidentKeyRequirement residentKeyRequirement;
/** The user.id supplied to the authenticator during registration. As generated by the IdP.*/
- @Nonnull final byte[] userId;
+ @Nonnull private final byte[] userId;
/** The attestation conveyance preference.*/
@Nonnull private final AttestationConveyancePreference attestationConveyancePreference;
@@ -105,7 +105,7 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
/**
- * Get the username
+ * Get the username.
*
* @return the username.
*/
@@ -314,8 +314,8 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
/** Builder class.*/
public static final class Builder implements IUserVerificationRequirementStage, IChallengeStage,
- IExcludeCredentialsStage, IUsernameStage, IDisplayNameStage, IResidentKeyRequirementStage, IUserHandleStage,
- IAttestationConveyancePreferenceStage, IBuildStage {
+ IExcludeCredentialsStage, IUsernameStage, IDisplayNameStage, IResidentKeyRequirementStage,
+ IUserHandleStage, IAttestationConveyancePreferenceStage, IBuildStage {
/** Does the authentication/registration require user verification.*/
private UserVerificationRequirement userVerificationRequirement;
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/RegistrationResult.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/RegistrationResult.java
index 397e2c9..e16c7d7 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/RegistrationResult.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/RegistrationResult.java
@@ -34,11 +34,11 @@ import net.shibboleth.shared.logic.Constraint;
/**
* The result of a call to {@link WebAuthnAuthenticationClient#validateAuthenticatorAttestationResponse
- * (com.yubico.webauthn.data.PublicKeyCredentialCreationOptions, com.yubico.webauthn.data.PublicKeyCredential)}
+ * (com.yubico.webauthn.data.PublicKeyCredentialCreationOptions, com.yubico.webauthn.data.PublicKeyCredential)}.
*/
@ThreadSafe
@Immutable
-public class RegistrationResult {
+public final class RegistrationResult {
/**
* Is the attestation signature valid. Does it link to a trusted root attestation.
@@ -200,6 +200,7 @@ public class RegistrationResult {
/**
* Set the attestation type.
+ *
* @param attestationType the attestation type
* @return this builder
*/
@@ -209,7 +210,7 @@ public class RegistrationResult {
/** Builder stage.*/
public interface ICredentialStage {
/**
- * Set the public key credential attestation response
+ * Set the public key credential attestation response.
*
* @param credential the attestation response
* @return this builder
@@ -219,7 +220,7 @@ public class RegistrationResult {
}
/**
- * Builder stage
+ * Builder stage.
*/
public interface IBuildStage {
/**
@@ -256,8 +257,8 @@ public class RegistrationResult {
}
@Override
- public IAttestationTypeStage withAttestationTrusted(final boolean attestationTrusted) {
- this.attestationTrusted = attestationTrusted;
+ public IAttestationTypeStage withAttestationTrusted(final boolean attTrusted) {
+ attestationTrusted = attTrusted;
return this;
}
@@ -269,8 +270,8 @@ public class RegistrationResult {
@Override
public IBuildStage withCredential(
- @Nonnull final PublicKeyCredential<AuthenticatorAttestationResponse, ClientRegistrationExtensionOutputs>
- cred) {
+ @Nonnull
+ final PublicKeyCredential<AuthenticatorAttestationResponse, ClientRegistrationExtensionOutputs> cred){
this.credential = Constraint.isNotNull(cred, "Credential cannot be null");
return this;
}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/WebAuthnRegistrationEventIds.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/WebAuthnRegistrationEventIds.java
index 70d927d..f67a93f 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/WebAuthnRegistrationEventIds.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/WebAuthnRegistrationEventIds.java
@@ -25,11 +25,6 @@ import net.shibboleth.shared.annotation.constraint.NotEmpty;
*/
public final class WebAuthnRegistrationEventIds {
- /** Private constructor.*/
- private WebAuthnRegistrationEventIds() {
-
- }
-
/** Registration failed. */
@Nonnull @NotEmpty public static final String INVALID_REGISTRATION = "InvalidRegistration";
@@ -43,6 +38,11 @@ public final class WebAuthnRegistrationEventIds {
* A general event ID that is signalled if there is an issue performing an 'admin' action (e.g., registration or
* user management).
*/
- @Nonnull @NotEmpty public static final String INVALID_ADMIN_ACTION = "InvalidAdminAction";
+ @Nonnull @NotEmpty public static final String INVALID_ADMIN_ACTION = "InvalidAdminAction";
+
+ /** Private constructor.*/
+ private WebAuthnRegistrationEventIds() {
+
+ }
}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/audit/WebAuthnAuditFields.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/audit/WebAuthnAuditFields.java
index 68eebfd..96b75e0 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/audit/WebAuthnAuditFields.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/audit/WebAuthnAuditFields.java
@@ -19,15 +19,10 @@ import javax.annotation.Nonnull;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
/**
- * Audit fields for WebAuthn
+ * Audit fields for WebAuthn.
*/
public final class WebAuthnAuditFields {
-
- /** Private constructor.*/
- private WebAuthnAuditFields() {
-
- }
-
+
/** The user.id of the currently authenticated user. */
@Nonnull @NotEmpty public static final String USERID = "WebAuthnUID";
@@ -51,5 +46,12 @@ public final class WebAuthnAuditFields {
/** The Id of the credential that has been added.*/
@Nonnull @NotEmpty public static final String CRED_ADDED = "WebAuthnAdminCA";
+
+
+ /** Private constructor.*/
+ private WebAuthnAuditFields() {
+
+ }
+
}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/AssertionResult.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/AssertionResult.java
index c184192..8e27b22 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/AssertionResult.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/AssertionResult.java
@@ -21,11 +21,11 @@ import net.shibboleth.shared.annotation.constraint.NotEmpty;
/**
* The result of calling {@link WebAuthnAuthenticationClient#validateAuthenticatorAssertionResponse(String, byte[],
- * com.yubico.webauthn.data.PublicKeyCredentialRequestOptions, com.yubico.webauthn.data.PublicKeyCredential)}
+ * com.yubico.webauthn.data.PublicKeyCredentialRequestOptions, com.yubico.webauthn.data.PublicKeyCredential)}.
*
* <p>Note, an instantiatable version of Yuico's AssertionResult.</p>
*/
-public class AssertionResult {
+public final class AssertionResult {
/** Is this assertion valid?*/
private final boolean success;
@@ -145,7 +145,8 @@ public class AssertionResult {
*/
public interface IUserIdStage {
/**
- * Set the user.id
+ * Set the user.id.
+ *
* @param userId the user.id
* @return the next stage
*/
@@ -157,7 +158,8 @@ public class AssertionResult {
*/
public interface IBuildStage {
/**
- * Build the result
+ * Build the result.
+ *
* @return an assertion result
*/
public AssertionResult build();
@@ -186,26 +188,26 @@ public class AssertionResult {
}
@Override
- public IUsernameStage withSuccess(final boolean success) {
- this.success = success;
+ public IUsernameStage withSuccess(final boolean successIn) {
+ success = successIn;
return this;
}
@Override
- public ISignatureCounterValidStage withUsername(final String username) {
- this.username = username;
+ public ISignatureCounterValidStage withUsername(final String uname) {
+ username = uname;
return this;
}
@Override
- public IUserIdStage withSignatureCounterValid(final boolean signatureCounterValid) {
- this.signatureCounterValid = signatureCounterValid;
+ public IUserIdStage withSignatureCounterValid(final boolean sigCounterValid) {
+ signatureCounterValid = sigCounterValid;
return this;
}
@Override
- public IBuildStage withUserId(final byte[] userId) {
- this.userId = userId;
+ public IBuildStage withUserId(final byte[] id) {
+ userId = id;
return this;
}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/BaseOptionsParameters.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/BaseOptionsParameters.java
index d1afa10..8e307ab 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/BaseOptionsParameters.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/BaseOptionsParameters.java
@@ -26,23 +26,23 @@ import net.shibboleth.shared.logic.Constraint;
public abstract class BaseOptionsParameters {
/** Does the authentication/registration require user verification.*/
- @Nonnull protected final UserVerificationRequirement userVerificationRequirement;
+ @Nonnull private final UserVerificationRequirement userVerificationRequirement;
/** The challenge sent to the authenticator in authentication or registration ceremonies.*/
- @Nonnull protected final byte[] challenge;
+ @Nonnull private final byte[] challenge;
/**
* Constructor.
*
- * @param userVerificationRequirement the user verification requirement
- * @param challenge the challenge
+ * @param uvRequirement the user verification requirement
+ * @param challengeIn the challenge
*/
- protected BaseOptionsParameters(@Nonnull final UserVerificationRequirement userVerificationRequirement,
- @Nonnull final byte[] challenge) {
+ protected BaseOptionsParameters(@Nonnull final UserVerificationRequirement uvRequirement,
+ @Nonnull final byte[] challengeIn) {
super();
- this.userVerificationRequirement =
- Constraint.isNotNull(userVerificationRequirement, "UserVerificationRequirement can not be null");
- this.challenge = Constraint.isNotNull(challenge, "Challenge can not be null");
+ userVerificationRequirement =
+ Constraint.isNotNull(uvRequirement, "UserVerificationRequirement can not be null");
+ challenge = Constraint.isNotNull(challengeIn, "Challenge can not be null");
}
/**
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/CredentialRequestOptionsParameters.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/CredentialRequestOptionsParameters.java
index 75a88c2..9e0c303 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/CredentialRequestOptionsParameters.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/CredentialRequestOptionsParameters.java
@@ -30,7 +30,7 @@ import net.shibboleth.shared.logic.Constraint;
/**
* The parameters required to build a PublicKeyCredentialRequestOptions.
*/
-public class CredentialRequestOptionsParameters extends BaseOptionsParameters {
+public final class CredentialRequestOptionsParameters extends BaseOptionsParameters {
/**
* Credentials that have already been registered with the credential repository. The authenticator should use
@@ -64,7 +64,8 @@ public class CredentialRequestOptionsParameters extends BaseOptionsParameters {
}
/**
- * Create a new builder
+ * Create a new builder.
+ *
* @return a builder
*/
public static IUserVerificationRequirementStage builder() {
@@ -110,7 +111,7 @@ public class CredentialRequestOptionsParameters extends BaseOptionsParameters {
/** Build the options.*/
public interface IBuildStage {
/**
- * Build the request options parameters
+ * Build the request options parameters.
*
* @return the parameters
*/
@@ -136,20 +137,20 @@ public class CredentialRequestOptionsParameters extends BaseOptionsParameters {
@Override
public IChallengeStage withUserVerificationRequirement(
- @Nonnull final UserVerificationRequirement userVerificationRequirement) {
- this.userVerificationRequirement = userVerificationRequirement;
+ @Nonnull final UserVerificationRequirement uvRequirement) {
+ userVerificationRequirement = uvRequirement;
return this;
}
@Override
- public IAllowCredentialsStage withChallenge(@Nonnull final byte[] challenge) {
- this.challenge = challenge;
+ public IAllowCredentialsStage withChallenge(@Nonnull final byte[] challengeIn) {
+ challenge = challengeIn;
return this;
}
@Override
- public IBuildStage withAllowCredentials(@Nonnull final List<PublicKeyCredentialDescriptor> allowCredentials) {
- this.allowCredentials = allowCredentials;
+ public IBuildStage withAllowCredentials(@Nonnull final List<PublicKeyCredentialDescriptor> allowCreds) {
+ allowCredentials = allowCreds;
return this;
}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/WebAuthnAuthenticationEventIds.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/WebAuthnAuthenticationEventIds.java
index b9b26e6..f08b062 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/WebAuthnAuthenticationEventIds.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/WebAuthnAuthenticationEventIds.java
@@ -25,11 +25,6 @@ import net.shibboleth.shared.annotation.constraint.NotEmpty;
*/
public final class WebAuthnAuthenticationEventIds {
- /** Private constructor.*/
- private WebAuthnAuthenticationEventIds() {
-
- }
-
/** The user has no registered WebAuthn credentials. */
@Nonnull @NotEmpty
public static final String NO_REGISTERED_WEBAUTHN_CREDENTIALS = "NoRegisteredWebAuthnCredentials";
@@ -38,5 +33,9 @@ public final class WebAuthnAuthenticationEventIds {
@Nonnull @NotEmpty
public static final String USER_HANDLE_NOT_REGISTERED = "UserHandleNotRegistered";
+ /** Private constructor.*/
+ private WebAuthnAuthenticationEventIds() {
+
+ }
}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClient.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClient.java
index 436598b..740c694 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClient.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClient.java
@@ -1,3 +1,17 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
package net.shibboleth.idp.plugin.authn.webauthn.client;
import javax.annotation.Nonnull;
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClientFactory.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClientFactory.java
index d8a0bd5..5b57afc 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClientFactory.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClientFactory.java
@@ -1,3 +1,17 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
package net.shibboleth.idp.plugin.authn.webauthn.client;
import javax.annotation.Nonnull;
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/BaseWebAuthnContext.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/BaseWebAuthnContext.java
index 341ba18..d4c21f9 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/BaseWebAuthnContext.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/BaseWebAuthnContext.java
@@ -64,7 +64,7 @@ public class BaseWebAuthnContext extends BaseContext {
* @return true iff existing credentials are available, false otherwise.
*/
public boolean isWebAuthnAvailable() {
- return (existingCredentials != null && !existingCredentials.isEmpty());
+ return existingCredentials != null && !existingCredentials.isEmpty();
}
/**
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnAuthenticationContext.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnAuthenticationContext.java
index 7994340..fd715b6 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnAuthenticationContext.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnAuthenticationContext.java
@@ -1,3 +1,17 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
package net.shibboleth.idp.plugin.authn.webauthn.context;
import javax.annotation.Nonnull;
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationContext.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationContext.java
index d2dc554..dfb822a 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationContext.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationContext.java
@@ -1,3 +1,17 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
package net.shibboleth.idp.plugin.authn.webauthn.context;
import javax.annotation.Nonnull;
@@ -147,7 +161,7 @@ public final class WebAuthnRegistrationContext extends BaseWebAuthnContext {
/**
* Get the credential public key which is the result of registration of a new key pair generated
- * by the authenticator
+ * by the authenticator.
*
* @return Returns the registrationResult.
*/
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsDiscoverableCredentialRequired.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsDiscoverableCredentialRequired.java
index 7ac91fd..24609e0 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsDiscoverableCredentialRequired.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsDiscoverableCredentialRequired.java
@@ -54,8 +54,8 @@ public class IsDiscoverableCredentialRequired implements Predicate<ProfileReques
return false;
}
final boolean discoverableCredentialRequired = webauthnContext.getUsername() == null;
- log.debug("{}", discoverableCredentialRequired ? "Usernameless (discoverable/passkey) authentication required" :
- "Passwordless authentication required (username supplied) for '"+webauthnContext.getUsername()+"'");
+ log.debug("{}", discoverableCredentialRequired ? "Usernameless (discoverable/passkey) authentication required"
+ : "Passwordless authentication required (username supplied) for '"+webauthnContext.getUsername()+"'");
return discoverableCredentialRequired;
}
}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsSecondFactor.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsSecondFactor.java
index ba05c17..687c853 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsSecondFactor.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsSecondFactor.java
@@ -180,8 +180,8 @@ public class IsSecondFactor extends AbstractInitializableComponent implements Pr
foundFactor.ifPresent(factor -> log.trace("Found acceptable previous factor '{}'", factor));
if (username != null && foundFactor.isPresent()) {
- log.debug("Principal name '{}' found, and previous factor '{}' accepted, assuming second factor usage", username,
- foundFactor.get());
+ log.debug("Principal name '{}' found, and previous factor '{}' accepted, assuming second factor usage",
+ username, foundFactor.get());
return true;
} else {
log.debug("Request did not contain an acceptable previous factor, assuming first factor usage");
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsUsernameCollectionRequired.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsUsernameCollectionRequired.java
index 1c2ae70..3e3f171 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsUsernameCollectionRequired.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/logic/IsUsernameCollectionRequired.java
@@ -30,7 +30,8 @@ import net.shibboleth.shared.primitive.LoggerFactory;
/**
* A predicate that determines if a username already exists in the authentication context.
*/
-public class IsUsernameCollectionRequired extends AbstractInitializableComponent implements Predicate<ProfileRequestContext> {
+public class IsUsernameCollectionRequired extends AbstractInitializableComponent
+ implements Predicate<ProfileRequestContext> {
/** Class logger. */
@Nonnull private final Logger log = LoggerFactory.getLogger(IsUsernameCollectionRequired.class);
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/navigate/AbstractAttributeContextUserIdentityStrategy.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/navigate/AbstractAttributeContextUserIdentityStrategy.java
index e8cbbe6..45ea040 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/navigate/AbstractAttributeContextUserIdentityStrategy.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/navigate/AbstractAttributeContextUserIdentityStrategy.java
@@ -38,8 +38,8 @@ import net.shibboleth.shared.primitive.LoggerFactory;
*
* @param <T> the type of attribute value to return
*/
-public abstract class AbstractAttributeContextUserIdentityStrategy<T> extends AbstractIdentifiableInitializableComponent
- implements Function<ProfileRequestContext, T> {
+public abstract class AbstractAttributeContextUserIdentityStrategy<T>
+ extends AbstractIdentifiableInitializableComponent implements Function<ProfileRequestContext, T> {
/** Class logger. */
@Nonnull private final Logger log = LoggerFactory.getLogger(AbstractAttributeContextUserIdentityStrategy.class);
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/WebAuthnAuthenticationClientException.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/WebAuthnAuthenticationClientException.java
index b1744ac..b2562c0 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/WebAuthnAuthenticationClientException.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/WebAuthnAuthenticationClientException.java
@@ -1,3 +1,17 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
package net.shibboleth.idp.plugin.authn.webauthn.exception;
/**
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/principal/WebAuthnUserIdPrinicpal.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/principal/WebAuthnUserIdPrinicpal.java
index 8ac2dec..ba43b0c 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/principal/WebAuthnUserIdPrinicpal.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/principal/WebAuthnUserIdPrinicpal.java
@@ -26,7 +26,7 @@ import net.shibboleth.shared.codec.EncodingException;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.logic.ConstraintViolationException;
-/** Principal based on the WebAuthn user.id base64 encoded*/
+/** Principal based on the WebAuthn user.id base64 encoded.*/
public class WebAuthnUserIdPrinicpal implements CloneablePrincipal {
/** The username. */
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/CredentialRegistration.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/CredentialRegistration.java
index 84e9d40..c30698d 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/CredentialRegistration.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/CredentialRegistration.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -53,7 +50,7 @@ import net.shibboleth.shared.logic.Constraint;
@ThreadSafe
@Immutable
@JsonDeserialize(builder = CredentialRegistration.Builder.class)
-public class CredentialRegistration {
+public final class CredentialRegistration {
/** The users identity. */
@Nonnull private final UserIdentity userIdentity;
@@ -163,7 +160,7 @@ public class CredentialRegistration {
}
/**
- * Get the registered credential
+ * Get the registered credential.
*
* @return the registered credential
*/
@@ -276,12 +273,15 @@ public class CredentialRegistration {
/** {@inheritDoc} */
@Override
public boolean equals(final Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
final CredentialRegistration other = (CredentialRegistration) obj;
return Objects.equals(credential, other.credential);
}
@@ -309,7 +309,7 @@ public class CredentialRegistration {
}
/**
- * Builder stage
+ * Builder stage.
* @return the next stage
*/
public static IUserIdentityStage builder() {
@@ -341,7 +341,7 @@ public class CredentialRegistration {
/** Builder stage.*/
public interface IRegistrationTimeStage {
/**
- * Set the time the registration took place
+ * Set the time the registration took place.
*
* @param registrationTime the registration time
* @return the next builder stage
@@ -396,7 +396,7 @@ public class CredentialRegistration {
@Nonnull public IBuildStage withUserVerified(boolean userVerified);
/**
- * Build this credential registration
+ * Build this credential registration.
* @return a credential registration
*/
@Nonnull public CredentialRegistration build();
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnModule.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnModule.java
index 0f23b74..0887363 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnModule.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnModule.java
@@ -12,7 +12,6 @@
* limitations under the License.
*/
-
package net.shibboleth.idp.plugin.authn.webauthn;
import java.io.IOException;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AddDisplayName.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AddDisplayName.java
index a1e2e87..583f404 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AddDisplayName.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AddDisplayName.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AddUserId.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AddUserId.java
index 1dbb634..5befab7 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AddUserId.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AddUserId.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -72,6 +69,12 @@ public class AddUserId extends AbstractWebAuthnAction<WebAuthnRegistrationContex
/** The credential repository to use.*/
@NonnullAfterInit private WebAuthnCredentialRepository repository;
+ /** Constructor. */
+ public AddUserId() {
+ super(new ChildContextLookup<>(WebAuthnRegistrationContext.class));
+ userIdGeneratorStrategy = new RandomUserIdGenerator();
+ }
+
/** {@inheritDoc} */
@Override
protected void doInitialize() throws ComponentInitializationException {
@@ -82,12 +85,6 @@ public class AddUserId extends AbstractWebAuthnAction<WebAuthnRegistrationContex
}
}
- /** Constructor. */
- public AddUserId() {
- super(new ChildContextLookup<>(WebAuthnRegistrationContext.class));
- userIdGeneratorStrategy = new RandomUserIdGenerator();
- }
-
/**
* Set the strategy used to generate the user.id.
*
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AdminDeletePublicKeyCredential.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AdminDeletePublicKeyCredential.java
index 7af5e4c..ddf19b7 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AdminDeletePublicKeyCredential.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AdminDeletePublicKeyCredential.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AllowCurrentUserAccessPredicate.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AllowCurrentUserAccessPredicate.java
index e2ee889..398389e 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AllowCurrentUserAccessPredicate.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AllowCurrentUserAccessPredicate.java
@@ -37,8 +37,8 @@ import net.shibboleth.shared.primitive.LoggerFactory;
/**
* An access control predicate that should implement comparison logic to allow access only to authenticated users who
- * initiated the WebAuthn registration/authentication process. If the authenticated user is not the same as the user who
- * started the registration/authentication process (as determined by the initial username collection step), access
+ * initiated the WebAuthn registration/authentication process. If the authenticated user is not the same as the user
+ * who started the registration/authentication process (as determined by the initial username collection step), access
* should be denied.
*
* <p>It is important to prevent users from changing their username between the registration and authentication
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java
index d63809f..4c720e5 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java
@@ -12,7 +12,6 @@
* limitations under the License.
*/
-
package net.shibboleth.idp.plugin.authn.webauthn.admin.impl;
import java.util.Objects;
@@ -61,6 +60,7 @@ public class CreatePublicKeyCredentialCreationOptions extends AbstractWebAuthnAc
super(new ChildContextLookup<>(WebAuthnRegistrationContext.class));
}
+ // Checkstyle: MethodLength OFF
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
@Nonnull final WebAuthnRegistrationContext context) {
@@ -145,5 +145,7 @@ public class CreatePublicKeyCredentialCreationOptions extends AbstractWebAuthnAc
return;
}
}
+
+ // Checkstyle: MethodLength ON
}
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/DeletePublicKeyCredential.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/DeletePublicKeyCredential.java
index 026cd45..601dd03 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/DeletePublicKeyCredential.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/DeletePublicKeyCredential.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -54,7 +51,12 @@ public class DeletePublicKeyCredential extends AbstractWebAuthnAuditingAction<We
private final Logger log = LoggerFactory.getLogger(DeletePublicKeyCredential.class);
/** The credential repository to use.*/
- @NonnullAfterInit private WebAuthnCredentialRepository repository;
+ @NonnullAfterInit private WebAuthnCredentialRepository repository;
+
+ /** Constructor.*/
+ protected DeletePublicKeyCredential() {
+ super(new ChildContextLookup<>(WebAuthnRegistrationContext.class));
+ }
/** {@inheritDoc} */
@Override
@@ -65,11 +67,6 @@ public class DeletePublicKeyCredential extends AbstractWebAuthnAuditingAction<We
throw new ComponentInitializationException("Credential repository can not be null");
}
}
-
- /** Constructor.*/
- protected DeletePublicKeyCredential() {
- super(new ChildContextLookup<>(WebAuthnRegistrationContext.class));
- }
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractKeyRemovalInformationFromFormRequest.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractKeyRemovalInformationFromFormRequest.java
index 7c49937..859f9dd 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractKeyRemovalInformationFromFormRequest.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractKeyRemovalInformationFromFormRequest.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -77,6 +74,8 @@ public class ExtractKeyRemovalInformationFromFormRequest extends AbstractProfile
}
/**
+ * Set the context setting consumer action.
+ *
* @param consumer The contextSettingConsumer to set.
*/
public void setContextSettingConsumer(final BiConsumer<ProfileRequestContext, byte[]> consumer) {
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractPublicKeyCredentialAttestationFromFormRequest.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractPublicKeyCredentialAttestationFromFormRequest.java
index 2b1b1f4..b393eb9 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractPublicKeyCredentialAttestationFromFormRequest.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractPublicKeyCredentialAttestationFromFormRequest.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -14,7 +11,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package net.shibboleth.idp.plugin.authn.webauthn.admin.impl;
import java.io.IOException;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractUsernameSearchFromFormRequest.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractUsernameSearchFromFormRequest.java
index 02de66a..a0aaa03 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractUsernameSearchFromFormRequest.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractUsernameSearchFromFormRequest.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/LookupCredentialsForUser.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/LookupCredentialsForUser.java
index cfd5273..a9d4dab 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/LookupCredentialsForUser.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/LookupCredentialsForUser.java
@@ -50,6 +50,11 @@ public class LookupCredentialsForUser extends AbstractWebAuthnAction<WebAuthnMan
/** The credential repository to use.*/
@NonnullAfterInit private WebAuthnCredentialRepository repository;
+ /** Constructor. */
+ public LookupCredentialsForUser() {
+ super(new ChildContextLookup<>(WebAuthnManagementContext.class));
+ }
+
/** {@inheritDoc} */
@Override
protected void doInitialize() throws ComponentInitializationException {
@@ -59,11 +64,6 @@ public class LookupCredentialsForUser extends AbstractWebAuthnAction<WebAuthnMan
throw new ComponentInitializationException("Credential repository can not be null");
}
}
-
- /** Constructor. */
- public LookupCredentialsForUser() {
- super(new ChildContextLookup<>(WebAuthnManagementContext.class));
- }
/** {@inheritDoc} */
@Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ManagementContextCredentialRemovalConsumer.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ManagementContextCredentialRemovalConsumer.java
index a973697..961a41e 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ManagementContextCredentialRemovalConsumer.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ManagementContextCredentialRemovalConsumer.java
@@ -36,7 +36,8 @@ public class ManagementContextCredentialRemovalConsumer extends AbstractIdentifi
implements BiConsumer<ProfileRequestContext, byte[]> {
/** Class logger. */
- @Nonnull @NotEmpty private final Logger log = LoggerFactory.getLogger(ManagementContextCredentialRemovalConsumer.class);
+ @Nonnull @NotEmpty
+ private final Logger log = LoggerFactory.getLogger(ManagementContextCredentialRemovalConsumer.class);
/** Lookup strategy to locate the webauthn management context. */
@Nonnull
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/RegistrationContextCredentialRemovalConsumer.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/RegistrationContextCredentialRemovalConsumer.java
index 3187b2e..7399363 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/RegistrationContextCredentialRemovalConsumer.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/RegistrationContextCredentialRemovalConsumer.java
@@ -24,7 +24,6 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationContext;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
@@ -36,7 +35,8 @@ public class RegistrationContextCredentialRemovalConsumer extends AbstractIdenti
implements BiConsumer<ProfileRequestContext, byte[]> {
/** Class logger. */
- @Nonnull @NotEmpty private final Logger log = LoggerFactory.getLogger(RegistrationContextCredentialRemovalConsumer.class);
+ @Nonnull
+ private final Logger log = LoggerFactory.getLogger(RegistrationContextCredentialRemovalConsumer.class);
/** Lookup strategy to locate the webauthn registration context. */
@Nonnull
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/StorePublicKeyCredential.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/StorePublicKeyCredential.java
index 10080a4..39be089 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/StorePublicKeyCredential.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/StorePublicKeyCredential.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -71,6 +68,12 @@ public class StorePublicKeyCredential extends AbstractWebAuthnAuditingAction<Web
/** The credential repository to use.*/
@NonnullAfterInit private WebAuthnCredentialRepository repository;
+
+ /** Constructor. */
+ protected StorePublicKeyCredential() {
+ super(new ChildContextLookup<>(WebAuthnRegistrationContext.class));
+ }
+
/** {@inheritDoc} */
@Override
protected void doInitialize() throws ComponentInitializationException {
@@ -79,13 +82,9 @@ public class StorePublicKeyCredential extends AbstractWebAuthnAuditingAction<Web
if (repository == null) {
throw new ComponentInitializationException("Credential repository can not be null");
}
- }
-
- /** Constructor. */
- protected StorePublicKeyCredential() {
- super(new ChildContextLookup<>(WebAuthnRegistrationContext.class));
}
+ // Checkstyle: MethodLength OFF
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
@Nonnull final WebAuthnRegistrationContext context) {
@@ -173,6 +172,8 @@ public class StorePublicKeyCredential extends AbstractWebAuthnAuditingAction<Web
}
+
+ // Checkstyle: MethodLength ON
/**
* Find attestation metadata for the authenticator.
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ValidateAuthenticatorAttestationResponse.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ValidateAuthenticatorAttestationResponse.java
index a5dcc9e..d78dbce 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ValidateAuthenticatorAttestationResponse.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ValidateAuthenticatorAttestationResponse.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/audit/impl/AbstractWebAuthnAuditingAction.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/audit/impl/AbstractWebAuthnAuditingAction.java
index e494954..3b8572e 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/audit/impl/AbstractWebAuthnAuditingAction.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/audit/impl/AbstractWebAuthnAuditingAction.java
@@ -38,6 +38,8 @@ import net.shibboleth.shared.logic.Constraint;
/**
* A base class for actions that include audit logging support.
+ *
+ * @param <T> the WebAuthn context type
*/
public abstract class AbstractWebAuthnAuditingAction<T> extends AbstractWebAuthnAction<T> {
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebAuthnAuthenticationClient.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebAuthnAuthenticationClient.java
index 59c4e85..650eb33 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebAuthnAuthenticationClient.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebAuthnAuthenticationClient.java
@@ -98,7 +98,7 @@ public class YubicoWebAuthnAuthenticationClient implements WebAuthnAuthenticatio
.rpId(rp.getIdentity().getId())
.allowCredentials(Optional.ofNullable(requestParams.getAllowCredentials()))
.userVerification(requestParams.getUserVerificationRequirement())
- .timeout(Optional.of(60000l))
+ .timeout(Optional.of(60000L))
.build();
if (request == null) {
throw new WebAuthnAuthenticationClientException("Unable to build public key credential request options");
@@ -207,7 +207,8 @@ public class YubicoWebAuthnAuthenticationClient implements WebAuthnAuthenticatio
try {
log.trace("Public Key Credential to validate '{}'", authenticatorAttestationResponse);
- final com.yubico.webauthn.RegistrationResult result = rp.finishRegistration(FinishRegistrationOptions.builder()
+ final com.yubico.webauthn.RegistrationResult result =
+ rp.finishRegistration(FinishRegistrationOptions.builder()
.request(publicKeyCredentialCreationOptions)
.response(authenticatorAttestationResponse)
.build());
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnClientFactory.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnClientFactory.java
index f62a769..9c2ad7f 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnClientFactory.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnClientFactory.java
@@ -173,6 +173,7 @@ public class YubicoWebauthnClientFactory extends AbstractInitializableComponent
"PreferredPublickeyParams can not be null");
}
+ // Checkstyle: ReturnCount OFF
/**
* Set the ordered list of preferred public key credential parameters to send to the authenticator during
* registration.
@@ -209,6 +210,7 @@ public class YubicoWebauthnClientFactory extends AbstractInitializableComponent
.collect(CollectionSupport.nonnullCollector(Collectors.toList()))
.get());
}
+ // Checkstyle: ReturnCount ON
/**
* Get the ordered list of preferred public key credential parameters to send to the authenticator during
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAction.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAction.java
index 42efe84..24034fb 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAction.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAction.java
@@ -49,6 +49,8 @@ import net.shibboleth.shared.primitive.LoggerFactory;
* @event {@link EventIds#INVALID_PROFILE_CTX}
* @pre <pre>ProfileRequestContext.getSubcontext(ProfileRequestContext.class) != null</pre>
*
+ * @param <T> the WebAuthn context type
+ *
*/
public class AbstractWebAuthnAction<T> extends AbstractProfileAction {
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ExtractPublicKeyCredentialAssertionFromFormRequest.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ExtractPublicKeyCredentialAssertionFromFormRequest.java
index 1e5be8d..cf71e64 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ExtractPublicKeyCredentialAssertionFromFormRequest.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ExtractPublicKeyCredentialAssertionFromFormRequest.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -58,7 +55,8 @@ public class ExtractPublicKeyCredentialAssertionFromFormRequest
@Nonnull @NotEmpty public static final String DEFAULT_PARAMETER_NAME = "publicKeyCredential";
/** Class logger. */
- @Nonnull private final Logger log = LoggerFactory.getLogger(ExtractPublicKeyCredentialAssertionFromFormRequest.class);
+ @Nonnull
+ private final Logger log = LoggerFactory.getLogger(ExtractPublicKeyCredentialAssertionFromFormRequest.class);
/** Name of public key credential with the assertion response parameter. */
@NonnullAfterInit @NotEmpty private String publicKeyCredentialAssertionParameterName;
@@ -124,8 +122,8 @@ public class ExtractPublicKeyCredentialAssertionFromFormRequest
log.trace("{} PublicKeyCredential authenticator assertion response: '{}'",getLogPrefix(), pkCredAssertionJson);
try {
- final PublicKeyCredential<AuthenticatorAssertionResponse, ClientAssertionExtensionOutputs> pkCredAssertion =
- PublicKeyCredential.parseAssertionResponseJson(pkCredAssertionJson);
+ final PublicKeyCredential<AuthenticatorAssertionResponse, ClientAssertionExtensionOutputs> pkCredAssertion
+ = PublicKeyCredential.parseAssertionResponseJson(pkCredAssertionJson);
context.setPublicKeyCredentialAssertionResponse(pkCredAssertion);
} catch (final IOException e) {
log.debug("{} Could not parse PublicKeyCredential response from request parameter '{}'",
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java
index 156ee37..01bfefe 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java
@@ -1,10 +1,7 @@
/*
- * 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
+ * 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java
index b7b5b0a..e48032f 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java
@@ -68,6 +68,14 @@ public class LookupRegisteredCredentials extends AbstractWebAuthnAction<BaseWebA
/** The credential repository to use.*/
@NonnullAfterInit private WebAuthnCredentialRepository repository;
+
+ /** Constructor. */
+ public LookupRegisteredCredentials() {
+ super(new ChildContextLookup<>(BaseWebAuthnContext.class).
+ compose(new ChildContextLookup<>(AuthenticationContext.class)));
+ noCredentialsEventId = WebAuthnAuthenticationEventIds.NO_REGISTERED_WEBAUTHN_CREDENTIALS;
+ triggerEventOnNoCredentialsPredicate = PredicateSupport.alwaysFalse();
+ }
/** {@inheritDoc} */
@Override
@@ -79,14 +87,6 @@ public class LookupRegisteredCredentials extends AbstractWebAuthnAction<BaseWebA
}
}
- /** Constructor. */
- public LookupRegisteredCredentials() {
- super(new ChildContextLookup<>(BaseWebAuthnContext.class).
- compose(new ChildContextLookup<>(AuthenticationContext.class)));
- noCredentialsEventId = WebAuthnAuthenticationEventIds.NO_REGISTERED_WEBAUTHN_CREDENTIALS;
- triggerEventOnNoCredentialsPredicate = PredicateSupport.alwaysFalse();
- }
-
/**
* Set a flag which triggers a custom event to be built if no credentials are found.
*
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandle.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandle.java
index e844b3f..96ff730 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandle.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandle.java
@@ -76,6 +76,15 @@ public class LookupRegisteredCredentialsFromUserHandle extends AbstractWebAuthnA
/** The credential repository to use.*/
@NonnullAfterInit private WebAuthnCredentialRepository repository;
+
+ /** Constructor. */
+ public LookupRegisteredCredentialsFromUserHandle() {
+ super(new ChildContextLookup<>(WebAuthnAuthenticationContext.class).
+ compose(new ChildContextLookup<>(AuthenticationContext.class)));
+ noCredentialsEventId = WebAuthnAuthenticationEventIds.NO_REGISTERED_WEBAUTHN_CREDENTIALS;
+ triggerEventOnNoCredentialsPredicate = PredicateSupport.alwaysFalse();
+ }
+
/** {@inheritDoc} */
@Override
protected void doInitialize() throws ComponentInitializationException {
@@ -85,15 +94,7 @@ public class LookupRegisteredCredentialsFromUserHandle extends AbstractWebAuthnA
throw new ComponentInitializationException("Credential repository can not be null");
}
}
-
- /** Constructor. */
- public LookupRegisteredCredentialsFromUserHandle() {
- super(new ChildContextLookup<>(WebAuthnAuthenticationContext.class).
- compose(new ChildContextLookup<>(AuthenticationContext.class)));
- noCredentialsEventId = WebAuthnAuthenticationEventIds.NO_REGISTERED_WEBAUTHN_CREDENTIALS;
- triggerEventOnNoCredentialsPredicate = PredicateSupport.alwaysFalse();
- }
-
+
/**
* Set a flag which triggers a custom event to be built if no credentials are found.
*
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java
index 723d5e7..c8df92a 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java
@@ -1,3 +1,17 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
package net.shibboleth.idp.plugin.authn.webauthn.impl;
import java.util.function.Function;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/metadata/FidoMetadataServiceFactory.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/metadata/FidoMetadataServiceFactory.java
index ddb56a4..2521a6f 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/metadata/FidoMetadataServiceFactory.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/metadata/FidoMetadataServiceFactory.java
@@ -65,7 +65,9 @@ public class FidoMetadataServiceFactory extends AbstractIdentifiableInitializabl
/** The HTTPS location of the metadata blob to download.*/
@GuardedBy("this") @Nullable private Resource metadataBlobUrl;
- /** The File location of the metadata blob. If this file is specified, metadata will never be downloaded over HTTP.*/
+ /**
+ * The File location of the metadata blob. If this file is specified, metadata will never be downloaded over HTTP.
+ */
@GuardedBy("this") @Nullable private Resource metadataBlobFile;
/** The expected set of legal headers on the FIDO metadata blob.*/
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialRegistrationSerializer.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialRegistrationSerializer.java
index 1584ae7..594cbaf 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialRegistrationSerializer.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialRegistrationSerializer.java
@@ -44,7 +44,7 @@ public class CredentialRegistrationSerializer extends AbstractInitializableCompo
implements StorageSerializer<Set<CredentialRegistration>> {
/** The CBOR friendly json mapper.*/
- protected ObjectMapper jsonMapper;
+ private final ObjectMapper jsonMapper;
/** Constructor.*/
public CredentialRegistrationSerializer() {
@@ -69,8 +69,8 @@ public class CredentialRegistrationSerializer extends AbstractInitializableCompo
@Override
@Nonnull @Unmodifiable @NotLive
- public Set<CredentialRegistration> deserialize(final long version, final String context, final String key, final String value,
- final Long expiration) throws IOException {
+ public Set<CredentialRegistration> deserialize(final long version, final String context, final String key,
+ final String value, final Long expiration) throws IOException {
checkComponentActive();
try {
//TODO the other properties?
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRespository.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRespository.java
index 7ce0a56..e8952ce 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRespository.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRespository.java
@@ -36,7 +36,6 @@ import org.opensaml.storage.StorageRecord;
import org.opensaml.storage.StorageSerializer;
import org.opensaml.storage.StorageService;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import com.yubico.webauthn.CredentialRepository;
import com.yubico.webauthn.RegisteredCredential;
@@ -56,6 +55,7 @@ import net.shibboleth.shared.component.AbstractIdentifiableInitializableComponen
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.logic.ConstraintViolationException;
+import net.shibboleth.shared.primitive.LoggerFactory;
/**
* A {@link CredentialRepository} adaptor for the Shibboleth {@link StorageService}.
@@ -72,12 +72,12 @@ import net.shibboleth.shared.logic.ConstraintViolationException;
public class IdPStorageServiceCredentialRespository extends AbstractIdentifiableInitializableComponent
implements WebAuthnCredentialRepository {
- /** Class logger.*/
- private static final Logger log = LoggerFactory.getLogger(IdPStorageServiceCredentialRespository.class);
-
/** The context to use to partition the storage records.*/
@Nonnull @NotEmpty private static final String STORAGE_CONTEXT = "net.shibboleth.idp.plugin.authn.webauthn";
+ /** Class logger.*/
+ @Nonnull private final Logger log = LoggerFactory.getLogger(IdPStorageServiceCredentialRespository.class);
+
/** Storage record serializer. */
@NonnullAfterInit private StorageSerializer<Set<CredentialRegistration>> serializer;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list