Class RequestAuthorizationUtilities
Contains various helper methods for authorizing image requests.
Inherited Members
Namespace: SixLabors.ImageSharp.Web
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public sealed class RequestAuthorizationUtilities
Constructors
| Edit this page View SourceRequestAuthorizationUtilities(IOptions<ImageSharpMiddlewareOptions>, IRequestParser, IEnumerable<IImageWebProcessor>, CommandParser, IServiceProvider)
Initializes a new instance of the RequestAuthorizationUtilities class.
Declaration
public RequestAuthorizationUtilities(IOptions<ImageSharpMiddlewareOptions> options, IRequestParser requestParser, IEnumerable<IImageWebProcessor> processors, CommandParser commandParser, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IOptions<ImageSharpMiddlewareOptions> | options | The middleware configuration options. |
IRequestParser | requestParser | An IRequestParser instance used to parse image requests for commands. |
IEnumerable<IImageWebProcessor> | processors | A collection of IImageWebProcessor instances used to process images. |
CommandParser | commandParser | The command parser. |
IServiceProvider | serviceProvider | The service provider. |
Fields
| Edit this page View SourceTokenCommand
The command used by image requests for transporting Hash-based Message Authentication Code (HMAC) tokens.
Declaration
public const string TokenCommand = "hmac"
Field Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceComputeHMAC(HostString, PathString, QueryString, QueryCollection, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public string? ComputeHMAC(HostString host, PathString path, QueryString queryString, QueryCollection query, CommandHandling handling)
Parameters
Type | Name | Description |
---|---|---|
HostString | host | The host header. |
PathString | path | The path or pathbase. |
QueryString | queryString | The querystring. |
QueryCollection | query | The query collection. |
CommandHandling | handling | The command collection handling. |
Returns
Type | Description |
---|---|
string | The computed HMAC. |
ComputeHMAC(HostString, PathString, QueryString, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public string? ComputeHMAC(HostString host, PathString path, QueryString queryString, CommandHandling handling)
Parameters
Type | Name | Description |
---|---|---|
HostString | host | The host header. |
PathString | path | The path or pathbase. |
QueryString | queryString | The querystring. |
CommandHandling | handling | The command collection handling. |
Returns
Type | Description |
---|---|
string | The computed HMAC. |
ComputeHMAC(HttpContext, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public string? ComputeHMAC(HttpContext context, CommandHandling handling)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context | The request HTTP context. |
CommandHandling | handling | The command collection handling. |
Returns
Type | Description |
---|---|
string | The computed HMAC. |
ComputeHMAC(string, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public string? ComputeHMAC(string uri, CommandHandling handling)
Parameters
Type | Name | Description |
---|---|---|
string | uri | The uri to compute the code from. |
CommandHandling | handling | The command collection handling. |
Returns
Type | Description |
---|---|
string | The computed HMAC. |
ComputeHMAC(Uri, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public string? ComputeHMAC(Uri uri, CommandHandling handling)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The uri to compute the code from. |
CommandHandling | handling | The command collection handling. |
Returns
Type | Description |
---|---|
string | The computed HMAC. |
StripUnknownCommands(CommandCollection)
Strips any unknown commands from the command collection.
Declaration
public void StripUnknownCommands(CommandCollection commands)
Parameters
Type | Name | Description |
---|---|---|
CommandCollection | commands | The unsanitized command collection. |