[java-opensaml] branch main updated: Add a dummy X509CredentialNameEvaluator.
Scott Cantor
cantor.2 at osu.edu
Mon Nov 14 16:04:57 UTC 2022
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=15549ee8d122df07fc28ce88794200318d2a4c60
The following commit(s) were added to refs/heads/main by this push:
new 15549ee8d Add a dummy X509CredentialNameEvaluator.
15549ee8d is described below
commit 15549ee8d122df07fc28ce88794200318d2a4c60
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Nov 14 11:04:54 2022 -0500
Add a dummy X509CredentialNameEvaluator.
---
.../impl/DummyX509CredentialNameEvaluator.java | 59 ++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/opensaml-security-impl/src/main/java/org/opensaml/security/x509/impl/DummyX509CredentialNameEvaluator.java b/opensaml-security-impl/src/main/java/org/opensaml/security/x509/impl/DummyX509CredentialNameEvaluator.java
new file mode 100644
index 000000000..610d176ae
--- /dev/null
+++ b/opensaml-security-impl/src/main/java/org/opensaml/security/x509/impl/DummyX509CredentialNameEvaluator.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+
+package org.opensaml.security.x509.impl;
+
+import java.util.Set;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.opensaml.security.SecurityException;
+import org.opensaml.security.x509.X509Credential;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A dummy implementation of {@link X509CredentialNameEvaluator} which always returns true.
+ *
+ * <p>This is a convenience class to assist with cases where it may be necessary to always
+ * have an instance of the interface but not always perform the checking.</p>
+ *
+ * @since 5.0.0
+ */
+public class DummyX509CredentialNameEvaluator implements X509CredentialNameEvaluator {
+
+ /** Class logger. */
+ @Nonnull private final Logger log = LoggerFactory.getLogger(DummyX509CredentialNameEvaluator.class);
+
+ /**
+ * {@inheritDoc}
+ *
+ * <p>
+ * If the set of trusted names is null or empty, or if no supported name types are configured to be
+ * checked, then the evaluation is considered successful.
+ * </p>
+ *
+ */
+ public boolean evaluate(@Nonnull final X509Credential credential, @Nullable final Set<String> trustedNames)
+ throws SecurityException {
+
+ log.debug("dummy name evaluator returning true");
+ return true;
+ }
+
+}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list