Replace the policy name attribute in MapSpaYarp with IEndpointConventionBuilder#31
Conversation
…pointConventionBuilder instead. This allows more flexibility in the configuration of the endpoint such as AllowAnonymous or RequireAuthorization.
HanoRossouw
left a comment
There was a problem hiding this comment.
Reviewed code changes for exposing IEndpointConventionBuilder to pass additional config on the endpoint up to the implementer. No faulty code changes found and logic seem sound and allows for greater capabilities in usage while reducing concerns of this package also
|
I just looked again at my changes and saw that I introduced a breaking change. However, there was no change for a long time, so I am not sure if it makes sense to change anything in my PR. |
I can confirm it does cause an issue if you do not handle the null in the pipeline when the spa.proxy.json file is not present. but honestly is a minor issue compared to having to send in a policyname or allow anonymous boolean flag to control endpoint auth |
|
Currently there is not even a possibility to call AllowAnonymous() for the SpaYarp catch all path. That was the main reason for the change, since it is currently unconvenient to allow anonymous access if MapSpaYarp() is combined with AddAuthorization() when an authenticated user is requested by default. It would be possible though, to create a custom authorization policy without rules, such that it behaves like AllowAnonymous, but that is not an elegant solution if the convention builder can be exposed instead. |
|
I consider this projekt as dead and will not continue pushing changes to it. |
Return the IEndpointConventionBuilder instead of passing a policyName.
This allows more flexibility in the configuration of the endpoint such as AllowAnonymous or RequireAuthorization.
Also added a section in the Readme.md and fixed some small issues which prevented me from building (e.g. the version in global.json).
Increased the version from 2.0.1 to 2.0.2.