Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<FrameworkVersion>10.0.5</FrameworkVersion>
<ExtensionsVersion>10.0.5</ExtensionsVersion>
<EntityFrameworkVersion>10.0.5</EntityFrameworkVersion>
<EntityFrameworkVersion>10.0.10</EntityFrameworkVersion>

<IdentityServerVersion>1.0.1-*</IdentityServerVersion>
</PropertyGroup>
Expand Down Expand Up @@ -61,8 +61,8 @@
<PackageReference Update="Microsoft.EntityFrameworkCore.Design" Version="$(EntityFrameworkVersion)" PrivateAssets="All"/>

<!--other entity framework-->
<PackageReference Update="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.8" />
<PackageReference Update="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
<PackageReference Update="SQLitePCLRaw.bundle_e_sqlite3" Version="3.0.3" />
</ItemGroup>

<Target Name="SetAssemblyVersion" AfterTargets="MinVer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer"/>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3"/>
<ProjectReference Include="..\..\src\Open.IdentityServer.EntityFramework.Storage.csproj"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class IdentityServerKeyMaterial
/// <summary>
/// Get or set unique identifier
/// </summary>
public string Id { get; set; }
public string Id { get; set; } = null!;

/// <summary>
/// Get or set version of key material
Expand All @@ -35,7 +35,7 @@ public class IdentityServerKeyMaterial
/// <summary>
/// Get or set key algorithm value
/// </summary>
public string Algorithm { get; set; }
public string Algorithm { get; set; } = null!;

/// <summary>
/// Get or set is x509 certificate value
Expand All @@ -45,7 +45,7 @@ public class IdentityServerKeyMaterial
/// <summary>
/// Get or set data value
/// </summary>
public string Data { get; set; }
public string Data { get; set; } = null!;

/// <summary>
/// Get or set created value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<PackageReference Include="AwesomeAssertions"/>

<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite"/>
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageReference Include="xunit.runner.visualstudio"/>

<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite"/>
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<PackageReference Include="AwesomeAssertions"/>

<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite"/>
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer"/>
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Open.IdentityServer/host/Host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />

<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite"/>
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" PrivateAssets="All"/>

<ProjectReference Include="..\src\Open.IdentityServer.csproj"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public Cookie GetSessionCookie()

public string CreateAuthorizeUrl(
string clientId = null!,
string? responseType = null,
string responseType = null!,
string? scope = null,
string? redirectUri = null,
string? state = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public async Task Valid_token_and_valid_scope_should_succeed()
ClientId = "api1",
ClientSecret = "secret",

Token = tokenResponse.AccessToken
Token = tokenResponse.AccessToken ?? string.Empty
}, TestContext.Current.CancellationToken);

introspectionResponse.IsActive.Should().Be(true);
Expand Down Expand Up @@ -206,11 +206,12 @@ public async Task Response_data_should_be_valid_using_single_scope()
ClientId = "api1",
ClientSecret = "secret",

Token = tokenResponse.AccessToken
Token = tokenResponse.AccessToken ?? string.Empty
}, TestContext.Current.CancellationToken);

var values = introspectionResponse.Json.Deserialize<Dictionary<string, object>>();


values.Should().NotBeNull();
((JsonElement)values["aud"]).ValueKind.Should().Be(JsonValueKind.String);
((JsonElement)values["iss"]).ValueKind.Should().Be(JsonValueKind.String);
((JsonElement)values["nbf"]).ValueKind.Should().Be(JsonValueKind.Number);
Expand Down Expand Up @@ -245,11 +246,12 @@ public async Task Response_data_with_user_authentication_should_be_valid_using_s
ClientId = "api1",
ClientSecret = "secret",

Token = tokenResponse.AccessToken
Token = tokenResponse.AccessToken ?? string.Empty
}, TestContext.Current.CancellationToken);

var values = introspectionResponse.Json.Deserialize<Dictionary<string, object>>();

values.Should().NotBeNull();
((JsonElement)values["aud"]).ValueKind.Should().Be(JsonValueKind.String);
((JsonElement)values["iss"]).ValueKind.Should().Be(JsonValueKind.String);
((JsonElement)values["nbf"]).ValueKind.Should().Be(JsonValueKind.Number);
Expand Down Expand Up @@ -284,11 +286,12 @@ public async Task Response_data_should_be_valid_using_multiple_scopes_multiple_a
ClientId = "api3",
ClientSecret = "secret",

Token = tokenResponse.AccessToken
Token = tokenResponse.AccessToken ?? string.Empty
}, TestContext.Current.CancellationToken);

var values = introspectionResponse.Json.Deserialize<Dictionary<string, object>>();

values.Should().NotBeNull();
values["aud"].GetType().Name.Should().Be("JsonElement");

var audiences = ((JsonElement)values["aud"]).EnumerateArray();
Expand Down Expand Up @@ -329,11 +332,12 @@ public async Task Response_data_should_be_valid_using_multiple_scopes_single_aud
ClientId = "api3",
ClientSecret = "secret",

Token = tokenResponse.AccessToken
Token = tokenResponse.AccessToken ?? string.Empty
}, TestContext.Current.CancellationToken);

var values = introspectionResponse.Json.Deserialize<Dictionary<string, object>>();

values.Should().NotBeNull();
((JsonElement)values["aud"]).ValueKind.Should().Be(JsonValueKind.String);
((JsonElement)values["iss"]).ValueKind.Should().Be(JsonValueKind.String);
((JsonElement)values["nbf"]).ValueKind.Should().Be(JsonValueKind.Number);
Expand Down Expand Up @@ -367,17 +371,17 @@ public async Task Token_with_many_scopes_but_api_should_only_see_its_own_scopes(
ClientId = "api3",
ClientSecret = "secret",

Token = tokenResponse.AccessToken
Token = tokenResponse.AccessToken ?? string.Empty
}, TestContext.Current.CancellationToken);

introspectionResponse.IsActive.Should().BeTrue();
introspectionResponse.IsError.Should().BeFalse();

var scopes = from c in introspectionResponse.Claims
var scopes = (from c in introspectionResponse.Claims
where c.Type == "scope"
select c.Value;

scopes.Count().Should().Be(1);
select c.Value).ToList();
scopes.Count.Should().Be(1);
scopes.First().Should().Be("api3-a");
}

Expand All @@ -400,17 +404,17 @@ public async Task Valid_token_with_valid_multiple_scopes()
ClientId = "api1",
ClientSecret = "secret",

Token = tokenResponse.AccessToken
Token = tokenResponse.AccessToken ?? string.Empty
}, TestContext.Current.CancellationToken);

introspectionResponse.IsActive.Should().Be(true);
introspectionResponse.IsError.Should().Be(false);

var scopes = from c in introspectionResponse.Claims
var scopes = (from c in introspectionResponse.Claims
where c.Type == "scope"
select c;
select c).ToList();

scopes.Count().Should().Be(1);
scopes.Count.Should().Be(1);
scopes.First().Value.Should().Be("api1");
}

Expand All @@ -433,7 +437,7 @@ public async Task Valid_token_with_invalid_scopes_should_fail()
ClientId = "api2",
ClientSecret = "secret",

Token = tokenResponse.AccessToken
Token = tokenResponse.AccessToken ?? string.Empty
}, TestContext.Current.CancellationToken);

introspectionResponse.IsActive.Should().Be(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public async Task ProcessAsync_WhenClientUpdateClaimsOnRefreshIsFalse_ShouldStil
};

var fakeTokenString = "some.token.string";
Token? updatedToken = null;
Token updatedToken = null;
Mock.Get(tokenService)
.Setup(x => x.CreateSecurityTokenAsync(It.IsAny<Token>()))
.ReturnsAsync((Token token) =>
Expand Down
Loading
Loading