Add base security support

- Add base of support using spring security to
  protect events, transitions and actions.
- Fixes #114
This commit is contained in:
Janne Valkealahti
2015-12-20 14:33:54 +00:00
parent cba4b2fd0c
commit d0aaa4bfee
71 changed files with 4037 additions and 146 deletions

View File

@@ -0,0 +1,3 @@
security:
basic:
enabled: false

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<logger name="org.springframework.statemachine" level="TRACE"/>
</configuration>

View File

@@ -0,0 +1,19 @@
+--------------------------------------------------------------------------+
| SM |
+--------------------------------------------------------------------------+
| |
| +-----------+ A +-----------+ B +--------+ E +--------+ |
| *-->| S0 |------>| S1 |------>| S2 |------>| S3 | |
| | | | | | | | | |
| | D | | F | | | | | |
| | +-------+ | | +-------+ | | | | | |
| | | | | | | | | | | | | |
| | | v | | | v | | | | | |
| +-----------+ +-----------+ +--------+ +--------+ |
| ^ ^ | | |
| | | C | | |
| | +------------------------------------+ | |
| | C | |
| +----------------------------------------------------------+ |
| |
+--------------------------------------------------------------------------+

View File

@@ -0,0 +1,27 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Spring Statemachine Scope Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div th:with="currentUser=${#httpServletRequest.userPrincipal?.principal}" >
<div th:if="${currentUser != null}">
<form th:action="@{/logout}" method="post">
<input type="submit" value="Log out" />
</form>
<p th:text="'CurrentUser: ' + ${currentUser.username}"/>
</div>
</div>
<p th:text="'States: ' + ${states}" />
<form action="#" data-th-action="@{/states}" data-th-object="${model}" method="post">
<button type="submit" name="event" value="A">Send A</button>
<button type="submit" name="event" value="B">Send B</button>
<button type="submit" name="event" value="C">Send C</button>
<button type="submit" name="event" value="D">Send D</button>
<button type="submit" name="event" value="E">Send E</button>
<button type="submit" name="event" value="F">Send F</button>
</form>
<pre th:text="${stateChartModel}"/>
</body>
</html>