Use abuse status instead of dev/prod for graphql abuse check
This commit is contained in:
parent
c23cca950a
commit
db49e962f4
2 changed files with 3 additions and 3 deletions
|
@ -137,7 +137,7 @@ function execute(
|
||||||
$flags = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE;
|
$flags = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE;
|
||||||
$validations = GraphQL::getStandardValidationRules();
|
$validations = GraphQL::getStandardValidationRules();
|
||||||
|
|
||||||
if (App::isProduction()) {
|
if (App::getEnv('_APP_OPTIONS_ABUSE', 'enabled') !== 'disabled') {
|
||||||
$validations[] = new DisableIntrospection();
|
$validations[] = new DisableIntrospection();
|
||||||
$validations[] = new QueryComplexity($maxComplexity);
|
$validations[] = new QueryComplexity($maxComplexity);
|
||||||
$validations[] = new QueryDepth($maxDepth);
|
$validations[] = new QueryDepth($maxDepth);
|
||||||
|
|
|
@ -20,8 +20,8 @@ class AbuseTest extends Scope
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
if (App::isDevelopment()) {
|
if (App::getEnv('_APP_OPTIONS_ABUSE') === 'disabled') {
|
||||||
$this->markTestSkipped('Skipping abuse test in development environment');
|
$this->markTestSkipped('Abuse is not enabled.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue