Commit Graph

179 Commits

Author SHA1 Message Date
Dipti Pai 3ee0e7a8cd Provider Azure Event Hub - Remove JWT auth from docs
Signed-off-by: Dipti Pai <diptipai89@outlook.com>
2025-09-05 11:21:23 -07:00
Adrian Fernandez De La Torre a332f9c326 Setup OTEL provider type
Signed-off-by: Adrian Fernandez De La Torre <adri1197@gmail.com>
2025-09-05 11:02:14 +02:00
Matheus Pimenta de328fa438
Introduce zulip alert provider
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-09-04 19:08:06 +01:00
Stefan Prodan e2151f5632
Migrate tests to Gomega
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-08-31 13:50:53 +03:00
abhijith-darshan 4eae0d34da
Add support for mTLS to GitHub App transport
This commit ensures that if GitHub app secret data contains ca.crt then a TLS config with user provided custom ca is used in the underlying HTTP transports. The ca.crt in GitHub App secretRef is ignored if certSecretRef is also provided.

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): keep Makefile in sync with other controllers

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): use proper func naming format

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): revert Makefile changes

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): add get secret helper

This commit creates a getSecret helper func which can be used to resolve secret. createNotifier re-uses this helper func to extract and pass secrets down to other methods

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): adds tls test cases

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): remove debug logs

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): adds documentation

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): update docs with mTLS info

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>
2025-08-18 11:03:43 +02:00
cappyzawa 10a6172536
[RFC-0010] Add default-service-account for lockdown
Add --default-service-account flag for multi-tenant workload identity
lockdown support. This flag sets the default service account name to
be used when .spec.serviceAccountName is not specified in resources.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-08-18 01:44:25 +09:00
cappyzawa 43b3104555
Add object-level workload identity support to Google Pub/Sub notifier
Add support for object-level GCP workload identity authentication to enable
individual Providers to authenticate using their own ServiceAccount without
needing to manage JSON credentials. This extends beyond the existing
controller-level workload identity that is automatically handled by
Google libraries.

The implementation maintains backward compatibility by prioritizing
JSON credentials when both authentication methods are available.
Proxy support is also added following the Azure DevOps pattern
for consistency across notifiers.

This change is part of the broader effort to support multi-tenant
workload identity across Flux controllers (RFC-0010).

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-08-03 07:35:37 +09:00
Matheus Pimenta 3e69e745a3
Introduce proper basic auth support for Alertmanager Provider
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-07-28 11:32:41 +01:00
cappyzawa 67c049d3c7
Add mTLS support for DataDog and Sentry notifiers
These notifiers were using x509.CertPool which only supports CA
certificates for server authentication. By migrating to tls.Config,
they now support mutual TLS authentication with client certificates.

This enables secure communication in enterprise environments that
require client certificate authentication, completing the runtime/secrets
migration for these remaining notifiers.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-22 14:23:12 +09:00
cappyzawa 0c1801906a
Add mTLS support for git-based notifiers
Replace x509.CertPool with tls.Config across all Git-based notifiers
(GitHub, GitLab, Gitea, Bitbucket, Azure DevOps, GitHub Dispatch) to
enable mutual TLS authentication for enterprise environments.

Adopt runtime/secrets AuthMethodsFromSecret for standardized handling
of Bearer tokens, basic auth, and token auth while maintaining full
backward compatibility with existing Secret formats.

This unifies authentication processing across Git-based providers and
adds mTLS capability without changing API surface or breaking existing
deployments.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-19 08:31:47 +09:00
Dipti Pai dc8e92c119 Azure OIDC integration updates:
- Azure DevOps commit status update using Managed Identity.
- Migrate Azure Event Hubs to new ProducerClient (azeventhubs) sdk
- Unit Tests and doc update

Signed-off-by: Dipti Pai <diptipai89@outlook.com>
2025-07-18 07:58:13 -07:00
cappyzawa 955d24142c
Make address field optional for providers that generate URLs internally
This change removes the generic address validation from event_handlers.go
that was preventing address-optional providers from functioning without
specifying a dummy address value. Some providers generate URLs internally
and don't require external address configuration.

This allows providers that generate URLs internally to work without
requiring dummy address values in the provider configuration.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-16 00:13:29 +09:00
Matheus Pimenta febff88be7
Upgrade Kubernetes to 1.33.2
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-07-14 16:45:44 +01:00
cappyzawa e4160c509c
fixup! Add proxy support to Telegram notifier
Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-08 21:42:27 +09:00
cappyzawa fc4adfd030
Add proxy support to Telegram notifier
Replace shoutrrr with direct Telegram Bot API calls to enable proxy
configuration through postMessage function.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-08 00:15:02 +09:00
cappyzawa 98ecf2de79
Add mTLS support for postMessage-based notifiers
- Implement mTLS support for 10 postMessage notifiers
- Unify constructor signatures with tlsConfig parameter
- Make TLSConfig field public for consistency
- Update factory functions and fuzz tests
- Add mTLS test cases
- Replace CertPool with TLSConfig using runtime/secrets

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-03 21:39:16 +09:00
Hidehito Yabuuchi 882383e44c Fix Slack chat.postMessage error handling
Signed-off-by: Hidehito Yabuuchi <hdht.ybuc@gmail.com>
2025-05-24 18:23:45 +09:00
Matheus Pimenta 637d55d0b9
Upgrade fluxcd/pkg auth and git
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-07 18:17:38 +01:00
Dipti Pai 0beb3d02f7 Managed Identity support for Azure Event Hubs. Changes include -
- If authentication token is not specified in provider, attempt to get the token using workload identity.
= Add new field .spec.serviceAccountName to support multi-tenant workload identity as defined in RFC-0010 to use an identity with a service account other than the notification-controller.
- Use proxy to get the token if specified in provider spec.
- Cache the tokens if enabled in the notification controller options.
- If address has SAS connection string, use that for authentication, this takes priority over token-authentication
- If static JWT token is specified in the secret reference, use it for authentication, this takes priority over workload identity-acquired token.
- Update RBAC for notification-controller to be able to create service token requests.
- Add unit tests for the 3 authentication mechanisms (SAS, JWT, managed identity).
- Add documentation for using single-tenant and multi-tenant approaches of workload identity with azureeventhub provider.
- Add operation post to github helpers and provider controller for cache event metrics
- Enable token cache by default.

Signed-off-by: Dipti Pai <diptipai89@outlook.com>

review comments

Signed-off-by: Dipti Pai <diptipai89@outlook.com>

enable cache by default

Signed-off-by: Dipti Pai <diptipai89@outlook.com>
2025-05-05 12:03:52 -07:00
Sergey Dreger 0338a311f4 feat: add 'proxyURL' support to Gitea notifier
Signed-off-by: Sergey Dreger <sergey.dreger@gmail.com>
2025-04-09 15:06:49 +03:00
Sergey Dreger 30d8d01687 fix: pass 'certPool' to Gitea client on creation
It is required when a custom CA is passed, otherwise the
gitea.NewClient() call will fail with the 'tls: failed to verify
certificate: x509: certificate signed by unknown authority' error.
Because the current version of Gitea SDK performs a call to the
'/api/v1/version' endpoint during a new client creation, so the
'certPool' must be passed when creating the client.

Resolves: #1083
Signed-off-by: Sergey Dreger <sergey.dreger@gmail.com>
2025-03-23 17:17:41 +02: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 7a34aee2bd
Add involved object reference as annotations for the grafana provider
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-02-12 14:10:13 +00:00
Moritz Rieger 764123c6d3 fix: adding of duplicate commit statuses in gitlab
RESOLVES #1009

Signed-off-by: Moritz Rieger <moritz.rieger@exaring.de>
2025-01-31 09:00:27 +01:00
Georgi Panov ecc3395615 Add support for Bearer Token authentication to Provider alertmanager
Signed-off-by: Georgi Panov <77702912+d4rkfella@users.noreply.github.com>
Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Update alertmanager_test.go

Signed-off-by: Georgi Panov <77702912+d4rkfella@users.noreply.github.com>
Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Update alertmanager_fuzz_test.go

Signed-off-by: Georgi Panov <77702912+d4rkfella@users.noreply.github.com>
Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Update factory.go

Signed-off-by: Georgi Panov <77702912+d4rkfella@users.noreply.github.com>
Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Update factory.go

Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Fix a mistake with the last commit to update the docs

Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Fix another formatting issue

Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Screwed up my previous commit so implementing the suggested changes again and fixed formatting for the structs

Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Tried to use better wording, to outline that authentication is optional

Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Another small change to the explanation for bearer token authentication

Signed-off-by: Darkfella91 <darkfella91@gmail.com>

Fix incorrect article usage and the configured address example as suggested

Signed-off-by: Darkfella91 <darkfella91@gmail.com>
2025-01-26 23:43:03 +02:00
Matheus Pimenta e0b98ca519
Add support for MetaOriginRevisionKey from the Event API
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-01-21 08:28:31 +00:00
Valentin Flaux 56c5a5a4bc
msteams notifier: adaptive cards full width
Configure the adaptive card to expand and make full use of extra canvas
space in teams.

Signed-off-by: Valentin Flaux <38909103+vflaux@users.noreply.github.com>
2025-01-13 16:50:46 +01:00
Erik Godding Boye f3438f7709
Migrate to gitlab.com/gitlab-org/api/client-go
Signed-off-by: Erik Godding Boye <egboye@gmail.com>
2025-01-03 13:36:13 +01:00
Stefan Prodan b2ab2c2b07
Update go-github to v63
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-26 15:05:47 +03:00
Matheus Pimenta e0cf7a1fc7 Add MS Adaptive Card payload to `msteams` Provider
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-09-12 11:00:51 -03:00
Matheus Pimenta bd12728d0f Upgrade dependencies
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-08-15 09:03:03 -03:00
Max Jonas Werner f9610afa8d
Fix telegram test flake
The test would sometimes fail because the metadata lines are built
from a map and map iteration order in Go is non-deterministic.
Therefore, the lines may be ordered differently between different test
runs.

Now, the test sorts the metadata lines of the telegram message so they
are always the same and only then verifies the expected output.

closes #867

Signed-off-by: Max Jonas Werner <max.werner@associmates.eu>
2024-08-01 15:50:58 +02:00
Max Jonas Werner e70166d5e3
Add test for telegram notifier
This test will make sure we're properly escaping the message and
constructing the URL correctly.

Signed-off-by: Max Jonas Werner <max.werner@associmates.eu>
2024-06-25 10:16:08 +02:00
hohohong 0f8ff3c0d8
telegram notifier should escape with metadata key
Signed-off-by: hohohong <github@m.hs1o.dev>
2024-06-25 10:16:08 +02:00
Timur Demin 531c5873e7 Alertmanager: Change timestamp label to .StartsAt
notification-controller posted all outgoing Alertmanager alerts with
"timestamp" label, effectively preventing grouping alerts related to the
same resource and forcing users to configure a separate alert receiver
with `send_resolved: false`.

This changes it to instead set "startsAt", which was previously set
(automatically by Alertmanager) to alert posting time. "endsAt" remains
unset, as we have no way of figuring that out but the reconciliation
interval of the resource that generated the alert, which can currently
only be found out by making a Kubernetes API round-trip.

Note that this requires users to adapt alert templates that relied on
.Labels.Timestamp.

Signed-off-by: Timur Demin <me@tdem.in>
2024-04-27 16:20:12 +05:00
Gaurav Dasson 633e33bf4b Add support for Bitbucket Context path - Fix issue #742
Signed-off-by: Gaurav Dasson <gaurav.dasson@gmail.com>
2024-04-20 23:56:03 -05:00
al-lac 94ce6da0f2 Add severity to opsgenie Details payload
Co-authored-by: souleb <bah.soule@gmail.com>
Signed-off-by: al-lac <lackner.alex@gmail.com>
2024-04-19 14:36:35 +02:00
Soule BA e3ae7c2d48
refactor notifier factory
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-09 22:21:11 +02:00
Stefan Prodan 952ccd000f
User the password as fallback for Git provider token auth
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-09 18:59:04 +03:00
Anatoly Medvedkov bf918b9b3c Fix Telegram MarkdownV2 escaping
Current implementation was missing '*' symbol.

Signed-off-by: Anatoly Medvedkov <32126+coding4food@users.noreply.github.com>
2024-03-21 13:41:04 +03:00
Stefan Prodan aef940033c
Fix timout propagation for alerts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-03-07 16:30:39 +02:00
Stefan Prodan 32c59b2474
Fix BitBucket status update panic
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-01-30 15:23:38 +02:00
Arthur ANDRIEU 5371d8a79d fix(grafana-provider): replace ":" character in eventMetadata
Signed-off-by: Arthur Andrieu  <arthur.andrieu@gmail.com>
2024-01-11 19:16:00 +01:00
Hector Fernandez 39a3853c5c replace whilp/git-urls module by chainguard-dev/git-urls
Signed-off-by: Hector Fernandez <hector@chainguard.dev>
2023-12-06 09:38:59 +01:00
Toby Watson 427d20046e
Add NATS provider to v1beta3
Signed-off-by: Toby Watson <SkullKidCode@users.noreply.github.com>
2023-11-30 23:19:21 +00:00
Sunny 4bf469e61b Add Alert and Provider v1beta3 API
v1beta3 API for Alert and Provider makes them static objects, removing
the status subresource and spec fields that are relevant to dynamic
objects with reconcilers.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-11-28 16:17:03 +05:30
gdasson 504dc991cc Adding bitbucketserver provider for git commit status
Signed-off-by: gdasson <gaurav.dasson@gmail.com>
2023-11-20 23:17:04 -06:00
Hidde Beydals bdda58062f
misc: handle `strings.Title` deprecation
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-11 15:01:29 +02:00
Hidde Beydals 16fb90ed84
misc: remove redundant `break` statements
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 12:07:32 +02:00