Removed exceptions from @PostConstruct methods, closes #663
parent
7f8402e59e
commit
f4b508fa62
|
@ -66,7 +66,7 @@ public class StaticClientConfigurationService implements ClientConfigurationServ
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void afterPropertiesSet() throws Exception {
|
public void afterPropertiesSet() {
|
||||||
if (clients == null || clients.isEmpty()) {
|
if (clients == null || clients.isEmpty()) {
|
||||||
throw new IllegalArgumentException("Clients map cannot be null or empty");
|
throw new IllegalArgumentException("Clients map cannot be null or empty");
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class StaticServerConfigurationService implements ServerConfigurationServ
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void afterPropertiesSet() throws Exception {
|
public void afterPropertiesSet() {
|
||||||
if (servers == null || servers.isEmpty()) {
|
if (servers == null || servers.isEmpty()) {
|
||||||
throw new IllegalArgumentException("Servers map cannot be null or empty.");
|
throw new IllegalArgumentException("Servers map cannot be null or empty.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class StaticSingleIssuerService implements IssuerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void afterPropertiesSet() throws Exception {
|
public void afterPropertiesSet() {
|
||||||
|
|
||||||
if (Strings.isNullOrEmpty(issuer)) {
|
if (Strings.isNullOrEmpty(issuer)) {
|
||||||
throw new IllegalArgumentException("Issuer must not be null or empty.");
|
throw new IllegalArgumentException("Issuer must not be null or empty.");
|
||||||
|
|
|
@ -127,11 +127,8 @@ public class ThirdPartyIssuerService implements IssuerService {
|
||||||
this.blacklist = blacklist;
|
this.blacklist = blacklist;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void afterPropertiesSet() throws Exception {
|
public void afterPropertiesSet() {
|
||||||
if (Strings.isNullOrEmpty(this.accountChooserUrl)) {
|
if (Strings.isNullOrEmpty(this.accountChooserUrl)) {
|
||||||
throw new IllegalArgumentException("Account Chooser URL cannot be null or empty");
|
throw new IllegalArgumentException("Account Chooser URL cannot be null or empty");
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,12 +109,20 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
|
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void afterPropertiesSet() throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException{
|
public void afterPropertiesSet() {
|
||||||
|
|
||||||
if (keys == null) {
|
if (keys == null) {
|
||||||
throw new IllegalArgumentException("Encryption and decryption service must have at least one key configured.");
|
throw new IllegalArgumentException("Encryption and decryption service must have at least one key configured.");
|
||||||
}
|
}
|
||||||
buildEncryptersAndDecrypters();
|
try {
|
||||||
|
buildEncryptersAndDecrypters();
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
throw new IllegalArgumentException("Encryption and decryption service could not find given algorithm.");
|
||||||
|
} catch (InvalidKeySpecException e) {
|
||||||
|
throw new IllegalArgumentException("Encryption and decryption service saw an invalid key specification.");
|
||||||
|
} catch (JOSEException e) {
|
||||||
|
throw new IllegalArgumentException("Encryption and decryption service was unable to process JOSE object.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefaultEncryptionKeyId() {
|
public String getDefaultEncryptionKeyId() {
|
||||||
|
|
Loading…
Reference in New Issue