mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
KEYCLOAK-10022 Fixing few admin events not raised bug
This commit is contained in:
parent
9c37da0ee9
commit
ff8b790549
@ -113,9 +113,7 @@ public class PolicyResourceService {
|
||||
|
||||
policyStore.delete(policy.getId());
|
||||
|
||||
if (authorization.getRealm().isAdminEventsEnabled()) {
|
||||
audit(toRepresentation(policy, authorization), OperationType.DELETE);
|
||||
}
|
||||
audit(toRepresentation(policy, authorization), OperationType.DELETE);
|
||||
|
||||
return Response.noContent().build();
|
||||
}
|
||||
@ -257,8 +255,6 @@ public class PolicyResourceService {
|
||||
}
|
||||
|
||||
private void audit(AbstractPolicyRepresentation policy, OperationType operation) {
|
||||
if (authorization.getRealm().isAdminEventsEnabled()) {
|
||||
adminEvent.operation(operation).resourcePath(authorization.getKeycloakSession().getContext().getUri()).representation(policy).success();
|
||||
}
|
||||
adminEvent.operation(operation).resourcePath(authorization.getKeycloakSession().getContext().getUri()).representation(policy).success();
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,12 +320,10 @@ public class PolicyService {
|
||||
}
|
||||
|
||||
private void audit(AbstractPolicyRepresentation resource, String id, OperationType operation, KeycloakSession session) {
|
||||
if (authorization.getRealm().isAdminEventsEnabled()) {
|
||||
if (id != null) {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri(), id).representation(resource).success();
|
||||
} else {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri()).representation(resource).success();
|
||||
}
|
||||
if (id != null) {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri(), id).representation(resource).success();
|
||||
} else {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri()).representation(resource).success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,9 +166,7 @@ public class ResourceSetService {
|
||||
|
||||
storeFactory.getResourceStore().delete(id);
|
||||
|
||||
if (authorization.getRealm().isAdminEventsEnabled()) {
|
||||
audit(toRepresentation(resource, resourceServer, authorization), OperationType.DELETE);
|
||||
}
|
||||
audit(toRepresentation(resource, resourceServer, authorization), OperationType.DELETE);
|
||||
|
||||
return Response.noContent().build();
|
||||
}
|
||||
@ -471,12 +469,10 @@ public class ResourceSetService {
|
||||
}
|
||||
|
||||
public void audit(ResourceRepresentation resource, String id, OperationType operation) {
|
||||
if (authorization.getRealm().isAdminEventsEnabled()) {
|
||||
if (id != null) {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri(), id).representation(resource).success();
|
||||
} else {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri()).representation(resource).success();
|
||||
}
|
||||
if (id != null) {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri(), id).representation(resource).success();
|
||||
} else {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri()).representation(resource).success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,9 +143,7 @@ public class ScopeService {
|
||||
|
||||
storeFactory.getScopeStore().delete(id);
|
||||
|
||||
if (authorization.getRealm().isAdminEventsEnabled()) {
|
||||
audit(toRepresentation(scope), OperationType.DELETE);
|
||||
}
|
||||
audit(toRepresentation(scope), OperationType.DELETE);
|
||||
|
||||
return Response.noContent().build();
|
||||
}
|
||||
@ -266,12 +264,10 @@ public class ScopeService {
|
||||
}
|
||||
|
||||
private void audit(ScopeRepresentation resource, String id, OperationType operation) {
|
||||
if (authorization.getRealm().isAdminEventsEnabled()) {
|
||||
if (id != null) {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri(), id).representation(resource).success();
|
||||
} else {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri()).representation(resource).success();
|
||||
}
|
||||
if (id != null) {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri(), id).representation(resource).success();
|
||||
} else {
|
||||
adminEvent.operation(operation).resourcePath(session.getContext().getUri()).representation(resource).success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user