[java-oidc-common] branch main updated: JCOMOIDC-89 - Add a new CredentialFactoryBean type which allows null objects from createInstance

Phil Smart philip.smart at jisc.ac.uk
Wed Oct 25 12:05:32 UTC 2023


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

philsmart pushed a commit to branch main
in repository java-oidc-common.

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

The following commit(s) were added to refs/heads/main by this push:
     new d793b24  JCOMOIDC-89 - Add a new CredentialFactoryBean type which allows null     objects from createInstance
d793b24 is described below

commit d793b24476ec25c2ca17546daf92fe7800fd7c15
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Oct 25 13:05:25 2023 +0100

    JCOMOIDC-89 - Add a new CredentialFactoryBean type which allows null
        objects from createInstance
    
         - rename throwIfBeanIsNull to throwIfCredentialIsNull
    
    https://shibboleth.atlassian.net/browse/JCOMOIDC-89
---
 .../AbstractNullableCredentialFactoryBean.java     | 24 +++++++++++-----------
 .../credential/BasicJWKCredentialFactoryBean.java  |  4 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/oidc-common-crypto-api/src/main/java/net/shibboleth/oidc/security/credential/AbstractNullableCredentialFactoryBean.java b/oidc-common-crypto-api/src/main/java/net/shibboleth/oidc/security/credential/AbstractNullableCredentialFactoryBean.java
index 40bbce3..972fb19 100644
--- a/oidc-common-crypto-api/src/main/java/net/shibboleth/oidc/security/credential/AbstractNullableCredentialFactoryBean.java
+++ b/oidc-common-crypto-api/src/main/java/net/shibboleth/oidc/security/credential/AbstractNullableCredentialFactoryBean.java
@@ -54,31 +54,31 @@ public abstract class AbstractNullableCredentialFactoryBean<T extends Credential
     /** For logging: The description of the source of the configuration.*/
     @Nullable private String configDescription;
     
-    /** Should the factory throw an exception if the created bean instance is null?.*/
-    private boolean throwIfBeanIsNull;
+    /** Should the factory throw an exception if the created credential is null?.*/
+    private boolean throwIfCredentialIsNull;
     
     
     /** Constructor. */
     protected AbstractNullableCredentialFactoryBean() {
-        throwIfBeanIsNull = true;
+        throwIfCredentialIsNull = true;
     }    
     
     /**
-     * Should the factory throw an exception if the bean is null?
+     * Should the factory throw an exception if the credential is {@code null}?
      *  
      * @param flag the flag
      */
-    public void setThrowIfBeanIsNull(final boolean flag) {
-        throwIfBeanIsNull = flag;
+    public void setThrowIfCredentialIsNull(final boolean flag) {
+        throwIfCredentialIsNull = flag;
     }
     
     /**
-     * Get the flag to determine if the factory should throw an exception if the bean is {@code null}.
+     * Get the flag to determine if the factory should throw an exception if the credential is {@code null}.
      * 
-     * @return true if the factory should throw an exception if the bean is null, false otherwise. 
+     * @return true if the factory should throw an exception if the credential is null, false otherwise. 
      */
-    public boolean isThrowIfBeanIsNull() {
-        return throwIfBeanIsNull;
+    public boolean isThrowIfCredentialIsNull() {
+        return throwIfCredentialIsNull;
     }
 
    
@@ -183,8 +183,8 @@ public abstract class AbstractNullableCredentialFactoryBean<T extends Credential
     @Override
     @Nullable protected T doCreateInstance() throws Exception {
         final T credential = doCreateCredential();
-        if (credential == null && isThrowIfBeanIsNull()) {
-            log.debug("Credential was null, must not be null (if allowable set throwIfBeanIsNull "
+        if (credential == null && isThrowIfCredentialIsNull()) {
+            log.debug("Credential was null, must not be null (if allowable set throwIfCredentialIsNull "
                     + "to 'false')");
             throw new BeanCreationException("Null credential");
         }
diff --git a/oidc-common-crypto-api/src/main/java/net/shibboleth/oidc/security/credential/BasicJWKCredentialFactoryBean.java b/oidc-common-crypto-api/src/main/java/net/shibboleth/oidc/security/credential/BasicJWKCredentialFactoryBean.java
index e7ce913..dd83f4e 100644
--- a/oidc-common-crypto-api/src/main/java/net/shibboleth/oidc/security/credential/BasicJWKCredentialFactoryBean.java
+++ b/oidc-common-crypto-api/src/main/java/net/shibboleth/oidc/security/credential/BasicJWKCredentialFactoryBean.java
@@ -85,8 +85,8 @@ public class BasicJWKCredentialFactoryBean extends AbstractNullableCredentialFac
     @Deprecated(since="3.1.0", forRemoval=true)
     public void setFailIfResourceIsNull(final boolean flag) {
         DeprecationSupport.warn(ObjectType.METHOD, "setFailIfResourceIsNull",
-                "oidc-credentials.xml", "setFailIfBeanIsNull");
-        setThrowIfBeanIsNull(flag);
+                "oidc-credentials.xml", "setThrowIfCredentialIsNull");
+        setThrowIfCredentialIsNull(flag);
     }
 
     /**

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


More information about the commits mailing list