Browse Source

Add the missing Async suffix to FindByLogoutRedirectUri() and FindByRedirectUri()

pull/432/merge
Kévin Chalet 9 years ago
parent
commit
f6197994df
  1. 10
      src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
  2. 4
      src/OpenIddict.Core/Stores/IOpenIddictApplicationStore.cs
  3. 4
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs

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

@ -162,9 +162,9 @@ namespace OpenIddict.Core
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result /// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result
/// returns the client applications corresponding to the specified post_logout_redirect_uri. /// returns the client applications corresponding to the specified post_logout_redirect_uri.
/// </returns> /// </returns>
public virtual Task<TApplication[]> FindByLogoutRedirectUri(string address, CancellationToken cancellationToken) public virtual Task<TApplication[]> FindByLogoutRedirectUriAsync(string address, CancellationToken cancellationToken)
{ {
return Store.FindByLogoutRedirectUri(address, cancellationToken); return Store.FindByLogoutRedirectUriAsync(address, cancellationToken);
} }
/// <summary> /// <summary>
@ -176,9 +176,9 @@ namespace OpenIddict.Core
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result /// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result
/// returns the client applications corresponding to the specified redirect_uri. /// returns the client applications corresponding to the specified redirect_uri.
/// </returns> /// </returns>
public virtual Task<TApplication[]> FindByRedirectUri(string address, CancellationToken cancellationToken) public virtual Task<TApplication[]> FindByRedirectUriAsync(string address, CancellationToken cancellationToken)
{ {
return Store.FindByRedirectUri(address, cancellationToken); return Store.FindByRedirectUriAsync(address, cancellationToken);
} }
/// <summary> /// <summary>
@ -527,7 +527,7 @@ namespace OpenIddict.Core
{ {
// Warning: SQL engines like Microsoft SQL Server are known to use case-insensitive lookups by default. // Warning: SQL engines like Microsoft SQL Server are known to use case-insensitive lookups by default.
// To ensure a case-sensitive comparison is used, string.Equals(Ordinal) is manually called here. // To ensure a case-sensitive comparison is used, string.Equals(Ordinal) is manually called here.
foreach (var application in await Store.FindByLogoutRedirectUri(address, cancellationToken)) foreach (var application in await Store.FindByLogoutRedirectUriAsync(address, cancellationToken))
{ {
// Note: the post_logout_redirect_uri must be compared using case-sensitive "Simple String Comparison". // Note: the post_logout_redirect_uri must be compared using case-sensitive "Simple String Comparison".
if (string.Equals(address, await Store.GetLogoutRedirectUriAsync(application, cancellationToken), StringComparison.Ordinal)) if (string.Equals(address, await Store.GetLogoutRedirectUriAsync(application, cancellationToken), StringComparison.Ordinal))

4
src/OpenIddict.Core/Stores/IOpenIddictApplicationStore.cs

@ -68,7 +68,7 @@ namespace OpenIddict.Core
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result /// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result
/// returns the client applications corresponding to the specified post_logout_redirect_uri. /// returns the client applications corresponding to the specified post_logout_redirect_uri.
/// </returns> /// </returns>
Task<TApplication[]> FindByLogoutRedirectUri(string address, CancellationToken cancellationToken); Task<TApplication[]> FindByLogoutRedirectUriAsync(string address, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Retrieves all the applications associated with the specified redirect_uri. /// Retrieves all the applications associated with the specified redirect_uri.
@ -79,7 +79,7 @@ namespace OpenIddict.Core
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result /// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result
/// returns the client applications corresponding to the specified redirect_uri. /// returns the client applications corresponding to the specified redirect_uri.
/// </returns> /// </returns>
Task<TApplication[]> FindByRedirectUri(string address, CancellationToken cancellationToken); Task<TApplication[]> FindByRedirectUriAsync(string address, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Retrieves the client identifier associated with an application. /// Retrieves the client identifier associated with an application.

4
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs

@ -164,7 +164,7 @@ namespace OpenIddict.EntityFrameworkCore
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result /// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result
/// returns the client applications corresponding to the specified post_logout_redirect_uri. /// returns the client applications corresponding to the specified post_logout_redirect_uri.
/// </returns> /// </returns>
public virtual Task<TApplication[]> FindByLogoutRedirectUri(string address, CancellationToken cancellationToken) public virtual Task<TApplication[]> FindByLogoutRedirectUriAsync(string address, CancellationToken cancellationToken)
{ {
return Applications.Where(application => application.LogoutRedirectUri == address).ToArrayAsync(cancellationToken); return Applications.Where(application => application.LogoutRedirectUri == address).ToArrayAsync(cancellationToken);
} }
@ -178,7 +178,7 @@ namespace OpenIddict.EntityFrameworkCore
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result /// A <see cref="Task"/> that can be used to monitor the asynchronous operation, whose result
/// returns the client applications corresponding to the specified redirect_uri. /// returns the client applications corresponding to the specified redirect_uri.
/// </returns> /// </returns>
public virtual Task<TApplication[]> FindByRedirectUri(string address, CancellationToken cancellationToken) public virtual Task<TApplication[]> FindByRedirectUriAsync(string address, CancellationToken cancellationToken)
{ {
return Applications.Where(application => application.RedirectUri == address).ToArrayAsync(cancellationToken); return Applications.Where(application => application.RedirectUri == address).ToArrayAsync(cancellationToken);
} }

Loading…
Cancel
Save