This sample project is comprehended by the following:
- Spring Boot REST controller
- OrientDB remote object persistence by means of Spring Data
- Shiro session-management with OrientDB-based authorizing realm
- Hazelcast powered session distributed persistence
- JDK 8
- Maven 3.2.3 or newer
We need spring-data-orient
for Spring Data OrientDB support.
We'll be checking out commit b25c54f
, the latest at the time of this writing.
git clone https://github.com/noskovd/spring-data-orient.git
cd spring-data-orient
git checkout b25c54f
mvn clean install
mvn clean package spring-boot:run
curl -i -H "Accept: application/json" -X PUT http://localhost:8080/users
curl -i -H "Accept: application/json" -X GET http://localhost:8080/users
You should get a 401 Unauthorized
response status.
curl -i -c cookie.txt -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"username":"[email protected]","password":"123qwe"}' http://localhost:8080/users/auth
You should get a 200 OK
response status and have a valid cookie stored in cookie.txt
.
curl -i -b cookie.txt -H "Accept: application/json" -X GET http://localhost:8080/users
You should get a 200 OK
response status and some JSON representing existing users.
curl -i -b cookie.txt -H "Accept: application/json" -X GET http://localhost:8080/users/do_something
You should get a 401 Unauthorized
response status.