-
Notifications
You must be signed in to change notification settings - Fork 79
/
jetty-restrict-all.xml
53 lines (42 loc) · 1.79 KB
/
jetty-restrict-all.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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">
<!-- ======================================== -->
<!-- Single Constraint for all operations -->
<!-- ======================================== -->
<New class="org.eclipse.jetty.util.security.Constraint"
id="DefaultSecurityConstraint">
<Set name="authenticate">true</Set>
<Set name="name">BASIC</Set>
<Set name="roles">
<Array type="java.lang.String">
<Item>readwrite</Item>
</Array>
</Set>
</New>
<Get id="OldHandler" name="handler"/>
<Set name="handler">
<New class="com.sonian.elasticsearch.http.jetty.security.RestConstraintSecurityHandler"
id="DefaultSecurityHandler">
<Set name="handler"><Ref id="OldHandler"/></Set>
<Set name="loginService">
<!-- from jetty-es-auth.xml or jetty-hash-auth.xml -->
<Ref id="DefaultLoginService"/>
</Set>
<Set name="realmName">DefaultRealm</Set>
<!-- ======================================== -->
<!-- All operations require authentication -->
<!-- ======================================== -->
<Call name="addConstraintMapping">
<Arg>
<New class="org.eclipse.jetty.security.ConstraintMapping">
<Set name="pathSpec">*</Set>
<Set name="constraint">
<Ref id="DefaultSecurityConstraint"/>
</Set>
</New>
</Arg>
</Call>
</New>
</Set>
</Configure>