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