forked from Waffle/waffle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
822 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Waffle (https://github.com/Waffle/waffle) | ||
Copyright (c) 2010-2016 Application Security, Inc. | ||
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse | ||
Public License v1.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v10.html. | ||
Contributors: Application Security, Inc. | ||
--> | ||
<!DOCTYPE Compression> | ||
<Compression> | ||
<!-- Dummy compression file --> | ||
</Compression> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Waffle (https://github.com/Waffle/waffle) | ||
Copyright (c) 2010-2016 Application Security, Inc. | ||
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse | ||
Public License v1.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v10.html. | ||
Contributors: Application Security, Inc. | ||
--> | ||
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.github.waffle.demo</groupId> | ||
<artifactId>waffle-demo-parent</artifactId> | ||
<version>1.9.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>waffle-springboot</artifactId> | ||
<version>1.9.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>waffle-springboot</name> | ||
<description>Springboot Demo for WAFFLE</description> | ||
<url>https://waffle.github.com/waffle/</url> | ||
|
||
<scm> | ||
<connection>scm:git:ssh://[email protected]/Waffle/waffle.git</connection> | ||
<developerConnection>scm:git:ssh://[email protected]/Waffle/waffle.git</developerConnection> | ||
<url>https://github.com/Waffle/waffle</url> | ||
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<properties> | ||
<springboot.version>1.5.7.RELEASE</springboot.version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<!-- Import dependency management from Spring Boot --> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-dependencies</artifactId> | ||
<version>${springboot.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-security</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.waffle</groupId> | ||
<artifactId>waffle-spring-security4</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.waffle</groupId> | ||
<artifactId>waffle-tomcat85</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>${project.name}</finalName> | ||
</build> | ||
</project> |
39 changes: 39 additions & 0 deletions
39
Source/JNA/waffle-demo/waffle-springboot/src/main/java/resources/logback.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<!-- | ||
Waffle (https://github.com/Waffle/waffle) | ||
Copyright (c) 2010-2016 Application Security, Inc. | ||
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse | ||
Public License v1.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v10.html. | ||
Contributors: Application Security, Inc. | ||
--> | ||
<!DOCTYPE configuration> | ||
<configuration scan="true" debug="false"> | ||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>${catalina.base}/logs/waffle-springboot.log</file> | ||
|
||
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> | ||
<fileNamePattern>>${catalina.base}/logs/archive/waffle-springboot.%i.log.zip | ||
</fileNamePattern> | ||
<minIndex>1</minIndex> | ||
<maxIndex>3</maxIndex> | ||
</rollingPolicy> | ||
|
||
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> | ||
<maxFileSize>5MB</maxFileSize> | ||
</triggeringPolicy> | ||
<encoder> | ||
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n | ||
</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="FILE" /> | ||
</root> | ||
</configuration> |
21 changes: 21 additions & 0 deletions
21
Source/JNA/waffle-demo/waffle-springboot/src/main/java/static/401.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- | ||
Waffle (https://github.com/Waffle/waffle) | ||
Copyright (c) 2010-2016 Application Security, Inc. | ||
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse | ||
Public License v1.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v10.html. | ||
Contributors: Application Security, Inc. | ||
--> | ||
<html> | ||
<head> | ||
<title>Access Denied (Waffle)</title> | ||
</head> | ||
<body> | ||
Access Denied | ||
</body> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
Source/JNA/waffle-demo/waffle-springboot/src/main/java/static/404.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- | ||
Waffle (https://github.com/Waffle/waffle) | ||
Copyright (c) 2010-2016 Application Security, Inc. | ||
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse | ||
Public License v1.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v10.html. | ||
Contributors: Application Security, Inc. | ||
--> | ||
<html> | ||
<head> | ||
<title>Page Not Found (Waffle)</title> | ||
</head> | ||
<body> | ||
Page Not Found | ||
</body> | ||
</html> |
45 changes: 45 additions & 0 deletions
45
Source/JNA/waffle-demo/waffle-springboot/src/main/java/static/WEB-INF/web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Waffle (https://github.com/Waffle/waffle) | ||
Copyright (c) 2010-2016 Application Security, Inc. | ||
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse | ||
Public License v1.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v10.html. | ||
Contributors: Application Security, Inc. | ||
--> | ||
<web-app xmlns="https://java.sun.com/xml/ns/javaee" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://java.sun.com/xml/ns/javaee https://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
version="2.5"> | ||
|
||
<description>Waffle Springboot Authenticator Demo</description> | ||
<display-name>Waffle Demo</display-name> | ||
|
||
<security-constraint> | ||
<display-name>Waffle Security Constraint</display-name> | ||
<web-resource-collection> | ||
<web-resource-name>Protected Area</web-resource-name> | ||
<url-pattern>/*</url-pattern> | ||
<http-method>DELETE</http-method> | ||
<http-method>GET</http-method> | ||
<http-method>POST</http-method> | ||
<http-method>PUT</http-method> | ||
</web-resource-collection> | ||
<auth-constraint> | ||
<role-name>Everyone</role-name> | ||
</auth-constraint> | ||
</security-constraint> | ||
<security-role> | ||
<role-name>Everyone</role-name> | ||
</security-role> | ||
|
||
<error-page> | ||
<error-code>401</error-code> | ||
<location>/401.html</location> | ||
</error-page> | ||
|
||
</web-app> |
68 changes: 68 additions & 0 deletions
68
Source/JNA/waffle-demo/waffle-springboot/src/main/java/static/index.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<%-- | ||
Waffle (https://github.com/Waffle/waffle) | ||
Copyright (c) 2010-2016 Application Security, Inc. | ||
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse | ||
Public License v1.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v10.html. | ||
Contributors: Application Security, Inc. | ||
--%> | ||
<% | ||
if (request.getParameter("logoff") != null) { | ||
session.invalidate(); | ||
response.sendRedirect("index.jsp"); | ||
return; | ||
} | ||
%> | ||
<html> | ||
<head> | ||
<title>Protected Page for Examples</title> | ||
</head> | ||
<body style="background-color:white;"> | ||
You are logged in as remote user <b><%= request.getRemoteUser() %></b> in session <b><%= session.getId() %></b>. | ||
<br><br> | ||
<% | ||
if (request.getUserPrincipal() != null) { | ||
%> | ||
Your user principal name is <b><%= request.getUserPrincipal().getName() %></b>. | ||
<br><br> | ||
<% | ||
} else { | ||
%> | ||
No user principal could be identified. | ||
<br><br> | ||
<% | ||
} | ||
%> | ||
<% | ||
String role = request.getParameter("role"); | ||
if (role == null) | ||
role = ""; | ||
if (role.length() > 0) { | ||
if (request.isUserInRole(role)) { | ||
%> | ||
You have been granted role <b><%= role %></b>. | ||
<br><br> | ||
<% | ||
} else { | ||
%> | ||
You have <i>not</i> been granted role <b><%= role %></b>. | ||
<br><br> | ||
<% | ||
} | ||
} | ||
%> | ||
To check whether your username has been granted a particular role, enter it here: | ||
<form method="GET" action='<%= response.encodeURL("index.jsp") %>'> | ||
<input type="text" name="role" value="<%= role %>"> | ||
</form> | ||
<br><br> | ||
You can logoff by clicking | ||
<a href='<%= response.encodeURL("index.jsp?logoff=true") %>'>here</a>. | ||
This should cause automatic re-logon with Waffle and a new session ID. | ||
</body> | ||
</html> |
Oops, something went wrong.