Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates/use gofr oauth #38

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.
google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f/go.mod h1:CLGoBuH1VHxAUXVPP8FfPwPEVJB6lz3URE5mY2SuayE=
google.golang.org/genproto/googleapis/bytestream v0.0.0-20241007155032-5fefd90f89a9 h1:+d6UwW1ElERBQ1pMjX1fJHEQIsACGO6EBeaiwKJgbrs=
google.golang.org/genproto/googleapis/bytestream v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:T8O3fECQbif8cez15vxAcjbwXxvL2xbnvbQ7ZfiMAMs=
google.golang.org/genproto/googleapis/bytestream v0.0.0-20241015192408-796eee8c2d53 h1:mVZqGNBNN8C63iGnWgHZSGbT/vG7voylnp4atysmReg=
google.golang.org/genproto/googleapis/bytestream v0.0.0-20241015192408-796eee8c2d53/go.mod h1:T8O3fECQbif8cez15vxAcjbwXxvL2xbnvbQ7ZfiMAMs=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
Expand Down
41 changes: 11 additions & 30 deletions k8s/auth-server/base/auth-server-configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,14 @@ data:
rules.json: |
[
{
"id": "health-check",
"id": "k8s-health",
"match": {
"url": "<^http://oathkeeper-proxy\\.default\\.svc\\.cluster\\.local:4455/authenticate$>",
"methods": [
"GET"],
"headers": {
"X-Original-Uri": [
"^/\\.well-known/health$"]
}
"url": "<^/health/(ready|alive|live)$>",
"methods": ["GET"]
},
"authenticators": [
{
"handler": "anonymous",
"config": {
"subject": "guest"
}
"handler": "noop"
}
],
"authorizer": {
Expand All @@ -34,28 +26,18 @@ data:
}
],
"upstream": {
"url": "http://eventrunner-api.eventrunner.svc.cluster.local:8200/.well-known/health",
"preserve_host": false,
"preserve_path": false
"url": "http://oathkeeper-proxy.default.svc.cluster.local:4455"
}
},
{
"id": "alive-check",
"id": "wellknown-endpoints",
"match": {
"url": "<^http://oathkeeper-proxy\\.default\\.svc\\.cluster\\.local:4455/authenticate$>",
"methods": [
"GET"],
"headers": {
"X-Original-Uri": [
"^/\\.well-known/alive$"]
}
"url": "<^/decisions/.well-known/(alive|health)>",
"methods": ["GET"]
},
"authenticators": [
{
"handler": "anonymous",
"config": {
"subject": "guest"
}
"handler": "noop"
}
],
"authorizer": {
Expand All @@ -68,8 +50,7 @@ data:
],
"upstream": {
"url": "http://eventrunner-api.eventrunner.svc.cluster.local:8200/.well-known/alive",
"preserve_host": false,
"preserve_path": false
"preserve_host": true
}
}
]
]
20 changes: 9 additions & 11 deletions k8s/eventrunner-api/base/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,24 @@ metadata:
name: eventrunner-api
namespace: eventrunner
annotations:
cert-manager.io/cluster-issuer: threadr-issuer
nginx.ingress.kubernetes.io/auth-url: "http://oathkeeper-proxy.default.svc.cluster.local:4455/authenticate"
nginx.ingress.kubernetes.io/auth-response-headers: "X-User,X-Tenant-ID,X-Request-Id,Authorization"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/auth-url: "http://oathkeeper-proxy.default.svc.cluster.local:4455/decisions$request_uri"
nginx.ingress.kubernetes.io/auth-method: GET
nginx.ingress.kubernetes.io/auth-response-headers: "Authorization"
nginx.ingress.kubernetes.io/auth-snippet: |
proxy_set_header X-Original-Uri $request_uri;
proxy_set_header Host $http_host;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Original-Method $request_method;
proxy_set_header Content-Length "";
spec:
ingressClassName: nginx
tls:
- hosts:
- api.tunnel.threadr.ai
secretName: eventrunner-api-tls
rules:
- host: api.tunnel.threadr.ai
http:
paths:
- path: /
- path: /.well-known
pathType: Prefix
backend:
service:
name: eventrunner-api
port:
number: 8200
number: 8200
13 changes: 13 additions & 0 deletions k8s/ory/oathkeeper/oathkeeper-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,25 @@ oathkeeper:
authenticators:
anonymous:
enabled: true
config:
subject: "guest"
noop:
enabled: true

authorizers:
allow:
enabled: true
deny:
enabled: true

errors:
fallback:
- json
handlers:
json:
enabled: true
config:
verbose: true

mutators:
noop:
Expand Down
Loading