Commit Graph

232 Commits

Author SHA1 Message Date
James Newton-King 9df5918239
Clean up endpoint builder (#791) 2018-09-13 10:27:01 +12:00
James Newton-King cf484a49d0
Merge branch 'merge/release/2.2-to-master' 2018-09-13 09:22:33 +12:00
James Newton-King cee960f3c5
Add IParameterTransformer (#750) 2018-09-12 21:45:25 +12:00
Ryan Nowak 087e6d05ee
Merge pull request #790 from dotnet-maestro-bot/merge/release/2.2-to-master
[automated] Merge branch 'release/2.2' => 'master'
2018-09-10 18:54:06 -07:00
Ryan Nowak 5f172efa9d Add support Endpoint Name endpoint finding 2018-09-10 16:50:46 -07:00
Ryan Nowak 57cc8aea96 Various improvments to route values link APIs
- Add docs
- Add support for templates
- Remove undesirable constructor parameter
- misc cleanup
2018-09-10 16:50:46 -07:00
Ryan Nowak e6ff157b5f Add a test for Routing#435
This was already fixes as part of the LinkGenerator redesign. Adding a
test so we can mark it as complete.
2018-09-06 19:29:18 -07:00
Ryan Nowak 489a179c41 Add a test for Routing#435
This was already fixes as part of the LinkGenerator redesign. Adding a
test so we can mark it as complete.
2018-09-06 16:57:43 -07:00
Ryan Nowak d364a9e5af Merge branch 'release/2.2' 2018-09-06 14:47:29 -07:00
Ryan Nowak e3b704095b
Revisions to LinkGenerator (#770)
* Revisions to LinkGenerator

* PR feedback
2018-09-05 20:52:09 -07:00
Ikebe Shodai 950d2e9b74 Fix locale sensitive unit tests 2018-09-05 20:13:25 -07:00
James Newton-King aadc31d9a5
Merge release/2.2 2018-09-06 14:07:11 +12:00
James Newton-King 0f5d471dfd
Create collections on DfaNode as needed (#779) 2018-09-06 12:58:57 +12:00
Ryan Nowak ca681138e3 Merge branch 'dotnet-maestro-bot-merge/release/2.2-to-master' 2018-09-03 11:43:23 -07:00
Ryan Nowak 945e798ca7 [Design] Set the endpoint feature only on success 2018-08-30 14:52:35 -07:00
Ryan Nowak 71d4a2e1f0
Merge pull request #760 from dotnet-maestro-bot/merge/release/2.2-to-master
[automated] Merge branch 'release/2.2' => 'master'
2018-08-30 14:46:40 -07:00
Ryan Nowak 8395ad8340 remove references to ref emit packages 2018-08-30 13:26:22 -07:00
James Newton-King 74bfff149e
Use var in for loops (#758) 2018-08-31 08:24:41 +12:00
Ryan Nowak 9bc84cec8c
Merge pull request #757 from dotnet-maestro-bot/merge/release/2.2-to-master
[automated] Merge branch 'release/2.2' => 'master'
2018-08-29 21:32:44 -07:00
Ryan Nowak 8d053853bb Address PR feedback, I hit merge too soon. 2018-08-29 19:46:25 -07:00
Ryan Nowak 3511c8cef0 Add vectorized il-emit trie jump table
Add new futuristic jump table. Remove old experimental jump tables since
this is much much better.
2018-08-29 19:30:02 -07:00
James Newton-King c685765cd3
Merge branch 'merge/release/2.2-to-master' 2018-08-30 08:13:00 +12:00
James Newton-King 4e9e33a223
Unit test constraints without HttpContext (#755) 2018-08-29 17:34:54 +12:00
James Newton-King e73601dda9
Move core endpoint types to HttpAbstractions (#703) 2018-08-29 17:07:35 +12:00
James Newton-King 2d8b187ca0
Merge branch 'merge/release/2.2-to-master' 2018-08-29 15:55:56 +12:00
James Newton-King 99c4f2f36a
Support policy arguments and resolving services by constructors (#753) 2018-08-29 14:51:34 +12:00
James Newton-King dd1dcaebee
Merge branch 'merge/release/2.2-to-master' 2018-08-24 09:52:47 +12:00
James Newton-King 40fb13a021
Fix DfaMatcher to work with non-RouteEndpoint (#739) 2018-08-24 09:11:13 +12:00
dotnet-maestro-bot 90d8f96b3f Change RoutePattern to not throw when inline and arg default value are the same (#747) (#748) 2018-08-23 23:17:14 +12:00
James Newton-King 15e46ad323
Change RoutePattern to not throw when inline and arg default value are the same (#747) 2018-08-23 21:39:23 +12:00
Ryan Nowak 61c5f2bad4
Merge pull request #746 from dotnet-maestro-bot/merge/release/2.2-to-master
[automated] Merge branch 'release/2.2' => 'master'
2018-08-22 20:38:02 -07:00
Ryan Nowak a0aa61fd10 Improvements for IEndpointSelectorPolicy
These changes are based on our discussion earlier this week. Adding
async, and making it possible to short circuit, which should be better
aligned with the requirments of versioning.
2018-08-22 19:26:13 -07:00
James Newton-King 5e8e490867
Merge fixes 2018-08-22 20:42:53 +12:00
James Newton-King aff4a38865
Merge release/2.2 2018-08-22 20:37:21 +12:00
James Newton-King 1680b9f4fc
Change endpoint invoker to RequestDelegate, Endpoint/EndpointMetadataCollection namespaces, split out IRouteValuesFeature (#712) 2018-08-22 17:15:57 +12:00
James Newton-King a15f213e43
Merge branch 'merge/release/2.2-to-master' 2018-08-22 15:58:38 +12:00
James Newton-King 08a0a7fadb
Remove MatchProcessor, add IParameterPolicy (#734) 2018-08-22 15:24:34 +12:00
James Newton-King b658d90785
Merge release/2.2 2018-08-22 09:57:19 +12:00
Kiran Challa 731767837a Introducing new **catchAll parameter to allow generating links with unencoded values 2018-08-16 15:52:09 -07:00
Ryan Nowak 2b4df294d6
Merge pull request #726 from dotnet-maestro-bot/merge/release/2.2-to-master
[automated] Merge branch 'release/2.2' => 'master'
2018-08-16 09:52:51 -07:00
Ryan Nowak 4fa0b068b8 Fix #710 - add support for data tokens 2018-08-15 21:43:50 -07:00
Ryan Nowak 97f54c532b Support supression of matching for endpoints 2018-08-15 21:36:08 -07:00
James Newton-King 95267a32e2
Add EndpointBuilder (#701) 2018-08-09 13:06:27 +12:00
Kiran Challa 4d706f045f rebase changes 2018-08-03 12:45:31 -07:00
Kiran Challa 09ce9c3041 Api clean up 2018-08-03 12:37:37 -07:00
James Newton-King 091cb94094 Change metadata namespace
Change EndpointOptions visibility to internal
Add IRequiredValuesMetadata
2018-08-03 12:37:37 -07:00
Kiran Challa c8946a40e4 Created LinkGenerationTemplate and friends 2018-08-03 12:33:34 -07:00
Kiran Challa b177ba5309 Changed api of LinkGenerator 2018-08-02 16:10:56 -07:00
James Newton-King 8c4f187c22
Endpoint routing rename and API review changes (#684) 2018-08-02 13:38:08 +12:00
Kiran Challa 85c7bd8fac Discard ambient values during link generation if the values do not match explicit values
[Fixes #544] Link generation: Discard ambient values unless routing to the same address
2018-07-31 14:50:04 -07:00
Ryan Nowak f8b3b73ca7 Remove EndpointConstraints
Adds IEndpointSelectorPolicy so that MVC can plug in to the
EndpointSelector to run action constraints.
2018-07-28 19:03:12 -07:00
Ryan Nowak 54e5370e8f Add CORS support to HttpMethodMatcherPolicy
Also removes HttpMethodEndpointConstraint, since it's been fully
replaced.
2018-07-26 23:01:11 -07:00
James Newton-King c68c5befc7
Remove ChangeToken from EndpointDataSource (#662) 2018-07-26 11:06:54 +12:00
James Newton-King fdff66054f
Missing ChangeToken -> GetChangeToken updates (#660) 2018-07-25 14:35:41 +12:00
Ryan Nowak 147c9527f3
Implement EndpointSelector and MatcherPolicy (#646)
Implement EndpointSelector and MatcherPolicy

This change makes the EndpointSelector API more concrete, and is the
beggining of removing EndpointConstraint by making it obsolete.

To that end, I'm introducing MatcherPolicy, which is a
feature-collection API for registering policies that interact with the
DfaMatcher. The two policies that we'll need to start are:
- ability to order endpoints
- ability to append 'policy' nodes to the graph

These two concepts together replace EndpointConstraint. Extending our
graph representation is a really efficient way to processing most common
scenarios.

---

In general this helps with common cases where 4 or so endpoints match
the URL, but with different HTTP methods supported on each. Today we
have to process route values and call into some 'policy' to make a
decision about which one is the winner. This change pushes this
knowledge down into the graph so that it's roughly as cheap as a
dictionary lookup, and can be done allocation-free.

The big savings here is ability to remove more candidates *before*
collecting route data.

---

Along with this change, I also built 'rejection' into the DFA node
model, you can see an example with the HTTP Method handling that I
implemented. I implemented a policy that can treat failure to resolve an
HTTP method as a 405 response by returning a failure endpoint. This is
at the heart of much of the feedback we've gotten in this area around
versioning and http method handling. We also have a version of this
feature in MVC for [Consumes].
2018-07-24 17:31:51 -07:00
Kiran Challa 71cb933a08 Show a flattened tree in LinkGenerationDecisionTree's DebuggerDisplayString
[Fixes #636] Flatten the LinkGenerationDecisionTree to show as debugger display string
2018-07-24 17:11:53 -07:00
Kiran Challa 34499dbe24 Added support for suppressing link generation for endpoints 2018-07-24 16:47:34 -07:00
Nate McMaster deddb336b7
Merge branch 'release/2.1' into release/2.2 2018-07-24 11:47:18 -07:00
Kiran Challa 7da1baf9d8 Do not use decision tree for named routes in RouteValuesBasedEndpointFinder 2018-07-24 05:33:19 -07:00
Kiran Challa 5f1631ab46 Added support for configuring route options with LinkGenerator 2018-07-24 04:45:33 -07:00
James Newton-King 1e807240ea
Add GetChangeToken to EndpointDataSource (#649) 2018-07-23 13:46:22 +12:00
Ryan Nowak b9df95831d Change Branding
For preview one the branding is:

new thing = UseGlobalRouting/UseEndpoint
old thing = UseRouter

We're going to drop the name Dispatcher everywhere and make sure that we
position our new work as 'new and improved routing' instead of
introducing a new product/concept name.

We're not totally sure of the term Global yet, but it's what we're doing
for preview 1. Suggestions welcome for dicussion after we do the first
preview :)
2018-07-22 16:41:59 -07:00
Ryan Nowak f1c060bf3d RoutePattern everywhere 2018-07-20 13:04:34 -07:00
James Newton-King 90395c933d
Implement IRoutingFeature on EndpointFeature for back-compat (#641) 2018-07-20 18:23:14 +12:00
Kiran Challa 41f56dbbed Minor fix to DefaultLinkGenerator and enabled constraint related tests in DefaultLinkGeneratorTest 2018-07-19 09:11:50 -07:00
Ryan Nowak 477296a3cc Make DFA matcher the default 2018-07-18 07:50:27 -07:00
Ryan Nowak 400d243f42
Fix remaining feature gaps in DfaMatcher (#621)
* Fix remaining feature gaps in DfaMatcher

* addressed minor feedback

* missed one
2018-07-17 19:22:46 -07:00
Kiran Challa 1196349bf4 [Fixes #583] Handle change events in RouteValueBaseEndpointFinder 2018-07-17 05:54:11 -07:00
Kiran Challa aed2e24483 Allow to pass in HttpContext when generating links 2018-07-17 05:16:57 -07:00
Ryan Nowak 02e1d78319 Minor fixes for MatchProcessorFactory
Fixing minor issues found doing DFA integration.
2018-07-16 21:06:35 -07:00
Ryan Nowak 5f29e8b062 Hoist path out of loop in BarebonesMatcher
This is an oopsie from a previous change.
2018-07-16 20:43:31 -07:00
Ryan Nowak b2e4743c7d
Change benchmarks (#612)
Add benchmarks that include some HTTP method matching.

Clean up names and name like-kinded benchmarks alphabetically.

Matcher*Benchmark -> E2E including HTTP method selection
MatcherSelectCandidates*Benchmark -> Focused on just URL path processing
2018-07-14 17:21:05 -07:00
James Newton-King 497a38035d
Add application startup check that dispatcher is added to request pipeline (#614) 2018-07-15 11:50:55 +12:00
James Newton-King 73e4d55d7b
Check dispatcher services registered (#610) 2018-07-14 18:20:42 +12:00
Ryan Nowak 9e114b547d
Introduce RoutePattern (#585)
* Introduce RoutePattern

Introduces RoutePattern - a new parser and representation for routing
templates, defaults, and constraints.

This is a new representation for all of the 'inputs' to routing that is
immutable and captures 'out of line' information for defaults and
constraints.

This will allow us to unify the handling of constraints and values from
attribute style routes and conventional style routes.
2018-07-13 18:01:46 -07:00
Kiran Challa 42708bec91 Added support for route constraints in Dispatcher world 2018-07-13 14:18:54 -07:00
Kiran Challa 1c7f53ae39 Fix TemplateBinder to consider null and empty string values the same 2018-07-13 10:21:55 -07:00
Ryan Nowak 7209cab5e9
Productize JumpTable (#594)
* Productize JumpTable
2018-07-12 23:28:51 -07:00
James Newton-King 0cf972cc43
Error message on no dispatcher middleware in endpoint middleware (#600) 2018-07-13 10:16:21 +12:00
Kiran Challa 3a022107dc Revert "Added support for route constraints in Dispatcher world"
This reverts commit 85e92ab3cc.
2018-07-12 06:24:37 -07:00
Nate McMaster 85e92ab3cc Added support for route constraints in Dispatcher world 2018-07-12 05:06:22 -07:00
Ryan Nowak 576c14a1b5 Remove InstructionMatcher 2018-07-11 23:47:57 -07:00
Kiran Challa 9c23ffb215 Added tests for verifying the effects of change made to empty string hashcode from netcoreapp2.0 to 2.1 2018-07-09 13:11:03 -07:00
Kiran Challa 1009705283 Added a RouteValuesBasedEndpointFinder 2018-06-28 10:53:10 -07:00
Ryan Nowak 30fcfb65ea Productionize Path tokenization 2018-06-21 17:13:03 -07:00
James Newton-King 6efd679ce3
Fix TreeMatcher with route constraints (#576) 2018-06-22 10:33:44 +12:00
Ryan Nowak db95a8c624 Add more matcher tests
This is a code dump of existing tests for TemplateMatcher and TreeRouter
converted to the format of matcher conformance tests.

Note that most of the new tests aren't yet supported by our experimental
matchers, which don't support many of these advanced features.
2018-06-20 10:39:53 -07:00
Ryan Nowak 5b8db03a57 Fixing up a few small issues
The instruction matcher was missing a few details, which made it faster
than it should have been. Right now I'm trying to keep the design of
these in sync. Once I fixed that it exposed a legitimate bug that was
blocking the github benchmark.
2018-06-15 18:04:43 -07:00
Ryan Nowak 00e99dbbb2 Flesh out experimental matchers
This change improves this area a bit by consolidating the matcher
implementations between the benchmarks project and the conformance
tests.

Additionally I split the minimal matcher into a really trivial
implementation for the simple tests and a more complex one for the
larger tests. This allows us to keep the plaintext/techempower scenario
in sight while also having a good baseline for the more sophisticated
tests.

Also starting to add tests that verify that matchers behave as expected.

The matchers now successfully execute all of these benchmarks, which
means that they support literals and parameters.

Missing features:
- complex segments
- catchall
- default values
- optional parameters
- constraints
- complex segments with file extensions

This is a good place to iterate a bit more of perf and try to make a
decision about what we want to implement.
2018-06-15 15:43:50 -07:00
Kiran Challa d3ddc1709a Added initial support for link generation when using Dispatcher 2018-06-14 15:31:30 -07:00
James Newton-King 9efa7665c9
Fix endpoint constraint cache (#555) 2018-06-13 16:40:06 +12:00
James Newton-King 28d1bc4fa2
Fix TreeMatcher's use of EndpointSelector (#551) 2018-06-12 15:47:34 +12:00
James Newton-King 84bc8351c9
Initial endpoint constraints functionality (#548) 2018-06-12 09:43:17 +12:00
Ryan Nowak 08f12f2bfd Add sample matcher tests 2018-06-09 13:29:06 -07:00
James Newton-King 1b470f3d3b
Fix Endpoint order in TreeMatcher (#542) 2018-06-08 16:19:56 +12:00
James Newton-King 21f8ce5e95
Initial DispatcherMiddleware tests (#529) 2018-06-07 21:47:06 +12:00
kishan.anem acea87a617 IUrlHelper and support for RouteOptions.LowercaseUrls
changes are made as suggestions.
@rynowak
#518
#Issue:  aspnet/Mvc#7720
2018-05-31 20:07:01 -07:00
kishan.anem cb77c17cf4 TestCase added and IUrlHelper and support for RouteOptions.LowercaseUrls
checked appliesd to the query string.
@rynowak
#518
#Issue:  aspnet/Mvc#7720
2018-05-31 20:07:01 -07:00
Kiran Challa 39f7420c4d Fixed routing test 2018-04-13 11:51:45 -07:00
= 7113e54267 Update usage of TestSink 2018-04-12 16:17:04 -07:00