-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from codeforjapan/yash/admin-acl-p2
ACL - PlantUML diagrams & Admin Delete
- Loading branch information
Showing
8 changed files
with
236 additions
and
14 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@startuml | ||
|
||
title ACL | ||
|
||
== ACL on LIST endpoints == | ||
autonumber 1 | ||
|
||
actor AdminUser | ||
AdminUser -> "NestJS Guard": GET /admins/organizations | ||
note over "NestJS Guard" | ||
Expects JWT Payload: | ||
- isAdminUser | ||
- userAdminRole | ||
- userAccessKey | ||
end note | ||
|
||
"NestJS Guard" -> "Service": Pass userAccessKey to organization service | ||
note left "Service" | ||
Example value: | ||
- userAccessKey: SUPER_ADMIN_KEY | ||
end note | ||
|
||
"Service" -> "Firestore": Fetch all accessible documents \n in organizations collection | ||
note over "Firestore" | ||
.where( | ||
accessControlList, | ||
array-contains, | ||
userAccessKey | ||
) | ||
end note | ||
|
||
"Firestore" -> "Service": Return array of organizations | ||
|
||
"Service" -> "AdminUser": Organizations LIST based on ACL | ||
|
||
|
||
== ACL on GET by ID endpoints == | ||
autonumber 1 | ||
|
||
AdminUser -> "NestJS Guard": GET /admins/organizations/ABC | ||
note over "NestJS Guard" | ||
Expects JWT Payload: | ||
- isAdminUser | ||
- userAdminRole | ||
- userAccessKey | ||
end note | ||
|
||
"NestJS Guard" -> "Service": Pass userAccessKey to organization service | ||
note left "Service" | ||
Example value: | ||
- userAccessKey: SUPER_ADMIN_KEY | ||
end note | ||
|
||
"Service" -> "Firestore": Fetch single document \n based on ID ABC | ||
|
||
"Firestore" -> "Service": Return ABC organization | ||
note over "Service" | ||
canUserAccessResource( | ||
userAccessKey, | ||
organization | ||
) | ||
end note | ||
|
||
"Service" -> "AdminUser": Organizations GET by ID based on ACL | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters