aspnet / AspNetWebHooks

Libraries to create and consume web hooks on ASP.NET 4.x (Due to other priorities this project is currently in maintenance mode only. There are no planned releases at this time. No new features are planned and we are only addressing critical issues as required.)
Apache License 2.0
134 stars 103 forks source link

Pusher webhooks sample #37

Closed Misiu closed 3 years ago

Misiu commented 5 years ago

I've added Pusher sample and moved constants to separate file, similar to https://github.com/aspnet/WebHooks/blob/master/src/Microsoft.AspNetCore.WebHooks.Receivers.Pusher/PusherConstants.cs

This is the first step. In next, I'd like to add behavior like in VSTS Receiver - base handler like https://github.com/aspnet/AspNetWebHooks/blob/master/src/Microsoft.AspNet.WebHooks.Receivers.VSTS/Handlers/VstsWebHookHandlerBase.cs

dnfclas commented 5 years ago

CLA assistant check
All CLA requirements met.

Misiu commented 5 years ago

I've added PusherWebHookHandlerBase similar to VstsWebHookHandlerBase

Because Pusher has batch webhooks I must iterate over events and for each of them I call the correct strong-typed method.

Sample method:

public virtual void ChannelOccupied(WebHookHandlerContext context, ChannelOccupiedPayload payload)
{
}

After approval, I can modify my sample, so that handler will extend PusherWebHookHandlerBase.

dougbu commented 3 years ago

@Misiu thanks very much for your PR. This repo is in maintenance mode and we make fixes only for critical issues in this repo.

Misiu commented 3 years ago

@dougbu sure thing. I created this PR a long time ago. Sadly there are no alternatives for .NET Core 3.1 or .NET 5. Or maybe there are? 🤔

dougbu commented 3 years ago

Sadly there are no alternatives for .NET Core 3.1 or .NET 5.

Packages such as https://www.nuget.org/packages/Microsoft.AspNetCore.WebHooks.Receivers.Pusher/1.0.0-preview2-final target netstandard2.0 and are therefore compatible with netcoreapp3.1 and net5.0. They will however likely remain in preview.

Misiu commented 3 years ago

@dougbu thank you for the link. There are https://github.com/aspnet/AspLabs but sadly no releases. Maybe someday webhooks will be taken seriously and first-class support will be added.