-
Notifications
You must be signed in to change notification settings - Fork 16
/
fcrepo-config.xml
218 lines (171 loc) · 8.87 KB
/
fcrepo-config.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<!-- Master context for fcrepo4. -->
<!-- Context that supports the actual ModeShape JCR itself -->
<context:property-placeholder/>
<context:annotation-config/>
<context:component-scan base-package="org.fcrepo"/>
<!-- **********************************
MODESHAPE configuration
********************************** -->
<!-- Authentication Not Enabled -->
<bean name="modeshapeRepofactory"
class="org.fcrepo.kernel.modeshape.spring.ModeShapeRepositoryFactoryBean"
p:repositoryConfiguration="${fcrepo.modeshape.configuration}" />
<!-- To use Authentication:
1. Comment out the above bean definition.
2. Uncomment this bean definition.
3. Uncomment one of the provider definitions (WebAC)
4. Uncomment the "authenticationProvider" bean definition below.
5. Remember to set the system property fcrepo.modeshape.configuration to the location of your repository.json
-->
<!--
<bean name="modeshapeRepofactory"
class="org.fcrepo.kernel.modeshape.spring.ModeShapeRepositoryFactoryBean"
p:repositoryConfiguration="${fcrepo.modeshape.configuration}"
depends-on="authenticationProvider"/>
-->
<!-- **************************
Authentication
************************** -->
<!-- Optional PrincipalProvider that will inspect the request header, "some-header", for user role values -->
<bean name="headerProvider" class="org.fcrepo.auth.common.HttpHeaderPrincipalProvider">
<property name="headerName" value="some-header"/>
<property name="separator" value=","/>
</bean>
<!-- Optional PrincipalProvider that will use container configured roles as principals -->
<bean name="containerRolesProvider" class="org.fcrepo.auth.common.ContainerRolesPrincipalProvider">
<property name="roleNames">
<util:set set-class="java.util.HashSet">
<value>tomcat-role-1</value>
<value>tomcat-role-2</value>
</util:set>
</property>
</bean>
<!-- delegatedPrincipleProvider allows a single user to be passed in the header "On-Behalf-Of",
this is to be used as the actor making the request when authenticating.
NOTE: Only users with the role fedoraAdmin can delegate to another user.
NOTE: Only supported in WebAC authentication -->
<bean name="delegatedPrincipalProvider" class="org.fcrepo.auth.common.DelegateHeaderPrincipalProvider"/>
<!-- Defines a set of users from both the headerProvider and delegatedPrincipleProvider -->
<util:set id="principalProviderSet">
<ref bean="headerProvider"/>
<ref bean="containerRolesProvider"/>
<ref bean="delegatedPrincipalProvider"/>
</util:set>
<!-- **** WebAC Authentication **** -->
<!--
<bean name="fad" class="org.fcrepo.auth.webac.WebACAuthorizationDelegate"/>
<bean name="accessRolesProvider" class="org.fcrepo.auth.webac.WebACRolesProvider"/>
-->
<!-- Creates a servlet container authentication provider with the supplied FAD and set
of principles providers.
*** To use authorization, see steps on line 32 of this file. ***
-->
<!--
<bean name="authenticationProvider" class="org.fcrepo.auth.common.ServletContainerAuthenticationProvider">
<property name="fad" ref="fad"/>
<property name="principalProviders" ref="principalProviderSet"/>
</bean>
-->
<!-- **************************
END Authentication
************************** -->
<!-- **************************
AUDIT
publish audit events to JMS
You also need to uncomment the fcrepo-audit dependency in the pom.xml
************************** -->
<!--
<bean class="org.fcrepo.audit.InternalAuditor"/>
-->
<!-- **************************
PID Minter
Select one of the following.
************************** -->
<!-- Mints PIDs using random UUIDs and generates additional hierarchy -->
<bean class="org.fcrepo.mint.UUIDPathMinter"
c:length="${fcrepo.uuid.path.length:2}"
c:count="${fcrepo.uuid.path.count:4}"/>
<!-- Mints Pids with no additional hierarchy.
Choose this if you use the AppleTreeConverter
in the translation chain below. -->
<!--
<bean class="org.fcrepo.mint.UUIDPidMinter" />
-->
<!-- Mints PIDs using external REST service
<bean class="org.fcrepo.mint.HttpPidMinter"
c:url="http://localhost/my/minter" c:method="POST"
c:username="${fcrepo.minter.username:minterUser}"
c:password="${fcrepo.minter.password:minterPass}"
c:regex="" c:xpath="/response/ids/value"/>
-->
<!-- Identifier translation chain -->
<util:list id="translationChain" value-type="org.fcrepo.kernel.api.identifiers.InternalIdentifierConverter">
<!-- Use AppleTreeConverter to hide Fedora's Pairtree hierarchy from public view
https://gitlab.amherst.edu/acdc/acrepo-apple-trees.
NOTE: It is recommended to use the UUIDPidMinter above with this converter.
-->
<!--
<bean class="edu.amherst.acdc.orchard.AppleTreeConverter"/>
-->
<bean class="org.fcrepo.kernel.modeshape.identifiers.HashConverter"/>
<bean class="org.fcrepo.kernel.modeshape.identifiers.NamespaceConverter"/>
</util:list>
<!-- *************************************
JMS/Eventing Configuration
************************************* -->
<!-- publishes events from the internal bus to a JMS Topic or Queue.
"constructor-arg" for both is topic/queue name. -->
<!-- JMS Topic -->
<bean class="org.fcrepo.jms.JMSTopicPublisher">
<constructor-arg value="fedora"/>
</bean>
<!-- JMS Queue -->
<!--
<bean class="org.fcrepo.jms.JMSQueuePublisher">
<constructor-arg value="fedora"/>
</bean>
-->
<!-- ActiveMQ connection -->
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="jmsBroker"
p:brokerURL="vm://${fcrepo.jms.host:localhost}:${fcrepo.dynamic.jms.port:61616}?create=false"/>
<!-- JMS Broker configuration -->
<bean name="jmsBroker" class="org.apache.activemq.xbean.BrokerFactoryBean"
p:config="${fcrepo.activemq.configuration:classpath:/config/activemq.xml}" p:start="true"/>
<!-- translates events into JMS header-only format-->
<bean class="org.fcrepo.jms.DefaultMessageFactory"/>
<!-- listener that moves JCR Events to the Fedora internal event bus -->
<bean class="org.fcrepo.kernel.modeshape.observer.SimpleObserver"/>
<!-- used by bean above to filter which events get put on the bus -->
<bean name="fedoraEventFilter" class="org.fcrepo.kernel.modeshape.observer.DefaultFilter"/>
<!-- used by observer bean to map JCR events into Fedora events -->
<bean name="fedoraEventMapper" class="org.fcrepo.kernel.modeshape.observer.eventmappings.AllNodeEventsOneEvent"/>
<!-- Fedora's lightweight internal event bus. Currently memory-resident.-->
<bean name="fedoraInternalEventBus" class="com.google.common.eventbus.EventBus"/>
<!-- ***********************************
Internal system configuration
*********************************** -->
<task:scheduler id="taskScheduler" />
<task:executor id="taskExecutor" pool-size="1" />
<task:annotation-driven executor="taskExecutor" scheduler="taskScheduler" />
<!-- Start the Modeshape JCR -->
<bean class="org.modeshape.jcr.ModeShapeEngine" init-method="start"/>
<!-- For the time being, load annotation config here too -->
<bean class="org.fcrepo.metrics.MetricsConfig"/>
<bean id="connectionManager" class="org.apache.http.impl.conn.PoolingHttpClientConnectionManager" />
<!-- Generates HTTP Sessions -->
<bean class="org.fcrepo.http.commons.session.SessionFactory"/>
</beans>