public static IApplicationBuilder UseProtectedFolder(this IApplicationBuilder builder, Action<ProtectedFolderOptions> options) {
            var protectFolderOptions = new ProtectedFolderOptions();

            options(protectFolderOptions);

            return UseProtectedFolder(builder, protectFolderOptions);
        }
 public static IApplicationBuilder UseProtectedFolder(this IApplicationBuilder builder, ProtectedFolderOptions options) {
     return builder.UseMiddleware<ProtectedFolderMiddleware>(options);
 }
 public ProtectedFolderMiddleware(RequestDelegate next, ProtectedFolderOptions options) {
     _next = next;
     _path = options.Path;
     _policy = options.PolicyName;
 }