-
Notifications
You must be signed in to change notification settings - Fork 100
/
sec-primitives.xml
193 lines (155 loc) · 7.42 KB
/
sec-primitives.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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!--
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright 2008 Glencoe Software, Inc. All rights reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Written by: Josh Moore, josh at glencoesoftware.com
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<beans>
<description>
sec-primitives.xml defines the low-level decision makers and state holders
for security questions. These classes can safely be used by the hibernate
layer, such as via the EventListener.
</description>
<bean id="keystore" class="ome.security.KeyAndTrustStoreConfiguration" lazy-init="false">
<description>Sets the keystore and truststore System properties on start-up</description>
<property name="keyStore" value="${omero.security.keyStore}" />
<property name="keyStorePassword" value="${omero.security.keyStorePassword}" />
<property name="trustStore" value="${omero.security.trustStore}" />
<property name="trustStorePassword" value="${omero.security.trustStorePassword}" />
</bean>
<bean id="currentDetails" class="ome.security.basic.CurrentDetails">
<constructor-arg ref="sessionCache"/>
<constructor-arg ref="roles"/>
<constructor-arg ref="systemTypes"/>
<constructor-arg ref="adminPrivileges"/>
<constructor-arg ref="managedRepoUuids"/>
<constructor-arg ref="scriptRepoUuids"/>
</bean>
<alias name="currentDetails" alias="principalHolder"/>
<bean id="internalServiceFactory" class="ome.tools.spring.InternalServiceFactory"/>
<bean id="roles" factory-bean="dbUserCheck" factory-method="getRoles"/>
<bean id="adminPrivileges" class="ome.security.basic.LightAdminPrivileges">
<constructor-arg ref="roles"/>
</bean>
<bean id="securityFilterHolder" class="ome.security.SecurityFilterHolder">
<constructor-arg ref="currentDetails"/>
<constructor-arg ref="&OneGroupSecurityFilter"/><!-- filter is a factory -->
<constructor-arg ref="&AllGroupsSecurityFilter"/><!-- filter is a factory -->
<constructor-arg ref="&SharingSecurityFilter"/><!-- filter is a factory -->
</bean>
<bean id="OneGroupSecurityFilter" class="ome.security.basic.OneGroupSecurityFilter">
<constructor-arg ref="roles"/>
</bean>
<bean id="AllGroupsSecurityFilter" class="ome.security.basic.AllGroupsSecurityFilter">
<constructor-arg ref="simpleSqlAction"/>
<constructor-arg ref="roles"/>
</bean>
<bean id="SharingSecurityFilter" class="ome.security.basic.SharingSecurityFilter">
<constructor-arg ref="roles"/>
<constructor-arg ref="shareStore"/>
</bean>
<bean id="LightAdminPrivilegesSecurityFilter" class="ome.security.basic.LightAdminPrivilegesSecurityFilter">
<constructor-arg ref="roles"/>
</bean>
<alias name="${omero.security.chmod_strategy}" alias="chmodStrategy"/>
<bean id="groupChmodStrategy" class="ome.security.basic.GroupChmodStrategy">
<constructor-arg ref="basicACLVoter"/>
<constructor-arg ref="omeroSessionFactory"/>
<constructor-arg ref="simpleSqlAction"/>
<constructor-arg ref="extendedMetadata"/>
</bean>
<bean id="systemTypes" class="ome.security.SystemTypes"/>
<bean id="tokenHolder" class="ome.security.basic.TokenHolder"/>
<bean id="managedRepoUuids" class="com.google.common.collect.Sets" factory-method="newConcurrentHashSet"/>
<bean id="scriptRepoUuids" class="com.google.common.collect.Sets" factory-method="newConcurrentHashSet"/>
<alias name="${omero.policy.bean}" alias="policyService"/>
<bean id="defaultPolicyService" class="ome.security.policy.DefaultPolicyService"/>
<bean id="RESTRICT-BINARY-ACCESS" class="ome.security.policy.BinaryAccessPolicy">
<constructor-arg>
<set>
<value>ome.model.annotations.FileAnnotation</value>
<value>ome.model.core.Image</value>
<value>ome.model.core.OriginalFile</value>
<value>ome.model.screen.Plate</value>
<value>ome.model.screen.Well</value>
</set>
</constructor-arg>
<constructor-arg ref="aclVoter"/>
<constructor-arg value="${omero.policy.binary_access}"/>
</bean>
<bean id="aclVoter" class="ome.security.CompositeACLVoter">
<constructor-arg ref="currentDetails"/>
<constructor-arg ref="sharingACLVoter"/>
<constructor-arg ref="basicACLVoter"/>
</bean>
<bean id="sharingACLVoter" class="ome.security.sharing.SharingACLVoter">
<constructor-arg ref="systemTypes"/>
<constructor-arg ref="currentDetails"/>
<constructor-arg ref="shareStore"/>
<constructor-arg ref="tokenHolder"/>
</bean>
<bean id="basicACLVoter" class="ome.security.basic.BasicACLVoter">
<constructor-arg ref="currentDetails"/>
<constructor-arg ref="systemTypes"/>
<constructor-arg ref="tokenHolder"/>
<constructor-arg ref="securityFilterHolder"/>
<constructor-arg ref="policyService"/>
<constructor-arg ref="roles"/>
<constructor-arg ref="adminPrivileges"/>
<constructor-arg ref="managedRepoUuids"/>
<constructor-arg ref="scriptRepoUuids"/>
<constructor-arg ref="uuid"/> <!-- allows setting OriginalFile.repo -->
</bean>
<bean name="sessionCache" class="ome.services.sessions.state.SessionCache">
<property name="cacheManager" ref="cacheManager"/>
<property name="updateInterval" value="${omero.sessions.sync_force}"/><!-- ms -->
</bean>
<bean name="sessionManager" class="ome.services.sessions.SessionManagerImpl"
depends-on="dbPatchCheck"
init-method="init"><!-- Init called to add root login method. -->
<property name="uuid" ref="uuid"/>
<property name="principalHolder" ref="principalHolder"/>
<property name="sessionCache" ref="sessionCache"/>
<property name="roles" ref="roles"/>
<property name="adminPrivileges" ref="adminPrivileges"/>
<property name="executor" ref="executor"/>
<property name="defaultTimeToIdle" value="${omero.sessions.timeout}"/>
<property name="defaultTimeToLive" value="${omero.sessions.maximum}"/>
<property name="counterFactory" ref="sessionCounterFactory"/>
<property name="readOnly" value="${omero.cluster.read_only}"/>
</bean>
<bean id="methodSecurity" class="ome.security.basic.BasicMethodSecurity">
<property name="sessionManager" ref="sessionManager"/>
</bean>
<!-- Throttling primitives -->
<bean id="threadCounterFactory" class="ome.services.sessions.stats.CounterFactory">
<property name="objectsReadHardLimit" value="64000"/>
<property name="objectsWrittenHardLimit" value="64000"/>
</bean>
<!-- Uses Integer.MAX_VALUE -->
<bean id="sessionCounterFactory" class="ome.services.sessions.stats.CounterFactory"/>
<!--
The following stats types
-->
<bean id="perSessionStats" class="ome.services.sessions.stats.PerSessionStats">
<constructor-arg ref="currentDetails"/>
</bean>
<bean id="perThreadStats" class="ome.services.sessions.stats.PerThreadStats">
<constructor-arg ref="currentDetails"/>
</bean>
<bean id="delegatingStats" class="ome.services.sessions.stats.DelegatingStats">
<constructor-arg>
<list>
<ref bean="perThreadStats"/>
<ref bean="perSessionStats"/>
</list>
</constructor-arg>
</bean>
</beans>