refactor(config): reorganize schemas and normalize firewall behavior shape#439
Open
jcbsfilho wants to merge 9 commits into
Open
refactor(config): reorganize schemas and normalize firewall behavior shape#439jcbsfilho wants to merge 9 commits into
jcbsfilho wants to merge 9 commits into
Conversation
…shape
- move schema files from helpers/ to a dedicated schemas/ directory
and extract the firewall schema into its own module (firewall/behaviors,
firewall/functionsInstances).
- replace the property-per-behavior pattern ({ deny: true },
{ runFunction: ... }, { setWafRuleset: {...} }) with a uniform
{ type, attributes } shape across firewall behaviors, aligning the
config contract with the API representation.
…inated union shape
…te docs - rename the WAF behavior type from `set_waf_ruleset` to `set_waf` across schema, strategy, constants, types, tests, and README. Also rename the `wafMode` attribute to `mode` in the set_waf schema to align with the API field naming convention.
Contributor
SCC Complexity Analysis
|
commit: |
Contributor
SCC Complexity Analysis
|
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.
This pull request refactors the configuration package to reorganize and normalize how firewall behaviors are defined and processed. The main changes include moving schema files to a dedicated directory, splitting monolithic schemas, and introducing a new, more explicit structure for firewall rule behaviors. The documentation and example configurations have been updated accordingly, and tests have been adjusted to match the new structure.
Schema and Structure Refactoring
helpers/to a newschemas/directory and split the monolithic schema into feature-specific modules for better maintainability. (.changeset/free-ravens-jump.md.changeset/free-ravens-jump.mdR1-R9)index.tspackages/config/src/configProcessor/converterJsonConfig/index.tsL2-R3)Firewall Behavior API Redesign
behaviorobject to abehaviorsarray, where each behavior is now an object with atypefield and, where applicable, anattributesfield. This makes the API more explicit and extensible. (README.md[1] [2]setWafRulesetbehavior toset_wafand updated its shape and documentation for clarity. (README.md[1].changeset/free-ravens-jump.md[2]Example Configurations and Tests
behaviorsarray and discriminated union structure, replacing legacy keys likedeny: truewith{ type: 'deny' }, and so on for all behaviors.Processor Logic Update
deny,drop, orset_custom_response) using the new structure, ensuring they cannot be combined with other behaviors. (firewallProcessConfigStrategy.tspackages/config/src/configProcessor/processStrategy/implementations/secure/firewallProcessConfigStrategy.tsL109-R114)Dependency Updates
package.jsonpackages/config/package.jsonL45-R47)