feat: return IEndpointConventionBuilder from MapGitHubWebhooks to allow additional configuration of endpoint #477
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows additional configuration of endpoint. For example, allowing anonymous access for the endpoint for an app that otherwise requires a specific type of authentication:
app.MapGitHubWebhooks("/api/github/webhooks, githubWebhookSecret).AllowAnonymous()
Resolves #476
Before the change?
If you have authentication on your entire app but you want to allow anonymous access to the GitHub webhook endpoint, there doesn't seem to be a way to do that currently.
After the change?
The IEndpointConventionBuilder is available to users of the library, so they can configure any of the settings that you normally could for a
app.MapPost( ... )
call, includingAllowAnonymous()
.Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!