Merge pull request #3326 from hmlnarik/KEYCLOAK-3664
KEYCLOAK-3664 Fix for NPE in subsystem when secure-deployment is undefined for a particular deployment
This commit is contained in:
commit
c62c60c723
3 changed files with 18 additions and 3 deletions
|
@ -165,6 +165,9 @@ public final class KeycloakAdapterConfigService {
|
||||||
|
|
||||||
protected boolean isDeploymentConfigured(DeploymentUnit deploymentUnit) {
|
protected boolean isDeploymentConfigured(DeploymentUnit deploymentUnit) {
|
||||||
ModelNode deployment = getSecureDeployment(deploymentUnit);
|
ModelNode deployment = getSecureDeployment(deploymentUnit);
|
||||||
|
if (! deployment.isDefined()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
ModelNode resource = deployment.get(SecureDeploymentDefinition.RESOURCE.getName());
|
ModelNode resource = deployment.get(SecureDeploymentDefinition.RESOURCE.getName());
|
||||||
return resource.isDefined();
|
return resource.isDefined();
|
||||||
}
|
}
|
||||||
|
@ -202,7 +205,9 @@ public final class KeycloakAdapterConfigService {
|
||||||
|
|
||||||
private ModelNode getSecureDeployment(DeploymentUnit deploymentUnit) {
|
private ModelNode getSecureDeployment(DeploymentUnit deploymentUnit) {
|
||||||
String deploymentName = preferredDeploymentName(deploymentUnit);
|
String deploymentName = preferredDeploymentName(deploymentUnit);
|
||||||
return this.secureDeployments.get(deploymentName);
|
return this.secureDeployments.containsKey(deploymentName)
|
||||||
|
? this.secureDeployments.get(deploymentName)
|
||||||
|
: new ModelNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
// KEYCLOAK-3273: prefer module name if available
|
// KEYCLOAK-3273: prefer module name if available
|
||||||
|
|
|
@ -164,6 +164,9 @@ public final class KeycloakAdapterConfigService {
|
||||||
|
|
||||||
protected boolean isDeploymentConfigured(DeploymentUnit deploymentUnit) {
|
protected boolean isDeploymentConfigured(DeploymentUnit deploymentUnit) {
|
||||||
ModelNode deployment = getSecureDeployment(deploymentUnit);
|
ModelNode deployment = getSecureDeployment(deploymentUnit);
|
||||||
|
if (! deployment.isDefined()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
ModelNode resource = deployment.get(SecureDeploymentDefinition.RESOURCE.getName());
|
ModelNode resource = deployment.get(SecureDeploymentDefinition.RESOURCE.getName());
|
||||||
return resource.isDefined();
|
return resource.isDefined();
|
||||||
}
|
}
|
||||||
|
@ -201,7 +204,9 @@ public final class KeycloakAdapterConfigService {
|
||||||
|
|
||||||
private ModelNode getSecureDeployment(DeploymentUnit deploymentUnit) {
|
private ModelNode getSecureDeployment(DeploymentUnit deploymentUnit) {
|
||||||
String deploymentName = preferredDeploymentName(deploymentUnit);
|
String deploymentName = preferredDeploymentName(deploymentUnit);
|
||||||
return this.secureDeployments.get(deploymentName);
|
return this.secureDeployments.containsKey(deploymentName)
|
||||||
|
? this.secureDeployments.get(deploymentName)
|
||||||
|
: new ModelNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
// KEYCLOAK-3273: prefer module name if available
|
// KEYCLOAK-3273: prefer module name if available
|
||||||
|
|
|
@ -164,6 +164,9 @@ public final class KeycloakAdapterConfigService {
|
||||||
|
|
||||||
protected boolean isDeploymentConfigured(DeploymentUnit deploymentUnit) {
|
protected boolean isDeploymentConfigured(DeploymentUnit deploymentUnit) {
|
||||||
ModelNode deployment = getSecureDeployment(deploymentUnit);
|
ModelNode deployment = getSecureDeployment(deploymentUnit);
|
||||||
|
if (! deployment.isDefined()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
ModelNode resource = deployment.get(SecureDeploymentDefinition.RESOURCE.getName());
|
ModelNode resource = deployment.get(SecureDeploymentDefinition.RESOURCE.getName());
|
||||||
return resource.isDefined();
|
return resource.isDefined();
|
||||||
}
|
}
|
||||||
|
@ -201,7 +204,9 @@ public final class KeycloakAdapterConfigService {
|
||||||
|
|
||||||
private ModelNode getSecureDeployment(DeploymentUnit deploymentUnit) {
|
private ModelNode getSecureDeployment(DeploymentUnit deploymentUnit) {
|
||||||
String deploymentName = preferredDeploymentName(deploymentUnit);
|
String deploymentName = preferredDeploymentName(deploymentUnit);
|
||||||
return this.secureDeployments.get(deploymentName);
|
return this.secureDeployments.containsKey(deploymentName)
|
||||||
|
? this.secureDeployments.get(deploymentName)
|
||||||
|
: new ModelNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
// KEYCLOAK-3273: prefer module name if available
|
// KEYCLOAK-3273: prefer module name if available
|
||||||
|
|
Loading…
Reference in a new issue