-
Notifications
You must be signed in to change notification settings - Fork 25.1k
ROPC remediation - configuration/index.md, use-http-context.md, new include file #33858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
64505d7
address ropc issue
tdykstra 63ca30c
delete unneeded include
tdykstra 294b9d5
ropc changes
tdykstra e43b2ce
rename string to strings
tdykstra 6a2ddcf
markdownlint
tdykstra a363bd6
delete unneeded word
tdykstra f1bf60d
mark ropc done
tdykstra a2d5300
Update aspnetcore/fundamentals/configuration/options.md
tdykstra 28c27e1
Update aspnetcore/fundamentals/configuration/index.md
Rick-Anderson a808c1b
Apply suggestions from code review
tdykstra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| :::moniker range="= aspnetcore-7.0" | ||
|
|
||
| <!-- ms.sfi.ropc: t --> | ||
| Application configuration in ASP.NET Core is performed using one or more [configuration providers](#cp). Configuration providers read configuration data from key-value pairs using a variety of configuration sources: | ||
|
|
||
| * Settings files, such as `appsettings.json` | ||
|
|
@@ -140,6 +140,7 @@ Configuration data guidelines: | |
| * Never store passwords or other sensitive data in configuration provider code or in plain text configuration files. The [Secret Manager](xref:security/app-secrets) tool can be used to store secrets in development. | ||
| * Don't use production secrets in development or test environments. | ||
| * Specify secrets outside of the project so that they can't be accidentally committed to a source code repository. | ||
| * Avoid the use of passwords in production apps; for more information, see [Secure authentication flows](xref:security/index#secure-authentication-flows). | ||
|
||
|
|
||
| By [default](#default), the user secrets configuration source is registered after the JSON configuration sources. Therefore, user secrets keys take precedence over keys in `appsettings.json` and `appsettings.{Environment}.json`. | ||
|
|
||
|
|
@@ -390,6 +391,8 @@ The preferred way to read hierarchical configuration data is using the options p | |
|
|
||
| ## Configuration keys and values | ||
|
|
||
| [!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)] | ||
|
|
||
| Configuration keys: | ||
|
|
||
| * Are case-insensitive. For example, `ConnectionString` and `connectionstring` are treated as equivalent keys. | ||
|
|
@@ -441,6 +444,8 @@ The preceding sequence of providers is used in the [default configuration](#defa | |
|
|
||
| ### Connection string prefixes | ||
|
|
||
| [!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)] | ||
|
|
||
| The Configuration API has special processing rules for four connection string environment variables. These connection strings are involved in configuring Azure connection strings for the app environment. Environment variables with the prefixes shown in the table are loaded into the app with the [default configuration](#default) or when no prefix is supplied to `AddEnvironmentVariables`. | ||
|
|
||
| | Connection string prefix | Provider | | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,11 @@ author: jamesnk | |
| description: How to use HttpContext in ASP.NET Core. | ||
| monikerRange: '>= aspnetcore-3.1' | ||
| ms.author: wpickett | ||
| ms.date: 01/31/2022 | ||
| ms.date: 10/07/2024 | ||
| uid: fundamentals/use-httpcontext | ||
| --- | ||
| <!-- ms.sfi.ropc: t --> | ||
|
|
||
| # Use HttpContext in ASP.NET Core | ||
|
|
||
| [!INCLUDE[](~/includes/not-latest-version.md)] | ||
|
|
@@ -28,7 +30,7 @@ Commonly used members on `HttpRequest` include: | |
| |<xref:Microsoft.AspNetCore.Http.HttpRequest.Headers?displayProperty=nameWithType>|A collection of request headers.|`user-agent=Edge`<br />`x-custom-header=MyValue`| | ||
| |<xref:Microsoft.AspNetCore.Http.HttpRequest.RouteValues?displayProperty=nameWithType>|A collection of route values. The collection is set when the request is matched to a route.|`language=en`<br />`article=getstarted`| | ||
| |<xref:Microsoft.AspNetCore.Http.HttpRequest.Query?displayProperty=nameWithType>|A collection of query values parsed from <xref:Microsoft.AspNetCore.Http.HttpRequest.QueryString>.|`filter=hello`<br />`page=1`| | ||
| |[HttpRequest.ReadFormAsync()](xref:Microsoft.AspNetCore.Http.HttpRequest.ReadFormAsync(System.Threading.CancellationToken))|A method that reads the request body as a form and returns a form values collection. For information about why `ReadFormAsync` should be used to access form data, see [Prefer ReadFormAsync over Request.Form](xref:fundamentals/best-practices#prefer-readformasync-over-requestform).|`[email protected]`<br />`password=TNkt4taM`| | ||
| |[HttpRequest.ReadFormAsync()](xref:Microsoft.AspNetCore.Http.HttpRequest.ReadFormAsync(System.Threading.CancellationToken))|A method that reads the request body as a form and returns a form values collection. For information about why `ReadFormAsync` should be used to access form data, see [Prefer ReadFormAsync over Request.Form](xref:fundamentals/best-practices#prefer-readformasync-over-requestform).|`[email protected]`| | ||
| |<xref:Microsoft.AspNetCore.Http.HttpRequest.Body?displayProperty=nameWithType>|A <xref:System.IO.Stream> for reading the request body.|UTF-8 JSON payload| | ||
|
|
||
| ### Get request headers | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| author: tdykstra | ||
| ms.author: tdykstra | ||
| ms.date: 10/16/2024 | ||
| ms.topic: include | ||
| --- | ||
| <!-- ms.sfi.ropc: t --> | ||
| > [!WARNING] | ||
| > This article shows the use of connection strings. With a local database the user doesn't have to be authenticated, but in production, connection strings sometimes include a password to authenticate. A resource owner password credential (ROPC) is a security risk that should be avoided in production databases. Production apps should use the most secure authentication flow available. For more information on authentication for apps deployed to test or production environments, see [Secure authentication flows](xref:security/index#secure-authentication-flows). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.