Class OPAAuthorizationEventPublisher
java.lang.Object
com.styra.opa.springboot.authorization.OPAAuthorizationEventPublisher
- All Implemented Interfaces:
AuthorizationEventPublisher
Publishes OPA authorization granted/denied events. By default, only denied events are published. To change default
behavior, the following configuration properties could be used:
-
opa.authorization-event.denied.enabled
-
opa.authorization-event.granted.enabled
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOPAAuthorizationEventPublisher
(org.springframework.context.ApplicationEventPublisher publisher, OPAProperties opaProperties) -
Method Summary
Modifier and TypeMethodDescription<T> void
publishAuthorizationEvent
(Supplier<Authentication> authentication, T object, AuthorizationDecision decision)
-
Constructor Details
-
OPAAuthorizationEventPublisher
public OPAAuthorizationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher, OPAProperties opaProperties)
-
-
Method Details
-
publishAuthorizationEvent
public <T> void publishAuthorizationEvent(Supplier<Authentication> authentication, T object, AuthorizationDecision decision) - Specified by:
publishAuthorizationEvent
in interfaceAuthorizationEventPublisher
-