mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Fix caa records inheritance
This commit is contained in:
parent
7f690a1048
commit
dade82706a
1 changed files with 11 additions and 2 deletions
|
|
@ -65,9 +65,18 @@ class DNS extends Validator
|
|||
}
|
||||
|
||||
if (empty($query)) {
|
||||
// No CAA records means anyone can issue certificate
|
||||
// CAA records inherit from parent (custom CAA behaviour)
|
||||
if ($this->type === self::RECORD_CAA) {
|
||||
return true;
|
||||
if (\substr_count($value, ".") === 1) {
|
||||
return true; // No CAA on apex domain means anyone can issue certificate
|
||||
}
|
||||
|
||||
// Recursive validation by parent domain
|
||||
$parts = \explode('.', $value);
|
||||
\array_shift($parts);
|
||||
$parentDomain = \implode('.', $parts);
|
||||
$validator = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA);
|
||||
return $validator->isValid($parentDomain);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue