System Library Common Framework
Search Results for

    *.Benchmark*,*.Tests*,*.ApiTests*,*.BaseTest*,DelegateJsonConverter,CalleeCancelledRequestException,ClientResponse,ContentType,OutputCachePolicy
    Show / Hide Table of Contents Show / Hide Table of Contents
    NamespaceSystemLibrary.Common.Framework.App.Attributes SystemLibrary.Common.Framework.App.dll

    Filters access based on Origin header

    Input:

    `null`: Allows all

    `*`: Allows all

    - A regex: Value must satisfy the regex pattern

    - A pipe separated list: Any part is within the Value in a case insensitive check

    `text`: Value must match, case sensitive
    [OriginFilter(null)] // Allows all
    [OriginFilter("*")] // Allows all
    [OriginFilter("^[ab0-4]{4,}$")] // Allow origin containing `a, b, 0, 1, 2, 3 or 4` with a minimum length of 4
    [OriginFilter("SystemLibrary\.com")] // Exact match of SystemLibrary.com, case sensitive
    [OriginFilter("test.systemlibrary\.com|test2.systemlibrary.com")] // Allow origins containing test.systemlibrary.com or test2.systemlibrary.com, case insensitive
    Remarks
    X

    Validating as a regex expression requires any of these characters: ^$*?[

    Validate case insensitive with a string.Contains match requires at least one delimiter |

    Falls back to normal string equals comparison, case sensitive

    OriginFilterAttribute

    public class OriginFilterAttribute : BaseApiFilterAttribute, IActionFilter, IAsyncActionFilter, IResultFilter, IAsyncResultFilter, IOrderedFilter, IFilterMetadata

    Inheritance
    object
    Attribute
    ActionFilterAttribute
    BaseApiFilterAttribute
    OriginFilterAttribute
    Implements
    IActionFilter
    IAsyncActionFilter
    IResultFilter
    IAsyncResultFilter
    IOrderedFilter
    IFilterMetadata
    Inherited Members
    BaseApiFilterAttribute.RequestHasValidHeaderValue(string, string)
    BaseApiFilterAttribute.OnAccessDenied(ActionExecutingContext, string)
    ActionFilterAttribute.OnActionExecuted(ActionExecutedContext)
    ActionFilterAttribute.OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)
    ActionFilterAttribute.OnResultExecuting(ResultExecutingContext)
    ActionFilterAttribute.OnResultExecuted(ResultExecutedContext)
    ActionFilterAttribute.OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)
    ActionFilterAttribute.Order
    Examples
    Arguments
    X

    Constructors

    match: either a regex, an exact string, or strings delimited by |

    Remarks
    X

    Validating as a regex expression requires any of these characters: ^$*?[

    Validate case insensitive with a string.Contains match requires at least one delimiter |

    Falls back to normal string equals comparison, case sensitive

    public OriginFilterAttribute(string match = null)

    X
    Methods arguments
    Type Name Description
    string match

    Methods

    Called before the action executes, after model binding is complete.

    Remarks
    X

    Validating as a regex expression requires any of these characters: ^$*?[

    Validate case insensitive with a string.Contains match requires at least one delimiter |

    Falls back to normal string equals comparison, case sensitive

    public override void OnActionExecuting(ActionExecutingContext context)

    X
    Methods arguments
    Type Name Description
    ActionExecutingContext context

    The ActionExecutingContext.

    Overrides
    ActionFilterAttribute.OnActionExecuting(ActionExecutingContext)

    Implements

    IActionFilter
    IAsyncActionFilter
    IResultFilter
    IAsyncResultFilter
    IOrderedFilter
    IFilterMetadata

    Extension Methods

    ObjectExtensions.Json(object, bool)
    ObjectExtensions.Json(object, JsonSerializerOptions, bool, params JsonConverter[])
    ObjectExtensions.Json(object, params JsonConverter[])
    ObjectExtensions.Xml(object)

    }

    In This Article
    Package: nuget
    Source: github
    Website: System Library Common Framework