Skip to content

Commit ab9ec4d

Browse files
author
eugenp
committed
- preliminary security work
1 parent 040b8f9 commit ab9ec4d

64 files changed

Lines changed: 1050 additions & 582 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎infoq/infoq - pom.xml‎

Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>org</groupId>
5+
<artifactId>rest</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<packaging>war</packaging>
8+
9+
<dependencies>
10+
11+
<dependency>
12+
<groupId>com.google.guava</groupId>
13+
<artifactId>guava</artifactId>
14+
<version>${guava.version}</version>
15+
</dependency>
16+
17+
<dependency>
18+
<groupId>javax.servlet</groupId>
19+
<artifactId>servlet-api</artifactId>
20+
<version>2.5</version>
21+
<scope>provided</scope>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>org.apache.httpcomponents</groupId>
26+
<artifactId>httpcore</artifactId>
27+
<version>${http.version}</version>
28+
<exclusions>
29+
<exclusion>
30+
<artifactId>commons-logging</artifactId>
31+
<groupId>commons-logging</groupId>
32+
</exclusion>
33+
</exclusions>
34+
</dependency>
35+
36+
<!-- spring -->
37+
<dependency>
38+
<groupId>org.springframework</groupId>
39+
<artifactId>spring-webmvc</artifactId>
40+
<version>${spring.version}</version>
41+
<exclusions>
42+
<exclusion>
43+
<artifactId>commons-logging</artifactId>
44+
<groupId>commons-logging</groupId>
45+
</exclusion>
46+
</exclusions>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.springframework</groupId>
50+
<artifactId>spring-oxm</artifactId>
51+
<version>${spring.version}</version>
52+
</dependency>
53+
54+
<!-- security -->
55+
<dependency>
56+
<groupId>org.springframework.security</groupId>
57+
<artifactId>spring-security-web</artifactId>
58+
<version>${spring-security.version}</version>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.springframework.security</groupId>
62+
<artifactId>spring-security-config</artifactId>
63+
<version>${spring-security.version}</version>
64+
</dependency>
65+
<dependency>
66+
<groupId>org.springframework</groupId>
67+
<artifactId>spring-tx</artifactId>
68+
<version>${spring.version}</version>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.springframework</groupId>
72+
<artifactId>spring-aop</artifactId>
73+
<version>${spring.version}</version>
74+
</dependency>
75+
76+
<!-- json, xml, atom -->
77+
<dependency>
78+
<groupId>org.codehaus.jackson</groupId>
79+
<artifactId>jackson-mapper-asl</artifactId>
80+
<version>${jackson-mapper-asl.version}</version>
81+
<scope>runtime</scope>
82+
</dependency>
83+
<dependency>
84+
<groupId>javax.xml.bind</groupId>
85+
<artifactId>jaxb-api</artifactId>
86+
<version>${jaxb-api.version}</version>
87+
<scope>runtime</scope>
88+
</dependency>
89+
<dependency>
90+
<groupId>rome</groupId>
91+
<artifactId>rome</artifactId>
92+
<version>1.0</version>
93+
<scope>runtime</scope>
94+
</dependency>
95+
<dependency>
96+
<groupId>com.thoughtworks.xstream</groupId>
97+
<artifactId>xstream</artifactId>
98+
<version>1.4.2</version>
99+
</dependency>
100+
101+
<!-- logging -->
102+
<dependency>
103+
<groupId>org.slf4j</groupId>
104+
<artifactId>slf4j-api</artifactId>
105+
<version>${org.slf4j.version}</version>
106+
</dependency>
107+
<dependency>
108+
<groupId>ch.qos.logback</groupId>
109+
<artifactId>logback-classic</artifactId>
110+
<version>1.0.0</version>
111+
<scope>runtime</scope>
112+
</dependency>
113+
<dependency>
114+
<groupId>org.slf4j</groupId>
115+
<artifactId>jcl-over-slf4j</artifactId>
116+
<version>${org.slf4j.version}</version>
117+
<scope>runtime</scope>
118+
</dependency>
119+
120+
<!-- test scoped -->
121+
<dependency>
122+
<groupId>org.springframework</groupId>
123+
<artifactId>spring-test</artifactId>
124+
<version>${spring.version}</version>
125+
<scope>test</scope>
126+
</dependency>
127+
128+
<dependency>
129+
<groupId>junit</groupId>
130+
<artifactId>junit</artifactId>
131+
<version>${junit.version}</version>
132+
<scope>test</scope>
133+
</dependency>
134+
135+
<dependency>
136+
<groupId>org.hamcrest</groupId>
137+
<artifactId>hamcrest-core</artifactId>
138+
<version>${org.hamcrest.version}</version>
139+
<scope>test</scope>
140+
</dependency>
141+
<dependency>
142+
<groupId>org.hamcrest</groupId>
143+
<artifactId>hamcrest-library</artifactId>
144+
<version>${org.hamcrest.version}</version>
145+
<scope>test</scope>
146+
</dependency>
147+
148+
<dependency>
149+
<groupId>org.mockito</groupId>
150+
<artifactId>mockito-core</artifactId>
151+
<version>${mockito.version}</version>
152+
<scope>test</scope>
153+
</dependency>
154+
155+
<dependency>
156+
<groupId>org.apache.httpcomponents</groupId>
157+
<artifactId>httpclient</artifactId>
158+
<version>${httpclient.version}</version>
159+
<scope>test</scope>
160+
<exclusions>
161+
<exclusion>
162+
<artifactId>commons-logging</artifactId>
163+
<groupId>commons-logging</groupId>
164+
</exclusion>
165+
</exclusions>
166+
</dependency>
167+
168+
<dependency>
169+
<groupId>org.apache.commons</groupId>
170+
<artifactId>commons-lang3</artifactId>
171+
<version>${commons-lang3.version}</version>
172+
<scope>test</scope>
173+
</dependency>
174+
175+
<dependency>
176+
<groupId>com.jayway.restassured</groupId>
177+
<artifactId>rest-assured</artifactId>
178+
<version>1.5</version>
179+
<scope>test</scope>
180+
<exclusions>
181+
<exclusion>
182+
<artifactId>commons-logging</artifactId>
183+
<groupId>commons-logging</groupId>
184+
</exclusion>
185+
</exclusions>
186+
</dependency>
187+
188+
</dependencies>
189+
190+
<build>
191+
<finalName>rest</finalName>
192+
<resources>
193+
<resource>
194+
<directory>src/main/resources</directory>
195+
<filtering>true</filtering>
196+
</resource>
197+
<resource>
198+
<directory>src/main/resources/${target}</directory>
199+
</resource>
200+
</resources>
201+
202+
<plugins>
203+
204+
<plugin>
205+
<groupId>org.apache.maven.plugins</groupId>
206+
<artifactId>maven-surefire-plugin</artifactId>
207+
<version>2.11</version>
208+
<configuration>
209+
<excludes>
210+
<exclude>**/*IntegrationTest.java</exclude>
211+
</excludes>
212+
</configuration>
213+
</plugin>
214+
<plugin>
215+
<groupId>org.apache.maven.plugins</groupId>
216+
<artifactId>maven-compiler-plugin</artifactId>
217+
<version>2.3.2</version>
218+
<configuration>
219+
<source>1.6</source>
220+
<target>1.6</target>
221+
</configuration>
222+
</plugin>
223+
224+
<plugin>
225+
<groupId>org.codehaus.cargo</groupId>
226+
<artifactId>cargo-maven2-plugin</artifactId>
227+
<version>1.1.4</version>
228+
<configuration>
229+
<wait>true</wait>
230+
<container>
231+
<containerId>jetty7x</containerId>
232+
<type>embedded</type>
233+
</container>
234+
<configuration>
235+
<properties>
236+
<cargo.servlet.port>8080</cargo.servlet.port>
237+
</properties>
238+
</configuration>
239+
</configuration>
240+
</plugin>
241+
242+
</plugins>
243+
244+
</build>
245+
246+
<repositories>
247+
248+
<repository>
249+
<id>jboss-public-repository-group</id>
250+
<name>JBoss Public Maven Repository Group</name>
251+
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
252+
<layout>default</layout>
253+
<releases>
254+
<enabled>true</enabled>
255+
<updatePolicy>never</updatePolicy>
256+
</releases>
257+
<snapshots>
258+
<enabled>true</enabled>
259+
<updatePolicy>never</updatePolicy>
260+
</snapshots>
261+
</repository>
262+
263+
</repositories>
264+
265+
<properties>
266+
<target>dev</target>
267+
268+
<!-- VERSIONS -->
269+
<spring-security.version>3.1.0.RELEASE</spring-security.version>
270+
<spring.version>3.1.0.RELEASE</spring.version> <!-- 3.1.0.BUILD-SNAPSHOT -->
271+
<javassist.version>3.15.0-GA</javassist.version>
272+
<cglib.version>2.2.2</cglib.version>
273+
274+
<commons-lang3.version>3.1</commons-lang3.version>
275+
<guava.version>11.0</guava.version>
276+
277+
<jackson-mapper-asl.version>1.9.4</jackson-mapper-asl.version>
278+
<jaxb-api.version>2.2.6</jaxb-api.version>
279+
280+
<!-- VERSIONS - logging -->
281+
<org.slf4j.version>1.6.4</org.slf4j.version>
282+
283+
<!-- VERSIONS - testing -->
284+
<org.hamcrest.version>1.3.RC2</org.hamcrest.version>
285+
<junit.version>4.10</junit.version>
286+
<mockito.version>1.9.0</mockito.version>
287+
288+
<http.version>4.1.4</http.version>
289+
<httpclient.version>4.1.2</httpclient.version>
290+
291+
</properties>
292+
293+
</project>

‎infoq/infoq - web.xml‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
5+
id="WebApp_ID" version="3.0">
6+
<display-name>rest</display-name>
7+
8+
<!-- Spring security -->
9+
<listener>
10+
<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
11+
</listener>
12+
13+
<filter>
14+
<filter-name>springSecurityFilterChain</filter-name>
15+
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
16+
</filter>
17+
<filter-mapping>
18+
<filter-name>springSecurityFilterChain</filter-name>
19+
<url-pattern>/*</url-pattern>
20+
</filter-mapping>
21+
22+
<!-- Spring -->
23+
<context-param>
24+
<param-name>contextClass</param-name>
25+
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
26+
</context-param>
27+
<context-param>
28+
<param-name>contextConfigLocation</param-name>
29+
<param-value>org.rest.spring</param-value>
30+
</context-param>
31+
<listener>
32+
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
33+
</listener>
34+
35+
<!-- rest -->
36+
<servlet>
37+
<servlet-name>rest</servlet-name>
38+
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
39+
<init-param>
40+
<param-name>contextClass</param-name>
41+
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
42+
</init-param>
43+
<init-param>
44+
<param-name>contextConfigLocation</param-name>
45+
<param-value>org.spring.rest</param-value> <!-- won't find anything -->
46+
</init-param>
47+
48+
<load-on-startup>1</load-on-startup>
49+
</servlet>
50+
<servlet-mapping>
51+
<servlet-name>rest</servlet-name>
52+
<url-pattern>/api/*</url-pattern>
53+
</servlet-mapping>
54+
55+
<!-- Disables servlet container welcome file handling. Needed for compatibility
56+
with Servlet 3.0 and Tomcat 7.0 -->
57+
<welcome-file-list>
58+
<welcome-file />
59+
</welcome-file-list>
60+
61+
</web-app>

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@
431431
<commons-lang3.version>3.1</commons-lang3.version>
432432
<guava.version>11.0</guava.version>
433433

434-
<jackson-mapper-asl.version>1.9.3</jackson-mapper-asl.version>
434+
<jackson-mapper-asl.version>1.9.4</jackson-mapper-asl.version>
435435
<jaxb-api.version>2.2.6</jaxb-api.version>
436436

437437
<!-- VERSIONS - persistence -->

‎src/main/java/org/rest/common/util/HttpConstants.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
public final class HttpConstants{
44
public static final String SET_COOKIE_HEADER = "Set-Cookie";
55
public static final String COOKIE_HEADER = "Cookie";
6-
public static final String LINK_HEADER = "Link";
76

87
private HttpConstants(){
98
throw new AssertionError();

‎src/main/java/org/rest/common/util/RESTURIUtil.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.rest.common.util;
22

3-
43
public final class RESTURIUtil{
54

65
public static final String REL_COLLECTION = "collection";

0 commit comments

Comments
 (0)