-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to disable http.route in symfony
- Loading branch information
1 parent
7010b37
commit 04884ce
Showing
6 changed files
with
105 additions
and
81 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
|
@@ -6,7 +6,6 @@ import com.datadog.appsec.php.docker.InspectContainerHelper | |
import com.datadog.appsec.php.model.Span | ||
import com.datadog.appsec.php.model.Trace | ||
import org.junit.jupiter.api.MethodOrderer | ||
import org.junit.jupiter.api.Order | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.TestMethodOrder | ||
import org.junit.jupiter.api.condition.EnabledIf | ||
|
@@ -45,12 +44,6 @@ class Symfony62Tests { | |
www: 'symfony62', | ||
) | ||
|
||
@Test | ||
@Order(1) | ||
void 'reported telemetry integrations are not repeated'() { | ||
|
||
} | ||
|
||
@Test | ||
void 'login success automated event'() { | ||
//The user [email protected] is already on the DB | ||
|
@@ -115,4 +108,30 @@ class Symfony62Tests { | |
assert span.meta."appsec.blocked" == "true" | ||
assert span.meta."http.route" == '/dynamic-path/{param01}' | ||
} | ||
|
||
@Test | ||
void 'symfony http route disabled'() { | ||
try { | ||
def res = CONTAINER.execInContainer( | ||
'bash', '-c', | ||
'''echo export DD_TRACE_SYMFONY_HTTP_ROUTE=false >> /etc/apache2/envvars; | ||
service apache2 restart''') | ||
assert res.exitCode == 0 | ||
|
||
HttpRequest req = container.buildReq('/dynamic-path/someValue').GET().build() | ||
def trace = container.traceFromRequest(req, ofString()) { HttpResponse<String> re -> | ||
assert re.statusCode() == 200 | ||
assert re.body().contains('Hi someValue!') | ||
} | ||
|
||
Span span = trace.first() | ||
assert span.meta."http.route" != '/dynamic-path/{param01}' | ||
} finally { | ||
def res = CONTAINER.execInContainer( | ||
'bash', '-c', | ||
'''sed -i '/export DD_TRACE_SYMFONY_HTTP_ROUTE=/d' /etc/apache2/envvars; | ||
service apache2 restart''') | ||
assert res.exitCode == 0 | ||
} | ||
} | ||
} |
This file contains 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 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