You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integrate main commits into feature/v3 branch. (#185)
* Updated FeatureGateAttribute to be able to be used on Razor Pages. (#166)
* Add PageFeatureGate
* Fix tests.
* Remove test page.
* Added missing license headers.
* Bundle PageFeatureGateAttribute functionality into FeatureGate. Page filters and action filter execution is isolated.
* Use OkResult instead of StatusCode. Updated indenting.
* Remove unnecessary virtual for interface implementation.
* Add back netcoreapp2.1 in tests.
* Remove tabs from csproj
* Update package versions. (#167)
* Update type/method summaries in FeatureGateAttribute. (#170)
* Update type/method summaries in FeatureGateAttribute.
* Add back text.
* Add documentation for FeatureGateAttribute usage on Razor pages. (#169)
* Microsoft mandatory file (#177)
Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,6 +228,23 @@ services.AddMvc(o =>
228
228
229
229
The code above adds an MVC filter named `SomeMvcFilter`. This filter is only triggered within the MVC pipeline if the feature flag it specifies, "FeatureV", is enabled.
230
230
231
+
### Razor Pages
232
+
MVC Razor pages can require that a given feature, or one of any list of features, be enabled in order to execute. This can be done by using a `FeatureGateAttribute`, which can be found in the `Microsoft.FeatureManagement.Mvc` namespace.
233
+
234
+
```C#
235
+
[FeatureGate(MyFeatureFlags.FeatureU)]
236
+
publicclassIndexModel : PageModel
237
+
{
238
+
publicvoidOnGet()
239
+
{
240
+
}
241
+
}
242
+
```
243
+
244
+
The code above sets up a Razor page to require the "FeatureU" to be enabled. If the feature is not enabled, the page will generate an HTTP 404 (NotFound) result.
245
+
246
+
When used on Razor pages, the `FeatureGateAttribute` must be placed on the page handler type. It cannot be placed on individual handler methods.
247
+
231
248
### Application building
232
249
233
250
The feature management library can be used to add application branches and middleware that execute conditionally based on feature flag state.
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6
+
7
+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8
+
9
+
## Reporting Security Issues
10
+
11
+
**Please do not report security vulnerabilities through public GitHub issues.**
12
+
13
+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14
+
15
+
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16
+
17
+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18
+
19
+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
+
21
+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22
+
* Full paths of source file(s) related to the manifestation of the issue
23
+
* The location of the affected source code (tag/branch/commit or direct URL)
24
+
* Any special configuration required to reproduce the issue
25
+
* Step-by-step instructions to reproduce the issue
26
+
* Proof-of-concept or exploit code (if possible)
27
+
* Impact of the issue, including how an attacker might exploit the issue
28
+
29
+
This information will help us triage your report more quickly.
30
+
31
+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32
+
33
+
## Preferred Languages
34
+
35
+
We prefer all communications to be in English.
36
+
37
+
## Policy
38
+
39
+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
20
+
</p>
21
+
<p>
22
+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
23
+
It can result in displaying sensitive information from exceptions to end users.
24
+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
0 commit comments