envoyproxy / envoyproxy/gateway

Add support for dynamic metadata in http ext authz

Aperta
#4,163 7 commenti 1 reazione 0 assegnatari Vedi su GitHub
area/api help wanted
Lingua principale
Go
Stelle
3k
Fork
864
Merge medio
2g 2h
PR unite (30g)
140

Descrizione

*Description*:
We have a use case that requires emitting specific information from the external authz service into the logs, and this can be achieved using dynamic metadata. In the grpc ext_authz, dynamic metadata can be included directly as part of `CheckResponse`. However, in the http ext_authz, the only method to pass this information is by sending it as response headers, which are then emitted via the `dynamic_metadata_from_headers`.

It would be great if the [dynamic_metadata_from_headers](https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/ext_authz/v3/ext_authz.proto#extensions-filters-http-ext-authz-v3-authorizationresponse) field can be exposed

*proposal*:
In the current implementation, `allowed_upstream_headers` is already implemented as `headersToBackend` with support for the `exact` match type only. We can extend the functionality to include `dynamic_metadata_from_headers` to support this.

`headersToMetadata` seems like a suitable option for `dynamic_metadata_from_headers`. However, I welcome any feedback and suggestions

```
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
name: ext-auth-example
spec:
extAuth:
failOpen: false
http:
backendRefs:
- group: ""
kind: Service
name: http-ext-auth
port: 9002
headersToMetadata:
- x-user-id
targetRefs:
- group: gateway.networking.k8s.io
kind: HTTPRoute
name: backend
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.