Secrets should be able to be used in webhook notification service for requests that require an access token to be a part of the HTTP header field.
Motivation
Gitlab API requires the PRIVATE-TOKEN header field to be present with a valid access token in order to authenticate to its API. If we wish to use this then we would need to hardcode an access token inside of the configmap which is not ideal. We should be able to use the argocd-notifications-secret similar to the way it is able to be used in the template as demonstrated in the docs
When I try to leverage it in the service config like this:
Summary
Secrets should be able to be used in webhook notification service for requests that require an access token to be a part of the HTTP header field.
Motivation
Gitlab API requires the PRIVATE-TOKEN header field to be present with a valid access token in order to authenticate to its API. If we wish to use this then we would need to hardcode an access token inside of the configmap which is not ideal. We should be able to use the argocd-notifications-secret similar to the way it is able to be used in the template as demonstrated in the docs
When I try to leverage it in the service config like this:
I see the following error:
time="2024-10-25T18:39:57Z" level=error msg="error getting api from namespace: argocd error: error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{\".secrets.gitlab-token\":\"\"}"
Proposal
Make this such that we can use the argocd-notifications-secret fields in the webhook configuration similar to the templates configuration.