Browse Source

Backport the changes made to the built-in managers to OpenIddict 1.x

pull/553/head
Kévin Chalet 9 years ago
parent
commit
d4e9c85e4c
  1. 7
      src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
  2. 7
      src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs
  3. 7
      src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs
  4. 7
      src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs
  5. 6
      src/OpenIddict.Core/Stores/IOpenIddictApplicationStore.cs
  6. 6
      src/OpenIddict.Core/Stores/IOpenIddictAuthorizationStore.cs
  7. 10
      src/OpenIddict.Core/Stores/IOpenIddictScopeStore.cs
  8. 6
      src/OpenIddict.Core/Stores/IOpenIddictTokenStore.cs
  9. 5
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs
  10. 5
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs
  11. 6
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs
  12. 5
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs

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

@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using CryptoHelper;
@ -38,6 +39,12 @@ namespace OpenIddict.Core
/// </summary>
protected IOpenIddictApplicationStore<TApplication> Store { get; }
/// <summary>
/// Gets the applications as a queryable source,
/// if supported by the underlying store.
/// </summary>
public virtual IQueryable<TApplication> Applications => Store.Applications;
/// <summary>
/// Creates a new application.
/// </summary>

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

@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
@ -37,6 +38,12 @@ namespace OpenIddict.Core
/// </summary>
protected IOpenIddictAuthorizationStore<TAuthorization> Store { get; }
/// <summary>
/// Gets the authorizations as a queryable source,
/// if supported by the underlying store.
/// </summary>
public virtual IQueryable<TAuthorization> Authorizations => Store.Authorizations;
/// <summary>
/// Creates a new authorization.
/// </summary>

7
src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs

@ -4,6 +4,7 @@
* the license and the contributors participating to this project.
*/
using System.Linq;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;
@ -32,5 +33,11 @@ namespace OpenIddict.Core
/// Gets the store associated with the current manager.
/// </summary>
protected IOpenIddictScopeStore<TScope> Store { get; }
/// <summary>
/// Gets the scopes as a queryable source,
/// if supported by the underlying store.
/// </summary>
public virtual IQueryable<TScope> Scopes => Store.Scopes;
}
}

7
src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs

@ -5,6 +5,7 @@
*/
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using AspNet.Security.OpenIdConnect.Primitives;
@ -37,6 +38,12 @@ namespace OpenIddict.Core
/// </summary>
protected IOpenIddictTokenStore<TToken> Store { get; }
/// <summary>
/// Gets the tokens as a queryable source,
/// if supported by the underlying store.
/// </summary>
public virtual IQueryable<TToken> Tokens => Store.Tokens;
/// <summary>
/// Creates a new token.
/// </summary>

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

@ -5,6 +5,7 @@
*/
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
@ -17,6 +18,11 @@ namespace OpenIddict.Core
/// <typeparam name="TApplication">The type of the Application entity.</typeparam>
public interface IOpenIddictApplicationStore<TApplication> where TApplication : class
{
/// <summary>
/// Gets the applications as a queryable source, if supported by the store.
/// </summary>
IQueryable<TApplication> Applications { get; }
/// <summary>
/// Creates a new application.
/// </summary>

6
src/OpenIddict.Core/Stores/IOpenIddictAuthorizationStore.cs

@ -5,6 +5,7 @@
*/
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
@ -17,6 +18,11 @@ namespace OpenIddict.Core
/// <typeparam name="TAuthorization">The type of the Authorization entity.</typeparam>
public interface IOpenIddictAuthorizationStore<TAuthorization> where TAuthorization : class
{
/// <summary>
/// Gets the authorizations as a queryable source, if supported by the store.
/// </summary>
IQueryable<TAuthorization> Authorizations { get; }
/// <summary>
/// Creates a new authorization.
/// </summary>

10
src/OpenIddict.Core/Stores/IOpenIddictScopeStore.cs

@ -4,11 +4,19 @@
* the license and the contributors participating to this project.
*/
using System.Linq;
namespace OpenIddict.Core
{
/// <summary>
/// Provides methods allowing to manage the scopes stored in a database.
/// </summary>
/// <typeparam name="TScope">The type of the Scope entity.</typeparam>
public interface IOpenIddictScopeStore<TScope> where TScope : class { }
public interface IOpenIddictScopeStore<TScope> where TScope : class
{
/// <summary>
/// Gets the scopes as a queryable source, if supported by the store.
/// </summary>
IQueryable<TScope> Scopes { get; }
}
}

6
src/OpenIddict.Core/Stores/IOpenIddictTokenStore.cs

@ -5,6 +5,7 @@
*/
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
@ -17,6 +18,11 @@ namespace OpenIddict.Core
/// <typeparam name="TToken">The type of the Token entity.</typeparam>
public interface IOpenIddictTokenStore<TToken> where TToken : class
{
/// <summary>
/// Gets the tokens as a queryable source, if supported by the store.
/// </summary>
IQueryable<TToken> Tokens { get; }
/// <summary>
/// Creates a new token.
/// </summary>

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

@ -78,6 +78,11 @@ namespace OpenIddict.EntityFrameworkCore
/// </summary>
protected DbSet<TApplication> Applications => Context.Set<TApplication>();
/// <summary>
/// Gets the applications as a queryable source, if supported by the store.
/// </summary>
IQueryable<TApplication> IOpenIddictApplicationStore<TApplication>.Applications => Applications;
/// <summary>
/// Creates a new application.
/// </summary>

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

@ -83,6 +83,11 @@ namespace OpenIddict.EntityFrameworkCore
/// </summary>
protected DbSet<TAuthorization> Authorizations => Context.Set<TAuthorization>();
/// <summary>
/// Gets the authorizations as a queryable source, if supported by the store.
/// </summary>
IQueryable<TAuthorization> IOpenIddictAuthorizationStore<TAuthorization>.Authorizations => Authorizations;
/// <summary>
/// Creates a new authorization.
/// </summary>

6
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs

@ -6,6 +6,7 @@
using System;
using System.ComponentModel;
using System.Linq;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using OpenIddict.Core;
@ -66,6 +67,11 @@ namespace OpenIddict.EntityFrameworkCore
/// </summary>
protected DbSet<TScope> Scopes => Context.Set<TScope>();
/// <summary>
/// Gets the scopes as a queryable source, if supported by the store.
/// </summary>
IQueryable<TScope> IOpenIddictScopeStore<TScope>.Scopes => Scopes;
/// <summary>
/// Converts the provided identifier to a strongly typed key object.
/// </summary>

5
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs

@ -87,6 +87,11 @@ namespace OpenIddict.EntityFrameworkCore
/// </summary>
protected DbSet<TToken> Tokens => Context.Set<TToken>();
/// <summary>
/// Gets the tokens as a queryable source, if supported by the store.
/// </summary>
IQueryable<TToken> IOpenIddictTokenStore<TToken>.Tokens => Tokens;
/// <summary>
/// Creates a new token.
/// </summary>

Loading…
Cancel
Save