一个简单的 REST API,使用 Spring Boot 和 OrientDB (Object API) 数据存储,并通过 Apache Shiro(由 Hazelcast 提供的分布式会话存储)进行安全保护。
一个简单的 REST API,使用 Spring Boot 和 OrientDB (Object API) 数据存储,并通过 Apache Shiro(由 Hazelcast 提供的分布式会话存储)进行安全保护。
This sample project is comprehended by the following:
We need spring-data-orientdbfor Spring Data OrientDB support.
We'll be checking out a commit known to be working at the time of this writing.
git clone [email protected]:orientechnologies/spring-data-orientdb.git
cd spring-data-orientdb
git checkout 6337a3e
mvn clean installmvn clean package spring-boot:runmvn clean test
curl -i -H "Accept: application/json" -X PUT http://localhost:8080/userscurl -i -H "Accept: application/json" -X GET http://localhost:8080/usersYou 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/authYou 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/usersYou 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_somethingYou should get a 401 Unauthorized response status.
暂无开放 Issues,或尚未同步最近议题。