aspnet / WebHooks

[Archived] Libraries to create and consume web hooks on ASP.NET Core. Project moved to https://github.com/aspnet/AspLabs
Apache License 2.0
627 stars 439 forks source link

Reduce spread of `[GeneralWebHook]` support #258

Closed dougbu closed 6 years ago

dougbu commented 6 years ago

Most of the WebHook constraints and filters do runtime look-ups (Linq queries) to find their metadata. This is decentralized even though it's not required for anything but actions with [GeneralWebHook] applied. Thought is to instead apply specific constraints and filters when processing the application model.

For the [GeneralWebHook] case, use different constraint and filter constructors that pass a new interface. That interface would hide the runtime lookup behind its facade. When processing a request, constraints and filters would use the interface to grab the metadata they need, then proceed in the normal (receiver-specific) way.

Should not repeat any requirements the application model code enforces in the code for the [GeneralWebHook] case. Instead assume the retrieved metadata is consistent and let the constraints and filters "blow up" if not. This avoids additional code duplication and complexity.

dougbu commented 6 years ago

Self-assigning because this needs to be done in the Preview2 milestone. Will otherwise be locked into the current approach.

dougbu commented 6 years ago

@mkArtakMSFT doing this may reduce the size of other tasks and issues in this repo a bit. Issue is itself on the S / M border because it should mostly be mechanical.

dougbu commented 6 years ago

BTW this is tied to main ASP.NET Core WebHooks 1.0.0 rock because [GeneralWebHook] actions are central to that.

dougbu commented 6 years ago

/fyi @rynowak

WestDiscGolf commented 6 years ago

Any update on the above and associated pull request? is this the last large change which will be going in before the full aspnet core 2.1 release?

Cheers

dougbu commented 6 years ago

Any update on the above and associated pull request?

Have been doing other things but will get back to this soon.

is this the last large change which will be going in before the full aspnet core 2.1 release?

Not necessarily. Why do you ask?

WestDiscGolf commented 6 years ago

Thanks for the update. I've been working on a Webhook that I want to nuget up but have been developing it in this solution to aid with debugging and getting the latest changes as the library has been developing. Just curious how much I'd have to tweak before I can get a preview out based on a stable nuget :-)

dougbu commented 6 years ago

Reduced cost to track the review process that remains in this milestone.

dougbu commented 6 years ago

c9ab0b4ede