mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge pull request #11262 from appwrite/chore-remove-auth-skip-from-workers
chore: remove auth skip from workers
This commit is contained in:
@@ -153,11 +153,11 @@ class Certificates extends Action
|
||||
): void {
|
||||
// Get rule
|
||||
$rule = System::getEnv('_APP_RULES_FORMAT') === 'md5'
|
||||
? $authorization->skip(fn () => $dbForPlatform->getDocument('rules', md5($domain->get())))
|
||||
: $authorization->skip(fn () => $dbForPlatform->findOne('rules', [
|
||||
? $dbForPlatform->getDocument('rules', md5($domain->get()))
|
||||
: $dbForPlatform->findOne('rules', [
|
||||
Query::equal('domain', [$domain->get()]),
|
||||
Query::limit(1),
|
||||
]));
|
||||
]);
|
||||
|
||||
// Skip if rule is not desired state (created but not verified yet).
|
||||
if ($rule->getAttribute('status', '') !== RULE_STATUS_CREATED) {
|
||||
@@ -269,11 +269,11 @@ class Certificates extends Action
|
||||
// Get rule document for domain
|
||||
// TODO: (@Meldiron) Remove after 1.7.x migration
|
||||
$rule = System::getEnv('_APP_RULES_FORMAT') === 'md5'
|
||||
? $authorization->skip(fn () => $dbForPlatform->getDocument('rules', md5($domain->get())))
|
||||
: $authorization->skip(fn () => $dbForPlatform->findOne('rules', [
|
||||
? $dbForPlatform->getDocument('rules', md5($domain->get()))
|
||||
: $dbForPlatform->findOne('rules', [
|
||||
Query::equal('domain', [$domain->get()]),
|
||||
Query::limit(1),
|
||||
]));
|
||||
]);
|
||||
|
||||
// Rule not found (or) not in the expected state
|
||||
if ($rule->isEmpty() || !\in_array($rule->getAttribute('status'), [RULE_STATUS_CERTIFICATE_GENERATING, RULE_STATUS_VERIFIED])) {
|
||||
|
||||
@@ -493,7 +493,7 @@ class Migrations extends Action
|
||||
throw new \Exception('User ' . $userInternalId . ' not found');
|
||||
}
|
||||
|
||||
$bucket = $authorization->skip(fn () => $this->dbForPlatform->getDocument('buckets', $bucketId));
|
||||
$bucket = $this->dbForPlatform->getDocument('buckets', $bucketId);
|
||||
if ($bucket->isEmpty()) {
|
||||
throw new \Exception('Bucket not found');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user