Conflicts:
	docs/structured/03-getting-started.asciidoc
	docs/structured/06-ldap.asciidoc
	docs/structured/authentication/message-authentication.asciidoc

Original commit: elastic/x-pack-elasticsearch@642beb53ca
This commit is contained in:
Paul Echeverri 2014-10-22 12:02:29 -07:00
commit d34c7cddf3
3 changed files with 9 additions and 1 deletions

View File

@ -129,7 +129,12 @@ public class SecurityFilter extends AbstractComponent {
@Override
public void process(RestRequest request, RestChannel channel, RestFilterChain filterChain) throws Exception {
filter.authenticate(request);
// CORS - allow for preflight unauthenticated OPTIONS request
if (request.method() != RestRequest.Method.OPTIONS) {
filter.authenticate(request);
}
filterChain.continueProcessing(request, channel);
}
}

View File

@ -53,6 +53,7 @@ public class SecuredTransportModule extends AbstractShieldModule.Spawn implement
if (clientMode) {
// no ip filtering on the client
bind(N2NNettyUpstreamHandler.class).toProvider(Providers.<N2NNettyUpstreamHandler>of(null));
bind(TransportFilter.class).toInstance(TransportFilter.NOOP);
return;
}

View File

@ -13,6 +13,8 @@ import org.elasticsearch.transport.TransportResponse;
*/
public interface TransportFilter {
static final TransportFilter NOOP = new Base();
/**
* Called just before the given request is about to be sent. Any exception thrown
* by this method will stop the request from being sent.