Skip to content

Commit

Permalink
chore: rename _iast._util to _iast._utils (#6719)
Browse files Browse the repository at this point in the history
Typo, rename `ddtrace.appsec._iast._util` to
`ddtrace.appsec._iast._utils`


## Checklist

- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
  • Loading branch information
avara1986 authored Aug 23, 2023
1 parent 480b917 commit a658fb9
Show file tree
Hide file tree
Showing 29 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion ddtrace/appsec/_asm_request_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ddtrace.appsec import handlers
from ddtrace.appsec._constants import SPAN_DATA_NAMES
from ddtrace.appsec._constants import WAF_CONTEXT_NAMES
from ddtrace.appsec.iast._util import _is_iast_enabled
from ddtrace.appsec.iast._utils import _is_iast_enabled
from ddtrace.internal import core
from ddtrace.internal.compat import parse
from ddtrace.internal.constants import REQUEST_PATH_PARAMS
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/appsec/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ddtrace import config
from ddtrace.appsec.iast._patch import if_iast_taint_returned_object_for
from ddtrace.appsec.iast._patch import if_iast_taint_yield_tuple_for
from ddtrace.appsec.iast._util import _is_iast_enabled
from ddtrace.appsec.iast._utils import _is_iast_enabled
from ddtrace.contrib import trace_utils
from ddtrace.internal import core
from ddtrace.internal.logger import get_logger
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/appsec/iast/_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from ddtrace.internal.logger import get_logger

from ._ast.ast_patching import astpatch_module
from ._util import _is_iast_enabled
from ._utils import _is_iast_enabled


log = get_logger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/appsec/iast/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
from typing import TYPE_CHECKING

from ddtrace.appsec.iast._util import _is_iast_enabled
from ddtrace.appsec.iast._utils import _is_iast_enabled
from ddtrace.internal.logger import get_logger
from ddtrace.vendor.wrapt import FunctionWrapper
from ddtrace.vendor.wrapt import resolve_path
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/appsec/iast/_taint_tracking/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import TYPE_CHECKING

from ddtrace.appsec.iast._metrics import _set_metric_iast_executed_source
from ddtrace.appsec.iast._util import _is_python_version_supported
from ddtrace.appsec.iast._utils import _is_python_version_supported


if _is_python_version_supported():
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ddtrace/appsec/iast/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ddtrace.appsec._constants import IAST
from ddtrace.appsec.iast import oce
from ddtrace.appsec.iast._metrics import _set_metric_iast_request_tainted
from ddtrace.appsec.iast._util import _is_iast_enabled
from ddtrace.appsec.iast._utils import _is_iast_enabled
from ddtrace.appsec.trace_utils import _asm_manual_keep
from ddtrace.constants import ORIGIN_KEY
from ddtrace.ext import SpanTypes
Expand Down
6 changes: 3 additions & 3 deletions ddtrace/appsec/iast/taint_sinks/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from ddtrace.appsec.iast import oce
from ddtrace.appsec.iast._metrics import _set_metric_iast_executed_sink
from ddtrace.appsec.iast._overhead_control_engine import Operation
from ddtrace.appsec.iast._util import _has_to_scrub
from ddtrace.appsec.iast._util import _is_evidence_value_parts
from ddtrace.appsec.iast._util import _scrub
from ddtrace.appsec.iast._utils import _has_to_scrub
from ddtrace.appsec.iast._utils import _is_evidence_value_parts
from ddtrace.appsec.iast._utils import _scrub
from ddtrace.appsec.iast.reporter import Evidence
from ddtrace.appsec.iast.reporter import IastSpanReporter
from ddtrace.appsec.iast.reporter import Location
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/appsec/iast/taint_sinks/sql_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from ddtrace.appsec.iast import oce
from ddtrace.appsec.iast._taint_tracking import taint_ranges_as_evidence_info
from ddtrace.appsec.iast._util import _scrub_get_tokens_positions
from ddtrace.appsec.iast._utils import _scrub_get_tokens_positions
from ddtrace.appsec.iast.constants import EVIDENCE_SQL_INJECTION
from ddtrace.appsec.iast.constants import VULN_SQL_INJECTION
from ddtrace.appsec.iast.taint_sinks._base import VulnerabilityBase
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/bootstrap/sitecustomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def _(threading):

if asbool(os.getenv("DD_IAST_ENABLED", False)):

from ddtrace.appsec.iast._util import _is_python_version_supported
from ddtrace.appsec.iast._utils import _is_python_version_supported

if _is_python_version_supported():

Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/dbapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import six

from ddtrace import config
from ddtrace.appsec.iast._util import _is_iast_enabled
from ddtrace.appsec.iast._utils import _is_iast_enabled
from ddtrace.internal.constants import COMPONENT

from ...constants import ANALYTICS_SAMPLE_RATE_KEY
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/dbapi_async/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ddtrace import config
from ddtrace.appsec.iast._util import _is_iast_enabled
from ddtrace.appsec.iast._utils import _is_iast_enabled
from ddtrace.internal.constants import COMPONENT

from ...constants import ANALYTICS_SAMPLE_RATE_KEY
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/trace_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def set_http_meta(
span.set_tag_str(http.RETRIES_REMAIN, str(retries_remain))

if config._appsec_enabled:
from ddtrace.appsec.iast._util import _is_iast_enabled
from ddtrace.appsec.iast._utils import _is_iast_enabled

if _is_iast_enabled():
from ddtrace.appsec.iast.taint_sinks.insecure_cookie import asm_check_cookies
Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/aspects/test_encode_decode_aspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ddtrace.appsec.iast._taint_tracking import OriginType
from ddtrace.appsec.iast._taint_tracking import contexts_reset
from ddtrace.appsec.iast._taint_tracking import create_context
from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
except (ImportError, AttributeError):
pytest.skip("IAST not supported for this Python version", allow_module_level=True)

Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/ast/test_ast_patching.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
import pytest

from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast


try:
Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

from ddtrace.appsec.iast import oce
from ddtrace.appsec.iast._util import _is_python_version_supported
from ddtrace.appsec.iast._utils import _is_python_version_supported
from ddtrace.appsec.iast.taint_sinks._base import VulnerabilityBase
from ddtrace.appsec.iast.taint_sinks.path_traversal import patch as path_traversal_patch
from ddtrace.appsec.iast.taint_sinks.weak_cipher import patch as weak_cipher_patch
Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/taint_tracking/test_taint_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ddtrace.appsec.iast._taint_tracking import taint_pyobject
from ddtrace.appsec.iast._taint_tracking import taint_ranges_as_evidence_info
from ddtrace.appsec.iast._taint_tracking.aspects import add_aspect
from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
except (ImportError, AttributeError):
pytest.skip("IAST not supported for this Python version", allow_module_level=True)

Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/test_env_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from six import PY2

from ddtrace.appsec.iast._util import _is_python_version_supported
from ddtrace.appsec.iast._utils import _is_python_version_supported


def _run_python_file(*args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/test_json_tainting.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ddtrace.appsec.iast._taint_utils import LazyTaintDict
from ddtrace.appsec.iast._taint_utils import LazyTaintList
from ddtrace.appsec.iast._taint_utils import _is_tainted_struct
from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
except (ImportError, AttributeError):
pytest.skip("IAST not supported for this Python version", allow_module_level=True)

Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/test_path_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
from tests.appsec.iast.aspects.conftest import _iast_patched_module


Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from ddtrace.appsec._constants import IAST
from ddtrace.appsec.iast._patch_modules import patch_iast
from ddtrace.appsec.iast._util import _is_python_version_supported
from ddtrace.appsec.iast._utils import _is_python_version_supported
from ddtrace.constants import SAMPLING_PRIORITY_KEY
from ddtrace.constants import USER_KEEP
from ddtrace.ext import SpanTypes
Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/test_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from ddtrace.appsec._constants import IAST
from ddtrace.appsec.iast import oce
from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast.reporter import Evidence
from ddtrace.appsec.iast.reporter import IastSpanReporter
from ddtrace.appsec.iast.reporter import Location
Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/test_taint_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ddtrace.appsec.iast._taint_tracking import taint_pyobject
from ddtrace.appsec.iast._taint_tracking import taint_ranges_as_evidence_info
from ddtrace.appsec.iast._taint_tracking.aspects import add_aspect
from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
except (ImportError, AttributeError):
pytest.skip("IAST not supported for this Python version", allow_module_level=True)

Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/test_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ddtrace.appsec.iast._patch_modules import patch_iast
from ddtrace.appsec.iast._taint_tracking import OriginType
from ddtrace.appsec.iast._taint_tracking import taint_pyobject
from ddtrace.appsec.iast._util import _is_python_version_supported
from ddtrace.appsec.iast._utils import _is_python_version_supported
from ddtrace.ext import SpanTypes
from ddtrace.internal.telemetry.constants import TELEMETRY_NAMESPACE_TAG_IAST
from ddtrace.internal.telemetry.constants import TELEMETRY_TYPE_GENERATE_METRICS
Expand Down
2 changes: 1 addition & 1 deletion tests/appsec/iast/test_weak_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

from ddtrace.appsec._constants import IAST
from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast.constants import VULN_INSECURE_HASHING_TYPE
from ddtrace.appsec.iast.taint_sinks.weak_hash import unpatch_iast
from ddtrace.internal import core
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/dbapi/test_dbapi_appsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from ddtrace import Pin
from ddtrace.appsec.iast import oce
from ddtrace.appsec.iast._util import _is_python_version_supported
from ddtrace.appsec.iast._utils import _is_python_version_supported
from ddtrace.contrib.dbapi import TracedCursor
from ddtrace.settings import Config
from ddtrace.settings.integration import IntegrationConfig
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/django/django_app/appsec_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from ddtrace import tracer
from ddtrace.appsec import _asm_request_context
from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.trace_utils import block_request_if_user_blocked


Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/django/test_django_appsec_iast.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ddtrace.appsec._constants import IAST
from ddtrace.appsec.iast import oce
from ddtrace.appsec.iast._patch_modules import patch_iast
from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
from ddtrace.internal.compat import urlencode
from tests.appsec.iast.iast_utils import get_line_and_hash
from tests.utils import override_global_config
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/flask/test_flask_appsec_iast.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from ddtrace.appsec._constants import IAST
from ddtrace.appsec.iast import oce
from ddtrace.appsec.iast._util import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast._utils import _is_python_version_supported as python_supported_by_iast
from ddtrace.appsec.iast.constants import VULN_SQL_INJECTION
from ddtrace.contrib.sqlite3.patch import patch
from tests.appsec.iast.iast_utils import get_line_and_hash
Expand Down

0 comments on commit a658fb9

Please sign in to comment.