为澄清起见,我在https://github.com/spring-projects/spring-data-examples/tree/master/rest/security
使用示例我们有2个实体:员工和项目 我们有2个存储库:EmployeeRepository和ItemRepository
我的要求:
- curl localhost:8080
==> Response code 401 - Unauthorized
- curl localhost:8080 -u admin:password
==> Response:
{
"_links": {
"items": {
"href": "http://localhost:8080/items"
},
"employees": {
"href": "http://localhost:8080/employees"
}
}
}
- curl localhost:8080 -u user01:password
==> Response:
{
"_links": {
"items": {
"href": "http://localhost:8080/items"
}
}
}
Spring是否支持上述#2和#3要求?
谢谢