Skip to content

Commit d7c0870

Browse files
author
Daniel Berry
authored
Merge pull request #52 from GeoNode/GN_ADVANCED_SECURITY
PR - (Issue #2374) GNIP: GeoServer A&A Improvements
2 parents 66653c0 + fc779c8 commit d7c0870

File tree

11 files changed

+1102
-1005
lines changed

11 files changed

+1102
-1005
lines changed

pom.xml

Lines changed: 878 additions & 839 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
GeoNodeAuthProviderPanel.geonodeSettings=GeoNode Security Settings
2-
GeoNodeAuthFilterPanel.noFilterSettings=There are no user-configurable options for the GeoNode Authentication Filter
3-
GeoNodeAnonymousAuthFilterPanel.noFilterSettings=There are no user-configurable options for the GeoNode Authentication Filter
4-
51
GeoNodeAuthProviderPanel.short=GeoNode
62
GeoNodeAuthProviderPanel.title=GeoNode Authentication Provider
73
GeoNodeAuthProviderPanel.description=Authentication via Connection to GeoNode Frontend
84
GeoNodeAuthProviderPanel.geonodeBaseUrl=Frontend Site Base URL
5+
GeoNodeAuthProviderPanel.geonodeSettings=GeoNode Filter Settings
96

107
GeoNodeAuthFilterPanel.short=GeoNode Cookies
118
GeoNodeAuthFilterPanel.title=GeoNode Cookie Handler
129
GeoNodeAuthFilterPanel.description=Respect Django session cookies in GeoServer
1310

1411
GeoNodeAnonymousAuthFilterPanel.short=GeoNode Anonymous
1512
GeoNodeAnonymousAuthFilterPanel.title=GeoNode Anonymous authentication handler
16-
GeoNodeAnonymousAuthFilterPanel.description=Required for GeoServer to honor GeoNode security settings for anonymous users
13+
GeoNodeAnonymousAuthFilterPanel.description=Required for GeoServer to honor GeoNode security settings for anonymous users
14+
GeoNodeAnonymousAuthFilterPanel.noFilterSettings=There are no user-configurable options for the GeoNode Authentication Filter
15+
16+
GeoNodeAuthFilterPanel.noFilterSettings=There are no user-configurable options for the GeoNode Authentication Filter
Lines changed: 160 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,167 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
2+
<!-- Copyright (C) 2016 Open Source Geospatial Foundation. All rights
3+
reserved. This code is licensed under the GPL 2.0 license, available at the
4+
root application directory. -->
5+
<beans xmlns="http://www.springframework.org/schema/beans"
6+
xmlns:context="http://www.springframework.org/schema/context"
7+
xmlns:sec="http://www.springframework.org/schema/security"
8+
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
9+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:schemaLocation="http://www.springframework.org/schema/beans
11+
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
12+
http://www.springframework.org/schema/context
13+
http://www.springframework.org/schema/context/spring-context-3.0.xsd
14+
http://www.springframework.org/schema/security
15+
http://www.springframework.org/schema/security/spring-security-3.0.4.xsd
16+
http://www.springframework.org/schema/security/oauth2
17+
http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd">
18+
19+
<!-- GeoNode Integration -->
20+
<bean id="processRestletMapping" class="org.geoserver.rest.RESTMapping">
21+
<property name="routes">
22+
<map>
23+
<entry>
24+
<key>
25+
<value>/process/batchDownload/launch</value>
26+
</key>
27+
<value>downloadLauncherRestlet</value>
28+
</entry>
29+
<entry>
30+
<key>
31+
<value>/process/batchDownload/status</value>
32+
</key>
33+
<value>downloadStatusRestlet</value>
34+
</entry>
35+
<entry>
36+
<key>
37+
<value>/process/batchDownload/download</value>
38+
</key>
39+
<value>downloadReadyRestlet</value>
40+
</entry>
41+
<entry>
42+
<key>
43+
<value>/process/batchDownload/kill</value>
44+
</key>
45+
<value>downloadKillerRestlet</value>
46+
</entry>
47+
</map>
48+
</property>
49+
</bean>
350

4-
<beans>
5-
<bean id="processRestletMapping" class="org.geoserver.rest.RESTMapping">
6-
<property name="routes">
7-
<map>
8-
<entry>
9-
<key>
10-
<value>/process/batchDownload/launch</value>
11-
</key>
12-
<value>downloadLauncherRestlet</value>
13-
</entry>
14-
<entry>
15-
<key>
16-
<value>/process/batchDownload/status</value>
17-
</key>
18-
<value>downloadStatusRestlet</value>
19-
</entry>
20-
<entry>
21-
<key>
22-
<value>/process/batchDownload/download</value>
23-
</key>
24-
<value>downloadReadyRestlet</value>
25-
</entry>
26-
<entry>
27-
<key>
28-
<value>/process/batchDownload/kill</value>
29-
</key>
30-
<value>downloadKillerRestlet</value>
31-
</entry>
32-
</map>
33-
</property>
34-
</bean>
51+
<bean id="processExecutorThreadFactory"
52+
class="org.springframework.scheduling.concurrent.CustomizableThreadFactory">
53+
<description>ThreadFactory allowing for customizing the created
54+
threads (name, priority, etc)</description>
55+
<constructor-arg value="Process Thread" />
56+
<property name="threadPriority">
57+
<description>Thread priority, value from 1 to 10, defaults to 5,
58+
meaning java.lang.Thread#NORM_PRIORITY</description>
59+
<value>5</value>
60+
</property>
61+
<property name="daemon">
62+
<description>Specify executor threads to be daemon threads so that
63+
they shutdown when the application does</description>
64+
<value>true</value>
65+
</property>
66+
</bean>
3567

36-
<bean id="processExecutorThreadFactory" class="org.springframework.scheduling.concurrent.CustomizableThreadFactory">
37-
<description>ThreadFactory allowing for customizing the created threads (name, priority, etc)</description>
38-
<constructor-arg value="Process Thread" />
39-
<property name="threadPriority">
40-
<description>Thread priority, value from 1 to 10, defaults to 5, meaning java.lang.Thread#NORM_PRIORITY</description>
41-
<value>5</value>
42-
</property>
43-
<property name="daemon">
44-
<description>Specify executor threads to be daemon threads so that they shutdown when the application does</description>
45-
<value>true</value>
46-
</property>
47-
</bean>
68+
<bean id="processExecutor" class="org.geotools.process.ThreadPoolProcessExecutor">
69+
<description>An Executor that provides methods to manage termination
70+
and methods that can produce a {@link Progress}
71+
for tracking one or more asynchronous tasks.</description>
72+
<constructor-arg value="5">
73+
<description>Number of process executor threads in the pool</description>
74+
</constructor-arg>
75+
<constructor-arg ref="processExecutorThreadFactory">
76+
<description>Thread factory for this process executor</description>
77+
</constructor-arg>
78+
</bean>
4879

49-
<bean id="processExecutor" class="org.geotools.process.ThreadPoolProcessExecutor">
50-
<description>An Executor that provides methods to manage termination and methods that can produce a {@link Progress}
51-
for tracking one or more asynchronous tasks.</description>
52-
<constructor-arg value="5">
53-
<description>Number of process executor threads in the pool</description>
54-
</constructor-arg>
55-
<constructor-arg ref="processExecutorThreadFactory">
56-
<description>Thread factory for this process executor</description>
57-
</constructor-arg>
58-
</bean>
80+
<bean id="processStorageManagerFactory"
81+
class="org.geonode.process.storage.GeoServerDataDirStorageManagerFactory">
82+
<description>A storage manager is a process collaborator that
83+
abstracts out the process from the place where it can
84+
store temporary files. This one uses a directory inside the GeoServer data
85+
directory as the temp directory</description>
86+
<constructor-arg ref="resourceLoader">
87+
<description>The GeoServerResourceLoader (defined in geoserver's main
88+
module) where to get the data directory
89+
location from</description>
90+
</constructor-arg>
91+
<constructor-arg value="process_tmp_dir">
92+
<description>The name of the directory inside the geoserver data dir
93+
to use as the root for processes' temp data</description>
94+
</constructor-arg>
95+
</bean>
5996

60-
<bean id="processStorageManagerFactory" class="org.geonode.process.storage.GeoServerDataDirStorageManagerFactory">
61-
<description>A storage manager is a process collaborator that abstracts out the process from the place where it can
62-
store temporary files. This one uses a directory inside the GeoServer data directory as the temp directory</description>
63-
<constructor-arg ref="resourceLoader">
64-
<description>The GeoServerResourceLoader (defined in geoserver's main module) where to get the data directory
65-
location from</description>
66-
</constructor-arg>
67-
<constructor-arg value="process_tmp_dir">
68-
<description>The name of the directory inside the geoserver data dir to use as the root for processes' temp data</description>
69-
</constructor-arg>
70-
</bean>
97+
<bean id="processController" class="org.geonode.process.control.DefaultProcessController">
98+
<description>Global process manager to issue, query and kill
99+
asynchronous processes</description>
100+
<constructor-arg ref="processExecutor" />
101+
<constructor-arg ref="processStorageManagerFactory">
102+
<description>factory to create storage managers for each submitted
103+
async process</description>
104+
</constructor-arg>
105+
<constructor-arg value="5">
106+
<description>process eviction check period in seconds. Instructs the
107+
controller to check for process eviction
108+
every X seconds</description>
109+
</constructor-arg>
110+
<constructor-arg value="10">
111+
<description>Process eviction timeout. Instructs the controller to
112+
remove dead processes (and any data they may be
113+
holding) X MINUTES</description>
114+
</constructor-arg>
115+
</bean>
71116

72-
<bean id="processController" class="org.geonode.process.control.DefaultProcessController">
73-
<description>Global process manager to issue, query and kill asynchronous processes</description>
74-
<constructor-arg ref="processExecutor" />
75-
<constructor-arg ref="processStorageManagerFactory">
76-
<description>factory to create storage managers for each submitted async process</description>
77-
</constructor-arg>
78-
<constructor-arg value="5">
79-
<description>process eviction check period in seconds. Instructs the controller to check for process eviction
80-
every X seconds</description>
81-
</constructor-arg>
82-
<constructor-arg value="10">
83-
<description>Process eviction timeout. Instructs the controller to remove dead processes (and any data they may be
84-
holding) X MINUTES</description>
85-
</constructor-arg>
86-
</bean>
87-
88-
<bean id="downloadLauncherRestlet" class="org.geonode.rest.batchdownload.DownloadLauncherRestlet">
89-
<!-- the GeoServer catalog -->
90-
<constructor-arg ref="catalog" />
91-
<constructor-arg ref="processController" />
92-
</bean>
93-
<bean id="downloadStatusRestlet" class="org.geonode.rest.batchdownload.DownloadStatusRestlet">
94-
<!-- the GeoServer catalog -->
95-
<constructor-arg ref="processController" />
96-
</bean>
97-
<bean id="downloadReadyRestlet" class="org.geonode.rest.batchdownload.DownloadReadyRestlet">
98-
<constructor-arg ref="processController" />
99-
</bean>
100-
<bean id="downloadKillerRestlet" class="org.geonode.rest.batchdownload.DownloadKillerRestlet">
101-
<constructor-arg ref="processController" />
102-
</bean>
103-
<bean id="geoNodeSecurityProvider" class="org.geonode.security.GeoNodeSecurityProvider"/>
104-
<bean class="org.geonode.security.GeoNodeAnonymousSecurityProvider"/>
105-
<bean class="org.geonode.security.GeoNodeDataAccessManager">
106-
<constructor-arg ref="geoNodeSecurityProvider" />
107-
</bean>
108-
<bean id="geonodeAnonymousAuthFilterPanelInfo" class="org.geonode.web.security.GeoNodeAnonymousAuthFilterPanelInfo">
109-
<property name="id" value="security.geonodeAnonymousAuthFilter" />
110-
<property name="shortTitleKey" value="GeoNodeAnonymousAuthFilterPanel.short" />
111-
<property name="titleKey" value="GeoNodeAnonymousAuthFilterPanel.title" />
112-
<property name="descriptionKey" value="GeoNodeAnonymousAuthFilterPanel.description"/>
113-
</bean>
114-
<bean id="geonodeAuthFilterPanelInfo" class="org.geonode.web.security.GeoNodeAuthFilterPanelInfo">
115-
<property name="id" value="security.geonodeAuthFilter" />
116-
<property name="shortTitleKey" value="GeoNodeAuthFilterPanel.short" />
117-
<property name="titleKey" value="GeoNodeAuthFilterPanel.title" />
118-
<property name="descriptionKey" value="GeoNodeAuthFilterPanel.description"/>
119-
</bean>
120-
<bean id="geonodeAuthProviderPanelInfo" class="org.geonode.web.security.GeoNodeAuthProviderPanelInfo">
121-
<property name="id" value="security.geonodeAuthProvider" />
122-
<property name="shortTitleKey" value="GeoNodeAuthProviderPanel.short" />
123-
<property name="titleKey" value="GeoNodeAuthProviderPanel.title" />
124-
<property name="descriptionKey" value="GeoNodeAuthProviderPanel.description"/>
125-
</bean>
126-
<bean id="GeonodeWFSCredentialsPlugin" class="org.geonode.wfs.GeonodeWFSCredentialsPlugin">
127-
<description>Sets some geonode specific metadata properties to WFS transactions
128-
(such as full user name and email) to be available to the lower level geotools data access layer.
129-
For the specific case of versioning datastores this data can be used as part of the commit information</description>
130-
</bean>
131-
<!-- XStream persister initializer -->
132-
<bean id="gNodeAuthFilterConfigXStreamPersisterInitializer" class="org.geonode.security.GeoNodeAuthFilterConfigXStreamPersisterInitializer" />
117+
<bean id="downloadLauncherRestlet" class="org.geonode.rest.batchdownload.DownloadLauncherRestlet">
118+
<!-- the GeoServer catalog -->
119+
<constructor-arg ref="catalog" />
120+
<constructor-arg ref="processController" />
121+
</bean>
122+
<bean id="downloadStatusRestlet" class="org.geonode.rest.batchdownload.DownloadStatusRestlet">
123+
<!-- the GeoServer catalog -->
124+
<constructor-arg ref="processController" />
125+
</bean>
126+
<bean id="downloadReadyRestlet" class="org.geonode.rest.batchdownload.DownloadReadyRestlet">
127+
<constructor-arg ref="processController" />
128+
</bean>
129+
<bean id="downloadKillerRestlet" class="org.geonode.rest.batchdownload.DownloadKillerRestlet">
130+
<constructor-arg ref="processController" />
131+
</bean>
132+
<bean id="geoNodeSecurityProvider" class="org.geonode.security.GeoNodeSecurityProvider" />
133+
<bean class="org.geonode.security.GeoNodeAnonymousSecurityProvider" />
134+
<bean class="org.geonode.security.GeoNodeDataAccessManager">
135+
<constructor-arg ref="geoNodeSecurityProvider" />
136+
</bean>
137+
<bean id="geonodeAnonymousAuthFilterPanelInfo"
138+
class="org.geonode.web.security.GeoNodeAnonymousAuthFilterPanelInfo">
139+
<property name="id" value="security.geonodeAnonymousAuthFilter" />
140+
<property name="shortTitleKey" value="GeoNodeAnonymousAuthFilterPanel.short" />
141+
<property name="titleKey" value="GeoNodeAnonymousAuthFilterPanel.title" />
142+
<property name="descriptionKey" value="GeoNodeAnonymousAuthFilterPanel.description" />
143+
</bean>
144+
<bean id="geonodeAuthFilterPanelInfo" class="org.geonode.web.security.GeoNodeAuthFilterPanelInfo">
145+
<property name="id" value="security.geonodeAuthFilter" />
146+
<property name="shortTitleKey" value="GeoNodeAuthFilterPanel.short" />
147+
<property name="titleKey" value="GeoNodeAuthFilterPanel.title" />
148+
<property name="descriptionKey" value="GeoNodeAuthFilterPanel.description" />
149+
</bean>
150+
<bean id="geonodeAuthProviderPanelInfo" class="org.geonode.web.security.GeoNodeAuthProviderPanelInfo">
151+
<property name="id" value="security.geonodeAuthProvider" />
152+
<property name="shortTitleKey" value="GeoNodeAuthProviderPanel.short" />
153+
<property name="titleKey" value="GeoNodeAuthProviderPanel.title" />
154+
<property name="descriptionKey" value="GeoNodeAuthProviderPanel.description" />
155+
</bean>
156+
<bean id="GeonodeWFSCredentialsPlugin" class="org.geonode.wfs.GeonodeWFSCredentialsPlugin">
157+
<description>Sets some geonode specific metadata properties to WFS
158+
transactions
159+
(such as full user name and email) to be available to the lower level
160+
geotools data access layer.
161+
For the specific case of versioning datastores this data can be used as
162+
part of the commit information</description>
163+
</bean>
164+
<!-- XStream persister initializer -->
165+
<bean id="gNodeAuthFilterConfigXStreamPersisterInitializer"
166+
class="org.geonode.security.GeoNodeAuthFilterConfigXStreamPersisterInitializer" />
133167
</beans>

src/main/webapp/WEB-INF/web.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@
233233
<listener-class>org.geoserver.platform.GeoServerHttpSessionListenerProxy</listener-class>
234234
</listener>
235235

236+
<!-- request context listener for session-scoped beans -->
237+
<listener>
238+
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
239+
</listener>
240+
236241
<!-- spring dispatcher servlet, dispatches all incoming requests -->
237242
<servlet>
238243
<servlet-name>dispatcher</servlet-name>

src/main/webapp/data/global.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
<onlineResource>http://geoserver.org</onlineResource>
88
<verbose>false</verbose>
99
<verboseExceptions>false</verboseExceptions>
10+
<metadata>
11+
<map>
12+
<entry>
13+
<string>quietOnNotFound</string>
14+
<boolean>false</boolean>
15+
</entry>
16+
</map>
17+
</metadata>
1018
<localWorkspaceIncludesPrefix>false</localWorkspaceIncludesPrefix>
1119
</settings>
1220
<jai>
@@ -29,9 +37,11 @@
2937
<queueType>UNBOUNDED</queueType>
3038
<imageIOCacheThreshold>10240</imageIOCacheThreshold>
3139
</coverageAccess>
32-
<updateSequence>63</updateSequence>
40+
<updateSequence>147</updateSequence>
3341
<featureTypeCacheSize>0</featureTypeCacheSize>
3442
<globalServices>true</globalServices>
3543
<xmlPostRequestLogBufferSize>1024</xmlPostRequestLogBufferSize>
44+
<xmlExternalEntitiesEnabled>false</xmlExternalEntitiesEnabled>
45+
<webUIMode>DEFAULT</webUIMode>
3646
<resourceErrorHandling>SKIP_MISCONFIGURED_LAYERS</resourceErrorHandling>
3747
</global>

0 commit comments

Comments
 (0)