From a66683dd362ea427514ce7afa7d7b5a818f4fa31 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 16 Jan 2021 10:20:59 +0200 Subject: [PATCH] Added authentication flow --- app/config/roles.php | 6 +- docs/specs/authentication.drawio.svg | 159 +++++++ docs/specs/overview.drawio.svg | 652 ++++++++++++++++++++++++++- 3 files changed, 813 insertions(+), 4 deletions(-) create mode 100644 docs/specs/authentication.drawio.svg diff --git a/app/config/roles.php b/app/config/roles.php index 506b2403c6..78dd24ad45 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -2,7 +2,7 @@ use Appwrite\Auth\Auth; -$logged = [ +$member = [ 'public', 'home', 'console', @@ -66,7 +66,7 @@ return [ ], Auth::USER_ROLE_MEMBER => [ 'label' => 'Member', - 'scopes' => \array_merge($logged, []), + 'scopes' => \array_merge($member, []), ], Auth::USER_ROLE_ADMIN => [ 'label' => 'Admin', @@ -78,7 +78,7 @@ return [ ], Auth::USER_ROLE_OWNER => [ 'label' => 'Owner', - 'scopes' => \array_merge($logged, $admins, []), + 'scopes' => \array_merge($member, $admins, []), ], Auth::USER_ROLE_APP => [ 'label' => 'Application', diff --git a/docs/specs/authentication.drawio.svg b/docs/specs/authentication.drawio.svg new file mode 100644 index 0000000000..c7958fa22b --- /dev/null +++ b/docs/specs/authentication.drawio.svg @@ -0,0 +1,159 @@ + + + + + + + + + +
+
+
+ Session Cookie +
+
+
+
+ + Session Cookie + +
+
+ + + + + + +
+
+
+ Email / Password +
+
+
+
+ + Email / Password + +
+
+ + + + + + +
+
+
+ OAuth Provider +
+
+
+
+ + OAuth Provider + +
+
+ + + + +
+
+
+ Member +
+
+
+
+ + Member + +
+
+ + + + +
+
+
+ App +
+
+
+
+ + App + +
+
+ + + + + + +
+
+
+ JWT +
+
+
+
+ + JWT + +
+
+ + + + + + +
+
+
+ AP Key +
+
+
+
+ + AP Key + +
+
+ + + + +
+
+
+ Guest +
+
+
+
+ + Guest + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/docs/specs/overview.drawio.svg b/docs/specs/overview.drawio.svg index 7b376f6604..5f6c161004 100644 --- a/docs/specs/overview.drawio.svg +++ b/docs/specs/overview.drawio.svg @@ -1 +1,651 @@ -
Web
Web
Flutter
Flutter
iOS
iOS
Android
Android
Servers
Servers
Appwrite
Appwrite
Loadbalancer
Loadbalancer
Console
Console
APIs
APIs
Pub/Sub (Redis)
Pub/Sub (Redis)
Cache (Redis)
Cache (Redis)
Database (MariaDB)
Database (MariaDB)
Users
Users
Account
Account
Teams
Teams
Database
Database
Storage
Storage
Localization
Localization
Avatars
Avatars
Health
Health
SSL Gateway
SSL Gateway
Deletes
Deletes
Security Layer
Security Layer
Usage
Usage
Audits
Audits
Mails
Mails
SMTP
SMTP
Tasks
Tasks
Webhooks
Webhooks
Functions
Functions
Docker
Docker
StatsD (Telegraf)
StatsD (Telegraf)
TimeSeries (InfluxDB)
TimeSeries (InfluxDB)
Certs
Certs
Scheduler
Scheduler
Letsencrypt
Letsencrypt
AntiVirus (ClamAV)
AntiVirus (ClamAV)
Viewer does not support full SVG 1.1
\ No newline at end of file + + + + + + + + + +
+
+
+ Session Cookie +
+
+
+
+ + Session Cookie + +
+
+ + + + + + +
+
+
+ Email / Password +
+
+
+
+ + Email / Password + +
+
+ + + + + + +
+
+
+ OAuth Provider +
+
+
+
+ + OAuth Provider + +
+
+ + + + + +
+
+
+ Granted with +
+
+
+
+ + Granted with + +
+
+ + + + +
+
+
+ Member +
+
+
+
+ + Member + +
+
+ + + + + +
+
+
+ Granted with +
+
+
+
+ + Granted with + +
+
+ + + + +
+
+
+ App +
+
+
+
+ + App + +
+
+ + + + + + +
+
+
+ JWT +
+
+
+
+ + JWT + +
+
+ + + + + + +
+
+
+ AP Key +
+
+
+
+ + AP Key + +
+
+ + + + + +
+
+
+ Granted with +
+
+
+
+ + Granted with + +
+
+ + + + +
+
+
+ Guest +
+
+
+
+ + Guest + +
+
+ + + + + + +
+
+
+ Public Scopes +
+
+
+
+ + Public Scopes + +
+
+ + + + + + +
+
+
+ Member Scopes +
+
+
+
+ + Member Scopes + +
+
+ + + + + + +
+
+
+ Custom Scopes +
+ + (Defined on key creation) + +
+
+
+
+ + Custom Scopes... + +
+
+ + + + +
+
+
+ Scope Validation +
+
+
+
+ + Scope Validation + +
+
+ + + + + + + + + + +
+
+
+ Database +
+ + Each doc has permission + +
+
+
+
+ + Database... + +
+
+ + + + +
+
+
+ Roles Validation +
+
+
+
+ + Roles Validation + +
+
+ + + + + + +
+
+
+ Roles +
+
+
+
+ + Roles + +
+
+ + + + + + +
+
+
+ Wildcard +
+ * +
+
+
+
+ + Wildcard... + +
+
+ + + + + + +
+
+
+ Guset +
+ role:guest +
+
+
+
+ + Guset... + +
+
+ + + + + + +
+
+
+ Member +
+ role:member +
+
+
+
+ + Member... + +
+
+ + + + + + +
+
+
+ App +
+ role:app +
+
+
+
+ + App... + +
+
+ + + + +
+
+
+ User ID +
+ user:[ID] +
+
+
+
+ + User ID... + +
+
+ + + + + + +
+
+
+ Team ID +
+ team:[ID] +
+
+
+
+ + Team ID... + +
+
+ + + + + + +
+
+
+ Team ID + Role +
+ team:[ID]/[ROLE] +
+
+
+
+ + Team ID + Role... + +
+
+ + + + +
+
+
+ Member ID +
+ member:[ID] +
+
+
+
+ + Member ID... + +
+
+ + + + +
+
+
+ Endpoints +
+ + Each endpoint has 1 scope + +
+
+
+
+ + Endpoints... + +
+
+ + + + + + +
+
+
+ Scopes +
+
+
+
+ + Scopes + +
+
+ + + + + + +
+
+
+ public +
+
+
+
+ + public + +
+
+ + + + + + +
+
+
+ account +
+
+
+
+ + account + +
+
+ + + + + + +
+
+
+ files.read +
+
+
+
+ + files.read + +
+
+ + + + +
+
+
+ files.write +
+
+
+
+ + files.write + +
+
+ + + + +
+
+
+ + ... + +
+
+
+
+ + ... + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file