Browse Source

Update IOpenIddictAuthorizationManager.FindAsync() to make CancellationToken optional

pull/662/head
Kévin Chalet 8 years ago
parent
commit
803b6abbf3
  1. 4
      src/OpenIddict.Abstractions/Managers/IOpenIddictAuthorizationManager.cs
  2. 2
      src/OpenIddict.Abstractions/Stores/IOpenIddictAuthorizationStore.cs
  3. 4
      src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
  4. 2
      src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs
  5. 2
      src/OpenIddict.EntityFramework/Stores/OpenIddictAuthorizationStore.cs
  6. 2
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs
  7. 2
      src/OpenIddict.MongoDb/Stores/OpenIddictAuthorizationStore.cs
  8. 16
      src/OpenIddict.Server/Internal/OpenIddictServerProvider.Helpers.cs

4
src/OpenIddict.Abstractions/Managers/IOpenIddictAuthorizationManager.cs

@ -110,7 +110,7 @@ namespace OpenIddict.Abstractions
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the authorizations corresponding to the criteria.
/// </returns>
Task<ImmutableArray<object>> FindAsync([NotNull] string subject, [NotNull] string client, [NotNull] string status, CancellationToken cancellationToken);
Task<ImmutableArray<object>> FindAsync([NotNull] string subject, [NotNull] string client, [NotNull] string status, CancellationToken cancellationToken = default);
/// <summary>
/// Retrieves the authorizations matching the specified parameters.
@ -357,7 +357,7 @@ namespace OpenIddict.Abstractions
Task PopulateAsync([NotNull] object authorization, [NotNull] OpenIddictAuthorizationDescriptor descriptor, CancellationToken cancellationToken = default);
/// <summary>
/// Removes the ad-hoc authorizations that are marked as invalid or have no valid/nonexpired token attached.
/// Removes the authorizations that are marked as invalid and the ad-hoc ones that have no valid/nonexpired token attached.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>

2
src/OpenIddict.Abstractions/Stores/IOpenIddictAuthorizationStore.cs

@ -279,7 +279,7 @@ namespace OpenIddict.Abstractions
[CanBeNull] TState state, CancellationToken cancellationToken);
/// <summary>
/// Removes the ad-hoc authorizations that are marked as invalid or have no valid/nonexpired token attached.
/// Removes the authorizations that are marked as invalid and the ad-hoc ones that have no valid/nonexpired token attached.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>

4
src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs

@ -90,7 +90,7 @@ namespace OpenIddict.Core
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation.
/// </returns>
public virtual Task CreateAsync([NotNull] TApplication application, CancellationToken cancellationToken = default)
=> CreateAsync(application, /* secret: */ null, cancellationToken);
=> CreateAsync(application, secret: null, cancellationToken);
/// <summary>
/// Creates a new application.
@ -180,7 +180,7 @@ namespace OpenIddict.Core
var secret = await Store.GetClientSecretAsync(application, cancellationToken);
if (!string.IsNullOrEmpty(secret))
{
await Store.SetClientSecretAsync(application, /* secret: */ null, cancellationToken);
await Store.SetClientSecretAsync(application, secret: null, cancellationToken);
await CreateAsync(application, secret, cancellationToken);
}
else

2
src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs

@ -887,7 +887,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Removes the ad-hoc authorizations that are marked as invalid or have no valid/nonexpired token attached.
/// Removes the authorizations that are marked as invalid and the ad-hoc ones that have no valid/nonexpired token attached.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>

2
src/OpenIddict.EntityFramework/Stores/OpenIddictAuthorizationStore.cs

@ -691,7 +691,7 @@ namespace OpenIddict.EntityFramework
}
/// <summary>
/// Removes the ad-hoc authorizations that are marked as invalid or have no valid/nonexpired token attached.
/// Removes the authorizations that are marked as invalid and the ad-hoc ones that have no valid/nonexpired token attached.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>

2
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs

@ -780,7 +780,7 @@ namespace OpenIddict.EntityFrameworkCore
}
/// <summary>
/// Removes the ad-hoc authorizations that are marked as invalid or have no valid/nonexpired token attached.
/// Removes the authorizations that are marked as invalid and the ad-hoc ones that have no valid/nonexpired token attached.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>

2
src/OpenIddict.MongoDb/Stores/OpenIddictAuthorizationStore.cs

@ -615,7 +615,7 @@ namespace OpenIddict.MongoDb
}
/// <summary>
/// Removes the ad-hoc authorizations that are marked as invalid or have no valid/nonexpired token attached.
/// Removes the authorizations that are marked as invalid and the ad-hoc ones that have no valid/nonexpired token attached.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>

16
src/OpenIddict.Server/Internal/OpenIddictServerProvider.Helpers.cs

@ -569,8 +569,8 @@ namespace OpenIddict.Server.Internal
if (property.Key.EndsWith(OpenIddictConstants.PropertyTypes.Boolean))
{
var name = property.Key.Substring(
/* index: */ 0,
/* length: */ property.Key.LastIndexOf(OpenIddictConstants.PropertyTypes.Boolean));
startIndex: 0,
length: property.Key.LastIndexOf(OpenIddictConstants.PropertyTypes.Boolean));
bool value;
@ -593,8 +593,8 @@ namespace OpenIddict.Server.Internal
else if (property.Key.EndsWith(OpenIddictConstants.PropertyTypes.Integer))
{
var name = property.Key.Substring(
/* index: */ 0,
/* length: */ property.Key.LastIndexOf(OpenIddictConstants.PropertyTypes.Integer));
startIndex: 0,
length: property.Key.LastIndexOf(OpenIddictConstants.PropertyTypes.Integer));
long value;
@ -617,8 +617,8 @@ namespace OpenIddict.Server.Internal
else if (property.Key.EndsWith(OpenIddictConstants.PropertyTypes.Json))
{
var name = property.Key.Substring(
/* index: */ 0,
/* length: */ property.Key.LastIndexOf(OpenIddictConstants.PropertyTypes.Json));
startIndex: 0,
length: property.Key.LastIndexOf(OpenIddictConstants.PropertyTypes.Json));
if (request.IsAuthorizationRequest() || request.IsLogoutRequest())
{
@ -649,8 +649,8 @@ namespace OpenIddict.Server.Internal
else if (property.Key.EndsWith(OpenIddictConstants.PropertyTypes.String))
{
var name = property.Key.Substring(
/* index: */ 0,
/* length: */ property.Key.LastIndexOf(OpenIddictConstants.PropertyTypes.String));
startIndex: 0,
length: property.Key.LastIndexOf(OpenIddictConstants.PropertyTypes.String));
yield return (property.Key, name, property.Value);
}

Loading…
Cancel
Save