百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

spring-boot-shiro-orientdb

> 编程语言
开源

一个简单的 REST API,使用 Spring Boot 和 OrientDB (Object API) 数据存储,并通过 Apache Shiro(由 Hazelcast 提供的分布式会话存储)进行安全保护。

99 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个简单的 REST API,使用 Spring Boot 和 OrientDB (Object API) 数据存储,并通过 Apache Shiro(由 Hazelcast 提供的分布式会话存储)进行安全保护。

This sample project is comprehended by the following:

  • Spring Boot REST controller
  • OrientDB (2.0.13) remote object persistence by means of Spring Data
  • Apache Shiro (1.2.4) session-management with OrientDB-based authorizing realm
  • Hazelcast (3.5.1) powered session distributed persistence

Pre-requisites

  • JDK 8
  • Maven 3.2.3 or newer

Spring Data hack

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.

bash
git clone [email protected]:orientechnologies/spring-data-orientdb.git
cd spring-data-orientdb
git checkout 6337a3e
mvn clean install

Run

mvn clean package spring-boot:run

Testing

Automatically

mvn clean test

Manually

Initialize test scenario

bash
curl -i -H "Accept: application/json" -X PUT http://localhost:8080/users

Access protected method without being authenticated

bash
curl -i -H "Accept: application/json" -X GET http://localhost:8080/users

You should get a 401 Unauthorized response status.

Log-in

bash
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.

Access protected method again

bash
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.

Access another protected method to which you don't have permission

bash
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.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言