Commit Graph

206 Commits

Author SHA1 Message Date
Andrew Stanton-Nurse 3f683916bc
unquarantine negotiate tests (#20378)
these were quarantined because of the runtime JIT bug that caused DI failures, they can come out of the box now that the runtime issue is fixed
2020-03-31 23:56:45 +00:00
Kevin Pilch f34033a415 Add .vsconfig files in root and beside slns 2020-03-31 14:25:44 -07:00
huysentruitw 16e2586724
Use Backchannel.DefaultRequestVersion in OAuth & OIDC requests #20096 (#20295) 2020-03-30 20:12:54 +00:00
Roman Marusyk 28de202a3b
Use the custom token endpoint if it's available in OIDC Handler (#20230) 2020-03-30 19:52:33 +00:00
Patrick Goode ae192af856
Make change for #18729 (#19756) 2020-03-17 22:22:28 +00:00
Andrew Stanton-Nurse 3b4be4f51a
Quarantining some tests (#19568) 2020-03-04 11:27:55 -08:00
Sedat Kapanoglu 7e139c9b5f
Add HeaderNames.XRequestedWith = "X-Requested-With" (#19470)
* Add HeaderNames.XRequestedWith = "X-Requested-With"

X-Requested-With is the standard for differentiating AJAX requests and is commonly used. Having this in HeaderNames would prevent typos related to typing this header name. I couldn't find any rationale about excluding this but there might be legitimate reasons like discouraging the use of HTTP headers or differentiating AJAX requests, etc. Please reject this if that's the case.

* Replace "X-Requested-With" references with HeaderNames.XRequestedWith

The only remaining instance is WebSocketsTransport.cs in
SignalR\clients\csharp\Http.Connections.Client which doesn't have
Microsoft.Net in its references. I didn't want to impose a new
dependency as its risky.

* Fix the order of using statements

* Add XRequestedWith to the ref assembly
2020-03-03 15:45:50 -08:00
Ryan Nowak 1360d6559e
Add AddOptions to AddAuthorizationCore (#18911)
Fixes: #18471

AddAuthorizationCore previously assumed that options were already
registered. This isn't the case in 5.0 in Blazor WASM.

We don't want Blazor to register options in the default host because it
prevents options from being linked out.

note: we will have some remaining work for this issue after this change
is merged. The Blazor WASM hosting changes haven't landed in master yet,
so we'll need to update that code to remove options from the host.
2020-02-25 21:57:19 +00:00
John Luo 5f9f1ce183 Merge branch 'master' into johluo/migrating-extensions 2020-02-20 16:44:06 -08:00
John Luo 7d1f5d8c0b Updates for extensions migrations
- Multi-target ObjectPool
- Move Embedded.Manifest.Task.Internal.Entry to the public namespace
- Remove ref assemblies from AspNetCore.Testing
- Skip TestPathUtilitiesTest since it's a pattern we want to migrate away from
- Fix FileProviders.Abstractions version in Embedded.*.nuspec
- Add workarounds for project references to FileProviders.Embedded
2020-02-20 14:00:29 -08:00
Doug Bunting c2ee4ae820
Re-enable source build job
- change ref/ projects to build only the default TFM during source builds
  - avoid errors restoring packages like Microsoft.BCL.AsyncInterfaces
  - may also speed up source builds slightly
2020-02-19 22:46:22 -08:00
Brennan Conroy 2d066dcd3e Apply some fixes 2020-02-19 14:18:29 -08:00
Stephen Halter 88073f86ff Merge branch 'release/3.1' into master 2020-02-18 13:46:51 -08:00
Chris Ross 7e094d7b7d
Update OIDC SameSite sample (#18934) 2020-02-14 18:07:46 +00:00
Doug Bunting a6c43b14a1
Mark AspNetCore projects that aren't packaged explicitly (#18767)
* Mark AspNetCore projects that aren't packaged explicitly
- avoid NU5104 warnings due to confusing versioning
- `$(IsShippingPackage)` was semantically incorrect in any case

* Remove redundant `$(IsShippingPackage)` settings in `$(IsAspNetCoreApp)` projects
- default is `true` for all implementation projects

* Use `$(IsPackable)` when deciding how `$(IsAspNetCoreApp)` projects are handled
- remove all use of `$(IsShippingPackage)` for shared framework composition
- update documentation to match these changes

nits:
- remove odd default for `$(IsPackable)` in Directory.Build.targets
  - no longer relevant since all `$(IsAspNetCoreApp)` projects are `$(IsShippingPackage)` too
- include more information in docs/ProjectProperties.md

* Add direct System.Text.Json references
- avoid MSB3277 warnings
2020-02-13 15:51:27 -08:00
Edward Neal e7ea31b1c7
Allow opt-out from client certificate root checking (#15029)
* Added a new property, ValidateCertificateChain

This aligns the code with README.md, and enables chained certificate authentication to work in Azure App Service (which won't have the client certificate's root in its trust store)

* Updated reference assemblies

New ValidateCertificateChain property was missing from /ref - hadn't updated it, so automatic test was failing

* Replaced the broad property which disables certificate chain validation with a granular list of trusted issuers

Also updated documentation to remove the unused property and to indicate that it isn't possible to validate half of the chain from the OS' trust store, and half from the private root store

* Swapped property access for an AddRange call

* Updated reference assembly

* Added certificate tests

Three test cases:
- Untrusted client certificate should fail, as it does now.
- Client certificate which is part of a chain with an untrusted root but a trusted issuer should fail, since the chain as a whole isn't trusted.
- Client certificate which is part of a fully-trusted chain should pass.

Also noticed that there were a couple of issues in CreateServer, where the certificate revocation flags weren't being set properly.

Finally, the csproj was referring to a folder name ("test\Certificates") which didn't exist. It looks like the folder was renamed to "TestCertificates", so I've update the project to match.

* Update Microsoft.AspNetCore.Authentication.Certificate.netcoreapp.cs

* Reverting change of Tests csproj, which was blocking certificate tests

* Forgot to add certificates to the shared source root, so tests were failing

* Updating following code review

Replaced custom logic with a new ChainTrustValidationMode property. Updated reference assemblies

* Changed tests to account for new property

* Updated certificates for PR tests

* Updated certificates

Updating all new certificates to avoid using the alternate signature algorithm

* Dummy checkin

Compilation errors coming from CertificateTests.cs, performing this checkin to test whether or not they're limited to a specific build.

* Following up typo corrections

Commit 116799fa70 in upstream repo changed a variable name, causing compile errors on PR build. Fixing that

Co-authored-by: Hao Kung <HaoK@users.noreply.github.com>
2020-02-06 15:15:38 -08:00
Justin Kotalik d9ccf235fd Final bad conflicts 2020-01-15 16:39:50 -08:00
James Newton-King df712cc4a9
Add HttpProtocol (#18049) 2020-01-16 13:35:47 +13:00
Justin Kotalik 4dd0a6cd27 Merge branch 'release/2.1' into release/3.1 2020-01-15 16:19:30 -08:00
Chris Ross 8211a1c313 [2.1] CookieChunkingManager needs to flow the Secure attribute… (#17953) 2020-01-15 11:07:15 -08:00
Maher Jendoubi 116799fa70 Contributing: Fixed some typos (#18331) 2020-01-14 08:58:52 -08:00
Hao Kung 0977c9ac59
Add test for AuthenticationSchemes (#17816) 2020-01-09 14:33:29 -08:00
Kevin Pilch 0517745c08 aspnet/AspNetCore -> dotnet/aspnet
Except aspnet/AspNetCore-Internal.
2020-01-08 16:40:11 -08:00
Brian Surowiec 840e10d45b Fix spelling of hyphens (#18130) 2020-01-05 08:50:29 -08:00
Martin Costello 8b000d961c Use RandomNumberGenerator.Fill() (#18128)
* Use RandomNumberGenerator.Fill()

Use the new RandomNumberGenerator.Fill() method instead of maintaining instances of RandomNumberGenerator to use GetBytes().

* Revert RandomNumberGenerator.Fill()

Revert usage of RandomNumberGenerator.Fill() as the project still targets netstandard2.0.
2020-01-04 15:52:06 -08:00
Martin Costello c802134737 Use ISystemClock for request timestamps (#18124)
Use ISystemClock to generate timestamps for Twitter authentication.
Remove custom static field for the epoch.
2020-01-04 12:39:24 -08:00
Kahbazi b56f84131a Use Count instead of Any() on List (#18022) 2020-01-02 07:55:29 -08:00
Kahbazi 9a3aacb56a Replace string.Equals with HttpMethods.IsX (#17805) 2019-12-11 21:40:27 -08:00
Doug Bunting 7ba757265f
Merge branch 'release/3.1' into merge/release/3.0-to-release/3.1
- upgrade Arcade SDK to '1.0.0-beta.19607.3'
- regenerate eng/ProjectReferences.props and ref/ projects
2019-12-11 20:03:03 -08:00
Eddy Nakamura 5ff9ed68d1 updating inline <code> to <c> (#17611)
* updating inline "code" tag to "c" tag

* Apply suggestions from code review

Co-Authored-By: Andrew Stanton-Nurse <andrew@stanton-nurse.com>

* reverting tag

* reverting tag

* reverting entire file
2019-12-11 11:47:38 -08:00
Doug Bunting cf6b5028c3
Improve generation and use of ref/ projects (#17311)
* Remove useless src/PackageArchive files
- not used outside 2.x branches

* Improve use of ref/ assemblies
- compile against ref/ assemblies but do not change package metadata
  - update the metadata of implementation projects to include the ref/ assembly path
  - update `@(ReferenceAssembly)` metadata for Extensions packages, not `@(PackageReference)`
  - can be disabled using `$(CompileUsingReferenceAssemblies)` e.g. when generating ref/ projects
- include ref/ projects in source build by default
  - remove `$(ExcludeFromSourceBuild)` overrides from ref/ project files
- use latest package references and use project references even when _not_ building the targeting packs
- restore previous `@(Reference)` -> `@(PackageReference)` logic
  - add build-only Microsoft.Internal.Extensions.Refs package reference in most cases
- remove IndirectReferences.props and `@(_ExtensionInternalRefAssemblies)`; no longer needed

* Improve ref/ project generation
- use ../src/**/AssemblyInfo.cs files instead of including attributes in *.Manual.cs files
  - for same reason, copy `@(InternalsVisibleto)` items from src/ to ref/ projects
- use eng/targets/CSharp.ReferenceAssembly.props instead of ref/Directory.Build.props files
- use TFM-specific *.Manual.cs files in ref/ project files instead of ref/Directory.Build.props files

optimizations and usability improvements:
- add `$(BuildMainlyReferenceProviders)` property to focus on reference providers when generating ref/ projects
- disable `$(UseReferenceAssemblyInImplementation)` to avoid using ref/ projects while generating them

nits:
- clean up whitespace and remove blank lines in ref/ project files

* Perform smaller cleanup
- remove `$(IsTargetingPackPatching)`; use only `$(IsTargetingPackBuilding)`
- remove `$(DisableServicingFeatures)`; enable the servicing features we need
  - suppress baseline references even in servicing builds
- restore `$(AdditionalGenApiCmdOptions)`; useful when updating *.Manual.cs files

nits:
- simplify conditions using `$(HasReferenceAssembly)`
- correct spelling in comments
- shorten long lines

* Use a response file for GenAPI commands
- work around dotnet/arcade#4021 and help with additional ref assemblies
- mimic 111462e0c2 and integrate w/ other changes here

* Undo some manual ref/ project changes
- now done automatically or centrally
- remove manual `[TypeForwardedTo]` and `[InternalsVisibleTo]` attributes
  - fully qualify a type now that `using` is gone
- remove dupe `@(Compile)` items for *.Manual.cs files; included in the ref/ project files
- remove redundant `$(AllowUnsafeBlocks)` and `$(NoWarn)` settings

nits:
- rename a *.Manual.cs file that's not TFM-specific
- remove `private` members

* Correct use of `@(ProjectReference)` items for reference providers
- use `@(Reference)` instead

* Remove recently-added `@(Compile)` and `@(Reference)` items
- were added due to missing `[InternalsVisibleTo]` attributes in ref/ assemblies or as early workarounds
  - plus, now transitive references **Just Work™️**
- expose `ClosedGenericMatcher` in the usual (*.Manual.cs) way
- also undo Microsoft.Extensions.ApiDescription.Server workaround

* Remove `private` members from ref/ *.Manual.cs files
- not useful and bloat the ref/ assemblies

* Cleanup warnings
- avoid "CSC warning CS2008: No source files specified." building site extensions
- correct warnings (as errors) about `RenderToStringResult` being obsolete
  - add Microsoft.AspNetCore.SpaServices.Tests to Middleware solution

* Remove `@(RuntimeHostConfigurationOption)` workarounds
- deps files are unaffected by new ref/ assembly handling and test projects aren't special-cased
- also execute a test previously skipped due to deps file problems

* Regenerate ref/ projects
- pick up the latest generation changes

(unclear why Mvc.RazorPages/ref/Microsoft.AspNetCore.Mvc.RazorPages.netcoreapp3.0.cs changed but works)

* Fill in missing `internal` types 1 of n
- rename Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs; need `RenderTreeFrame` type everywhere
- add types needed in unit and perf tests to *.Manual.cs files

* Clean up recent commits
- remove recently-added `private` members
- restore `_dummyPrimitive` fields in Microsoft.AspNetCore.Server.HttpSys.Manual.cs

* Add *.Manual.cs files for more projects

* !fixup! fields in *.Manual.cs `struct`s
- GenAPI sometimes generates `_dummy` and `_dummyPrimitive` fields _instead of_ visible members
- what GenAPI generates sometimes have the right length but actual fields don't hurt
  - that is, using the real fields corrects both the visible API and `struct`s' sizes

nits:
- consolidate `namespace`s in Microsoft.AspNetCore.Mvc.Core.Manual.cs

* Remove special case for generating ref/ projects on non-Windows
- referenced issue was closed with no action but workaround still not required
- no tabs in generated content

* Only create ref/ projects for assemblies in the shared framework
- restrict when `$(HasReferenceAssembly)` is `true` by default
- add warnings when `$(IsAspNetCoreApp)` or `$(HasReferenceAssembly)` have unexpected values

* Remove "extra" ref/ projects
- associated implementation projects no longer have `$(HasReferenceAssembly)` set to `true`

* Add a few GenAPI exclusions
- see dotnet/arcade#4488
- generation for these members leads to NREs

* Add more `internal` types and members
- Identity/Core
- Identity/Extensions.Core
- Mvc/Mvc.ViewFeatures

* Add direct dependencies to work around CS1705 errors
- add direct references to some test and sample projects to make intent clear i.e. address CS1705 root cause
  - these projects must use implementation assemblies for those direct references
  - requirement also applies to anything depending on them e.g. functional tests
  - for simplicity, use `$(CompileUsingReferenceAssemblies)` instead of targeted `@(Reference)` metadata
- leads to ~40 projects that do not themselves add ref/ metadata
  - this is _not_ transitive i.e. it applies only to projects that override `$(CompileUsingReferenceAssemblies)`

* nits: Remove a few more `private` members in *.Manual.cs files

* !fixup! correct namespaces of a few types in *.Manual.cs files

* Try another way to fix Microsoft.AspNetCore.Blazor.Build.Tests

* Try another way to fix missing targets in Web.JS.npmproj
2019-12-11 07:36:59 -08:00
Chris Ross 5033efb3fe
Clean up test skip conditions (#17529) 2019-12-05 04:42:39 -08:00
Jason Bailey 9099305d04 Fix AuthorizationPolicyBuilder doc typo (#17296) 2019-11-22 15:50:49 -08:00
Scott Addie a9aa1424e3 Replace cert authN README content with link to official doc (#16906) 2019-11-14 12:45:42 -08:00
Brennan fece4705ee
[master] Update Arcade dependency (#16716) 2019-10-31 17:18:24 -07:00
Hao Kung 814a37548b
Only run claims transformation once per ClaimsPrincipal instance by default (#12028) 2019-10-29 15:48:06 -07:00
dotnet-maestro[bot] 2c6456d463 [release/3.0] Update dependencies from 4 repositories (#14425)
* Update dependencies from https://github.com/dotnet/arcade build 20190924.3
* Update dependencies from https://github.com/aspnet/Blazor build 20191003.2
* Update dependencies from https://github.com/aspnet/AspNetCore-Tooling build 20191007.2
* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191010.4
* Remove potentially unnecessary feeds
* Install the runtime during source build
* Pin m.nc.app.ref
* Add aspnetcore-dev feed back to nuget.config
* Pin internal refs package
* Move efcore internal refs dependency
* Compile against ref assemblies
* Add manually generated internal ref assembly:
  * DataProtection
  * Kestrel
  * Hosting
  * Http
  * Mvc
  * Middleware
  * SignalR
  * Identity
  * Components
* Fix crossgen for ref compilation
* Fix tools for ref compilation
* Explicitly specify ExcludeFromSourceBuild
* Build targeting pack for 3.0.1
* Improve condition for building targeting pack in 3.0.1
* Fixing siteex build for ref compilation
* Resolve reference assemblies from Extensions
* Don't build refPack during source build
* Add big list of project references, for tests to use
  * Exclude sources files from indirect references
  * The types in these packages will be compiled into the binaries of the projects that directly depended o it
  * Add manual indirect references to project references
  * Add samples/test assets
  * Don't add indirect refs for ProjectRefs with ReferenceOutputAssembly=false
* Fix JSInterop for ref compilation
* Do not substitute ext ref assemblies in ref pack
* Disable the TestFramework assembly attribute from Logging.Testing
There's custom logic in ProjectTemplates.Tests to use a different TestFramework instead
* Fix Functional tests
  * Issues caused by incorrect deps files working around this via test infrastructure instead
  * Mvc
  * Analyzers
  * StaticFiles
  * SignalR
  * HttpOverrides
2019-10-28 18:06:32 -07:00
riccikl d34dc80e02 Fix documentation to use see instead of seealso (#15182) (#15434) 2019-10-28 11:43:04 -07:00
riccikl 0a0e1ea0cd Fix references in documentation (#15436) 2019-10-28 11:41:04 -07:00
Steven Yeh ec4a7f6c2b Add Ability to Tweak JWT Refresh Intervals (#14909) 2019-10-28 11:02:23 -07:00
Hao Kung c376e833e4
Merge AuthZ ToString PR (#15350)
Rebased verison of https://github.com/aspnet/AspNetCore/pull/10822
2019-10-25 14:28:13 -07:00
Pranav K 882df6003f
Merge remote-tracking branch 'origin/release/3.1' 2019-10-23 16:23:13 -07:00
Brennan Conroy 859c1e085e Merge branch 'master' into merge/release/3.1-to-master 2019-10-23 14:06:23 -07:00
Chris Ross 1ba180e87c
Remove Microsoft.AspNetCore.SuppressSameSiteNone compat switch #14739 (#15092) 2019-10-22 10:05:37 -07:00
Chris Ross 90b42ba099
Update Facebook API to 4.0 #4684 (#14798) 2019-10-17 10:33:09 -07:00
wtgodbe ba2ed9fae9 merge release/3.1 to master 2019-10-16 13:23:32 -07:00
wtgodbe 8deeed2fa8 Merge branches 2019-10-14 13:21:58 -07:00
Doug Bunting 4d30facbaf
Merge branch 'release/2.2' => 'release/3.0' (#14714) 2019-10-10 14:50:19 -07:00
Pranav K 8c39137944 Port Throw when UseAuthorization is incorrectly configured (#14893)
* Port Throw when UseAuthorization is incorrectly configured

* fixup
2019-10-10 14:14:43 -07:00
Chris Ross 4fac2918a6
Merge branch 'release/3.0' into merge/release/2.2-to-release/3.0 2019-10-09 16:21:25 -07:00