use of org.talend.sdk.component.server.service.security.event.OnCommand in project component-runtime by Talend.
the class CommandSecurityProvider method filter.
@Override
public void filter(final ContainerRequestContext requestContext) throws IOException {
if (Boolean.TRUE.equals(request.getAttribute(SKIP))) {
return;
}
final OnCommand onCommand = new OnCommand(resourceInfo.getResourceClass(), resourceInfo.getResourceMethod());
onConnectionEvent.fire(onCommand);
if (!onCommand.isValid()) {
requestContext.abortWith(Response.status(Response.Status.UNAUTHORIZED).entity(new ErrorPayload(UNAUTHORIZED, "Invalid command credentials")).type(APPLICATION_JSON_TYPE).build());
}
}
Aggregations