argoproj-labs / argocd-extension-metrics

An Argo CD extension to enable visualization of metrics in Argo CD UI.
Apache License 2.0
114 stars 27 forks source link

Integrate with Argo CD authorization headers #15

Closed leoluz closed 11 months ago

leoluz commented 1 year ago

As the metric extension request to the backend service needs to be proxied by Argo CD a few headers are mandatory to be sent in order to make sure the user is authenticated and authorized.

Authentication (authn)

For authentication the browser is required to send the existing content of the argocd.token cookie in the Cookie header: Example: Cookie: "argocd.token=eyJhbGciOiJIUzI1Ni..."

The entire Argo CD cookie list can also be sent. The API server will filter out the argocd.token automatically in this case.

Authorization (authz)

For authorization the browser is required to send 2 additional headers:

1. To validate the logged in user has access to the application:

Example: Argocd-Application-Name: "namespace:app-name"

2. To validate the logged in user has access to the project:

Example: Argocd-Project-Name: "default"

leoluz commented 11 months ago

done