[java-oidc-common] branch main updated: Use BeanCreationException when a JWK credential can not be constructed

Phil Smart philip.smart at jisc.ac.uk
Fri Oct 20 12:58:38 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=22cb7c176d2e09a35235a132966fe49f82e0eb86

The following commit(s) were added to refs/heads/main by this push:
     new 22cb7c1  Use BeanCreationException when a JWK credential can not be constructed
22cb7c1 is described below

commit 22cb7c176d2e09a35235a132966fe49f82e0eb86
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Oct 20 13:58:31 2023 +0100

    Use BeanCreationException when a JWK credential can not be constructed
    
    Moving from the less specific FatalBeanException.
---
 .../oidc/security/credential/BasicJWKCredentialFactoryBean.java      | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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 0acd460..42b26fa 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
@@ -25,7 +25,6 @@ import javax.annotation.Nullable;
 import org.opensaml.spring.credential.AbstractCredentialFactoryBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.FatalBeanException;
 import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.core.io.Resource;
 
@@ -118,12 +117,12 @@ public class BasicJWKCredentialFactoryBean extends AbstractCredentialFactoryBean
             } else if (jwk.getKeyType() == KeyType.OCT) {
                 jwkCredential.setSecretKey(((OctetSequenceKey) jwk).toSecretKey(symmetricKeyAlgorithm));
             } else {
-                throw new FatalBeanException("Unsupported KeyFile at " + jwkResource.getDescription());
+                throw new BeanCreationException("Unsupported KeyFile at " + jwkResource.getDescription());
             }
         } catch (final IOException | ParseException e) {
             log.error("{}: Could not decode KeyFile at {}: {}", getConfigDescription(), jwkResource.getDescription(),
                     e);
-            throw new FatalBeanException("Could not decode provided KeyFile " + jwkResource.getDescription(), e);
+            throw new BeanCreationException("Could not decode provided KeyFile " + jwkResource.getDescription(), e);
         }
         jwkCredential.setUsageType(CredentialConversionUtil.getUsageType(jwk));
         jwkCredential.setEntityId(getEntityID());

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


More information about the commits mailing list