Add missing referencegrants for auth handlers#775
Conversation
|
I am not sure, how this is supposed to scale though, as it feels upside down. I'll research. |
This makes the "-auth" http-routes work.
| type: PathPrefix | ||
| value: /grafana | ||
| {{- if eq . "-auth" }} | ||
| {{- $authUrl := urlParse (tpl $.Values.gf_ingress_auth_url $) }} |
There was a problem hiding this comment.
[ARCHITECTURE, STYLE] Consider defining a shared Helm helper template (e.g., in _helpers.tpl using define) to extract the backend service name, namespace, and port from auth URLs. Encapsulating this URL parsing and service destination lookup logic avoids repeating identical template logic across both grafana-http-route.yaml and prometheus-http-route.yaml.
Additionally, consider placing distinct template statements on separate lines (such as on line 27) to improve code readability.
🤖 AI Reviewer (Jetski) | Traces: architecture: http://go/traj/7ef5cb6a-c322-4436-b205-9691752f849d, style: http://go/traj/6066be5b-eac5-4040-a40c-0c0682f51e23
| path: | ||
| type: ReplaceFullPath | ||
| replaceFullPath: {{ tpl $.Values.gf_ingress_auth_url $ }} | ||
| replaceFullPath: {{ $authUrl.path }}{{ if $authUrl.query }}?{{ $authUrl.query }}{{ end }} |
There was a problem hiding this comment.
[CORRECTNESS] Omit query parameters (?{{ $authUrl.query }}) from replaceFullPath and provide a default path (such as /) when $authUrl.path is empty, because Gateway API URLRewrite expects an RFC 3986 path component and will either reject or percent-encode question marks (this also applies to prometheus-http-route.yaml).
🤖 AI Reviewer (Jetski) | Traces: correctness: http://go/traj/82c48c05-bb91-453d-8c56-c99db974d19c
This makes the "-auth" http-routes work.
I am still not happy that we need to managed hard-coded lists.