From 04d6d33f6053c200362947a5ec76b0d654013e7f Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 16 Jul 2021 07:38:29 +0300 Subject: [PATCH] Fixed structure --- app/config/collections2.php | 166 +++++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 1 deletion(-) diff --git a/app/config/collections2.php b/app/config/collections2.php index 0a69b81c3..4c6659317 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -360,6 +360,169 @@ $collections = [ ], ], + // $session = new Document(array_merge( + // [ + // '$id' => $dbForInternal->getId(), + // 'userId' => $profile->getId(), + // 'provider' => Auth::SESSION_PROVIDER_EMAIL, + // 'providerUid' => $email, + // 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak + // 'expire' => $expiry, + // 'userAgent' => $request->getUserAgent('UNKNOWN'), + // 'ip' => $request->getIP(), + // 'countryCode' => ($record) ? \strtolower($record['country']['iso_code']) : '--', + // ], $detector->getOS(), $detector->getClient(), $detector->getDevice() + // )); + + 'sessions' => [ + '$collection' => Database::COLLECTIONS, + '$id' => 'sessions', + 'name' => 'Sessions', + 'attributes' => [ + [ + '$id' => 'userId', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'email', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 1024, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'status', + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'password', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'passwordUpdate', + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'prefs', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['json'] + ], + [ + '$id' => 'registration', + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'emailVerification', + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'reset', + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'sessions', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => ['json'], + ], + [ + '$id' => 'tokens', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => ['json'], + ], + [ + '$id' => 'memberships', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => ['json'], + ], + ], + 'indexes' => [ + [ + '$id' => '_key_email', + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['email'], + 'lengths' => [1024], + 'orders' => [Database::ORDER_ASC], + ] + ], + ], + 'teams' => [ '$collection' => Database::COLLECTIONS, '$id' => 'teams', @@ -1047,11 +1210,12 @@ $collections = [ ] ], ], + 'certificates' => [ '$collection' => Database::COLLECTIONS, '$id' => 'certificates', 'name' => 'Certificates', - 'attributes' => [, + 'attributes' => [ [ '$id' => 'domain', 'type' => Database::VAR_STRING,