elasticsearch-jetty Basis Auth Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http.type: com.sonian.elasticsearch.http.jetty.JettyHttpServerTransportModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> | |
<Configure id="ESServer" class="org.eclipse.jetty.server.Server"> | |
<New class="com.sonian.elasticsearch.http.jetty.handler.JettyHttpServerTransportHandler" | |
id="HttpServerAdapterHandler"> | |
</New> | |
<New class="com.sonian.elasticsearch.http.jetty.error.JettyHttpServerErrorHandler" | |
id="HttpServerErrorHandler"> | |
</New> | |
<New class="org.eclipse.jetty.security.HashLoginService" | |
id="DefaultLoginService"> | |
<Set name="name">DefaultRealm</Set> | |
<Set name="config"><Property name="es.config"/>/realm.properties</Set> | |
<Set name="refreshInterval">5</Set> | |
<Call name="start"/> | |
</New> | |
<New class="org.eclipse.jetty.http.security.Constraint" | |
id="BasicSecurityConstraint"> | |
<Set name="authenticate">true</Set> | |
<Set name="name">BASIC</Set> | |
<Set name="roles"> | |
<Array type="java.lang.String"> | |
<Item>user</Item> | |
</Array> | |
</Set> | |
</New> | |
<New class="com.sonian.elasticsearch.http.jetty.security.RestConstraintSecurityHandler" | |
id="DefaultSecurityHandler"> | |
<Set name="loginService"> | |
<Ref id="DefaultLoginService"/> | |
</Set> | |
<Set name="realmName">DefaultRealm</Set> | |
<!-- ======================================== --> | |
<!-- Require password for everything --> | |
<!-- ======================================== --> | |
<Call name="addConstraintMapping"> | |
<Arg> | |
<New class="org.eclipse.jetty.security.ConstraintMapping"> | |
<Set name="pathSpec">*</Set> | |
<Set name="constraint"> | |
<Ref id="BasicSecurityConstraint"/> | |
</Set> | |
</New> | |
</Arg> | |
</Call> | |
</New> | |
<Call name="addBean"> | |
<Arg> | |
<Ref id="DefaultLoginService"/> | |
</Arg> | |
</Call> | |
<Call name="addBean"> | |
<Arg> | |
<Ref id="HttpServerErrorHandler"/> | |
</Arg> | |
</Call> | |
<New id="GzipHandler" class="org.eclipse.jetty.server.handler.GzipHandler"> | |
<Set name="handler"> | |
<Ref id="DefaultSecurityHandler"/> | |
</Set> | |
</New> | |
<Set name="handler"> | |
<Ref id="GzipHandler"/> | |
</Set> | |
<Ref id="DefaultSecurityHandler"> | |
<Set name="handler"> | |
<Ref id="HttpServerAdapterHandler"/> | |
</Set> | |
</Ref> | |
<!-- ======================================== --> | |
<!-- Add HTTP connector --> | |
<!-- ======================================== --> | |
<Call name="addConnector"> | |
<Arg> | |
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> | |
<Set name="host"><Property name="jetty.bind_host"/></Set> | |
<Set name="port"><Property name="jetty.port"/></Set> | |
<Set name="maxIdleTime">600000</Set> | |
<Set name="Acceptors">2</Set> | |
</New> | |
</Arg> | |
</Call> | |
</Configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user: YouPasswordGoesHere,user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in case of this error:
ClassNotFoundException[org.eclipse.jetty.http.security.Constraint]
simply change the route in the
jetty.xml
file toorg.eclipse.jetty.util.security.Constraint
tags: elastic, elasticsearch