Skip to content

Commit

Permalink
Bump MongoDB to 3.0.0 and strong-name the MongoDB packages
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed Oct 22, 2024
1 parent f5721d0 commit 6c6c9ed
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 44 deletions.
32 changes: 16 additions & 16 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.1.14" />
<PackageVersion Include="Microsoft.Owin.Security" Version="4.2.2" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" />
<PackageVersion Include="MongoDB.Bson" Version="2.11.6" />
<PackageVersion Include="MongoDB.Driver" Version="2.11.6" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />
<PackageVersion Include="System.Collections.Immutable" Version="1.7.1" />
Expand Down Expand Up @@ -100,8 +100,8 @@
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.1.14" />
<PackageVersion Include="Microsoft.Owin.Security" Version="4.2.2" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" />
<PackageVersion Include="MongoDB.Bson" Version="2.11.6" />
<PackageVersion Include="MongoDB.Driver" Version="2.11.6" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />
<PackageVersion Include="System.Collections.Immutable" Version="1.7.1" />
Expand Down Expand Up @@ -157,8 +157,8 @@
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.1.14" />
<PackageVersion Include="Microsoft.Owin.Security" Version="4.2.2" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" />
<PackageVersion Include="MongoDB.Bson" Version="2.11.6" />
<PackageVersion Include="MongoDB.Driver" Version="2.11.6" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />
<PackageVersion Include="System.Collections.Immutable" Version="1.7.1" />
Expand Down Expand Up @@ -242,8 +242,8 @@
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="7.6.3" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="7.6.3" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.1.14" />
<PackageVersion Include="MongoDB.Bson" Version="2.20.0" />
<PackageVersion Include="MongoDB.Driver" Version="2.20.0" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />

<!--
Expand Down Expand Up @@ -289,8 +289,8 @@
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.1.2" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.1.2" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.10" />
<PackageVersion Include="MongoDB.Bson" Version="2.20.0" />
<PackageVersion Include="MongoDB.Driver" Version="2.20.0" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />
<PackageVersion Include="Xamarin.AndroidX.Browser" Version="1.8.0.6" />

Expand Down Expand Up @@ -337,8 +337,8 @@
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="8.1.2" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.1.2" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="MongoDB.Bson" Version="2.20.0" />
<PackageVersion Include="MongoDB.Driver" Version="2.20.0" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />
<PackageVersion Include="Xamarin.AndroidX.Browser" Version="1.8.0.6" />

Expand Down Expand Up @@ -404,8 +404,8 @@
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="7.6.3" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="7.6.3" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.1.14" />
<PackageVersion Include="MongoDB.Bson" Version="2.11.6" />
<PackageVersion Include="MongoDB.Driver" Version="2.11.6" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.7" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />
Expand Down Expand Up @@ -454,8 +454,8 @@
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="7.6.3" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="7.6.3" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.1.14" />
<PackageVersion Include="MongoDB.Bson" Version="2.11.6" />
<PackageVersion Include="MongoDB.Driver" Version="2.11.6" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.7" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />
<PackageVersion Include="System.Collections.Immutable" Version="1.7.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<ItemGroup>
<ProjectReference Include="..\..\src\OpenIddict.Owin\OpenIddict.Owin.csproj" />
<ProjectReference Include="..\..\src\OpenIddict.EntityFramework\OpenIddict.EntityFramework.csproj" />
<ProjectReference Include="..\..\src\OpenIddict.MongoDb\OpenIddict.MongoDb.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions sandbox/OpenIddict.Sandbox.AspNet.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ public void Configuration(IAppBuilder app)
// Note: call ReplaceDefaultEntities() to replace the default OpenIddict entities.
options.UseEntityFramework()
.UseDbContext<ApplicationDbContext>();
// Developers who prefer using MongoDB can remove the previous lines
// and configure OpenIddict to use the specified MongoDB database:
// options.UseMongoDb()
// .UseDatabase(new MongoClient().GetDatabase("openiddict"));
})

// Register the OpenIddict client components.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

<PropertyGroup>
<TargetFrameworks>
$(NetFrameworkTargetFrameworks);
net472;
net48;
$(NetCoreTargetFrameworks);
$(NetStandardTargetFrameworks)
netstandard2.1
</TargetFrameworks>
<DisablePolySharp>true</DisablePolySharp>
<SignAssembly>false</SignAssembly>
<PublicSign>false</PublicSign>
<IncludeInternalExtensions>false</IncludeInternalExtensions>
</PropertyGroup>

Expand Down
9 changes: 4 additions & 5 deletions src/OpenIddict.MongoDb/OpenIddict.MongoDb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

<PropertyGroup>
<TargetFrameworks>
$(NetFrameworkTargetFrameworks);
net472;
net48;
$(NetCoreTargetFrameworks);
$(NetStandardTargetFrameworks)
netstandard2.1
</TargetFrameworks>
<SignAssembly>false</SignAssembly>
<PublicSign>false</PublicSign>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -21,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver" NoWarn="NU1901;NU1902;NU1903;NU1904" />
<PackageReference Include="MongoDB.Driver" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public virtual async ValueTask<long> CountAsync<TResult>(
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TApplication>(Options.CurrentValue.ApplicationsCollectionName);

return await ((IMongoQueryable<TApplication>) query(collection.AsQueryable())).LongCountAsync(cancellationToken);
return await query(collection.AsQueryable()).LongCountAsync(cancellationToken);
}

/// <inheritdoc/>
Expand Down Expand Up @@ -209,7 +209,7 @@ async IAsyncEnumerable<TApplication> ExecuteAsync([EnumeratorCancellation] Cance
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TApplication>(Options.CurrentValue.ApplicationsCollectionName);

return await ((IMongoQueryable<TResult>) query(collection.AsQueryable(), state)).FirstOrDefaultAsync(cancellationToken);
return await query(collection.AsQueryable(), state).FirstOrDefaultAsync(cancellationToken);
}

/// <inheritdoc/>
Expand Down Expand Up @@ -441,7 +441,7 @@ public virtual async IAsyncEnumerable<TApplication> ListAsync(
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TApplication>(Options.CurrentValue.ApplicationsCollectionName);

var query = (IMongoQueryable<TApplication>) collection.AsQueryable().OrderBy(application => application.Id);
var query = (IQueryable<TApplication>) collection.AsQueryable().OrderBy(application => application.Id);

if (offset.HasValue)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public virtual async ValueTask<long> CountAsync<TResult>(
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TAuthorization>(Options.CurrentValue.AuthorizationsCollectionName);

return await ((IMongoQueryable<TAuthorization>) query(collection.AsQueryable())).LongCountAsync(cancellationToken);
return await query(collection.AsQueryable()).LongCountAsync(cancellationToken);
}

/// <inheritdoc/>
Expand Down Expand Up @@ -351,7 +351,7 @@ async IAsyncEnumerable<TAuthorization> ExecuteAsync([EnumeratorCancellation] Can
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TAuthorization>(Options.CurrentValue.AuthorizationsCollectionName);

return await ((IMongoQueryable<TResult>) query(collection.AsQueryable(), state)).FirstOrDefaultAsync(cancellationToken);
return await query(collection.AsQueryable(), state).FirstOrDefaultAsync(cancellationToken);
}

/// <inheritdoc/>
Expand Down Expand Up @@ -476,7 +476,7 @@ public virtual async IAsyncEnumerable<TAuthorization> ListAsync(
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TAuthorization>(Options.CurrentValue.AuthorizationsCollectionName);

var query = (IMongoQueryable<TAuthorization>) collection.AsQueryable().OrderBy(authorization => authorization.Id);
var query = (IQueryable<TAuthorization>) collection.AsQueryable().OrderBy(authorization => authorization.Id);

if (offset.HasValue)
{
Expand Down
6 changes: 3 additions & 3 deletions src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbScopeStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public virtual async ValueTask<long> CountAsync<TResult>(
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TScope>(Options.CurrentValue.ScopesCollectionName);

return await ((IMongoQueryable<TScope>) query(collection.AsQueryable())).LongCountAsync(cancellationToken);
return await query(collection.AsQueryable()).LongCountAsync(cancellationToken);
}

/// <inheritdoc/>
Expand Down Expand Up @@ -185,7 +185,7 @@ async IAsyncEnumerable<TScope> ExecuteAsync([EnumeratorCancellation] Cancellatio
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TScope>(Options.CurrentValue.ScopesCollectionName);

return await ((IMongoQueryable<TResult>) query(collection.AsQueryable(), state)).FirstOrDefaultAsync(cancellationToken);
return await query(collection.AsQueryable(), state).FirstOrDefaultAsync(cancellationToken);
}

/// <inheritdoc/>
Expand Down Expand Up @@ -330,7 +330,7 @@ public virtual async IAsyncEnumerable<TScope> ListAsync(
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TScope>(Options.CurrentValue.ScopesCollectionName);

var query = (IMongoQueryable<TScope>) collection.AsQueryable().OrderBy(scope => scope.Id);
var query = (IQueryable<TScope>) collection.AsQueryable().OrderBy(scope => scope.Id);

if (offset.HasValue)
{
Expand Down
6 changes: 3 additions & 3 deletions src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbTokenStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public virtual async ValueTask<long> CountAsync<TResult>(
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TToken>(Options.CurrentValue.TokensCollectionName);

return await ((IMongoQueryable<TToken>) query(collection.AsQueryable())).LongCountAsync(cancellationToken);
return await query(collection.AsQueryable()).LongCountAsync(cancellationToken);
}

/// <inheritdoc/>
Expand Down Expand Up @@ -333,7 +333,7 @@ async IAsyncEnumerable<TToken> ExecuteAsync([EnumeratorCancellation] Cancellatio
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TToken>(Options.CurrentValue.TokensCollectionName);

return await ((IMongoQueryable<TResult>) query(collection.AsQueryable(), state)).FirstOrDefaultAsync(cancellationToken);
return await query(collection.AsQueryable(), state).FirstOrDefaultAsync(cancellationToken);
}

/// <inheritdoc/>
Expand Down Expand Up @@ -512,7 +512,7 @@ public virtual async IAsyncEnumerable<TToken> ListAsync(
var database = await Context.GetDatabaseAsync(cancellationToken);
var collection = database.GetCollection<TToken>(Options.CurrentValue.TokensCollectionName);

var query = (IMongoQueryable<TToken>) collection.AsQueryable().OrderBy(token => token.Id);
var query = (IQueryable<TToken>) collection.AsQueryable().OrderBy(token => token.Id);

if (offset.HasValue)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(NetFrameworkTargetFrameworks);$(NetCoreTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>net472;net48;$(NetCoreTargetFrameworks)</TargetFrameworks>
<SignAssembly>false</SignAssembly>
<PublicSign>false</PublicSign>
</PropertyGroup>
Expand Down

0 comments on commit 6c6c9ed

Please sign in to comment.