square-napkin-92357
04/12/2025, 9:17 AM[
{
"id": "helloworld:protected1",
"upstream": {
"preserve_host": true,
"url": "<http://host.docker.internal:8080>"
},
"match": {
"url": "<http://127.0.0.1:4455/><**>",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH"
]
},
"authenticators": [
{
"handler": "noop"
}
],
"authorizer": {
"handler": "allow"
},
"mutators": [
{
"handler": "noop"
}
]
},
{
"id": "helloworld:protected2",
"upstream": {
"preserve_host": true,
"url": "<http://host.docker.internal:8080>"
},
"match": {
"url": "<http://127.0.0.1:4455/hello>",
"methods": [
"GET"
]
},
"authenticators": [
{
"handler": "bearer_token"
}
],
"authorizer": {
"handler": "remote_json"
},
"mutators": [
{
"handler": "id_token"
}
]
}
]
1. all requests to oathkeeper match with my app
2. I want to set an endpoint http://127.0.0.1:4455/hello must need authentication and authorization, but I got this message when call this endpoint "message": "Expected exactly one rule but found multiple rules"
Could anyone can suggest me a way to solve? Thank you!stale-tiger-66317
04/15/2025, 6:33 PMsquare-napkin-92357
04/16/2025, 12:00 PMsquare-napkin-92357
04/16/2025, 1:08 PM<http://127.0.0.1:4455/hello>
<http://127.0.0.1:4455/welcome>
<http://127.0.0.1:4455/health>
<http://127.0.0.1:4455/dashboard>
...
I want to protect http://127.0.0.1:4455/dashboard + http://127.0.0.1:4455/hello, other apis are public
As you said, we must deny access to all endpoints without authentication. After, make some apis become public. So I have access-rule like:
[
{
"id": "helloworld:protected",
"upstream": {
"preserve_host": true,
"url": "<http://host.docker.internal:8080>"
},
"match": {
"url": "<http://127.0.0.1:4455/><**>",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH"
]
},
"authenticators": [
{
"handler": "bear_token"
}
],
...
},
{
"id": "helloworld:public1",
"upstream": {
"preserve_host": true,
"url": "<http://host.docker.internal:8080>"
},
"match": {
"url": "<http://127.0.0.1:4455/hello>",
"methods": [
"GET"
]
},
...,
{
"id": "helloworld:public2",
"upstream": {
"preserve_host": true,
"url": "<http://host.docker.internal:8080>"
},
"match": {
"url": "<http://127.0.0.1:4455/dashboard>",
"methods": [
"GET"
]
},
...
}
]
So I must do many many matchers, but as my above codes http://127.0.0.1:4455/<**> includes http://127.0.0.1:4455/dashboard and http://127.0.0.1:4455/hello => I also get error: "message": "Expected exactly one rule but found multiple rules"
. Do you have any suggestion for this?stale-tiger-66317
04/19/2025, 8:35 PMsquare-napkin-92357
04/21/2025, 3:43 AM