Skip to content

Convention-Based Receiver Middleware Extensions #25

@tsutomi

Description

@tsutomi

The current set of ASP.NET Core receivers allows two different types of webhook handlers:

  1. Handlers registered as services and resolved by a factory/based middleware, that does not accept parameters
  2. Handlers defined directly in the convention-based middleware as callbacks

We should extend the design to have a convention-based middleware that receive handlers from dependency injection and accepts arguments to configure its execution

Example:

public class Program {
    public void ConfigureServices(IServiceCollection services) {
        services.AddWebhookReceiver<MyWebhook>()
            .AddHandler<MyHandler>();
    }

    public void Configure(IApplicationBuilder app) {
        app.UseWebhookReceiver<MyWebhook>("/webhooks" new WebhookReceiverOptions {
        });
    }
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestreceiverIssue related to the receiving capability

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions