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

Add support for custom headers with Grafana provider #821

Open
sentros opened this issue May 7, 2024 · 1 comment
Open

Add support for custom headers with Grafana provider #821

sentros opened this issue May 7, 2024 · 1 comment
Assignees
Labels
area/alerting Alerting related issues and PRs

Comments

@sentros
Copy link

sentros commented May 7, 2024

We have Grafana set up behind google IAP and then a custom rule for the /api/annotations/ endpoint that allows us to circumvent IAP with a custom header for flux notifications. According to the flux documentation the NATS provider supports custom HTTP headers but that doesn't seem to be the case for Grafana.

I would like the grafana provider to work like this:

---
apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
metadata:
  name: grafana
  namespace: flux-system
spec:
  type: grafana
  address: https://${grafana_fqdn}/api/annotations
  secretRef:
    name: grafana-secret
---
apiVersion: v1
kind: Secret
metadata:
  name: grafana-secret
  namespace: flux-system
stringData:
  headers: |
    Authorization: "${grafana_annotations_token}"
    CustomHeader: "${custom_secret}"

or alternatively like this:

---
apiVersion: v1
kind: Secret
metadata:
  name: grafana-secret
  namespace: flux-system
stringData:
  headers: |
    CustomHeader: "${custom_secret}"
  token: "${grafana_annotations_token}"

I tried looking through the code but I'm not well versed in go. To my eye it seems like headers are only added when there's a non empty username+password or token here. So I'm guessing some additions would need to be made for custom header support.

@fsequeira1
Copy link
Contributor

I will take this one

@stefanprodan stefanprodan added the area/alerting Alerting related issues and PRs label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Alerting related issues and PRs
Projects
None yet
Development

No branches or pull requests

3 participants