mirror of
https://github.com/valitydev/wachter.git
synced 2024-11-06 00:35:24 +00:00
Fix roles resolver (#19)
This commit is contained in:
parent
0367923537
commit
6856872154
@ -24,10 +24,12 @@ public class RoleAccessService {
|
|||||||
accessData.getServiceName(),
|
accessData.getServiceName(),
|
||||||
accessData.getMethodName(),
|
accessData.getMethodName(),
|
||||||
accessData.getUserEmail());
|
accessData.getUserEmail());
|
||||||
|
break;
|
||||||
} else if (role.equalsIgnoreCase(getServiceName(accessData))) {
|
} else if (role.equalsIgnoreCase(getServiceName(accessData))) {
|
||||||
log.info("Rights allowed in all service {} for user {}",
|
log.info("Rights allowed in all service {} for user {}",
|
||||||
accessData.getServiceName(),
|
accessData.getServiceName(),
|
||||||
accessData.getUserEmail());
|
accessData.getUserEmail());
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
throw new AuthorizationException(
|
throw new AuthorizationException(
|
||||||
String.format("User %s don't have access to %s in service %s",
|
String.format("User %s don't have access to %s in service %s",
|
||||||
|
@ -30,7 +30,7 @@ public abstract class AbstractKeycloakOpenIdAsWiremockConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected String generateSimpleJwtWithRoles() {
|
protected String generateSimpleJwtWithRoles() {
|
||||||
return keycloakOpenIdStub.generateJwt("messages", "messages:methodName");
|
return keycloakOpenIdStub.generateJwt("messages", "messages:methodName", "unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String generateSimpleJwtWithoutRoles() {
|
protected String generateSimpleJwtWithoutRoles() {
|
||||||
|
Loading…
Reference in New Issue
Block a user