Commit Graph

38 Commits

Author SHA1 Message Date
Paul Schultz 05f60e1e0a refactor: convert constructor parameter properties for erasableSyntaxOnly compatibility
Signed-off-by: Paul Schultz <pschultz@pobox.com>
2025-10-14 08:29:21 -05:00
Fredrik Adelöw 0efcc97787 run yarn generate on all packages
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2025-09-15 12:11:47 +02:00
Rogerio Angeliski cf75bca4f3 feat(events-backend,events-node): improve parser interface
Signed-off-by: Rogerio Angeliski <angeliski@hotmail.com>
2025-02-26 20:36:53 -03:00
Rogerio Angeliski b95aa77ce2 feat(events-backend,events-node): add a parser option to events by content type
Signed-off-by: Rogerio Angeliski <angeliski@hotmail.com>
2025-02-24 10:11:21 -03:00
aramissennyeydd 4729dafc1b update all generated clients
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
2024-11-28 16:19:39 -05:00
Patrik Oldsberg 79a06f6dd9 events-node: clarify purpose of subscriber ID
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-11-21 16:33:22 +01:00
Phil Kuang 1577511333 feat(events): allow setting a timeout for event bus polling
Signed-off-by: Phil Kuang <pkuang@factset.com>
2024-11-08 13:46:33 -05:00
Patrik Oldsberg 7cc3dee0b1 Merge pull request #27121 from Bonial-International-GmbH/pjungermann/events/validate-raw-body
fix(events,github): fixes signature validation by using raw req body
2024-11-07 16:56:06 +01:00
Patrik Oldsberg 1c7d10eea1 events-node: more reliable way to wait for 202 body to close
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-10-31 11:14:47 +01:00
Patrik Oldsberg 0b57aa1495 events-node: fix event bus poll duplication
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-10-31 10:54:14 +01:00
Patrick Jungermann 9816f510dc fix(events,github): fixes signature validation by using raw req body
Adds raw body information (body as buffer, encoding)
to `RequestDetails` to support more request validation
use cases.

Additionally, uses the raw body to retrieve the transmitted
JSON string unparsed/raw to correctly validate the signature.

Previously, we re-stringified the parsed JSON payload
which could lead to different JSON strings.
Those differences can lead to the rejection of requests
due to a mismatch in expected signature.

Fixes: #26709
Relates-to: PR #26884
Co-authored-by: Christopher Diaz <cdiaz@rvohealth.com>
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2024-10-24 17:19:12 +02:00
RedlineTriad e02a02bb20 fix: useEventBus by propagating config to DefaultEventsService
This setting was added by reading from an optional `config` argument.
This was never passed, so `auto` was always assumed.
https://github.com/backstage/backstage/pull/27227/files#diff-cffd40a187b4fc584f03c968517fbacc110bde6a467f2384bbd92b803d3db47eR374-R379

Signed-off-by: RedlineTriad <39059512+RedlineTriad@users.noreply.github.com>
2024-10-21 10:08:45 +02:00
Patrik Oldsberg 4501631eef events-node: more resilient and configurable events service
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-10-17 16:33:53 +02:00
Patrik Oldsberg f14e127e4c Update plugins/events-node/src/api/DefaultEventsService.ts
Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 17:47:26 +02:00
Patrik Oldsberg f1fb54af5b events-backend: rename consumedBy -> notifiedSubscribers
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:36 +02:00
Patrik Oldsberg 2c9ea899c7 events-node: restore behavior of top-level DefaltEventsService methods
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:35 +02:00
Patrik Oldsberg 12dab61250 events-backend: use consumedBy everywhere instead of subscriptionIds
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:35 +02:00
Patrik Oldsberg 1154a730f6 events-backend: fix schema and response shape
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:34 +02:00
Patrik Oldsberg f13bd3e987 events-node: try to recreate subscription if it is cleaned up during polling
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:34 +02:00
Patrik Oldsberg 88a1be5ec0 events-node: restore EventParams type
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:34 +02:00
Patrik Oldsberg 2e2fc18dcc events-backend: update schema
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:34 +02:00
Patrik Oldsberg cd243f994f events-node: graceful shutdown of events service
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:34 +02:00
Patrik Oldsberg d3a7aa3738 events-backend: refactor listening API to be promise based + return headers early
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:33 +02:00
Patrik Oldsberg ea33c1240a events-node: update DefaultEventsService to use backend
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:47:05 +02:00
Patrik Oldsberg 8c7542f0d7 events-backend: update even bus route paths
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:46:40 +02:00
Patrik Oldsberg b8be639b9a events-node: generate client
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:46:39 +02:00
Patrik Oldsberg a90ce4aa39 events-node: update EventParams type
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-09-18 10:46:25 +02:00
Camila Belo eb34b87d5a refactor: stop using getVoidLogger in tests
Signed-off-by: Camila Belo <camilaibs@gmail.com>
2024-05-16 09:21:54 +02:00
Marley 015149cffd fix: added eventsServiceFactory to defaultServiceFactories
Signed-off-by: Marley <55280588+marleypowell@users.noreply.github.com>
2024-04-30 09:31:50 +00:00
Patrick Jungermann eff3ca9ddd feat(events)!: migrate EventRouter implementations from EventBroker to EventsService
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2024-02-26 12:28:41 +01:00
Patrick Jungermann 56969b6e55 feat(events): add new events service
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2024-02-26 12:28:40 +01:00
Patrik Oldsberg 4c08ac06fc fix remaining alpha exports
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2023-02-21 14:43:21 +01:00
Patrik Oldsberg 334baa32b0 events-node: migrate to use exports
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2023-02-21 14:28:20 +01:00
Brian Fletcher 02ac6ed2db rename type to TPayload
Signed-off-by: Brian Fletcher <brian@roadie.io>
2023-02-02 13:20:27 +00:00
Brian Fletcher 19d4abf72c make EventParams typed for tidier event handling
Signed-off-by: Brian Fletcher <brian@roadie.io>
2023-02-02 11:48:03 +00:00
Patrick Jungermann cf41eedf43 chore(events): apply post-merge comments
Introduces a new interface `RequestDetails` to abstract `Request`
providing access to request body and headers.

**BREAKING:** Replace `request: Request` with `request: RequestDetails` at `RequestValidator`.

**BREAKING:** Remove required field `router` at `HttpPostIngressEventPublisher.fromConfig`
  and replace it with `bind(router: Router)`.
  Additionally, the path prefix `/http` will be added inside `HttpPostIngressEventPublisher`.

Relates-to: PR #13931
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2022-11-19 15:08:14 +01:00
Patrick Jungermann dc9da28abd feat(events/http): add HTTP endpoint-based event publisher
This plugin adds an event publisher which receives events via (an) HTTP endpoint(s)
and can be used as destination at webhook subscriptions.

Relates-to: #11082
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2022-11-12 00:02:48 +01:00
Patrick Jungermann 7bbd2403a1 feat(events): add events management capabilities
This change introduces some new plugins which provide the basics
for managing events inside of backstage.
Hereby, it offers extension points to add event publishers and subscribers
as well as to exchange the event broker implementation.

- `@backstage/plugin-events-backend`:
  backend for the events management which connects all parts
  and provides a simple in-memory event broker
- `@backstage/plugin-events-node`:
  interfaces and API for `@backstage/plugin-events-backend`
- `@backstage/plugin-events-test-utils`:
  test utilities like implementations useful for writing tests at modules

All plugins support the new backend-plugin-api.

Relates-to: #11082
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2022-11-12 00:00:49 +01:00