Skip to content

Commit 2395cdc

Browse files
Merge branch 'dev' into dev-v9
2 parents fd5d5aa + 67f41f9 commit 2395cdc

File tree

89 files changed

+200
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+200
-110
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ jobs:
126126
}
127127
if ($invalidPackages -gt 0) {
128128
Write-Output "::error::$invalidPackages NuGet package(s) failed validation."
129+
exit 1
129130
}
130131
131132
publish-myget:

.github/workflows/code-scan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ jobs:
3434
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
3535

3636
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
37+
uses: github/codeql-action/init@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
3838
with:
3939
languages: ${{ matrix.language }}
4040

4141
- name: Autobuild
42-
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
42+
uses: github/codeql-action/autobuild@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
4343

4444
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
45+
uses: github/codeql-action/analyze@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
4646
with:
4747
category: "/language:${{ matrix.language }}"

.github/workflows/update-dotnet-sdks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ permissions:
2121
jobs:
2222
update-sdk:
2323
name: Update .NET SDK
24-
uses: martincostello/update-dotnet-sdk/.github/workflows/update-dotnet-sdk.yml@68300a9120c745ca0ff120e2940b63ef1ad2c725 # v3.2.2
24+
uses: martincostello/update-dotnet-sdk/.github/workflows/update-dotnet-sdk.yml@67d6e2b14939c06978a7f80444157296c3defe14 # v3.2.3
2525
permissions:
2626
contents: write
2727
pull-requests: write

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ItemGroup>
44
<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" />
55
<PackageVersion Include="JustEat.HttpClientInterception" Version="4.3.0" />
6-
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
6+
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.4.0" />
77
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.0-preview.4.24267.6" />
88
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0-preview.4.24267.6" />
99
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.0-preview.4.24267.6" />

src/AspNet.Security.OAuth.AdobeIO/AdobeIOAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
4242
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4343
}
4444

45-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
45+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
46+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4647

4748
var principal = new ClaimsPrincipal(identity);
4849
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.Amazon/AmazonAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
5757
throw new HttpRequestException("An error occurred while retrieving the user profile from Amazon.");
5858
}
5959

60-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
60+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
61+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
6162

6263
var principal = new ClaimsPrincipal(identity);
6364
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.AmoCrm/AmoCrmAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
5151
throw new HttpRequestException("An error occurred while retrieving the user profile from amoCRM.");
5252
}
5353

54-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
54+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
55+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
5556

5657
var principal = new ClaimsPrincipal(identity);
5758
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.ArcGIS/ArcGISAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
4343

4444
// Request the token
4545
using var response = await Backchannel.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, Context.RequestAborted);
46-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
46+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
47+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4748

4849
// Note: error responses always return 200 status codes.
4950
if (payload.RootElement.TryGetProperty("error", out var error))

src/AspNet.Security.OAuth.Asana/AsanaAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3939
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4040
}
4141

42-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
42+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
43+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4344

4445
var principal = new ClaimsPrincipal(identity);
4546
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.Autodesk/AutodeskAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
4040
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4141
}
4242

43-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
43+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
44+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4445

4546
var principal = new ClaimsPrincipal(identity);
4647
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.Baidu/BaiduAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
4141
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4242
}
4343

44-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
44+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
45+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4546

4647
var principal = new ClaimsPrincipal(identity);
4748
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.Basecamp/BasecampAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3939
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4040
}
4141

42-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
42+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
43+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4344

4445
var principal = new ClaimsPrincipal(identity);
4546
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.BattleNet/BattleNetAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
4141
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4242
}
4343

44-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
44+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
45+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4546

4647
var principal = new ClaimsPrincipal(identity);
4748
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.Bitbucket/BitbucketAuthenticationHandler.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3939
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4040
}
4141

42-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
42+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
43+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4344

4445
var principal = new ClaimsPrincipal(identity);
4546
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
@@ -76,7 +77,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
7677
throw new HttpRequestException("An error occurred while retrieving the email address associated to the user profile.");
7778
}
7879

79-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
80+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
81+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
8082

8183
return (from address in payload.RootElement.GetProperty("values").EnumerateArray()
8284
where address.GetProperty("is_primary").GetBoolean()

src/AspNet.Security.OAuth.Buffer/BufferAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3939
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4040
}
4141

42-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
42+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
43+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4344

4445
var principal = new ClaimsPrincipal(identity);
4546
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.CiscoSpark/CiscoSparkAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3939
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4040
}
4141

42-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
42+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
43+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4344

4445
var principal = new ClaimsPrincipal(identity);
4546
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.Coinbase/CoinbaseAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3939
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4040
}
4141

42-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
42+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
43+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4344

4445
var principal = new ClaimsPrincipal(identity);
4546
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement.GetProperty("data"));

src/AspNet.Security.OAuth.Deezer/DeezerAuthenticationHandler.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
5555
return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an OAuth token."));
5656
}
5757

58-
var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
58+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
59+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
5960
return OAuthTokenResponse.Success(payload);
6061
}
6162

@@ -76,7 +77,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
7677
throw new HttpRequestException("An error occurred while retrieving the user profile.");
7778
}
7879

79-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
80+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
81+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
8082

8183
var principal = new ClaimsPrincipal(identity);
8284
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.DeviantArt/DeviantArtAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3939
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4040
}
4141

42-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
42+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
43+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4344

4445
var principal = new ClaimsPrincipal(identity);
4546
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.DigitalOcean/DigitalOceanAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
7575
throw new HttpRequestException("An error occurred while retrieving the user profile.");
7676
}
7777

78-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
78+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
79+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
7980

8081
var account = payload.RootElement.GetProperty("account");
8182

src/AspNet.Security.OAuth.Discord/DiscordAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
5555
throw new HttpRequestException("An error occurred while retrieving the user profile.");
5656
}
5757

58-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
58+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
59+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
5960

6061
var principal = new ClaimsPrincipal(identity);
6162
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.Dropbox/DropboxAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
5555
throw new HttpRequestException("An error occurred while retrieving the user profile.");
5656
}
5757

58-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
58+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
59+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
5960

6061
var principal = new ClaimsPrincipal(identity);
6162
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

src/AspNet.Security.OAuth.Ebay/EbayAuthenticationHandler.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync([NotNull]
3737
throw new HttpRequestException("An error occurred while retrieving the user profile.");
3838
}
3939

40-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
40+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
41+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4142

4243
var principal = new ClaimsPrincipal(identity);
4344
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
@@ -82,7 +83,8 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
8283
return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token."));
8384
}
8485

85-
var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
86+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
87+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
8688

8789
return OAuthTokenResponse.Success(payload);
8890
}

src/AspNet.Security.OAuth.ExactOnline/ExactOnlineAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
4040
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4141
}
4242

43-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
43+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
44+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4445
var user = payload.RootElement
4546
.GetProperty("d")
4647
.GetProperty("results")

src/AspNet.Security.OAuth.Feishu/FeishuAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3939
throw new HttpRequestException("An error occurred while retrieving the user profile.");
4040
}
4141

42-
using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted));
42+
using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
43+
using var payload = await JsonDocument.ParseAsync(stream, cancellationToken: Context.RequestAborted);
4344

4445
var principal = new ClaimsPrincipal(identity);
4546
var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);

0 commit comments

Comments
 (0)