Граф коммитов

29 Коммитов

Автор SHA1 Сообщение Дата
Javier Calvarro Nelson 51838a26a5
[Blazor] Adds compresion support for all assets in an application (#55558)
Adds a new MapStaticAssetEndpoints routerware that reads a manifest generated at build / publish time and maps the endpoints defined in the manifest to the files in the application wwwroot folder.

Adds a MatcherPolicy to perform content negotiation based on the Accept-Encoding header. Compressed resources contain a ContentEncoding attribute in their metadata that is used to filter out the compressed asset to serve to the client based on the Accept-Encoding header.

The content encoding has an associated Quality value that represents the 'server preference' for the encoding. We always use the client preference and only rely on the server preference to break ties.

This process is completely driven by de the build and transparent to the runtime, if in the future we add support for zstd, sbr, etc. we don't need to change the runtime.

The logic for serving static files is borrowed from the static files middleware, with simplifications and additions. I've ported the relevant tests to ensure a high degree of compatibility.

The logic is new "routerware" instead of directly baked into the static files middleware because we do not want to pollute that middleware with more complex logic and we are going to be layering fingerprinting on top of this change, which will register more endpoints that will include more custom headers, which is not suitable for the static files middleware.

During development we wrap the endpoints we generate to support changing the files while the app is running (we recompute some of the values on the fly and also register a fallback route that matches file patterns to serve new files added while the app is running).

The build/publish process computes all the required information about the assets that is used to emit the response. The ETag and Last-Modified values are computed using the Base64(SHA256) hash of the content and the LastWrite on the file at build/publish time.
2024-05-13 18:04:54 +02:00
William Godbe e9505bc64e
Ship Microsoft.AspNetCore.WebUtilities, Microsoft.Net.Http.Headers as packages (#48265)
* Ship Microsoft.AspNetCore.WebUtilities as a package

* Update Microsoft.Net.Http.Headers.csproj

* Update SharedFx.props

* Add browser as a supported platform
2023-05-17 09:03:31 -07:00
Stephen Halter d4430f0d7d
Add MapIdentityApi<TUser>() (#47414) 2023-04-27 12:06:51 -07:00
Javier Calvarro Nelson f772f1bcbc
[Blazor united] Initial startup APIs for registering pages and rendering from an endpoint (#46996)
* Adds the new Microsoft.AspNetCore.Components.Endpoints project for Server-Side Rendering components.
* Adds the structure for registering server side rendered Razor Component Endpoints.
* Adds a sample for Blazor United.
* Adds APIs for registering pages as endpoints and renders a static document for each page.
2023-03-07 10:58:27 +01:00
James Newton-King dfd4cdea4d
Add Kestrel named pipes transport (#44426) 2022-12-22 11:02:07 +08:00
William Godbe 361e62888c
Don't package Microsoft.Aspnetcore.Ratelimiting (#44502)
* Don't package Microsoft.Aspnetcore.Ratelimiting

* Update SharedFramework.Local.props
2022-10-12 13:16:13 -07:00
dotnet-maestro[bot] 9d4537c0a7
[main] Update dependencies from dotnet/efcore dotnet/runtime (#43089)
[main] Update dependencies from dotnet/efcore dotnet/runtime


 - Add RateLimiting libraries to SharedFx

 - Fix tests

 - Update Microsoft.AspNetCore.App.Ref.csproj

 - React to new exception type 51584ceecb
2022-08-09 19:25:18 +00:00
Sébastien Ros 47f5d8f990
Output caching middleware (#41037)
* Create output caching middleware

* Fix MVC attribute

* Update src/Middleware/OutputCaching/src/Policies/EnableCachingPolicy.cs

Co-authored-by: Kahbazi <A.Kahbazi@gmail.com>

* Update src/Middleware/OutputCaching/src/DispatcherExtensions.cs

Co-authored-by: Kahbazi <A.Kahbazi@gmail.com>

* Update src/Middleware/OutputCaching/src/Policies/PredicatePolicy.cs

Co-authored-by: Kahbazi <A.Kahbazi@gmail.com>

* Update src/Middleware/OutputCaching/src/Policies/ExpirationPolicy.cs

Co-authored-by: Kahbazi <A.Kahbazi@gmail.com>

* Fix mention of response cache

* Update src/Middleware/OutputCaching/src/OutputCachingPolicyProvider.cs

Co-authored-by: Kahbazi <A.Kahbazi@gmail.com>

* Use IReadOnlyList in IPoliciesMetadata

* Add XML documentation

* Missing changes

* Remove unused file

* PR feedback

* Fix build

* Add Path sample

* Fix build

* Update public api

* Fix typos

[skip ci]

* Update sample

[skip ci]

* Fix build

* API cleaning and test project

* Update src/Middleware/OutputCaching.Abstractions/src/Microsoft.AspNetCore.OutputCaching.Abstractions.csproj

Co-authored-by: James Newton-King <james@newtonking.com>

* Update src/Middleware/OutputCaching/src/Microsoft.AspNetCore.OutputCaching.csproj

Co-authored-by: James Newton-King <james@newtonking.com>

* Update TrimmableProjects

* Fix solution

* Improve ThrowIfNull usage

* API review feedback

* Add more tests

* Update API

* Clean up api

* Update unit tests

* Remove CachedResponseHeaders from public API

* Fix unshipped file

* API review feedback

* Fix unit tests

* Feedback

* Refactor resolved policies

* Clean sample

* Provide HttpContext in VaryByValue

* Reduce public API

* Apply API review changes

* Add more tests

* Add more tests

* Apply PR feedback

* PR feedback

* PR feedback

* Brennan's

* Update submodule (#42357)

Co-authored-by: Kahbazi <A.Kahbazi@gmail.com>
Co-authored-by: James Newton-King <james@newtonking.com>
2022-06-22 16:51:23 -07:00
David Acker d5a539f19b
Add Request Decompression middleware (#40279)
Co-authored-by: Pranav K <prkrishn@hotmail.com>
Co-authored-by: Sébastien Ros <sebastienros@gmail.com>
2022-06-03 22:22:04 +00:00
James Newton-King b4b43e39bc
Add gRPC JSON transcoding (#40242) 2022-03-27 20:29:23 +08:00
William Godbe 56d80d44ac
Add Microsoft.AspNetCore.Server.Kestrel.Transport.Quic to SharedFx (#34596)
* Add Microsoft.AspNetCore.Server.Kestrel.Transport.Quic to SharedFx

* Update SharedFramework.Local.props
2021-07-21 16:45:52 -07:00
Volodymyr S d7351f022d
Moved /src/Http/Features/ to /src/Extensions/Features/ (#34444)
* Moved Microsoft.Extensions.Features

Moved /src/Http/Features/ to /src/Extensions/Features/

* Updated references to Microsoft.Extensions.Features

* Build.props includes update

* Update eng/Build.props

* Update eng/Build.props

* Update eng/Build.props

* Project List refresh using GenerateProjectList.ps1

Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Co-authored-by: Doug Bunting <6431421+dougbu@users.noreply.github.com>
2021-07-19 15:14:59 -07:00
Pranav K b9efadc59d
Separate IResult based results from ActionResults (#33843)
* Separate IResult based results from ActionResults

Fixes https://github.com/dotnet/aspnetcore/issues/33729
2021-06-30 17:32:18 +00:00
Chris Ross fc1f919282
Move IFeatureCollection to new Extensions.Features assembly (#32043)
* Move IFeatureCollection to new Extensions.Features assembly

* Update src/Http/Http.Features/src/Microsoft.AspNetCore.Http.Features.csproj

* Update Microsoft.Extensions.Features.csproj

* Regen props
2021-04-26 09:20:34 -07:00
Justin Kotalik 4ee074f1bc
Adds HttpLogging middleware (#31816)
* Adding logging
* Progress
* Logging
* nit
* Polishing HttpLogging
* Namespace and nit
* System
* Fix public API
* Feedback
* Big perf wins for response body
* Adds request body side
* Another API pass
* Combine request and response stream base type
* Fixing variable
* nit
* Updating samples
* Some feedback
* Small fixups
* API review feedback
* Tests working and most of the feedback
* rename
* Feedback
* bit more logging
* More overloads
* Fixing truncation
* Update src/Middleware/HttpLogging/src/HttpRequestLog.cs
  Co-authored-by: Kahbazi <akahbazi@gmail.com>
* More tests and log headers later
* Test for invalid media type
* Logging request body if it isn't logged
* nit
* Update src/Middleware/HttpLogging/src/HttpResponseLog.cs
  Co-authored-by: Kahbazi <akahbazi@gmail.com>
* Feedback
* Remove uneeded dep
* Removing mroe
* Abstractions?
* Targeting pack and comments
* Extra check
* Fixing tests
* Fixing tests
* All of that feedback
* Another round of feedback
* Override writeasync
* Feedback
* Fixing some small parts
* Fixing response buffering check
  Co-authored-by: Kahbazi <akahbazi@gmail.com>
2021-04-20 13:57:46 -07: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 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
Steve Sanderson a4ab9ffa05 Factor out auth and forms. Fixes #12950 (#12999)
* Add empty Authorization src and test projects

* Add references

* Move auth types into .Authorization project

* Move auth tests

* Fix Mvc.ViewFeatures

* Remove the reference from .Web to .Authorization, so it's truly optional

* Add empty Forms src and test projects

* Remove dependencies from Components.csproj

* Move forms sources and tests

* Reference .Forms from .Web (needed unless we also have .Forms.Web)

* Rebase on #12936

* Update reference assemblies

* CR: Add Authorization namespace

* Update ref sources

* Add missing using

* Add another missing using
2019-08-12 16:36:27 -07:00
Ryan Nowak 45f50905d5 Remove stateful prerendering
Fixes: #12245
Fixes: #12630

This change removes stateful pre-rendering from Server-Side Blazor. This
means that when you render a component during the initial HTTP request,
we we will no longer preserve the component instances and their
parameters. While this feature was useful, it cause serious scalability
concerns.

This means that it will now be required to register "entry-point"
components in startup similar to client-side Blazor.
2019-08-01 07:44:14 -07:00
Ryan Nowak 291ad25f5d Rename .Components.Browser -> Components.Web
This is part of API review for Blazor. We're renaming these projects to
reflect the fact that they are for Blazor using web technologies (html
+css).

The old naming of .Browser of whether it meant client-side (in the
browser).
2019-07-01 15:36:35 -07:00
Hao Kung f35564ba06
Move DataProtection and Extensions.Identity to netstandard2.0/2.1 (#11008) 2019-06-21 14:40:42 -07:00
David Fowler 400835e0b4
Remove Transport.Abstractions from existence (#10722) 2019-06-01 17:22:47 -07:00
Javier Calvarro Nelson 3f041cee44
Produce Microsoft.AspNetCore.Authorization as a package (#10684)
Produce Microsoft.AspNetCore.Authorization as a package
2019-05-31 21:12:16 +02:00
Hao Kung 16a47948f8
Move AuthZ policy types back into Policy and rejigger AddAuthorization (#10021) 2019-05-20 16:20:19 -07:00
BrennanConroy c84e37f30d
Make System.Text.Json the default for SignalR and remove Newtonsoft from shared framework (#9476) 2019-04-18 13:49:24 -07:00
BrennanConroy 9fae14a926
System.Text.Json Hub Protocol (#8932) 2019-04-13 09:20:30 -07:00
Javier Calvarro Nelson b9e600a45c
Renames for blazor server-side, inclusion in shared framework, and other renaming fixes (#9001)
* Move contents of Microsoft.AspNetCore.Components.Services namespace to Microsoft.AspNetCore.Components
* Rename Components to Blazor
* Make Blazor server-side part of the shared framework.
2019-04-04 21:36:36 +02:00
Nate McMaster 3fd8a97af2
Add targets to generate the list of shared framework assemblies from project property (#7510)
Changes:
* Add support for a property, `IsAspNetCoreApp`, in the .csproj file of assemblies which are part of the shared framework. 
* Remove unused dependencies
* Remove reference which have become part of 'netcoreapp3.0'
2019-02-12 23:00:19 -08:00