Repository: corazawaf/coraza
Pull request #508 (2022-11-19 07:33:02)

Expose AddArgument on tx interface
> Thank you for contributing to Coraza WAF, your effort is greatly appreciated
> Before submitting check if what you want to add to `coraza` list meets [quality standards](https://github.com/corazawaf/coraza/blob/master/CONTRIBUTING.md#quality-standards) before sending pull request. Thanks!
Exposing the  AddArgument function allows the control of the arguments evaluated in a transaction.
Especially for custom protocols/library usage where it may not be possible for Coraza to get the raw body to parse. Having the add argument provides a way to add the arguments manually and still retail the behavior.

**Make sure that you've checked the boxes below before you submit PR:**

- [x] My code includes positive and negative tests.
- [x] I have an appropriate description with correct grammar.
- [x] I have read [Contribution guidelines](https://github.com/corazawaf/coraza/blob/master/CONTRIBUTING.md#contribution-guidelines), [maintainers note](https://github.com/corazawaf/coraza/blob/master/CONTRIBUTING.md#maintainers) and [Quality standard](https://github.com/github.com/corazawaf/coraza/v3sso/coraza-waf/blob/master/CONTRIBUTING.md#quality-standards).
- [x] My code is properly linted and passes pre-commit tests.

Thanks for your contribution :heart:

codecov-commenter: # [Codecov](https://codecov.io/gh/corazawaf/coraza/pull/508?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf) Report
Base: **78.04**% // Head: **78.04**% // No change to project coverage :thumbsup:
> Coverage data is based on head [(`eee19c8`)](https://codecov.io/gh/corazawaf/coraza/pull/508?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf) compared to base [(`128e9a3`)](https://codecov.io/gh/corazawaf/coraza/commit/128e9a3fe2fd615ccf282968ac206e723ca08432?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf).
> Patch has no changes to coverable lines.

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##           v3/dev     #508   +/-   ##
=======================================
  Coverage   78.04%   78.04%           
=======================================
  Files         145      145           
  Lines        6861     6861           
=======================================
  Hits         5355     5355           
  Misses       1268     1268           
  Partials      238      238           
```

| Flag | Coverage Δ | |
|---|---|---|
| default | `73.30% <ø> (ø)` | |
| examples | `27.20% <ø> (ø)` | |
| ftw | `55.54% <ø> (ø)` | |
| tinygo | `71.37% <ø> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf#carryforward-flags-in-the-pull-request-comment) to find out more.


Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf)

</details>

[:umbrella: View full report at Codecov](https://codecov.io/gh/corazawaf/coraza/pull/508?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corazawaf).

sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=coraza&pullRequest=508)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [82 Code Smells](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL)

[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list)  
[![0.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.1%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list) [0.1% Duplication](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list)


jptosso: Shall we use three methods, for get, post, response? Or we could use constants 
jcchavezs: I'd rather have an enum (aka constants) for the first argument and
definitively not call it orig but method or something like that instead.

On Sun, 20 Nov 2022, 01:05 Juan Pablo Tosso, ***@***.***>
wrote:

> Shall we use three methods, for get, post, response? Or we could use
> constants
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/corazawaf/coraza/pull/508#issuecomment-1320996153>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAXOYAXEAUETJURN7OKLZWTWJFTL3ANCNFSM6AAAAAASFFU2LM>
> .
> You are receiving this because your review was requested.Message ID:
> ***@***.***>
>

jptosso: @piyushroshan could you change the variable name to something like variableName or method? Also transform it into a constant int for get, post, and response.
sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=coraza&pullRequest=508)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [82 Code Smells](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL)

[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list)  
[![0.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.1%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list) [0.1% Duplication](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=coraza&pullRequest=508)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [82 Code Smells](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL)

[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list)  
[![0.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.1%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list) [0.1% Duplication](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=coraza&pullRequest=508)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [82 Code Smells](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL)

[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list)  
[![0.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.1%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list) [0.1% Duplication](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=coraza&pullRequest=508)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [82 Code Smells](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL)

[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list)  
[![0.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.1%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list) [0.1% Duplication](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=coraza&pullRequest=508)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=coraza&pullRequest=508&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL) [82 Code Smells](https://sonarcloud.io/project/issues?id=coraza&pullRequest=508&resolved=false&types=CODE_SMELL)

[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_coverage&view=list)  
[![0.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.1%')](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list) [0.1% Duplication](https://sonarcloud.io/component_measures?id=coraza&pullRequest=508&metric=new_duplicated_lines_density&view=list)



Patch:
diff --git a/internal/corazawaf/transaction.go b/internal/corazawaf/transaction.go
index 4191023..82c5a6f 100644
--- a/internal/corazawaf/transaction.go
+++ b/internal/corazawaf/transaction.go
@@ -641,7 +641,7 @@ func (tx *Transaction) ProcessConnection(client string, cPort int, server string
 
 // ExtractArguments transforms an url encoded string to a map and creates
 // ARGS_POST|GET
-func (tx *Transaction) ExtractArguments(orig string, uri string) {
+func (tx *Transaction) ExtractArguments(orig types.ArgumentType, uri string) {
 	data := urlutil.ParseQuery(uri, '&')
 	for k, vs := range data {
 		for _, v := range vs {
@@ -653,13 +653,18 @@ func (tx *Transaction) ExtractArguments(orig string, uri string) {
 // AddArgument Add arguments GET or POST
 // This will set ARGS_(GET|POST), ARGS, ARGS_NAMES, ARGS_COMBINED_SIZE and
 // ARGS_(GET|POST)_NAMES
-func (tx *Transaction) AddArgument(orig string, key string, value string) {
+func (tx *Transaction) AddArgument(argType types.ArgumentType, key string, value string) {
 	// TODO implement ARGS value limit using ArgumentsLimit
 	var vals *collection.Map
-	if orig == "GET" {
+	switch argType {
+	case types.ArgumentGET:
 		vals = tx.variables.argsGet
-	} else {
+	case types.ArgumentPOST:
 		vals = tx.variables.argsPost
+	case types.ArgumentPATH:
+		vals = tx.variables.argsPath
+	default:
+		return
 	}
 	keyl := strings.ToLower(key)
 
@@ -710,7 +715,7 @@ func (tx *Transaction) ProcessURI(uri string, method string, httpVersion string)
 			tx.Variables.RequestUri.Set(uri)
 		*/
 	} else {
-		tx.ExtractArguments("GET", parsedURL.RawQuery)
+		tx.ExtractArguments(types.ArgumentGET, parsedURL.RawQuery)
 		tx.variables.requestURI.Set(parsedURL.String())
 		path = parsedURL.Path
 		query = parsedURL.RawQuery
diff --git a/types/transaction.go b/types/transaction.go
index 0dfd3c0..62f2919 100644
--- a/types/transaction.go
+++ b/types/transaction.go
@@ -7,6 +7,21 @@ import (
 	"io"
 )
 
+// ArgumentType is used to define types of argument for transactions
+// There are three supported types: POST, GET and PATH
+type ArgumentType int
+
+const (
+	// ArgumentInvalid is used to define invalid argument types
+	ArgumentInvalid ArgumentType = iota
+	// ArgumentGET is used to define GET arguments
+	ArgumentGET
+	// ArgumentPOST is used to define POST arguments
+	ArgumentPOST
+	// ArgumentPATH is used to define PATH arguments
+	ArgumentPATH
+)
+
 // Transaction is created from a WAF instance to handle web requests and responses,
 // it contains a copy of most WAF configurations that can be safely changed.
 // Transactions are used to store all data like URLs, request and response
@@ -57,6 +72,13 @@ type Transaction interface {
 	// within the Transaction while also passing it further in an HTTP framework.
 	RequestBodyReader() (io.Reader, error)
 
+	// AddArgument Add arguments GET or POST
+	// This will set ARGS_(GET|POST), ARGS, ARGS_NAMES, ARGS_COMBINED_SIZE and
+	// ARGS_(GET|POST)_NAMES
+	// With this method it is possible to feed Coraza with a GET or POST argument
+	// providing granual control over the arguments.
+	AddArgument(orig ArgumentType, key string, value string)
+
 	// ProcessRequestBody Performs the request body (if any)
 	//
 	// This method perform the analysis on the request body. It is optional to


Test patch:
diff --git a/internal/corazawaf/transaction_test.go b/internal/corazawaf/transaction_test.go
index 8d91e21..c826b71 100644
--- a/internal/corazawaf/transaction_test.go
+++ b/internal/corazawaf/transaction_test.go
@@ -607,6 +607,24 @@ func TestTxProcessConnection(t *testing.T) {
 	}
 }
 
+func TestTxAddArgument(t *testing.T) {
+	waf := NewWAF()
+	tx := waf.NewTransaction()
+	tx.ProcessConnection("127.0.0.1", 80, "127.0.0.2", 8080)
+	tx.AddArgument(types.ArgumentGET, "test", "testvalue")
+	if tx.variables.argsGet.Get("test")[0] != "testvalue" {
+		t.Error("failed to set args get")
+	}
+	tx.AddArgument(types.ArgumentPOST, "ptest", "ptestvalue")
+	if tx.variables.argsPost.Get("ptest")[0] != "ptestvalue" {
+		t.Error("failed to set args post")
+	}
+	tx.AddArgument(types.ArgumentPATH, "ptest2", "ptestvalue")
+	if tx.variables.argsPath.Get("ptest2")[0] != "ptestvalue" {
+		t.Error("failed to set args post")
+	}
+}
+
 func TestTxGetField(t *testing.T) {
 	tx := makeTransaction(t)
 	rvp := ruleVariableParams{
diff --git a/internal/seclang/rules_test.go b/internal/seclang/rules_test.go
index b4094a2..61099eb 100644
--- a/internal/seclang/rules_test.go
+++ b/internal/seclang/rules_test.go
@@ -52,7 +52,7 @@ func TestRuleMatchWithRegex(t *testing.T) {
 		t.Error(err.Error())
 	}
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "id_test", "123")
+	tx.AddArgument(types.ArgumentGET, "id_test", "123")
 	tx.ProcessRequestHeaders()
 	if len(tx.MatchedRules()) != 1 {
 		t.Errorf("failed to match rules with %d", len(tx.MatchedRules()))
@@ -144,8 +144,8 @@ func TestRuleLogging(t *testing.T) {
 		t.Error(err.Error())
 	}
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "test1", "123")
-	tx.AddArgument("GET", "test2", "456")
+	tx.AddArgument(types.ArgumentGET, "test1", "123")
+	tx.AddArgument(types.ArgumentGET, "test2", "456")
 	tx.ProcessRequestHeaders()
 	if len(tx.MatchedRules()) != 3 {
 		t.Errorf("failed to match rules with %d", len(tx.MatchedRules()))
@@ -181,8 +181,8 @@ func TestRuleChains(t *testing.T) {
 		t.Error(err.Error())
 	}
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "test1", "123")
-	tx.AddArgument("GET", "test2", "456")
+	tx.AddArgument(types.ArgumentGET, "test1", "123")
+	tx.AddArgument(types.ArgumentGET, "test2", "456")
 	tx.ProcessRequestHeaders()
 	if len(tx.MatchedRules()) != 1 {
 		t.Errorf("failed to match rules with %d matches, expected 1", len(tx.MatchedRules()))
@@ -203,8 +203,8 @@ func TestTagsAreNotPrintedTwice(t *testing.T) {
 		t.Error(err.Error())
 	}
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "test1", "123")
-	tx.AddArgument("GET", "test2", "456")
+	tx.AddArgument(types.ArgumentGET, "test1", "123")
+	tx.AddArgument(types.ArgumentGET, "test2", "456")
 	tx.ProcessRequestHeaders()
 	if len(tx.MatchedRules()) != 1 {
 		t.Errorf("failed to match rules with %d", len(tx.MatchedRules()))
@@ -235,8 +235,8 @@ func TestStatusFromInterruptions(t *testing.T) {
 		t.Error(err.Error())
 	}
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "test1", "123")
-	tx.AddArgument("GET", "test2", "456")
+	tx.AddArgument(types.ArgumentGET, "test1", "123")
+	tx.AddArgument(types.ArgumentGET, "test2", "456")
 	it := tx.ProcessRequestHeaders()
 	if it == nil {
 		t.Error("failed to interrupt")
@@ -273,9 +273,9 @@ func TestLogsAreNotPrintedManyTimes(t *testing.T) {
 		t.Error(err.Error())
 	}
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "test1", "123")
-	tx.AddArgument("GET", "test2", "456")
-	tx.AddArgument("GET", "test2", "789")
+	tx.AddArgument(types.ArgumentGET, "test1", "123")
+	tx.AddArgument(types.ArgumentGET, "test2", "456")
+	tx.AddArgument(types.ArgumentGET, "test2", "789")
 	tx.AddRequestHeader("test", "123")
 	tx.ProcessRequestHeaders()
 	if len(tx.MatchedRules()) != 1 {
@@ -369,7 +369,7 @@ func TestIssue176(t *testing.T) {
 	//		t.Error(err.Error())
 	//	}
 	//	tx = waf.NewTransaction()
-	//	tx.AddArgument("GET", "Test1", "123")
+	//	tx.AddArgument(types.ArgumentGET, "Test1", "123")
 	//	it = tx.ProcessRequestHeaders()
 	//	if it == nil {
 	//		t.Error("failed to test argument case-sensitive")
@@ -382,7 +382,7 @@ func TestIssue176(t *testing.T) {
 	//		t.Error(err.Error())
 	//	}
 	//	tx = waf.NewTransaction()
-	//	tx.AddArgument("GET", "Test2", "123")
+	//	tx.AddArgument(types.ArgumentGET, "Test2", "123")
 	//	it = tx.ProcessRequestHeaders()
 	//	if it != nil {
 	//		t.Error("failed to test argument case-sensitive")
@@ -450,7 +450,7 @@ func TestUnicode(t *testing.T) {
 	}
 
 	tx := waf.NewTransaction()
-	tx.AddArgument("POST", "var", `ハローワールド`)
+	tx.AddArgument(types.ArgumentPOST, "var", `ハローワールド`)
 	it, err := tx.ProcessRequestBody()
 	if err != nil {
 		t.Error(err)
@@ -502,7 +502,7 @@ func Test941310(t *testing.T) {
 	// }
 	//
 	// tx := waf.NewTransaction()
-	// tx.AddArgument("POST", "var", `\\xbcscript\\xbealert(\xa2XSS\xa2)\xbc/script\xbe`)
+	// tx.AddArgument(types.ArgumentPOST, "var", `\\xbcscript\\xbealert(\xa2XSS\xa2)\xbc/script\xbe`)
 	// it, err := tx.ProcessRequestBody()
 	// if err != nil {
 	// 	t.Error(err)
@@ -524,7 +524,7 @@ func TestArgumentNamesCaseSensitive(t *testing.T) {
 	}
 	/*
 		tx := waf.NewTransaction()
-		tx.AddArgument("POST", "Test1", "Xyz")
+		tx.AddArgument(types.ArgumentPOST, "Test1", "Xyz")
 		it, err := tx.ProcessRequestBody()
 		if err != nil {
 			t.Error(err)
@@ -534,7 +534,7 @@ func TestArgumentNamesCaseSensitive(t *testing.T) {
 		}
 
 		tx = waf.NewTransaction()
-		tx.AddArgument("POST", "TEST1", "Xyz")
+		tx.AddArgument(types.ArgumentPOST, "TEST1", "Xyz")
 		it, err = tx.ProcessRequestBody()
 		if err != nil {
 			t.Error(err)
@@ -544,7 +544,7 @@ func TestArgumentNamesCaseSensitive(t *testing.T) {
 		}
 
 		tx = waf.NewTransaction()
-		tx.AddArgument("POST", "test1", "Xyz")
+		tx.AddArgument(types.ArgumentPOST, "test1", "Xyz")
 		it, err = tx.ProcessRequestBody()
 		if err != nil {
 			t.Error(err)
@@ -567,7 +567,7 @@ func TestArgumentsCaseSensitive(t *testing.T) {
 	}
 
 	tx := waf.NewTransaction()
-	tx.AddArgument("POST", "Test1", "Xyz")
+	tx.AddArgument(types.ArgumentPOST, "Test1", "Xyz")
 	it, err := tx.ProcessRequestBody()
 	if err != nil {
 		t.Error(err)
@@ -577,7 +577,7 @@ func TestArgumentsCaseSensitive(t *testing.T) {
 	}
 
 	tx = waf.NewTransaction()
-	tx.AddArgument("POST", "TEST1", "Xyz")
+	tx.AddArgument(types.ArgumentPOST, "TEST1", "Xyz")
 	it, err = tx.ProcessRequestBody()
 	if err != nil {
 		t.Error(err)
@@ -587,7 +587,7 @@ func TestArgumentsCaseSensitive(t *testing.T) {
 	}
 
 	tx = waf.NewTransaction()
-	tx.AddArgument("POST", "test1", "Xyz")
+	tx.AddArgument(types.ArgumentPOST, "test1", "Xyz")
 	it, err = tx.ProcessRequestBody()
 	if err != nil {
 		t.Error(err)
@@ -597,7 +597,7 @@ func TestArgumentsCaseSensitive(t *testing.T) {
 	}
 
 	tx = waf.NewTransaction()
-	tx.AddArgument("POST", "test1", "xyz")
+	tx.AddArgument(types.ArgumentPOST, "test1", "xyz")
 	it, err = tx.ProcessRequestBody()
 	if err != nil {
 		t.Error(err)
@@ -607,7 +607,7 @@ func TestArgumentsCaseSensitive(t *testing.T) {
 	}
 
 	tx = waf.NewTransaction()
-	tx.AddArgument("POST", "test1", "XYZ")
+	tx.AddArgument(types.ArgumentPOST, "test1", "XYZ")
 	it, err = tx.ProcessRequestBody()
 	if err != nil {
 		t.Error(err)
@@ -753,9 +753,9 @@ func TestParameterPollution(t *testing.T) {
 	}
 
 	tx := waf.NewTransaction()
-	tx.AddArgument("POST", "test1", "xyz")
-	tx.AddArgument("POST", "Test1", "Xyz")
-	tx.AddArgument("POST", "TEST1", "XYZ")
+	tx.AddArgument(types.ArgumentPOST, "test1", "xyz")
+	tx.AddArgument(types.ArgumentPOST, "Test1", "Xyz")
+	tx.AddArgument(types.ArgumentPOST, "TEST1", "XYZ")
 	_, err = tx.ProcessRequestBody()
 	if err != nil {
 		t.Error(err)
@@ -772,10 +772,10 @@ func TestParameterPollution(t *testing.T) {
 	}
 
 	tx = waf.NewTransaction()
-	tx.AddArgument("POST", "test1", "xyz")
-	tx.AddArgument("POST", "Test1", "Xyz")
-	tx.AddArgument("POST", "tesT1", "Xyz")
-	tx.AddArgument("POST", "TEST1", "XYZ")
+	tx.AddArgument(types.ArgumentPOST, "test1", "xyz")
+	tx.AddArgument(types.ArgumentPOST, "Test1", "Xyz")
+	tx.AddArgument(types.ArgumentPOST, "tesT1", "Xyz")
+	tx.AddArgument(types.ArgumentPOST, "TEST1", "XYZ")
 	_, err = tx.ProcessRequestBody()
 	if err != nil {
 		t.Error(err)
diff --git a/testing/auditlog_test.go b/testing/auditlog_test.go
index a965575..084b7ec 100644
--- a/testing/auditlog_test.go
+++ b/testing/auditlog_test.go
@@ -18,6 +18,7 @@ import (
 	"github.com/corazawaf/coraza/v3/internal/corazawaf"
 	"github.com/corazawaf/coraza/v3/internal/seclang"
 	"github.com/corazawaf/coraza/v3/loggers"
+	"github.com/corazawaf/coraza/v3/types"
 )
 
 func TestAuditLogMessages(t *testing.T) {
@@ -42,7 +43,7 @@ func TestAuditLogMessages(t *testing.T) {
 	}
 	defer os.Remove(file.Name())
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "test", "test")
+	tx.AddArgument(types.ArgumentGET, "test", "test")
 	tx.ProcessRequestHeaders()
 	al := tx.AuditLog()
 	if len(al.Messages) != 1 {
@@ -91,7 +92,7 @@ func TestAuditLogRelevantOnly(t *testing.T) {
 		t.Error(err)
 	}
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "test", "test")
+	tx.AddArgument(types.ArgumentGET, "test", "test")
 	tx.ProcessRequestHeaders()
 	// now we read file
 	if _, err := file.Seek(0, 0); err != nil {
@@ -128,7 +129,7 @@ func TestAuditLogRelevantOnlyOk(t *testing.T) {
 		t.Error(err)
 	}
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "test", "test")
+	tx.AddArgument(types.ArgumentGET, "test", "test")
 	tx.ProcessRequestHeaders()
 	// now we read file
 	if _, err := file.Seek(0, 0); err != nil {
@@ -165,7 +166,7 @@ func TestAuditLogRelevantOnlyNoAuditlog(t *testing.T) {
 		t.Error(err)
 	}
 	tx := waf.NewTransaction()
-	tx.AddArgument("GET", "test", "test")
+	tx.AddArgument(types.ArgumentGET, "test", "test")
 	tx.ProcessRequestHeaders()
 	// now we read file
 	if _, err := file.Seek(0, 0); err != nil {