Class RequestAuthorizationUtilities
Contains various helper methods for authorizing image requests.
Namespace: SixLabors.ImageSharp.Web
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public sealed class RequestAuthorizationUtilities : object
Constructors
| Improve this Doc 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
| Improve this Doc View SourceTokenCommand
The command used by image requests for transporting Hash-based Message Authentication Code (HMAC) tokens.
Declaration
public const string TokenCommand = null
Field Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc 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 |
---|---|
Nullable<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 |
---|---|
Nullable<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 |
---|---|
Nullable<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 |
---|---|
Nullable<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 |
---|---|
Nullable<String> | The computed HMAC. |
ComputeHMACAsync(HostString, PathString, QueryString, QueryCollection, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public Task<string?> ComputeHMACAsync(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 |
---|---|
Task<Nullable<String>> | The computed HMAC. |
ComputeHMACAsync(HostString, PathString, QueryString, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public Task<string?> ComputeHMACAsync(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 |
---|---|
Task<Nullable<String>> | The computed HMAC. |
ComputeHMACAsync(HttpContext, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public async Task<string?> ComputeHMACAsync(HttpContext context, CommandHandling handling)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context | The request HTTP context. |
CommandHandling | handling | The command collection handling. |
Returns
Type | Description |
---|---|
Task<Nullable<String>> | The computed HMAC. |
ComputeHMACAsync(String, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public Task<string?> ComputeHMACAsync(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 |
---|---|
Task<Nullable<String>> | The computed HMAC. |
ComputeHMACAsync(Uri, CommandHandling)
Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
Declaration
public Task<string?> ComputeHMACAsync(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 |
---|---|
Task<Nullable<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. |