feat: endpoints bdd#3276
Open
yenfryherrerafeliz wants to merge 7 commits intoaws:masterfrom
Open
Conversation
- Add BDD-based endpoint resolution alongside the existing tree ruletset evaluator.
- Introduce a Bdd package under EndpointV2 namespace containing utilities
and components used for resolving an endpoint through BDDs.
- Enhance the EndpointDefinitionProvider to resolve the endpoint rule definitions
by giving preference to BDDs "endpoint-bdd-1.json" rules over tree based rules.
- Enhance EndpointProviderV2 to support both, BDD endpoint resolver and Tree
endpoint resolver by also giving preference to BDD resolution.
How is this done:
- The parameter $ruleset now supports instances of BddRuleset, besides of array to preserve existent
behavior, and when an instance of BddReulset is present then a BDD evaluator is instantiated which
later is used to resolve the endpoint.
- Otherwise, if an array or a Ruleset is passed in then we resolve the endpoint
with the tree based endpoint resolution, which is the current behavior.
- Add a new method "getActiveParameters" in EndpointProviderV2 that is used by
the EndpointV2Middleware to get the active parameters, which internally
it just evaluates which rulset instance we should be getting the parameters from,
either from $bddRuleset if not null or the tree ruleset $ruleset.
- Enhance EndpointV2Middleware to consume the new getActiveParameters.
- Add support for templates with `_` and digits `0-9` so that isTemplate and
resolveTemplateString works fine fine over templates with {Test_123}.
- Bdd evaluator coerced condition results with `(bool)`, which treats "" as false,
while the tree evaluator only treats null or stric false as failure (per the rules-engine spec).
- Fix split to treat limit=0 as "unlimited" per the smithy standard library spec.
ab235c8 to
08035be
Compare
stobrien89
requested changes
Apr 29, 2026
Member
stobrien89
left a comment
There was a problem hiding this comment.
Looking good overall, just some comments on small stuff.
- Remove unncessary check for nodesCount - Remove unnecessary method `getEndpointDefinition` from EndpointDefinitionProvider since `getParsedRuleset` serves the same purpose. - Remove extra semicolons. - Remove unncessary tests. - Enhanced test to make sure `endpoint-rule-set-1.json` is used when bdd file is not present. -
- Add early string checks before regex in isTemplate() to avoid unnecessary pattern matching - Replace call_user_func_array with direct switch statement in callFunction() for common functions - Optimize parseArn() by using strncmp, removing intermediate variables, and simplifying empty checks - Remove unnecessary whitespace in RulesetStandardLibrary Co-authored-by: Michael Dowling
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of changes:
and components used for resolving an endpoint through BDDs.
by giving preference to BDDs "endpoint-bdd-1.json" rules over tree based rules.
endpoint resolver by also giving preference to BDD resolution.
How is this done:
behavior, and when an instance of BddReulset is present then a BDD evaluator is instantiated which
later is used to resolve the endpoint.
with the tree based endpoint resolution, which is the current behavior.
the EndpointV2Middleware to get the active parameters, which internally
it just evaluates which rulset instance we should be getting the parameters from,
either from $bddRuleset if not null or the tree ruleset $ruleset.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.