Browse Source

Decorate WinRT-only methods with [SupportedOSPlatform("windows10.0.17763")]

pull/1779/head
Kévin Chalet 3 years ago
parent
commit
79b62f6a23
  1. 2
      src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs
  2. 3
      src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs
  3. 1
      src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs
  4. 2
      src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationService.cs

2
src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.Authentication.cs

@ -7,6 +7,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using Microsoft.Extensions.Primitives;
using OpenIddict.Extensions;
@ -68,6 +69,7 @@ public static partial class OpenIddictClientSystemIntegrationHandlers
.Build();
/// <inheritdoc/>
[SupportedOSPlatform("windows10.0.17763")]
#pragma warning disable CS1998
public async ValueTask HandleAsync(ApplyAuthorizationRequestContext context)
#pragma warning restore CS1998

3
src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs

@ -9,6 +9,7 @@ using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Net;
using System.Runtime.Versioning;
using System.Security.Claims;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
@ -201,6 +202,7 @@ public static partial class OpenIddictClientSystemIntegrationHandlers
.Build();
/// <inheritdoc/>
[SupportedOSPlatform("windows10.0.17763")]
public ValueTask HandleAsync(ProcessRequestContext context)
{
if (context is null)
@ -470,6 +472,7 @@ public static partial class OpenIddictClientSystemIntegrationHandlers
.Build();
/// <inheritdoc/>
[SupportedOSPlatform("windows10.0.17763")]
public ValueTask HandleAsync(TContext context)
{
if (context is null)

1
src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs

@ -50,6 +50,7 @@ public static class OpenIddictClientSystemIntegrationHelpers
/// </summary>
/// <param name="transaction">The transaction instance.</param>
/// <returns>The <see cref="HttpListenerContext"/> instance or <see langword="null"/> if it couldn't be found.</returns>
[SupportedOSPlatform("windows10.0.17763")]
public static WebAuthenticationResult? GetWebAuthenticationResult(this OpenIddictClientTransaction transaction)
=> transaction.GetProperty<WebAuthenticationResult>(typeof(WebAuthenticationResult).FullName!);
#endif

2
src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationService.cs

@ -7,6 +7,7 @@
using System.ComponentModel;
using System.IO.Pipes;
using System.Net;
using System.Runtime.Versioning;
using System.Security.Principal;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
@ -71,6 +72,7 @@ public sealed class OpenIddictClientSystemIntegrationService
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>A <see cref="Task"/> that can be used to monitor the asynchronous operation.</returns>
/// <exception cref="ArgumentNullException"><paramref name="result"/> is <see langword="null"/>.</exception>
[SupportedOSPlatform("windows10.0.17763")]
internal Task HandleWebAuthenticationResultAsync(WebAuthenticationResult result, CancellationToken cancellationToken = default)
=> HandleRequestAsync(result ?? throw new ArgumentNullException(nameof(result)), cancellationToken);
#endif

Loading…
Cancel
Save