Commit 5dbfb6ded7f57f7fba65b20266735992675c2698
Exists in
master
Merge remote-tracking branch 'origin/2.4.0' into 2.4.0
Showing
21 changed files
with
890 additions
and
283 deletions
Show diff stats
impl/extension/jpa/src/test/resources/arquillian.xml
@@ -43,6 +43,12 @@ | @@ -43,6 +43,12 @@ | ||
43 | <property name="deploymentExportPath">target/deployments</property> | 43 | <property name="deploymentExportPath">target/deployments</property> |
44 | </engine> | 44 | </engine> |
45 | 45 | ||
46 | + <container qualifier="glassfish-embedded" default="true"> | ||
47 | + <configuration> | ||
48 | + <property name="resourcesXml">src/test/resources/glassfish-resources.xml</property> | ||
49 | + </configuration> | ||
50 | + </container> | ||
51 | + | ||
46 | <!-- | 52 | <!-- |
47 | <container qualifier="jbossas-managed" default="true"> | 53 | <container qualifier="jbossas-managed" default="true"> |
48 | <protocol type="Servlet 3.0" /> | 54 | <protocol type="Servlet 3.0" /> |
impl/extension/servlet/pom.xml
@@ -84,12 +84,22 @@ | @@ -84,12 +84,22 @@ | ||
84 | <scope>test</scope> | 84 | <scope>test</scope> |
85 | </dependency> | 85 | </dependency> |
86 | --> | 86 | --> |
87 | + | ||
88 | + <dependency> | ||
89 | + <groupId>org.apache.httpcomponents</groupId> | ||
90 | + <artifactId>httpclient</artifactId> | ||
91 | + <version>4.2.6</version> | ||
92 | + <scope>test</scope> | ||
93 | + </dependency> | ||
94 | + | ||
95 | + <!-- | ||
87 | <dependency> | 96 | <dependency> |
88 | <groupId>commons-httpclient</groupId> | 97 | <groupId>commons-httpclient</groupId> |
89 | <artifactId>commons-httpclient</artifactId> | 98 | <artifactId>commons-httpclient</artifactId> |
90 | <version>3.1</version> | 99 | <version>3.1</version> |
91 | <scope>test</scope> | 100 | <scope>test</scope> |
92 | </dependency> | 101 | </dependency> |
102 | + --> | ||
93 | </dependencies> | 103 | </dependencies> |
94 | 104 | ||
95 | <repositories> | 105 | <repositories> |
impl/extension/servlet/src/test/java/producer/HttpServletRequestProducerTest.java
@@ -1,50 +0,0 @@ | @@ -1,50 +0,0 @@ | ||
1 | -package producer; | ||
2 | - | ||
3 | -import static org.junit.Assert.assertEquals; | ||
4 | -import static org.junit.Assert.assertTrue; | ||
5 | -import static org.junit.Assert.fail; | ||
6 | - | ||
7 | -import java.net.URL; | ||
8 | - | ||
9 | -import javax.inject.Inject; | ||
10 | - | ||
11 | -import org.apache.commons.httpclient.HttpClient; | ||
12 | -import org.apache.commons.httpclient.HttpStatus; | ||
13 | -import org.apache.commons.httpclient.methods.GetMethod; | ||
14 | -import org.jboss.arquillian.container.test.api.Deployment; | ||
15 | -import org.jboss.arquillian.junit.Arquillian; | ||
16 | -import org.jboss.arquillian.test.api.ArquillianResource; | ||
17 | -import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
18 | -import org.junit.Test; | ||
19 | -import org.junit.runner.RunWith; | ||
20 | - | ||
21 | -import test.Tests; | ||
22 | -import br.gov.frameworkdemoiselle.context.RequestContext; | ||
23 | - | ||
24 | -@RunWith(Arquillian.class) | ||
25 | -public class HttpServletRequestProducerTest { | ||
26 | - | ||
27 | - private static final String PATH = "src/test/resources/producer"; | ||
28 | - | ||
29 | - @ArquillianResource | ||
30 | - private URL deploymentUrl; | ||
31 | - | ||
32 | - @Deployment(testable = false) | ||
33 | - public static WebArchive createDeployment() { | ||
34 | - return Tests.createDeployment().addClass(RequestServlet.class) | ||
35 | - .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | ||
36 | - } | ||
37 | - | ||
38 | - @Test | ||
39 | - public void createR() { | ||
40 | - HttpClient client = new HttpClient(); | ||
41 | - GetMethod method = new GetMethod(deploymentUrl + "/requestproducer"); | ||
42 | - try { | ||
43 | - int status = client.executeMethod(method); | ||
44 | - assertEquals(HttpStatus.SC_OK, status); | ||
45 | - } catch (Exception e) { | ||
46 | - fail(); | ||
47 | - } | ||
48 | - } | ||
49 | - | ||
50 | -} |
impl/extension/servlet/src/test/java/producer/HttpServletResponseProducerTest.java
@@ -1,50 +0,0 @@ | @@ -1,50 +0,0 @@ | ||
1 | -package producer; | ||
2 | - | ||
3 | -import static org.junit.Assert.assertEquals; | ||
4 | -import static org.junit.Assert.assertTrue; | ||
5 | -import static org.junit.Assert.fail; | ||
6 | - | ||
7 | -import java.net.URL; | ||
8 | - | ||
9 | -import javax.inject.Inject; | ||
10 | - | ||
11 | -import org.apache.commons.httpclient.HttpClient; | ||
12 | -import org.apache.commons.httpclient.HttpStatus; | ||
13 | -import org.apache.commons.httpclient.methods.GetMethod; | ||
14 | -import org.jboss.arquillian.container.test.api.Deployment; | ||
15 | -import org.jboss.arquillian.junit.Arquillian; | ||
16 | -import org.jboss.arquillian.test.api.ArquillianResource; | ||
17 | -import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
18 | -import org.junit.Test; | ||
19 | -import org.junit.runner.RunWith; | ||
20 | - | ||
21 | -import test.Tests; | ||
22 | -import br.gov.frameworkdemoiselle.context.RequestContext; | ||
23 | - | ||
24 | -@RunWith(Arquillian.class) | ||
25 | -public class HttpServletResponseProducerTest { | ||
26 | - | ||
27 | - private static final String PATH = "src/test/resources/producer"; | ||
28 | - | ||
29 | - @ArquillianResource | ||
30 | - private URL deploymentUrl; | ||
31 | - | ||
32 | - @Deployment(testable = false) | ||
33 | - public static WebArchive createDeployment() { | ||
34 | - return Tests.createDeployment().addClass(RequestServlet.class) | ||
35 | - .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | ||
36 | - } | ||
37 | - | ||
38 | - @Test | ||
39 | - public void createResponse() { | ||
40 | - HttpClient client = new HttpClient(); | ||
41 | - GetMethod method = new GetMethod(deploymentUrl + "/responseproducer"); | ||
42 | - try { | ||
43 | - int status = client.executeMethod(method); | ||
44 | - assertEquals(HttpStatus.SC_OK, status); | ||
45 | - } catch (Exception e) { | ||
46 | - fail(); | ||
47 | - } | ||
48 | - } | ||
49 | - | ||
50 | -} |
impl/extension/servlet/src/test/java/producer/RequestServlet.java
@@ -1,30 +0,0 @@ | @@ -1,30 +0,0 @@ | ||
1 | -package producer; | ||
2 | - | ||
3 | -import java.io.IOException; | ||
4 | - | ||
5 | -import javax.servlet.ServletException; | ||
6 | -import javax.servlet.http.HttpServlet; | ||
7 | -import javax.servlet.http.HttpServletRequest; | ||
8 | -import javax.servlet.http.HttpServletResponse; | ||
9 | - | ||
10 | -import org.apache.http.HttpStatus; | ||
11 | - | ||
12 | -import br.gov.frameworkdemoiselle.util.Beans; | ||
13 | - | ||
14 | -public class RequestServlet extends HttpServlet { | ||
15 | - | ||
16 | - private static final long serialVersionUID = 1L; | ||
17 | - | ||
18 | - @Override | ||
19 | - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
20 | - | ||
21 | - HttpServletRequest httpRequest = Beans.getReference(HttpServletRequest.class); | ||
22 | - | ||
23 | - if (httpRequest != null) { | ||
24 | - response.setStatus(HttpStatus.SC_OK); | ||
25 | - } else { | ||
26 | - response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); | ||
27 | - } | ||
28 | - } | ||
29 | - | ||
30 | -} |
impl/extension/servlet/src/test/java/producer/ResponseServlet.java
@@ -1,30 +0,0 @@ | @@ -1,30 +0,0 @@ | ||
1 | -package producer; | ||
2 | - | ||
3 | -import java.io.IOException; | ||
4 | - | ||
5 | -import javax.servlet.ServletException; | ||
6 | -import javax.servlet.http.HttpServlet; | ||
7 | -import javax.servlet.http.HttpServletRequest; | ||
8 | -import javax.servlet.http.HttpServletResponse; | ||
9 | - | ||
10 | -import org.apache.http.HttpStatus; | ||
11 | - | ||
12 | -import br.gov.frameworkdemoiselle.util.Beans; | ||
13 | - | ||
14 | -public class ResponseServlet extends HttpServlet { | ||
15 | - | ||
16 | - private static final long serialVersionUID = 1L; | ||
17 | - | ||
18 | - @Override | ||
19 | - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
20 | - | ||
21 | - HttpServletResponse httpResponse = Beans.getReference(HttpServletResponse.class); | ||
22 | - | ||
23 | - if (httpResponse != null) { | ||
24 | - response.setStatus(HttpStatus.SC_OK); | ||
25 | - } else { | ||
26 | - response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); | ||
27 | - } | ||
28 | - } | ||
29 | - | ||
30 | -} |
impl/extension/servlet/src/test/java/producer/request/HttpServletRequestProducerTest.java
0 → 100644
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
1 | +package producer.request; | ||
2 | + | ||
3 | +import static junit.framework.Assert.assertEquals; | ||
4 | + | ||
5 | +import java.io.IOException; | ||
6 | +import java.net.URL; | ||
7 | + | ||
8 | +import org.apache.http.HttpResponse; | ||
9 | +import org.apache.http.HttpStatus; | ||
10 | +import org.apache.http.client.ClientProtocolException; | ||
11 | +import org.apache.http.client.methods.HttpGet; | ||
12 | +import org.apache.http.impl.client.DefaultHttpClient; | ||
13 | +import org.jboss.arquillian.container.test.api.Deployment; | ||
14 | +import org.jboss.arquillian.junit.Arquillian; | ||
15 | +import org.jboss.arquillian.test.api.ArquillianResource; | ||
16 | +import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
17 | +import org.junit.Test; | ||
18 | +import org.junit.runner.RunWith; | ||
19 | + | ||
20 | +import test.Tests; | ||
21 | + | ||
22 | +@RunWith(Arquillian.class) | ||
23 | +public class HttpServletRequestProducerTest { | ||
24 | + | ||
25 | + private static final String PATH = "src/test/resources/producer/request"; | ||
26 | + | ||
27 | + @ArquillianResource | ||
28 | + private URL deploymentUrl; | ||
29 | + | ||
30 | + @Deployment(testable = false) | ||
31 | + public static WebArchive createDeployment() { | ||
32 | + return Tests.createDeployment().addClass(RequestServlet.class) | ||
33 | + .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | ||
34 | + } | ||
35 | + | ||
36 | + @Test | ||
37 | + public void createR() throws ClientProtocolException, IOException { | ||
38 | + HttpGet httpGet = new HttpGet(deploymentUrl + "/servlet"); | ||
39 | + HttpResponse httpResponse = new DefaultHttpClient().execute(httpGet); | ||
40 | + | ||
41 | + int status = httpResponse.getStatusLine().getStatusCode(); | ||
42 | + assertEquals(HttpStatus.SC_OK, status); | ||
43 | + } | ||
44 | +} |
impl/extension/servlet/src/test/java/producer/request/RequestServlet.java
0 → 100644
@@ -0,0 +1,30 @@ | @@ -0,0 +1,30 @@ | ||
1 | +package producer.request; | ||
2 | + | ||
3 | +import java.io.IOException; | ||
4 | + | ||
5 | +import javax.servlet.ServletException; | ||
6 | +import javax.servlet.http.HttpServlet; | ||
7 | +import javax.servlet.http.HttpServletRequest; | ||
8 | +import javax.servlet.http.HttpServletResponse; | ||
9 | + | ||
10 | +import org.apache.http.HttpStatus; | ||
11 | + | ||
12 | +import br.gov.frameworkdemoiselle.util.Beans; | ||
13 | + | ||
14 | +public class RequestServlet extends HttpServlet { | ||
15 | + | ||
16 | + private static final long serialVersionUID = 1L; | ||
17 | + | ||
18 | + @Override | ||
19 | + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
20 | + | ||
21 | + HttpServletRequest httpRequest = Beans.getReference(HttpServletRequest.class); | ||
22 | + | ||
23 | + if (httpRequest != null) { | ||
24 | + response.setStatus(HttpStatus.SC_OK); | ||
25 | + } else { | ||
26 | + response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); | ||
27 | + } | ||
28 | + } | ||
29 | + | ||
30 | +} |
impl/extension/servlet/src/test/java/producer/response/HttpServletResponseProducerTest.java
0 → 100644
@@ -0,0 +1,46 @@ | @@ -0,0 +1,46 @@ | ||
1 | +package producer.response; | ||
2 | + | ||
3 | +import static junit.framework.Assert.assertEquals; | ||
4 | + | ||
5 | +import java.io.IOException; | ||
6 | +import java.net.URL; | ||
7 | + | ||
8 | +import org.apache.http.HttpResponse; | ||
9 | +import org.apache.http.HttpStatus; | ||
10 | +import org.apache.http.client.ClientProtocolException; | ||
11 | +import org.apache.http.client.methods.HttpGet; | ||
12 | +import org.apache.http.impl.client.DefaultHttpClient; | ||
13 | +import org.jboss.arquillian.container.test.api.Deployment; | ||
14 | +import org.jboss.arquillian.junit.Arquillian; | ||
15 | +import org.jboss.arquillian.test.api.ArquillianResource; | ||
16 | +import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
17 | +import org.junit.Test; | ||
18 | +import org.junit.runner.RunWith; | ||
19 | + | ||
20 | +import producer.request.RequestServlet; | ||
21 | +import test.Tests; | ||
22 | + | ||
23 | +@RunWith(Arquillian.class) | ||
24 | +public class HttpServletResponseProducerTest { | ||
25 | + | ||
26 | + private static final String PATH = "src/test/resources/producer/response"; | ||
27 | + | ||
28 | + @ArquillianResource | ||
29 | + private URL deploymentUrl; | ||
30 | + | ||
31 | + @Deployment(testable = false) | ||
32 | + public static WebArchive createDeployment() { | ||
33 | + return Tests.createDeployment().addClass(RequestServlet.class) | ||
34 | + .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | ||
35 | + } | ||
36 | + | ||
37 | + @Test | ||
38 | + public void createResponse() throws ClientProtocolException, IOException { | ||
39 | + HttpGet httpGet = new HttpGet(deploymentUrl + "/servlet"); | ||
40 | + HttpResponse httpResponse = new DefaultHttpClient().execute(httpGet); | ||
41 | + | ||
42 | + int status = httpResponse.getStatusLine().getStatusCode(); | ||
43 | + assertEquals(HttpStatus.SC_OK, status); | ||
44 | + } | ||
45 | + | ||
46 | +} |
impl/extension/servlet/src/test/java/producer/response/ResponseServlet.java
0 → 100644
@@ -0,0 +1,30 @@ | @@ -0,0 +1,30 @@ | ||
1 | +package producer.response; | ||
2 | + | ||
3 | +import java.io.IOException; | ||
4 | + | ||
5 | +import javax.servlet.ServletException; | ||
6 | +import javax.servlet.http.HttpServlet; | ||
7 | +import javax.servlet.http.HttpServletRequest; | ||
8 | +import javax.servlet.http.HttpServletResponse; | ||
9 | + | ||
10 | +import org.apache.http.HttpStatus; | ||
11 | + | ||
12 | +import br.gov.frameworkdemoiselle.util.Beans; | ||
13 | + | ||
14 | +public class ResponseServlet extends HttpServlet { | ||
15 | + | ||
16 | + private static final long serialVersionUID = 1L; | ||
17 | + | ||
18 | + @Override | ||
19 | + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
20 | + | ||
21 | + HttpServletResponse httpResponse = Beans.getReference(HttpServletResponse.class); | ||
22 | + | ||
23 | + if (httpResponse != null) { | ||
24 | + response.setStatus(HttpStatus.SC_OK); | ||
25 | + } else { | ||
26 | + response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); | ||
27 | + } | ||
28 | + } | ||
29 | + | ||
30 | +} |
impl/extension/servlet/src/test/java/security/SecurityServlet.java
@@ -2,7 +2,6 @@ package security; | @@ -2,7 +2,6 @@ package security; | ||
2 | 2 | ||
3 | import java.io.IOException; | 3 | import java.io.IOException; |
4 | 4 | ||
5 | -import javax.inject.Inject; | ||
6 | import javax.servlet.ServletException; | 5 | import javax.servlet.ServletException; |
7 | import javax.servlet.annotation.WebServlet; | 6 | import javax.servlet.annotation.WebServlet; |
8 | import javax.servlet.http.HttpServlet; | 7 | import javax.servlet.http.HttpServlet; |
@@ -11,27 +10,33 @@ import javax.servlet.http.HttpServletResponse; | @@ -11,27 +10,33 @@ import javax.servlet.http.HttpServletResponse; | ||
11 | 10 | ||
12 | import org.apache.http.HttpStatus; | 11 | import org.apache.http.HttpStatus; |
13 | 12 | ||
13 | +import br.gov.frameworkdemoiselle.security.AuthenticationException; | ||
14 | import br.gov.frameworkdemoiselle.security.Credentials; | 14 | import br.gov.frameworkdemoiselle.security.Credentials; |
15 | import br.gov.frameworkdemoiselle.security.SecurityContext; | 15 | import br.gov.frameworkdemoiselle.security.SecurityContext; |
16 | +import br.gov.frameworkdemoiselle.util.Beans; | ||
16 | 17 | ||
17 | @WebServlet("/login") | 18 | @WebServlet("/login") |
18 | public class SecurityServlet extends HttpServlet { | 19 | public class SecurityServlet extends HttpServlet { |
19 | 20 | ||
20 | private static final long serialVersionUID = 1L; | 21 | private static final long serialVersionUID = 1L; |
21 | 22 | ||
22 | - @Inject | ||
23 | - private SecurityContext securityContext; | ||
24 | - | ||
25 | - @Inject | ||
26 | - private Credentials credentials; | ||
27 | - | ||
28 | @Override | 23 | @Override |
29 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | 24 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
30 | - super.doGet(request, response); | 25 | + String result = request.getHeader("Authorization"); |
26 | + result = (result == null ? request.getHeader("authorization") : result); | ||
27 | + | ||
28 | + Credentials credentials = Beans.getReference(Credentials.class); | ||
29 | + credentials.setUsername(request.getParameter("username")); | ||
30 | + credentials.setPassword(request.getParameter("password")); | ||
31 | + | ||
32 | + try { | ||
33 | + Beans.getReference(SecurityContext.class).login(); | ||
34 | + response.setStatus(HttpStatus.SC_OK); | ||
35 | + } catch (AuthenticationException e) { | ||
36 | + response.setStatus(HttpStatus.SC_UNAUTHORIZED); | ||
37 | + } | ||
38 | + | ||
39 | + | ||
31 | 40 | ||
32 | - credentials.setUsername("users"); | ||
33 | - credentials.setPassword("users"); | ||
34 | - securityContext.login(); | ||
35 | - response.setStatus(HttpStatus.SC_OK); | ||
36 | } | 41 | } |
37 | } | 42 | } |
impl/extension/servlet/src/test/java/security/SecurityTest.java
1 | package security; | 1 | package security; |
2 | 2 | ||
3 | import static org.junit.Assert.assertEquals; | 3 | import static org.junit.Assert.assertEquals; |
4 | -import static org.junit.Assert.fail; | ||
5 | 4 | ||
6 | import java.io.IOException; | 5 | import java.io.IOException; |
6 | +import java.net.URISyntaxException; | ||
7 | import java.net.URL; | 7 | import java.net.URL; |
8 | 8 | ||
9 | -import org.apache.commons.httpclient.HttpClient; | ||
10 | -import org.apache.commons.httpclient.HttpException; | ||
11 | -import org.apache.commons.httpclient.HttpStatus; | ||
12 | -import org.apache.commons.httpclient.methods.GetMethod; | 9 | +import org.apache.http.HttpResponse; |
10 | +import org.apache.http.HttpStatus; | ||
11 | +import org.apache.http.client.ClientProtocolException; | ||
12 | +import org.apache.http.client.methods.HttpGet; | ||
13 | +import org.apache.http.client.utils.URIBuilder; | ||
14 | +import org.apache.http.impl.client.DefaultHttpClient; | ||
13 | import org.jboss.arquillian.container.test.api.Deployment; | 15 | import org.jboss.arquillian.container.test.api.Deployment; |
14 | import org.jboss.arquillian.junit.Arquillian; | 16 | import org.jboss.arquillian.junit.Arquillian; |
15 | import org.jboss.arquillian.test.api.ArquillianResource; | 17 | import org.jboss.arquillian.test.api.ArquillianResource; |
@@ -19,6 +21,8 @@ import org.junit.runner.RunWith; | @@ -19,6 +21,8 @@ import org.junit.runner.RunWith; | ||
19 | 21 | ||
20 | import test.Tests; | 22 | import test.Tests; |
21 | 23 | ||
24 | +import com.sun.enterprise.security.auth.login.FileLoginModule; | ||
25 | + | ||
22 | @RunWith(Arquillian.class) | 26 | @RunWith(Arquillian.class) |
23 | public class SecurityTest { | 27 | public class SecurityTest { |
24 | 28 | ||
@@ -29,22 +33,30 @@ public class SecurityTest { | @@ -29,22 +33,30 @@ public class SecurityTest { | ||
29 | 33 | ||
30 | @Deployment(testable = false) | 34 | @Deployment(testable = false) |
31 | public static WebArchive createDeployment() { | 35 | public static WebArchive createDeployment() { |
32 | - return Tests.createDeployment().addClass(SecurityServlet.class) | 36 | + return Tests.createDeployment().addClasses(SecurityServlet.class, FileLoginModule.class) |
33 | .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | 37 | .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); |
34 | } | 38 | } |
35 | 39 | ||
36 | @Test | 40 | @Test |
37 | - public void login() { | ||
38 | - HttpClient client = new HttpClient(); | ||
39 | - GetMethod method = new GetMethod(deploymentUrl + "/login"); | ||
40 | - try { | ||
41 | - int status = client.executeMethod(method); | ||
42 | - assertEquals(HttpStatus.SC_OK, status); | ||
43 | - } catch (HttpException e) { | ||
44 | - fail(); | ||
45 | - } catch (IOException e) { | ||
46 | - e.printStackTrace(); | ||
47 | - } | 41 | + public void loginSucessfull() throws ClientProtocolException, IOException, URISyntaxException { |
42 | + URIBuilder uriBuilder = new URIBuilder(deploymentUrl + "/login"); | ||
43 | + uriBuilder.setParameter("username", "demoiselle"); | ||
44 | + uriBuilder.setParameter("password", "changeit"); | ||
45 | + | ||
46 | + HttpGet httpGet = new HttpGet(uriBuilder.build()); | ||
47 | + HttpResponse httpResponse = new DefaultHttpClient().execute(httpGet); | ||
48 | + | ||
49 | + int status = httpResponse.getStatusLine().getStatusCode(); | ||
50 | + assertEquals(HttpStatus.SC_OK, status); | ||
48 | } | 51 | } |
49 | 52 | ||
53 | + @Test | ||
54 | + public void loginFailed() throws ClientProtocolException, IOException { | ||
55 | + DefaultHttpClient client = new DefaultHttpClient(); | ||
56 | + HttpGet get = new HttpGet(deploymentUrl + "/login?username=demoiselle&password=wrongpass"); | ||
57 | + HttpResponse response = client.execute(get); | ||
58 | + | ||
59 | + int status = response.getStatusLine().getStatusCode(); | ||
60 | + assertEquals(HttpStatus.SC_UNAUTHORIZED, status); | ||
61 | + } | ||
50 | } | 62 | } |
impl/extension/servlet/src/test/java/security/authentication/basic/BasicAuthenticationFilterTest.java
0 → 100644
@@ -0,0 +1,35 @@ | @@ -0,0 +1,35 @@ | ||
1 | +package security.authentication.basic; | ||
2 | + | ||
3 | +import java.net.URL; | ||
4 | + | ||
5 | +import org.jboss.arquillian.container.test.api.Deployment; | ||
6 | +import org.jboss.arquillian.junit.Arquillian; | ||
7 | +import org.jboss.arquillian.test.api.ArquillianResource; | ||
8 | +import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
9 | +import org.junit.Test; | ||
10 | +import org.junit.runner.RunWith; | ||
11 | + | ||
12 | +import test.Tests; | ||
13 | + | ||
14 | +@RunWith(Arquillian.class) | ||
15 | +public class BasicAuthenticationFilterTest { | ||
16 | + | ||
17 | + private static final String PATH = "src/test/resources/security/authentication/basic"; | ||
18 | + | ||
19 | + @ArquillianResource | ||
20 | + private URL deploymentUrl; | ||
21 | + | ||
22 | + @Deployment(testable = false) | ||
23 | + public static WebArchive createDeployment() { | ||
24 | + return Tests.createDeployment().addClasses(BasicAuthenticationFilterTest.class) | ||
25 | + .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | ||
26 | + } | ||
27 | + | ||
28 | + @Test | ||
29 | + public void loginSucessfull() { | ||
30 | + } | ||
31 | + | ||
32 | + @Test | ||
33 | + public void loginfailed() { | ||
34 | + } | ||
35 | +} |
impl/extension/servlet/src/test/resources/arquillian.xml
@@ -49,13 +49,11 @@ | @@ -49,13 +49,11 @@ | ||
49 | </extension> | 49 | </extension> |
50 | --> | 50 | --> |
51 | 51 | ||
52 | - <!-- | ||
53 | - <container qualifier="glassfish" default="true"> | 52 | + <container qualifier="glassfish-embedded" default="true"> |
54 | <configuration> | 53 | <configuration> |
55 | - <property name="autoDelete">true</property> | 54 | + <property name="configurationXml">src/test/resources/domain.xml</property> |
56 | </configuration> | 55 | </configuration> |
57 | </container> | 56 | </container> |
58 | - --> | ||
59 | 57 | ||
60 | <!-- | 58 | <!-- |
61 | <container qualifier="jbossas-managed" default="true"> | 59 | <container qualifier="jbossas-managed" default="true"> |
@@ -0,0 +1,417 @@ | @@ -0,0 +1,417 @@ | ||
1 | +<domain log-root="${com.sun.aas.instanceRoot}/logs" application-root="${com.sun.aas.instanceRoot}/applications" version="23"> | ||
2 | + <system-applications> | ||
3 | + <application context-root="" location="${com.sun.aas.installRootURI}/lib/install/applications/__admingui" name="__admingui" directory-deployed="true" object-type="system-admin"> | ||
4 | + <module name="__admingui"> | ||
5 | + <engine sniffer="web"></engine> | ||
6 | + <engine sniffer="security"></engine> | ||
7 | + </module> | ||
8 | + </application> | ||
9 | + </system-applications> | ||
10 | + <applications></applications> | ||
11 | + <resources> | ||
12 | + <jdbc-resource pool-name="__TimerPool" jndi-name="jdbc/__TimerPool" object-type="system-admin"></jdbc-resource> | ||
13 | + <jdbc-resource pool-name="DerbyPool" jndi-name="jdbc/__default"></jdbc-resource> | ||
14 | + <jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" res-type="javax.sql.XADataSource" name="__TimerPool"> | ||
15 | + <property name="databaseName" value="${com.sun.aas.instanceRoot}/lib/databases/ejbtimer"></property> | ||
16 | + <property name="connectionAttributes" value=";create=true"></property> | ||
17 | + </jdbc-connection-pool> | ||
18 | + <jdbc-connection-pool is-isolation-level-guaranteed="false" datasource-classname="org.apache.derby.jdbc.ClientDataSource" res-type="javax.sql.DataSource" name="DerbyPool"> | ||
19 | + <property name="PortNumber" value="1527"></property> | ||
20 | + <property name="Password" value="APP"></property> | ||
21 | + <property name="User" value="APP"></property> | ||
22 | + <property name="serverName" value="localhost"></property> | ||
23 | + <property name="DatabaseName" value="sun-appserv-samples"></property> | ||
24 | + <property name="connectionAttributes" value=";create=true"></property> | ||
25 | + </jdbc-connection-pool> | ||
26 | + </resources> | ||
27 | + <servers> | ||
28 | + <server name="server" config-ref="server-config"> | ||
29 | + <application-ref ref="__admingui" virtual-servers="__asadmin"></application-ref> | ||
30 | + <resource-ref ref="jdbc/__TimerPool"></resource-ref> | ||
31 | + <resource-ref ref="jdbc/__default"></resource-ref> | ||
32 | + </server> | ||
33 | + </servers> | ||
34 | + <nodes> | ||
35 | + <node node-host="localhost" name="localhost-domain1" type="CONFIG" install-dir="${com.sun.aas.productRoot}"></node> | ||
36 | + </nodes> | ||
37 | + <configs> | ||
38 | + <config name="server-config"> | ||
39 | + <http-service> | ||
40 | + <access-log></access-log> | ||
41 | + <virtual-server id="server" network-listeners="http-listener-1,http-listener-2"></virtual-server> | ||
42 | + <virtual-server id="__asadmin" network-listeners="admin-listener"></virtual-server> | ||
43 | + </http-service> | ||
44 | + <iiop-service> | ||
45 | + <orb use-thread-pool-ids="thread-pool-1"></orb> | ||
46 | + <iiop-listener port="3700" id="orb-listener-1" address="0.0.0.0" lazy-init="true"></iiop-listener> | ||
47 | + <iiop-listener port="3820" id="SSL" address="0.0.0.0" security-enabled="true"> | ||
48 | + <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as"></ssl> | ||
49 | + </iiop-listener> | ||
50 | + <iiop-listener port="3920" id="SSL_MUTUALAUTH" address="0.0.0.0" security-enabled="true"> | ||
51 | + <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as" client-auth-enabled="true"></ssl> | ||
52 | + </iiop-listener> | ||
53 | + </iiop-service> | ||
54 | + <admin-service system-jmx-connector-name="system" type="das-and-server"> | ||
55 | + <jmx-connector port="8686" address="0.0.0.0" security-enabled="false" auth-realm-name="admin-realm" name="system"></jmx-connector> | ||
56 | + <property name="adminConsoleContextRoot" value="/admin"></property> | ||
57 | + <property name="adminConsoleDownloadLocation" value="${com.sun.aas.installRoot}/lib/install/applications/admingui.war"></property> | ||
58 | + <property name="ipsRoot" value="${com.sun.aas.installRoot}/.."></property> | ||
59 | + <das-config></das-config> | ||
60 | + </admin-service> | ||
61 | + <connector-service></connector-service> | ||
62 | + <web-container> | ||
63 | + <session-config> | ||
64 | + <session-manager> | ||
65 | + <manager-properties></manager-properties> | ||
66 | + <store-properties></store-properties> | ||
67 | + </session-manager> | ||
68 | + <session-properties></session-properties> | ||
69 | + </session-config> | ||
70 | + </web-container> | ||
71 | + <ejb-container session-store="${com.sun.aas.instanceRoot}/session-store"> | ||
72 | + <ejb-timer-service></ejb-timer-service> | ||
73 | + </ejb-container> | ||
74 | + <mdb-container></mdb-container> | ||
75 | + <jms-service default-jms-host="default_JMS_host"> | ||
76 | + <jms-host host="localhost" name="default_JMS_host"></jms-host> | ||
77 | + </jms-service> | ||
78 | + <security-service> | ||
79 | + <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="admin-realm"> | ||
80 | + <property name="file" value="${com.sun.aas.instanceRoot}/config/admin-keyfile"></property> | ||
81 | + <property name="jaas-context" value="fileRealm"></property> | ||
82 | + </auth-realm> | ||
83 | + <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="file"> | ||
84 | + <property name="file" value="src/test/resources/keyfile"></property> | ||
85 | + <property name="jaas-context" value="fileRealm"></property> | ||
86 | + </auth-realm> | ||
87 | + <auth-realm classname="com.sun.enterprise.security.auth.realm.certificate.CertificateRealm" name="certificate"></auth-realm> | ||
88 | + <jacc-provider policy-provider="com.sun.enterprise.security.provider.PolicyWrapper" name="default" policy-configuration-factory-provider="com.sun.enterprise.security.provider.PolicyConfigurationFactoryImpl"> | ||
89 | + <property name="repository" value="${com.sun.aas.instanceRoot}/generated/policy"></property> | ||
90 | + </jacc-provider> | ||
91 | + <jacc-provider policy-provider="com.sun.enterprise.security.jacc.provider.SimplePolicyProvider" name="simple" policy-configuration-factory-provider="com.sun.enterprise.security.jacc.provider.SimplePolicyConfigurationFactory"></jacc-provider> | ||
92 | + <audit-module classname="com.sun.enterprise.security.Audit" name="default"> | ||
93 | + <property name="auditOn" value="false"></property> | ||
94 | + </audit-module> | ||
95 | + <message-security-config auth-layer="SOAP"> | ||
96 | + <provider-config provider-type="client" provider-id="XWS_ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule"> | ||
97 | + <request-policy auth-source="content"></request-policy> | ||
98 | + <response-policy auth-source="content"></response-policy> | ||
99 | + <property name="encryption.key.alias" value="s1as"></property> | ||
100 | + <property name="signature.key.alias" value="s1as"></property> | ||
101 | + <property name="dynamic.username.password" value="false"></property> | ||
102 | + <property name="debug" value="false"></property> | ||
103 | + </provider-config> | ||
104 | + <provider-config provider-type="client" provider-id="ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule"> | ||
105 | + <request-policy auth-source="content"></request-policy> | ||
106 | + <response-policy auth-source="content"></response-policy> | ||
107 | + <property name="encryption.key.alias" value="s1as"></property> | ||
108 | + <property name="signature.key.alias" value="s1as"></property> | ||
109 | + <property name="dynamic.username.password" value="false"></property> | ||
110 | + <property name="debug" value="false"></property> | ||
111 | + <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property> | ||
112 | + </provider-config> | ||
113 | + <provider-config provider-type="server" provider-id="XWS_ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule"> | ||
114 | + <request-policy auth-source="content"></request-policy> | ||
115 | + <response-policy auth-source="content"></response-policy> | ||
116 | + <property name="encryption.key.alias" value="s1as"></property> | ||
117 | + <property name="signature.key.alias" value="s1as"></property> | ||
118 | + <property name="debug" value="false"></property> | ||
119 | + </provider-config> | ||
120 | + <provider-config provider-type="server" provider-id="ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule"> | ||
121 | + <request-policy auth-source="content"></request-policy> | ||
122 | + <response-policy auth-source="content"></response-policy> | ||
123 | + <property name="encryption.key.alias" value="s1as"></property> | ||
124 | + <property name="signature.key.alias" value="s1as"></property> | ||
125 | + <property name="debug" value="false"></property> | ||
126 | + <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property> | ||
127 | + </provider-config> | ||
128 | + </message-security-config> | ||
129 | + <message-security-config auth-layer="HttpServlet"> | ||
130 | + <provider-config provider-type="server" provider-id="GFConsoleAuthModule" class-name="org.glassfish.admingui.common.security.AdminConsoleAuthModule"> | ||
131 | + <request-policy auth-source="sender"></request-policy> | ||
132 | + <response-policy></response-policy> | ||
133 | + <property name="restAuthURL" value="http://localhost:${ADMIN_LISTENER_PORT}/management/sessions"></property> | ||
134 | + <property name="loginPage" value="/login.jsf"></property> | ||
135 | + <property name="loginErrorPage" value="/loginError.jsf"></property> | ||
136 | + </provider-config> | ||
137 | + </message-security-config> | ||
138 | + <property name="default-digest-algorithm" value="SHA-256"></property> | ||
139 | + </security-service> | ||
140 | + <transaction-service tx-log-dir="${com.sun.aas.instanceRoot}/logs"></transaction-service> | ||
141 | + <java-config debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009" system-classpath="" classpath-suffix=""> | ||
142 | + <jvm-options>-XX:MaxPermSize=192m</jvm-options> | ||
143 | + <jvm-options>-XX:PermSize=64m</jvm-options> | ||
144 | + <jvm-options>-client</jvm-options> | ||
145 | + <jvm-options>-Djava.awt.headless=true</jvm-options> | ||
146 | + <jvm-options>-Djavax.management.builder.initial=com.sun.enterprise.v3.admin.AppServerMBeanServerBuilder</jvm-options> | ||
147 | + <jvm-options>-XX:+UnlockDiagnosticVMOptions</jvm-options> | ||
148 | + <jvm-options>-Djava.endorsed.dirs=${com.sun.aas.installRoot}/modules/endorsed${path.separator}${com.sun.aas.installRoot}/lib/endorsed</jvm-options> | ||
149 | + <jvm-options>-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy</jvm-options> | ||
150 | + <jvm-options>-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf</jvm-options> | ||
151 | + <jvm-options>-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as</jvm-options> | ||
152 | + <jvm-options>-Xmx512m</jvm-options> | ||
153 | + <jvm-options>-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks</jvm-options> | ||
154 | + <jvm-options>-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks</jvm-options> | ||
155 | + <jvm-options>-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext</jvm-options> | ||
156 | + <jvm-options>-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver</jvm-options> | ||
157 | + <jvm-options>-DANTLR_USE_DIRECT_CLASS_LOADING=true</jvm-options> | ||
158 | + <jvm-options>-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory</jvm-options> | ||
159 | + <jvm-options>-Dosgi.shell.telnet.port=6666</jvm-options> | ||
160 | + <jvm-options>-Dosgi.shell.telnet.maxconn=1</jvm-options> | ||
161 | + <jvm-options>-Dosgi.shell.telnet.ip=127.0.0.1</jvm-options> | ||
162 | + <jvm-options>-Dgosh.args=--nointeractive</jvm-options> | ||
163 | + <jvm-options>-Dfelix.fileinstall.dir=${com.sun.aas.installRoot}/modules/autostart/</jvm-options> | ||
164 | + <jvm-options>-Dfelix.fileinstall.poll=5000</jvm-options> | ||
165 | + <jvm-options>-Dfelix.fileinstall.log.level=2</jvm-options> | ||
166 | + <jvm-options>-Dfelix.fileinstall.bundles.new.start=true</jvm-options> | ||
167 | + <jvm-options>-Dfelix.fileinstall.bundles.startTransient=true</jvm-options> | ||
168 | + <jvm-options>-Dfelix.fileinstall.disableConfigSave=false</jvm-options> | ||
169 | + <jvm-options>-XX:NewRatio=2</jvm-options> | ||
170 | + </java-config> | ||
171 | + <network-config> | ||
172 | + <protocols> | ||
173 | + <protocol name="http-listener-1"> | ||
174 | + <http default-virtual-server="server" max-connections="250"> | ||
175 | + <file-cache></file-cache> | ||
176 | + </http> | ||
177 | + </protocol> | ||
178 | + <protocol security-enabled="true" name="http-listener-2"> | ||
179 | + <http default-virtual-server="server" max-connections="250"> | ||
180 | + <file-cache></file-cache> | ||
181 | + </http> | ||
182 | + <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as"></ssl> | ||
183 | + </protocol> | ||
184 | + <protocol name="admin-listener"> | ||
185 | + <http default-virtual-server="__asadmin" max-connections="250" encoded-slash-enabled="true"> | ||
186 | + <file-cache></file-cache> | ||
187 | + </http> | ||
188 | + </protocol> | ||
189 | + </protocols> | ||
190 | + <network-listeners> | ||
191 | + <network-listener port="8080" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener> | ||
192 | + <network-listener port="8181" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener> | ||
193 | + <network-listener port="4848" protocol="admin-listener" transport="tcp" name="admin-listener" thread-pool="admin-thread-pool"></network-listener> | ||
194 | + </network-listeners> | ||
195 | + <transports> | ||
196 | + <transport name="tcp"></transport> | ||
197 | + </transports> | ||
198 | + </network-config> | ||
199 | + <thread-pools> | ||
200 | + <thread-pool name="admin-thread-pool" max-thread-pool-size="50" max-queue-size="256"></thread-pool> | ||
201 | + <thread-pool name="http-thread-pool"></thread-pool> | ||
202 | + <thread-pool name="thread-pool-1" max-thread-pool-size="200"></thread-pool> | ||
203 | + </thread-pools> | ||
204 | + <monitoring-service> | ||
205 | + <module-monitoring-levels></module-monitoring-levels> | ||
206 | + </monitoring-service> | ||
207 | + <group-management-service> | ||
208 | + <failure-detection></failure-detection> | ||
209 | + </group-management-service> | ||
210 | + </config> | ||
211 | + <config name="default-config"> | ||
212 | + <http-service> | ||
213 | + <access-log></access-log> | ||
214 | + <virtual-server id="server" network-listeners="http-listener-1, http-listener-2"> | ||
215 | + <property name="default-web-xml" value="${com.sun.aas.instanceRoot}/config/default-web.xml"></property> | ||
216 | + </virtual-server> | ||
217 | + <virtual-server id="__asadmin" network-listeners="admin-listener"></virtual-server> | ||
218 | + </http-service> | ||
219 | + <iiop-service> | ||
220 | + <orb use-thread-pool-ids="thread-pool-1"></orb> | ||
221 | + <iiop-listener port="${IIOP_LISTENER_PORT}" id="orb-listener-1" address="0.0.0.0"></iiop-listener> | ||
222 | + <iiop-listener port="${IIOP_SSL_LISTENER_PORT}" id="SSL" address="0.0.0.0" security-enabled="true"> | ||
223 | + <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as"></ssl> | ||
224 | + </iiop-listener> | ||
225 | + <iiop-listener port="${IIOP_SSL_MUTUALAUTH_PORT}" id="SSL_MUTUALAUTH" address="0.0.0.0" security-enabled="true"> | ||
226 | + <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as" client-auth-enabled="true"></ssl> | ||
227 | + </iiop-listener> | ||
228 | + </iiop-service> | ||
229 | + <admin-service system-jmx-connector-name="system"> | ||
230 | + <jmx-connector port="${JMX_SYSTEM_CONNECTOR_PORT}" address="0.0.0.0" security-enabled="false" auth-realm-name="admin-realm" name="system"></jmx-connector> | ||
231 | + <property name="adminConsoleDownloadLocation" value="${com.sun.aas.installRoot}/lib/install/applications/admingui.war"></property> | ||
232 | + <das-config></das-config> | ||
233 | + </admin-service> | ||
234 | + <web-container> | ||
235 | + <session-config> | ||
236 | + <session-manager> | ||
237 | + <manager-properties></manager-properties> | ||
238 | + <store-properties></store-properties> | ||
239 | + </session-manager> | ||
240 | + <session-properties></session-properties> | ||
241 | + </session-config> | ||
242 | + </web-container> | ||
243 | + <ejb-container session-store="${com.sun.aas.instanceRoot}/session-store"> | ||
244 | + <ejb-timer-service></ejb-timer-service> | ||
245 | + </ejb-container> | ||
246 | + <mdb-container></mdb-container> | ||
247 | + <jms-service addresslist-behavior="priority" default-jms-host="default_JMS_host"> | ||
248 | + <jms-host port="${JMS_PROVIDER_PORT}" host="localhost" name="default_JMS_host"></jms-host> | ||
249 | + </jms-service> | ||
250 | + <log-service log-rotation-limit-in-bytes="2000000" file="${com.sun.aas.instanceRoot}/logs/server.log"> | ||
251 | + <module-log-levels></module-log-levels> | ||
252 | + </log-service> | ||
253 | + <security-service> | ||
254 | + <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="admin-realm"> | ||
255 | + <property name="file" value="${com.sun.aas.instanceRoot}/config/admin-keyfile"></property> | ||
256 | + <property name="jaas-context" value="fileRealm"></property> | ||
257 | + </auth-realm> | ||
258 | + <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="file"> | ||
259 | + <property name="file" value="src/test/resources/keyfile"></property> | ||
260 | + <property name="jaas-context" value="fileRealm"></property> | ||
261 | + </auth-realm> | ||
262 | + <auth-realm classname="com.sun.enterprise.security.auth.realm.certificate.CertificateRealm" name="certificate"></auth-realm> | ||
263 | + <jacc-provider policy-provider="com.sun.enterprise.security.provider.PolicyWrapper" name="default" policy-configuration-factory-provider="com.sun.enterprise.security.provider.PolicyConfigurationFactoryImpl"> | ||
264 | + <property name="repository" value="${com.sun.aas.instanceRoot}/generated/policy"></property> | ||
265 | + </jacc-provider> | ||
266 | + <jacc-provider policy-provider="com.sun.enterprise.security.jacc.provider.SimplePolicyProvider" name="simple" policy-configuration-factory-provider="com.sun.enterprise.security.jacc.provider.SimplePolicyConfigurationFactory"></jacc-provider> | ||
267 | + <audit-module classname="com.sun.enterprise.security.Audit" name="default"> | ||
268 | + <property name="auditOn" value="false"></property> | ||
269 | + </audit-module> | ||
270 | + <message-security-config auth-layer="SOAP"> | ||
271 | + <provider-config provider-type="client" provider-id="XWS_ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule"> | ||
272 | + <request-policy auth-source="content"></request-policy> | ||
273 | + <response-policy auth-source="content"></response-policy> | ||
274 | + <property name="encryption.key.alias" value="s1as"></property> | ||
275 | + <property name="signature.key.alias" value="s1as"></property> | ||
276 | + <property name="dynamic.username.password" value="false"></property> | ||
277 | + <property name="debug" value="false"></property> | ||
278 | + </provider-config> | ||
279 | + <provider-config provider-type="client" provider-id="ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule"> | ||
280 | + <request-policy auth-source="content"></request-policy> | ||
281 | + <response-policy auth-source="content"></response-policy> | ||
282 | + <property name="encryption.key.alias" value="s1as"></property> | ||
283 | + <property name="signature.key.alias" value="s1as"></property> | ||
284 | + <property name="dynamic.username.password" value="false"></property> | ||
285 | + <property name="debug" value="false"></property> | ||
286 | + <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property> | ||
287 | + </provider-config> | ||
288 | + <provider-config provider-type="server" provider-id="XWS_ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule"> | ||
289 | + <request-policy auth-source="content"></request-policy> | ||
290 | + <response-policy auth-source="content"></response-policy> | ||
291 | + <property name="encryption.key.alias" value="s1as"></property> | ||
292 | + <property name="signature.key.alias" value="s1as"></property> | ||
293 | + <property name="debug" value="false"></property> | ||
294 | + </provider-config> | ||
295 | + <provider-config provider-type="server" provider-id="ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule"> | ||
296 | + <request-policy auth-source="content"></request-policy> | ||
297 | + <response-policy auth-source="content"></response-policy> | ||
298 | + <property name="encryption.key.alias" value="s1as"></property> | ||
299 | + <property name="signature.key.alias" value="s1as"></property> | ||
300 | + <property name="debug" value="false"></property> | ||
301 | + <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property> | ||
302 | + </provider-config> | ||
303 | + </message-security-config> | ||
304 | + </security-service> | ||
305 | + <transaction-service tx-log-dir="${com.sun.aas.instanceRoot}/logs" automatic-recovery="true"></transaction-service> | ||
306 | + <diagnostic-service></diagnostic-service> | ||
307 | + <java-config debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${JAVA_DEBUGGER_PORT}" system-classpath="" classpath-suffix=""> | ||
308 | + <jvm-options>-XX:MaxPermSize=192m</jvm-options> | ||
309 | + <jvm-options>-XX:PermSize=64m</jvm-options> | ||
310 | + <jvm-options>-server</jvm-options> | ||
311 | + <jvm-options>-Djava.awt.headless=true</jvm-options> | ||
312 | + <jvm-options>-XX:+UnlockDiagnosticVMOptions</jvm-options> | ||
313 | + <jvm-options>-Djava.endorsed.dirs=${com.sun.aas.installRoot}/modules/endorsed${path.separator}${com.sun.aas.installRoot}/lib/endorsed</jvm-options> | ||
314 | + <jvm-options>-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy</jvm-options> | ||
315 | + <jvm-options>-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf</jvm-options> | ||
316 | + <jvm-options>-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as</jvm-options> | ||
317 | + <jvm-options>-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks</jvm-options> | ||
318 | + <jvm-options>-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks</jvm-options> | ||
319 | + <jvm-options>-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext</jvm-options> | ||
320 | + <jvm-options>-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver</jvm-options> | ||
321 | + <jvm-options>-DANTLR_USE_DIRECT_CLASS_LOADING=true</jvm-options> | ||
322 | + <jvm-options>-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory</jvm-options> | ||
323 | + <jvm-options>-XX:NewRatio=2</jvm-options> | ||
324 | + <jvm-options>-Xmx512m</jvm-options> | ||
325 | + <jvm-options>-Dosgi.shell.telnet.port=${OSGI_SHELL_TELNET_PORT}</jvm-options> | ||
326 | + <jvm-options>-Dosgi.shell.telnet.maxconn=1</jvm-options> | ||
327 | + <jvm-options>-Dosgi.shell.telnet.ip=127.0.0.1</jvm-options> | ||
328 | + <jvm-options>-Dgosh.args=--noshutdown -c noop=true</jvm-options> | ||
329 | + <jvm-options>-Dfelix.fileinstall.dir=${com.sun.aas.installRoot}/modules/autostart/</jvm-options> | ||
330 | + <jvm-options>-Dfelix.fileinstall.poll=5000</jvm-options> | ||
331 | + <jvm-options>-Dfelix.fileinstall.log.level=3</jvm-options> | ||
332 | + <jvm-options>-Dfelix.fileinstall.bundles.new.start=true</jvm-options> | ||
333 | + <jvm-options>-Dfelix.fileinstall.bundles.startTransient=true</jvm-options> | ||
334 | + <jvm-options>-Dfelix.fileinstall.disableConfigSave=false</jvm-options> | ||
335 | + </java-config> | ||
336 | + <availability-service> | ||
337 | + <web-container-availability></web-container-availability> | ||
338 | + <ejb-container-availability sfsb-store-pool-name="jdbc/hastore"></ejb-container-availability> | ||
339 | + <jms-availability></jms-availability> | ||
340 | + </availability-service> | ||
341 | + <network-config> | ||
342 | + <protocols> | ||
343 | + <protocol name="http-listener-1"> | ||
344 | + <http default-virtual-server="server"> | ||
345 | + <file-cache></file-cache> | ||
346 | + </http> | ||
347 | + </protocol> | ||
348 | + <protocol security-enabled="true" name="http-listener-2"> | ||
349 | + <http default-virtual-server="server"> | ||
350 | + <file-cache></file-cache> | ||
351 | + </http> | ||
352 | + <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as"></ssl> | ||
353 | + </protocol> | ||
354 | + <protocol name="admin-listener"> | ||
355 | + <http default-virtual-server="__asadmin" max-connections="250"> | ||
356 | + <file-cache></file-cache> | ||
357 | + </http> | ||
358 | + </protocol> | ||
359 | + <protocol security-enabled="true" name="sec-admin-listener"> | ||
360 | + <http default-virtual-server="__asadmin" encoded-slash-enabled="true"> | ||
361 | + <file-cache></file-cache> | ||
362 | + </http> | ||
363 | + <ssl client-auth="want" classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="glassfish-instance"></ssl> | ||
364 | + </protocol> | ||
365 | + <protocol name="admin-http-redirect"> | ||
366 | + <http-redirect secure="true"></http-redirect> | ||
367 | + </protocol> | ||
368 | + <protocol name="pu-protocol"> | ||
369 | + <port-unification> | ||
370 | + <protocol-finder protocol="sec-admin-listener" name="http-finder" classname="com.sun.grizzly.config.HttpProtocolFinder"></protocol-finder> | ||
371 | + <protocol-finder protocol="admin-http-redirect" name="admin-http-redirect" classname="com.sun.grizzly.config.HttpProtocolFinder"></protocol-finder> | ||
372 | + </port-unification> | ||
373 | + </protocol> | ||
374 | + </protocols> | ||
375 | + <network-listeners> | ||
376 | + <network-listener port="${HTTP_LISTENER_PORT}" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener> | ||
377 | + <network-listener port="${HTTP_SSL_LISTENER_PORT}" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener> | ||
378 | + <network-listener port="${ASADMIN_LISTENER_PORT}" protocol="pu-protocol" transport="tcp" name="admin-listener" thread-pool="http-thread-pool"></network-listener> | ||
379 | + </network-listeners> | ||
380 | + <transports> | ||
381 | + <transport name="tcp"></transport> | ||
382 | + </transports> | ||
383 | + </network-config> | ||
384 | + <thread-pools> | ||
385 | + <thread-pool name="http-thread-pool"></thread-pool> | ||
386 | + <thread-pool max-thread-pool-size="200" name="thread-pool-1"></thread-pool> | ||
387 | + <thread-pool name="admin-thread-pool" max-thread-pool-size="50" max-queue-size="256"></thread-pool> | ||
388 | + </thread-pools> | ||
389 | + <group-management-service> | ||
390 | + <failure-detection></failure-detection> | ||
391 | + </group-management-service> | ||
392 | + <management-rules></management-rules> | ||
393 | + <system-property name="ASADMIN_LISTENER_PORT" value="24848"></system-property> | ||
394 | + <system-property name="HTTP_LISTENER_PORT" value="28080"></system-property> | ||
395 | + <system-property name="HTTP_SSL_LISTENER_PORT" value="28181"></system-property> | ||
396 | + <system-property name="JMS_PROVIDER_PORT" value="27676"></system-property> | ||
397 | + <system-property name="IIOP_LISTENER_PORT" value="23700"></system-property> | ||
398 | + <system-property name="IIOP_SSL_LISTENER_PORT" value="23820"></system-property> | ||
399 | + <system-property name="IIOP_SSL_MUTUALAUTH_PORT" value="23920"></system-property> | ||
400 | + <system-property name="JMX_SYSTEM_CONNECTOR_PORT" value="28686"></system-property> | ||
401 | + <system-property name="OSGI_SHELL_TELNET_PORT" value="26666"></system-property> | ||
402 | + <system-property name="JAVA_DEBUGGER_PORT" value="29009"></system-property> | ||
403 | + <monitoring-service> | ||
404 | + <module-monitoring-levels></module-monitoring-levels> | ||
405 | + </monitoring-service> | ||
406 | + <connector-service></connector-service> | ||
407 | + </config> | ||
408 | + </configs> | ||
409 | + <property name="administrative.domain.name" value="domain1"></property> | ||
410 | + <secure-admin special-admin-indicator="e4a50521-0eca-4932-bca9-805fc1d8412e"> | ||
411 | + <secure-admin-principal dn="CN=localhost,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US"></secure-admin-principal> | ||
412 | + <secure-admin-principal dn="CN=localhost-instance,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US"></secure-admin-principal> | ||
413 | + </secure-admin> | ||
414 | + <load-balancers></load-balancers> | ||
415 | + <lb-configs></lb-configs> | ||
416 | + <clusters></clusters> | ||
417 | +</domain> | ||
0 | \ No newline at end of file | 418 | \ No newline at end of file |
@@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
1 | +demoiselle;{SSHA256}yuPqrU5lEMJR0I4qNaegEK9hd5afM0Yo3rnLgYY7Sw0MlUFhbj9EmQ==;users |
impl/extension/servlet/src/test/resources/producer/request/web.xml
0 → 100644
@@ -0,0 +1,62 @@ | @@ -0,0 +1,62 @@ | ||
1 | +<!-- | ||
2 | + Demoiselle Framework | ||
3 | + Copyright (C) 2010 SERPRO | ||
4 | + ============================================================================ | ||
5 | + This file is part of Demoiselle Framework. | ||
6 | + | ||
7 | + Demoiselle Framework is free software; you can redistribute it and/or | ||
8 | + modify it under the terms of the GNU Lesser General Public License version 3 | ||
9 | + as published by the Free Software Foundation. | ||
10 | + | ||
11 | + This program is distributed in the hope that it will be useful, | ||
12 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | + GNU General Public License for more details. | ||
15 | + | ||
16 | + You should have received a copy of the GNU Lesser General Public License version 3 | ||
17 | + along with this program; if not, see <http://www.gnu.org/licenses /> | ||
18 | + or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
19 | + Fifth Floor, Boston, MA 02110-1301, USA. | ||
20 | + ============================================================================ | ||
21 | + Este arquivo é parte do Framework Demoiselle. | ||
22 | + | ||
23 | + O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
24 | + modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
25 | + do Software Livre (FSF). | ||
26 | + | ||
27 | + Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
28 | + GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
29 | + APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
30 | + para maiores detalhes. | ||
31 | + | ||
32 | + Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
33 | + "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | ||
34 | + ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
35 | + 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
36 | +--> | ||
37 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
38 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | ||
39 | + | ||
40 | + <listener> | ||
41 | + <listener-class>br.gov.frameworkdemoiselle.util.ServletListener</listener-class> | ||
42 | + </listener> | ||
43 | + | ||
44 | + <filter> | ||
45 | + <filter-name>Demoiselle Servlet Filter</filter-name> | ||
46 | + <filter-class>br.gov.frameworkdemoiselle.util.ServletFilter</filter-class> | ||
47 | + </filter> | ||
48 | + <filter-mapping> | ||
49 | + <filter-name>Demoiselle Servlet Filter</filter-name> | ||
50 | + <url-pattern>/*</url-pattern> | ||
51 | + </filter-mapping> | ||
52 | + | ||
53 | + <servlet> | ||
54 | + <servlet-name>Request Class</servlet-name> | ||
55 | + <servlet-class>producer.request.RequestServlet</servlet-class> | ||
56 | + </servlet> | ||
57 | + | ||
58 | + <servlet-mapping> | ||
59 | + <servlet-name>Request Class</servlet-name> | ||
60 | + <url-pattern>/servlet</url-pattern> | ||
61 | + </servlet-mapping> | ||
62 | +</web-app> | ||
0 | \ No newline at end of file | 63 | \ No newline at end of file |
impl/extension/servlet/src/test/resources/producer/response/web.xml
0 → 100644
@@ -0,0 +1,62 @@ | @@ -0,0 +1,62 @@ | ||
1 | +<!-- | ||
2 | + Demoiselle Framework | ||
3 | + Copyright (C) 2010 SERPRO | ||
4 | + ============================================================================ | ||
5 | + This file is part of Demoiselle Framework. | ||
6 | + | ||
7 | + Demoiselle Framework is free software; you can redistribute it and/or | ||
8 | + modify it under the terms of the GNU Lesser General Public License version 3 | ||
9 | + as published by the Free Software Foundation. | ||
10 | + | ||
11 | + This program is distributed in the hope that it will be useful, | ||
12 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | + GNU General Public License for more details. | ||
15 | + | ||
16 | + You should have received a copy of the GNU Lesser General Public License version 3 | ||
17 | + along with this program; if not, see <http://www.gnu.org/licenses /> | ||
18 | + or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
19 | + Fifth Floor, Boston, MA 02110-1301, USA. | ||
20 | + ============================================================================ | ||
21 | + Este arquivo é parte do Framework Demoiselle. | ||
22 | + | ||
23 | + O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
24 | + modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
25 | + do Software Livre (FSF). | ||
26 | + | ||
27 | + Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
28 | + GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
29 | + APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
30 | + para maiores detalhes. | ||
31 | + | ||
32 | + Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
33 | + "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | ||
34 | + ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
35 | + 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
36 | +--> | ||
37 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
38 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | ||
39 | + | ||
40 | + <listener> | ||
41 | + <listener-class>br.gov.frameworkdemoiselle.util.ServletListener</listener-class> | ||
42 | + </listener> | ||
43 | + | ||
44 | + <filter> | ||
45 | + <filter-name>Demoiselle Servlet Filter</filter-name> | ||
46 | + <filter-class>br.gov.frameworkdemoiselle.util.ServletFilter</filter-class> | ||
47 | + </filter> | ||
48 | + <filter-mapping> | ||
49 | + <filter-name>Demoiselle Servlet Filter</filter-name> | ||
50 | + <url-pattern>/*</url-pattern> | ||
51 | + </filter-mapping> | ||
52 | + | ||
53 | + <servlet> | ||
54 | + <servlet-name>Response Servlet</servlet-name> | ||
55 | + <servlet-class>producer.response.ResponseServlet</servlet-class> | ||
56 | + </servlet> | ||
57 | + | ||
58 | + <servlet-mapping> | ||
59 | + <servlet-name>Response Servlet</servlet-name> | ||
60 | + <url-pattern>/servlet</url-pattern> | ||
61 | + </servlet-mapping> | ||
62 | +</web-app> | ||
0 | \ No newline at end of file | 63 | \ No newline at end of file |
impl/extension/servlet/src/test/resources/producer/web.xml
@@ -1,72 +0,0 @@ | @@ -1,72 +0,0 @@ | ||
1 | -<!-- | ||
2 | - Demoiselle Framework | ||
3 | - Copyright (C) 2010 SERPRO | ||
4 | - ============================================================================ | ||
5 | - This file is part of Demoiselle Framework. | ||
6 | - | ||
7 | - Demoiselle Framework is free software; you can redistribute it and/or | ||
8 | - modify it under the terms of the GNU Lesser General Public License version 3 | ||
9 | - as published by the Free Software Foundation. | ||
10 | - | ||
11 | - This program is distributed in the hope that it will be useful, | ||
12 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | - GNU General Public License for more details. | ||
15 | - | ||
16 | - You should have received a copy of the GNU Lesser General Public License version 3 | ||
17 | - along with this program; if not, see <http://www.gnu.org/licenses /> | ||
18 | - or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
19 | - Fifth Floor, Boston, MA 02110-1301, USA. | ||
20 | - ============================================================================ | ||
21 | - Este arquivo é parte do Framework Demoiselle. | ||
22 | - | ||
23 | - O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
24 | - modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
25 | - do Software Livre (FSF). | ||
26 | - | ||
27 | - Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
28 | - GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
29 | - APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
30 | - para maiores detalhes. | ||
31 | - | ||
32 | - Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
33 | - "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | ||
34 | - ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
35 | - 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
36 | ---> | ||
37 | -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
38 | - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | ||
39 | - | ||
40 | - <listener> | ||
41 | - <listener-class>br.gov.frameworkdemoiselle.util.ServletListener</listener-class> | ||
42 | - </listener> | ||
43 | - | ||
44 | - <filter> | ||
45 | - <filter-name>Demoiselle Servlet Filter</filter-name> | ||
46 | - <filter-class>br.gov.frameworkdemoiselle.util.ServletFilter</filter-class> | ||
47 | - </filter> | ||
48 | - <filter-mapping> | ||
49 | - <filter-name>Demoiselle Servlet Filter</filter-name> | ||
50 | - <url-pattern>/*</url-pattern> | ||
51 | - </filter-mapping> | ||
52 | - | ||
53 | - <servlet> | ||
54 | - <servlet-name>Request Class</servlet-name> | ||
55 | - <servlet-class>producer.RequestServlet</servlet-class> | ||
56 | - </servlet> | ||
57 | - | ||
58 | - <servlet-mapping> | ||
59 | - <servlet-name>Request Class</servlet-name> | ||
60 | - <url-pattern>/requestproducer</url-pattern> | ||
61 | - </servlet-mapping> | ||
62 | - | ||
63 | - <servlet> | ||
64 | - <servlet-name>Response xClass</servlet-name> | ||
65 | - <servlet-class>producer.ResponseServlet</servlet-class> | ||
66 | - </servlet> | ||
67 | - | ||
68 | - <servlet-mapping> | ||
69 | - <servlet-name>Response xClass</servlet-name> | ||
70 | - <url-pattern>/responseproducer</url-pattern> | ||
71 | - </servlet-mapping> | ||
72 | -</web-app> | ||
73 | \ No newline at end of file | 0 | \ No newline at end of file |
impl/extension/servlet/src/test/resources/security/authentication/basic/web.xml
0 → 100644
@@ -0,0 +1,82 @@ | @@ -0,0 +1,82 @@ | ||
1 | +<!-- | ||
2 | + Demoiselle Framework | ||
3 | + Copyright (C) 2010 SERPRO | ||
4 | + ============================================================================ | ||
5 | + This file is part of Demoiselle Framework. | ||
6 | + | ||
7 | + Demoiselle Framework is free software; you can redistribute it and/or | ||
8 | + modify it under the terms of the GNU Lesser General Public License version 3 | ||
9 | + as published by the Free Software Foundation. | ||
10 | + | ||
11 | + This program is distributed in the hope that it will be useful, | ||
12 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | + GNU General Public License for more details. | ||
15 | + | ||
16 | + You should have received a copy of the GNU Lesser General Public License version 3 | ||
17 | + along with this program; if not, see <http://www.gnu.org/licenses /> | ||
18 | + or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
19 | + Fifth Floor, Boston, MA 02110-1301, USA. | ||
20 | + ============================================================================ | ||
21 | + Este arquivo é parte do Framework Demoiselle. | ||
22 | + | ||
23 | + O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
24 | + modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
25 | + do Software Livre (FSF). | ||
26 | + | ||
27 | + Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
28 | + GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
29 | + APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
30 | + para maiores detalhes. | ||
31 | + | ||
32 | + Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
33 | + "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | ||
34 | + ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
35 | + 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
36 | +--> | ||
37 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
38 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | ||
39 | + | ||
40 | + <listener> | ||
41 | + <listener-class>br.gov.frameworkdemoiselle.util.ServletListener</listener-class> | ||
42 | + </listener> | ||
43 | + | ||
44 | + <filter> | ||
45 | + <filter-name>Demoiselle Servlet Filter</filter-name> | ||
46 | + <filter-class>br.gov.frameworkdemoiselle.util.ServletFilter</filter-class> | ||
47 | + </filter> | ||
48 | + <filter-mapping> | ||
49 | + <filter-name>Demoiselle Servlet Filter</filter-name> | ||
50 | + <url-pattern>/*</url-pattern> | ||
51 | + </filter-mapping> | ||
52 | + | ||
53 | + <servlet> | ||
54 | + <servlet-name>Security Class</servlet-name> | ||
55 | + <servlet-class>security.SecurityServlet</servlet-class> | ||
56 | + </servlet> | ||
57 | + <servlet-mapping> | ||
58 | + <servlet-name>Security Class</servlet-name> | ||
59 | + <url-pattern>/login</url-pattern> | ||
60 | + </servlet-mapping> | ||
61 | + | ||
62 | + <!-- | ||
63 | + <security-constraint> | ||
64 | + <web-resource-collection> | ||
65 | + <web-resource-name>Private URL</web-resource-name> | ||
66 | + <url-pattern>/login</url-pattern> | ||
67 | + </web-resource-collection> | ||
68 | + <auth-constraint> | ||
69 | + <role-name>*</role-name> | ||
70 | + </auth-constraint> | ||
71 | + </security-constraint> | ||
72 | + | ||
73 | + <login-config> | ||
74 | + <auth-method>BASIC</auth-method> | ||
75 | + <realm-name>fileRealm</realm-name> | ||
76 | + </login-config> | ||
77 | + | ||
78 | + <security-role> | ||
79 | + <role-name>*</role-name> | ||
80 | + </security-role> | ||
81 | + --> | ||
82 | +</web-app> | ||
0 | \ No newline at end of file | 83 | \ No newline at end of file |
impl/extension/servlet/src/test/resources/security/web.xml
@@ -50,34 +50,33 @@ | @@ -50,34 +50,33 @@ | ||
50 | <url-pattern>/*</url-pattern> | 50 | <url-pattern>/*</url-pattern> |
51 | </filter-mapping> | 51 | </filter-mapping> |
52 | 52 | ||
53 | + <servlet> | ||
54 | + <servlet-name>Security Class</servlet-name> | ||
55 | + <servlet-class>security.SecurityServlet</servlet-class> | ||
56 | + </servlet> | ||
57 | + <servlet-mapping> | ||
58 | + <servlet-name>Security Class</servlet-name> | ||
59 | + <url-pattern>/login</url-pattern> | ||
60 | + </servlet-mapping> | ||
53 | 61 | ||
62 | + <!-- | ||
54 | <security-constraint> | 63 | <security-constraint> |
55 | <web-resource-collection> | 64 | <web-resource-collection> |
56 | - <web-resource-name>myapp</web-resource-name> | ||
57 | - <url-pattern>/\*</url-pattern> | ||
58 | - <http-method>GET</http-method> | 65 | + <web-resource-name>Private URL</web-resource-name> |
66 | + <url-pattern>/login</url-pattern> | ||
59 | </web-resource-collection> | 67 | </web-resource-collection> |
60 | <auth-constraint> | 68 | <auth-constraint> |
61 | - <role-name>users</role-name> | 69 | + <role-name>*</role-name> |
62 | </auth-constraint> | 70 | </auth-constraint> |
63 | </security-constraint> | 71 | </security-constraint> |
72 | + | ||
64 | <login-config> | 73 | <login-config> |
65 | <auth-method>BASIC</auth-method> | 74 | <auth-method>BASIC</auth-method> |
66 | - <realm-name>default</realm-name> | 75 | + <realm-name>fileRealm</realm-name> |
67 | </login-config> | 76 | </login-config> |
77 | + | ||
68 | <security-role> | 78 | <security-role> |
69 | - <role-name>users</role-name> | 79 | + <role-name>*</role-name> |
70 | </security-role> | 80 | </security-role> |
71 | - | ||
72 | - <servlet> | ||
73 | - <servlet-name>Security Class</servlet-name> | ||
74 | - <servlet-class>security.SecurityServlet</servlet-class> | ||
75 | - </servlet> | ||
76 | - | ||
77 | - <servlet-mapping> | ||
78 | - <servlet-name>Security Class</servlet-name> | ||
79 | - <url-pattern>/login</url-pattern> | ||
80 | - </servlet-mapping> | ||
81 | - | ||
82 | - | 81 | + --> |
83 | </web-app> | 82 | </web-app> |
84 | \ No newline at end of file | 83 | \ No newline at end of file |