-
Notifications
You must be signed in to change notification settings - Fork 489
chore(aap): remove waf_mockup + prevent concurrent access to ASM_Environment after finalization #16670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gh-worker-dd-mergequeue-cf854d
merged 19 commits into
main
from
christophe-papazian/improve_waf_interface
Mar 2, 2026
Merged
chore(aap): remove waf_mockup + prevent concurrent access to ASM_Environment after finalization #16670
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
92210f5
improvements
christophe-papazian 6251076
Merge remote-tracking branch 'origin/main' into christophe-papazian/i…
christophe-papazian c9b8e45
fix test
christophe-papazian 0aaa4d8
fix
christophe-papazian 926c642
Merge remote-tracking branch 'origin/main' into christophe-papazian/i…
christophe-papazian b4087e5
fixing tests
christophe-papazian 6ef1d3c
Merge remote-tracking branch 'origin/main' into christophe-papazian/i…
christophe-papazian adbd4bf
fix apisec
christophe-papazian 6dbd472
lint
christophe-papazian deec5c1
fix response body analysis
christophe-papazian 7fb5eca
remove print
christophe-papazian a76cfc4
fix api sec tests
christophe-papazian 5e8dc1b
improve missing waf case
christophe-papazian c025caf
lint & type
christophe-papazian 3b23ebb
florentin remarks
christophe-papazian 5e9d68f
Merge remote-tracking branch 'origin/main' into christophe-papazian/i…
christophe-papazian e51f390
fixing typing
christophe-papazian cb1ccd7
Merge remote-tracking branch 'origin/main' into christophe-papazian/i…
christophe-papazian b1f0320
Merge branch 'main' into christophe-papazian/improve_waf_interface
christophe-papazian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,28 @@ | ||
| from typing import Optional | ||
|
|
||
| from ddtrace.appsec._ddwaf.waf_stubs import WAF | ||
| from ddtrace.appsec._ddwaf.waf_stubs import DDWafRulesType | ||
| from ddtrace.appsec._utils import DDWaf_info | ||
| from ddtrace.appsec._utils import DDWaf_result | ||
| from ddtrace.internal.logger import get_logger | ||
| from ddtrace.internal.settings.asm import config as asm_config | ||
|
|
||
|
|
||
| __all__ = ["DDWaf", "DDWaf_info", "DDWaf_result", "version", "DDWafRulesType"] | ||
| __all__ = ["WAF", "DDWaf_info", "DDWaf_result", "version", "DDWafRulesType"] | ||
|
|
||
| LOGGER = get_logger(__name__) | ||
|
|
||
| _DDWAF_LOADED: bool = False | ||
| version: str = "unloaded" | ||
|
|
||
|
|
||
| if asm_config._asm_libddwaf_available: | ||
| def waf_module() -> Optional[type[WAF]]: | ||
| try: | ||
| import ddtrace.appsec._ddwaf.waf as waf_module | ||
|
|
||
| global _DDWAF_LOADED, version | ||
| _DDWAF_LOADED = True | ||
| version = waf_module.version() | ||
| return waf_module.DDWaf | ||
| except Exception: | ||
| import ddtrace.appsec._ddwaf.waf_mock as waf_module # type: ignore[no-redef] | ||
|
|
||
| LOGGER.warning("DDWaf features disabled. WARNING: Dynamic Library not loaded", exc_info=True) | ||
| else: | ||
| import ddtrace.appsec._ddwaf.waf_mock as waf_module # type: ignore[no-redef] | ||
|
|
||
| DDWaf: type[WAF] = waf_module.DDWaf | ||
| version = waf_module.version | ||
| return None |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.