Skip to content

Commit 712b62c

Browse files
authored
fix build warnings/suggestions (#47432)
1 parent 058b1e9 commit 712b62c

File tree

11 files changed

+16
-22
lines changed

11 files changed

+16
-22
lines changed

.openpublishing.redirection.core.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,8 +1345,7 @@
13451345
},
13461346
{
13471347
"source_path_from_root": "/docs/whats-new/dotnet-7-docs.md",
1348-
"redirect_url": "/dotnet/whats-new/dotnet-docs-mod0",
1349-
"redirect_document_id": true
1348+
"redirect_url": "/dotnet/whats-new"
13501349
},
13511350
{
13521351
"source_path_from_root": "/docs/core/whats-new/dotnet-8.md",

docs/core/compatibility/aspnet-core/8.0/securitytoken-events.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ ms.date: 07/31/2023
55
---
66
# Security token events return a JsonWebToken
77

8-
The <xref:Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerEvents>, <xref:Microsoft.AspNetCore.Authentication.WsFederation.WsFederationEvents>, and <xref:Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectEvents> events are authentication events fired respectively by the [JwtBearer](xref:Microsoft.AspNetCore.Authentication.JwtBearer), [WsFederation](xref:Microsoft.AspNetCore.Authentication.WsFederation), and [OpenIdConnect](xref:Microsoft.AspNetCore.Authentication.OpenIdConnect) authentication handlers. For example, the <xref:Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerEvents.OnTokenValidated> event is fired when a security token is validated. These events are fired with a context (for example, <xref:Microsoft.AspNetCore.Authentication.JwtBearer.TokenValidatedContext>) that exposes a <xref:Microsoft.AspNetCore.Authentication.JwtBearer.TokenValidatedContext.SecurityToken?displayProperty=nameWithType> property of abstract type <xref:System.IdentityModel.Tokens.SecurityToken>. The default real implementation of <xref:Microsoft.AspNetCore.Authentication.JwtBearer.TokenValidatedContext.SecurityToken?displayProperty=nameWithType> changed from <xref:System.IdentityModel.Tokens.Jwt.JwtSecurityToken> to <xref:Microsoft.IdentityModel.JsonWebTokens.JsonWebToken>.
8+
The <xref:Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerEvents>, <xref:Microsoft.AspNetCore.Authentication.WsFederation.WsFederationEvents>, and <xref:Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectEvents> events are authentication events fired respectively by the [JwtBearer](xref:Microsoft.AspNetCore.Authentication.JwtBearer), [WsFederation](xref:Microsoft.AspNetCore.Authentication.WsFederation), and [OpenIdConnect](xref:Microsoft.AspNetCore.Authentication.OpenIdConnect) authentication handlers. For example, the <xref:Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerEvents.OnTokenValidated> event is fired when a security token is validated. These events are fired with a context (for example, <xref:Microsoft.AspNetCore.Authentication.JwtBearer.TokenValidatedContext>) that exposes a <xref:Microsoft.AspNetCore.Authentication.JwtBearer.TokenValidatedContext.SecurityToken?displayProperty=nameWithType> property of abstract type <xref:System.IdentityModel.Tokens.SecurityToken>. The default real implementation of <xref:Microsoft.AspNetCore.Authentication.JwtBearer.TokenValidatedContext.SecurityToken?displayProperty=nameWithType> changed from `System.IdentityModel.Tokens.Jwt.JwtSecurityToken` to <xref:Microsoft.IdentityModel.JsonWebTokens.JsonWebToken>.
99

1010
## Version introduced
1111

1212
ASP.NET Core 8.0 Preview 7
1313

1414
## Previous behavior
1515

16-
Previously, the affected `SecurityToken` properties were implemented by <xref:System.IdentityModel.Tokens.Jwt.JwtSecurityToken>, which derives from <xref:System.IdentityModel.Tokens.SecurityToken>. <xref:System.IdentityModel.Tokens.Jwt.JwtSecurityToken> is the previous generation of JSON Web Token (JWT) implementation. The <xref:System.IdentityModel.Tokens.Jwt.JwtSecurityToken> tokens were produced by <xref:Microsoft.AspNetCore.Builder.JwtBearerOptions.SecurityTokenValidators>.
16+
Previously, the affected `SecurityToken` properties were implemented by `System.IdentityModel.Tokens.Jwt.JwtSecurityToken`, which derives from <xref:System.IdentityModel.Tokens.SecurityToken>. `JwtSecurityToken` is the previous generation of JSON Web Token (JWT) implementation. The `JwtSecurityToken` tokens were produced by <xref:Microsoft.AspNetCore.Builder.JwtBearerOptions.SecurityTokenValidators>.
1717

18-
In addition, the <xref:System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.DefaultInboundClaimTypeMap?displayProperty=nameWithType> field provided the default claim type mapping for inbound claims.
18+
In addition, the `JwtSecurityTokenHandler.DefaultInboundClaimTypeMap` field provided the default claim type mapping for inbound claims.
1919

2020
## New behavior
2121

22-
Starting in ASP.NET Core 8.0, the <xref:Microsoft.IdentityModel.JsonWebTokens> class, which also derives from <xref:System.IdentityModel.Tokens.SecurityToken>, implements the `SecurityToken` properties, by default. <xref:Microsoft.IdentityModel.JsonWebTokens> tokens are produced by more optimized <xref:Microsoft.IdentityModel.Tokens.TokenHandler> handlers.
22+
Starting in ASP.NET Core 8.0, the <xref:Microsoft.IdentityModel.JsonWebTokens> class, which also derives from <xref:System.IdentityModel.Tokens.SecurityToken>, implements the `SecurityToken` properties, by default. <xref:Microsoft.IdentityModel.JsonWebTokens> tokens are produced by more optimized `TokenHandler` handlers.
2323

2424
In addition, the <xref:Microsoft.IdentityModel.JsonWebTokens.JsonWebTokenHandler.DefaultInboundClaimTypeMap?displayProperty=nameWithType> field provides the default claim type mapping for inbound claims.
2525

@@ -37,7 +37,7 @@ This change was made because <xref:Microsoft.IdentityModel.JsonWebTokens.JsonWeb
3737

3838
## Recommended action
3939

40-
For most users, this change shouldn't be a problem as the type of the properties ([SecurityToken](xref:Microsoft.IdentityModel.Tokens.SecurityToken)) hasn't changed, and you weren't supposed to look at the real type.
40+
For most users, this change shouldn't be a problem as the type of the properties (`SecurityToken`) hasn't changed, and you weren't supposed to look at the real type.
4141

4242
However, if you were down-casting one of the affected `SecurityToken` properties to `JwtSecurityToken` (for example, to get the claims), you have two options:
4343

docs/core/extensions/httpclient-http3.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: Use HTTP/3 with HttpClient
33
description: Learn how to use the HttpClient to access HTTP/3 servers in .NET
44
author: IEvangelist
5-
ms.author: samsp
65
ms.date: 05/19/2023
76
---
87

docs/fundamentals/code-analysis/quality-rules/ca1835.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ helpviewer_keywords:
99
- "PreferStreamAsyncMemoryOverloads"
1010
- "CA1835"
1111
author: carlossanlop
12-
ms.author: calope
1312
dev_langs:
1413
- CSharp
1514
- VB
@@ -37,8 +36,8 @@ The rule works on `ReadAsync` and `WriteAsync` invocations of any class that inh
3736

3837
The rule only works when the method is preceded by the `await` keyword.
3938

40-
|Detected method|Suggested method|
41-
|-|-|
39+
| Detected method | Suggested method |
40+
|-----------------|------------------|
4241
|<xref:System.IO.Stream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)>|<xref:System.IO.Stream.ReadAsync(System.Memory{System.Byte},System.Threading.CancellationToken)>|
4342
|<xref:System.IO.Stream.ReadAsync(System.Byte[],System.Int32,System.Int32)>|<xref:System.IO.Stream.ReadAsync(System.Memory{System.Byte},System.Threading.CancellationToken)> with `CancellationToken` set to `default` in C#, or `Nothing` in Visual Basic.|
4443
|<xref:System.IO.Stream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)>|<xref:System.IO.Stream.WriteAsync(System.ReadOnlyMemory{System.Byte},System.Threading.CancellationToken)>|

docs/fundamentals/code-analysis/quality-rules/ca2016.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ helpviewer_keywords:
99
- "ForwardCancellationTokenToInvocations"
1010
- "CA2016"
1111
author: carlossanlop
12-
ms.author: calope
1312
dev_langs:
1413
- CSharp
1514
- VB

docs/fundamentals/code-analysis/quality-rules/ca5404.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ f1_keywords:
1818

1919
## Cause
2020

21-
Setting <xref:Microsoft.IdentityModel.Tokens.TokenValidationParameters> properties `RequireExpirationTime`, `ValidateAudience`, `ValidateIssuer`, or `ValidateLifetime` to `false`.
21+
Setting the `Microsoft.IdentityModel.Tokens.TokenValidationParameters` properties `RequireExpirationTime`, `ValidateAudience`, `ValidateIssuer`, or `ValidateLifetime` to `false`.
2222

2323
## Rule description
2424

@@ -28,7 +28,7 @@ More details about best practices for token validation can be found on the [libr
2828

2929
## How to fix violations
3030

31-
Set <xref:Microsoft.IdentityModel.Tokens.TokenValidationParameters> properties `RequireExpirationTime`, `ValidateAudience`, `ValidateIssuer`, or `ValidateLifetime` to `true`. Or, remove the assignment to `false` because the default value is `true`.
31+
Set the `Microsoft.IdentityModel.Tokens.TokenValidationParameters` properties `RequireExpirationTime`, `ValidateAudience`, `ValidateIssuer`, and `ValidateLifetime` to `true`. Or, remove the assignment to `false` because the default value is `true`.
3232

3333
## When to suppress warnings
3434

docs/fundamentals/code-analysis/quality-rules/ca5405.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ f1_keywords:
1818

1919
## Cause
2020

21-
The callback assigned to <xref:Microsoft.IdentityModel.Tokens.AudienceValidator> or <xref:Microsoft.IdentityModel.Tokens.LifetimeValidator> always returns `true`.
21+
The callback assigned to `AudienceValidator` or `LifetimeValidator` always returns `true`.
2222

2323
## Rule description
2424

docs/fundamentals/code-analysis/quality-rules/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ The following table lists code quality analysis rules.
331331
> | [CA5401: Do not use CreateEncryptor with non-default IV](ca5401.md) | Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks. |
332332
> | [CA5402: Use CreateEncryptor with the default IV](ca5402.md) | Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks. |
333333
> | [CA5403: Do not hard-code certificate](ca5403.md) | The `data` or `rawData` parameter of a <xref:System.Security.Cryptography.X509Certificates.X509Certificate> or <xref:System.Security.Cryptography.X509Certificates.X509Certificate2> constructor is hard-coded. |
334-
> | [CA5404: Do not disable token validation checks](ca5404.md) | <xref:Microsoft.IdentityModel.Tokens.TokenValidationParameters> properties that control token validation should not be set to `false`. |
335-
> | [CA5405: Do not always skip token validation in delegates](ca5405.md) | The callback assigned to <xref:Microsoft.IdentityModel.Tokens.AudienceValidator> or <xref:Microsoft.IdentityModel.Tokens.LifetimeValidator> always returns `true`. |
334+
> | [CA5404: Do not disable token validation checks](ca5404.md) | `TokenValidationParameters` properties that control token validation should not be set to `false`. |
335+
> | [CA5405: Do not always skip token validation in delegates](ca5405.md) | The callback assigned to `AudienceValidator` or `LifetimeValidator` always returns `true`. |
336336
> | [IL3000: Avoid accessing Assembly file path when publishing as a single file](../../../core/deploying/single-file/warnings/il3000.md) | Avoid accessing Assembly file path when publishing as a single file. |
337337
> | [IL3001: Avoid accessing Assembly file path when publishing as a single-file](../../../core/deploying/single-file/warnings/il3001.md) | Avoid accessing Assembly file path when publishing as a single file. |
338338
> | [IL3002: Avoid calling members annotated with 'RequiresAssemblyFilesAttribute' when publishing as a single file](../../../core/deploying/single-file/warnings/il3002.md) | Avoid calling members annotated with 'RequiresAssemblyFilesAttribute' when publishing as a single file|

docs/fundamentals/code-analysis/quality-rules/security-warnings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,5 @@ Security rules support safer libraries and applications. These rules help preven
112112
|[CA5401: Do not use CreateEncryptor with non-default IV](ca5401.md)|Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks.|
113113
|[CA5402: Use CreateEncryptor with the default IV](ca5402.md)|Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks.|
114114
|[CA5403: Do not hard-code certificate](ca5403.md)|The `data` or `rawData` parameter of a <xref:System.Security.Cryptography.X509Certificates.X509Certificate> or <xref:System.Security.Cryptography.X509Certificates.X509Certificate2> constructor is hard-coded.|
115-
| [CA5404: Do not disable token validation checks](ca5404.md) | <xref:Microsoft.IdentityModel.Tokens.TokenValidationParameters> properties that control token validation should not be set to `false`. |
116-
| [CA5405: Do not always skip token validation in delegates](ca5405.md) | The callback assigned to <xref:Microsoft.IdentityModel.Tokens.AudienceValidator> or <xref:Microsoft.IdentityModel.Tokens.LifetimeValidator> always returns `true`. |
115+
| [CA5404: Do not disable token validation checks](ca5404.md) | `TokenValidationParameters` properties that control token validation should not be set to `false`. |
116+
| [CA5405: Do not always skip token validation in delegates](ca5405.md) | The callback assigned to `AudienceValidator` or `LifetimeValidator` always returns `true`. |

docs/fundamentals/networking/telemetry/tracing.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
22
title: Networking tracing
3-
description: Learn how to consume .NET networking Tracing.
3+
description: Learn how to consume .NET networking tracing.
44
author: samsp-msft
5-
ms.author: samsp
65
ms.date: 10/4/2024
76
---
87

0 commit comments

Comments
 (0)