Skip to content

feat(subscriptions): Scripts for consuming events#2948

Open
Cobalt0s wants to merge 1 commit into
cobalt0s/microsoft-webhook-verifierfrom
cobalt0s/subscribe-scripts
Open

feat(subscriptions): Scripts for consuming events#2948
Cobalt0s wants to merge 1 commit into
cobalt0s/microsoft-webhook-verifierfrom
cobalt0s/subscribe-scripts

Conversation

@Cobalt0s
Copy link
Copy Markdown
Contributor

@Cobalt0s Cobalt0s commented May 1, 2026

Description

Introduces reusable scripts and test scenarios for working with subscription webhooks locally.

Key features

  • Webhook consumer script
    Starts a local webhook server (requires ngrok) and prints incoming events.
    Supports optional custom handling — if a request is not intercepted, it falls back to logging. Some connectors require a response during provider webhook validation; this is handled via subscription.NewWebhookRouter().

  • Subscription + consumer flow script
    Provides an end-to-end workflow for creating subscriptions and consuming events.

    • The webhook URL (public HTTPS via ngrok) is provided to the script via environment variables or standard input.
    • The script supports graceful shutdown (CTRL+C / kill signal), ensuring:
      • webhook server shuts down cleanly without deadlocks
      • event-waiting loop unblocks and exits safely
    • Supports executing a sequence of connector operations (create/update/delete) to observe real-time event consumption and filtering based on subscription rules.

Notes

  • Requires ngrok for exposing the local webhook.
  • Designed for flexible local debugging, manual verification, and experimentation with subscription flows.

Scripts

No webhook input

Invallid URL format or empty string exists the script.

No webhook input

Event Consuming

Infinite listener which outputs all incoming events.

Webhook Consumer

Killing script

Interrupting the script accepts the signal, gracefully shuts down the webhook handler, and exits the loop that receives messages from the webhook routine.

Interupt

Successful script run

Subscribes to create and delete. Then invoke create, update and delete. The 2 expected messeges arrive and update had no side effects.

Calendar events

@Cobalt0s Cobalt0s self-assigned this May 1, 2026
@Cobalt0s Cobalt0s force-pushed the cobalt0s/subscribe-scripts branch from bfa981f to d3bd6c1 Compare May 1, 2026 21:58
@Cobalt0s Cobalt0s marked this pull request as ready for review May 1, 2026 21:58
@Cobalt0s Cobalt0s force-pushed the cobalt0s/subscribe-scripts branch from d3bd6c1 to de29855 Compare May 13, 2026 21:33
@Cobalt0s Cobalt0s force-pushed the cobalt0s/microsoft-webhook-verifier branch from fd4bc89 to b9f9c18 Compare May 13, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants