mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
feat: update proxy and certificates files
This commit is contained in:
@@ -329,7 +329,7 @@ App::post('/v1/functions')
|
||||
$routeSubdomain = ID::unique();
|
||||
$domain = "{$routeSubdomain}.{$functionsDomain}";
|
||||
// TODO: @christyjacob remove once we migrate the rules in 1.7.x
|
||||
$ruleId = version_compare(APP_VERSION_STABLE, '1.7.0', '<') ? ID::unique() : md5($domain);
|
||||
$ruleId = System::getEnv('_APP_RULES_FORMAT', null) === 'md5' ? md5($domain) : ID::unique();
|
||||
|
||||
$rule = Authorization::skip(
|
||||
fn () => $dbForConsole->createDocument('rules', new Document([
|
||||
|
||||
@@ -61,13 +61,12 @@ App::post('/v1/proxy/rules')
|
||||
}
|
||||
|
||||
// TODO: @christyjacob remove once we migrate the rules in 1.7.x
|
||||
if (version_compare(APP_VERSION_STABLE, '1.7.0', '<')) {
|
||||
if (System::getEnv('_APP_RULES_FORMAT', null) === 'md5') {
|
||||
$document = $dbForConsole->getDocument('rules', md5($domain));
|
||||
} else {
|
||||
$document = $dbForConsole->findOne('rules', [
|
||||
Query::equal('domain', [$domain]),
|
||||
]);
|
||||
} else {
|
||||
$ruleId = md5($domain);
|
||||
$document = $dbForConsole->getDocument('rules', $ruleId);
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +110,7 @@ App::post('/v1/proxy/rules')
|
||||
}
|
||||
|
||||
// TODO: @christyjacob remove once we migrate the rules in 1.7.x
|
||||
$ruleId = version_compare(APP_VERSION_STABLE, '1.7.0', '<') ? ID::unique() : md5($domain->get());
|
||||
$ruleId = System::getEnv('_APP_RULES_FORMAT', null) === 'md5' ? md5($domain->get()) : ID::unique();
|
||||
|
||||
$rule = new Document([
|
||||
'$id' => $ruleId,
|
||||
|
||||
@@ -340,12 +340,12 @@ class Certificates extends Action
|
||||
private function updateDomainDocuments(string $certificateId, string $domain, bool $success, Database $dbForConsole, Event $queueForEvents, Func $queueForFunctions): void
|
||||
{
|
||||
// TODO: @christyjacob remove once we migrate the rules in 1.7.x
|
||||
if (version_compare(APP_VERSION_STABLE, '1.7.0', '<')) {
|
||||
if (System::getEnv('_APP_RULES_FORMAT', null) === 'md5') {
|
||||
$rule = $dbForConsole->getDocument('rules', md5($domain));
|
||||
} else {
|
||||
$rule = $dbForConsole->findOne('rules', [
|
||||
Query::equal('domain', [$domain]),
|
||||
]);
|
||||
} else {
|
||||
$rule = $dbForConsole->getDocument('rules', md5($domain));
|
||||
}
|
||||
|
||||
if (!$rule->isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user