SystemLibrary.Common.Framework.App.Attributes
Classes
ApiTokenFilterAttribute
Filters access based on api-token
header
Optional: set a custom token header name
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 sensitiveBaseApiFilterAttribute
OriginFilterAttribute
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
UserAgentFilterAttribute
Filters access based on User-Agent
header
NOTE: If attribute is added it blocks most known spiders, crawlers and bots even if you allow all
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[UserAgentFilter(null)] // Allows all
[UserAgentFilter("*")] // Allows all
[UserAgentFilter("^[ab0-4]{4,}$")] // Allow user agents containing only `a, b, 0, 1, 2, 3 or 4` with a minimum length of 4
[UserAgentFilter("User Agent")] // Exact match of 'User Agent', case sensitive
[UserAgentFilter("firefox|edg|chrome")] // Allow user agents containing firefox or edg or chrome, case insensitive