public static TEndpoint Authorize <TEndpoint>(
     this TEndpoint endpoint, AuthorizationCategory category,
     string policy = null) where TEndpoint : IEndpoint
 {
     endpoint.AuthorizeableEndpoint = new()
     {
         Category = category,
         Policy   = policy
     };
     return(endpoint);
 }
 public static ControllerEndpointSettings AuthorizeAction(this ControllerEndpointSettings controller,
                                                          string actionMethodName, AuthorizationCategory category, string policy = null)
 {
     controller.ActionSettingsCollection.FirstOrDefault(x => x.ActionMethod
                                                        .EndsWith(actionMethodName, StringComparison.OrdinalIgnoreCase))
     .Authorize(category, policy);
     return(controller);
 }