Commit Graph

16 Commits

Author SHA1 Message Date
Matheus Pimenta e95f8d5b38
[RFC-0010] Introduce feature gate
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-19 14:15:57 +01:00
Dipti Pai bc7166d419 [RFC-007] GitHub App authentication support for github and github-dispatch providers.
- Add providerOpts in notifier to configure authentication options for various providers.
- If token/password are not set to PAT, check if github app details are configured in secret and if found; authenticate using github-app by retrieving app installation token.
- If proxy is specified in the provider spec OR in the secret, configure github app authentication to fetch the installation token over the proxy.
- Add unit tests for providers.
- Update documentation describing the usage of github app authentication with the providers.
- Add token cache to notification controller to cache and re-use the tokens.

Signed-off-by: Dipti Pai <diptipai89@outlook.com>
2025-03-20 14:18:10 -07:00
kathleen french 1967bc0c74 feat: support CEL expressions to construct commit statuses for v1beta3 provider types
Signed-off-by: kathleen french <kfrench@groq.com>
2025-03-14 08:53:55 -04:00
Matheus Pimenta 939a16620f
[RFC-0008] Custom Event Metadata from Annotations
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-01-10 13:19:15 +00:00
Sunny 68c38244cc Exclude eventv1.MetaTokenKey from event metadata
eventv1.MetaTokenKey is required to be considered in rate limiting but
it is only for internal use by flux components and should not be sent to
the alert provider. Remove eventv1.MetaTokenKey from the metadata of
event before processing the event for various matching alerts.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-12-13 23:13:38 +05:30
Matheus Pimenta 143a0b3ee0 Remove URL syntax validation for provider address entirely
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2023-12-12 19:01:31 +00:00
Max Jonas Werner 52d8945284
Cap provider address at 2048 bytes
The provider address is already capped at 2048 bytes in the CRD and
this commit adds the same upper limit when reading the address from a
Secret.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-11-28 12:31:20 +01:00
Sunny 19a60e98ea event handler: Add k8s events for Alerts
Emit events in the event handler along with logs on the respective alert
to make the message visible on the alert it belongs to.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-11-28 16:17:03 +05:30
Sunny 80f7237673 Refactor event handler
- Break down the EventServer.handleEvent() implementation into multiple
  smaller functions which are extensively tested on their own.
  - New implementation of filter Alerts for Event
  - New implementation of Event matches Alert
- Remove any readiness check on Alert or Provider.
- Add kubebuilder marker for generating RBAC permissions to create and
  patch events, and query Alert and Provider objects.
- Convert the event handler test from controllers/ dir to work with
  just EventServer without any reconciler, keeping all the test cases
  and slightly modified test set up code.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-11-28 16:17:03 +05:30
Matheus Pimenta ae6cc4b4f6 Reduce logging repeated code in event server
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2023-06-12 14:26:59 +01:00
Matheus Pimenta 8c11d8a19b Fix Alert .spec.eventMetadata behavior
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2023-05-24 11:27:27 +01:00
Somtochi Onyekwere b5f67d4f59 use masktoken pkg for redacting token
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-07-04 16:15:10 +01:00
Paulo Gomes a0dc84e36a
Small fixes
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-05-24 07:20:15 +01:00
Somtochi Onyekwere b30e2458d8 return actual error when regex.Compile fails
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-04-08 16:26:52 +01:00
Somtochi Onyekwere 6477e1500e return error on invalid UTF-8
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-04-08 15:09:18 +01:00
Somtochi Onyekwere 996ee365c5 Create function for redacting logs
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-21 16:37:33 +01:00