mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix: emit Project.wafEnabled for SDK 27 migration client (#13293)
appwrite/appwrite 27.1.0 declares wafEnabled as a required, non-nullable
property on Models\Project, so deserialising a project the server does not
send it for throws "Missing required field". The migration source adapter
reads projects through that SDK, which takes out eight
MigrationsConsoleClientTest cases.
Add the rule and coerce the attribute so the field is always present.
Cherry-picked from 2f152910c9 on feat-query-lib, where it is currently
stranded behind #11649.
Co-authored-by: Jake Barnby <jakeb994@gmail.com>
This commit is contained in:
1 parent
6f9bdf1239
commit
eeeaba89cc
1 file changed
+7
@@ -199,6 +199,12 @@ class Project extends Model
|
||||
'default' => '',
|
||||
'example' => self::TYPE_DATETIME_EXAMPLE,
|
||||
])
|
||||
->addRule('wafEnabled', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Whether WAF enforcement is enabled for the project.',
|
||||
'default' => false,
|
||||
'example' => false,
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
@@ -234,6 +240,7 @@ class Project extends Model
|
||||
$this->expandProtocols($document);
|
||||
$this->expandAuthMethods($document);
|
||||
$this->expandConsoleAccessedAt($document);
|
||||
$document->setAttribute('wafEnabled', (bool) $document->getAttribute('wafEnabled', false));
|
||||
|
||||
return $document;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user