-
Notifications
You must be signed in to change notification settings - Fork 3
/
example_bookstore.py
56 lines (54 loc) · 1.96 KB
/
example_bookstore.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from fluentm.entities import Actor, Boundary, Process, DataFlow, TLS, HTTP, SQL
from fluentm.renderer import report
scenes = {
"Customer Login": [
DataFlow(
Actor("Customer"),
Process("Nginx").inBoundary(Boundary("Front End")),
TLS(HTTP("GET /Login credentials")),
),
DataFlow(
Process("Nginx"),
Process("User Database").inBoundary(Boundary("Back End")),
SQL("SELECT user password"),
),
DataFlow(Process("User Database"), Process("Nginx"), SQL("password")),
DataFlow(Process("Nginx"), Actor("Customer"), TLS(HTTP("Login Cookie"))),
],
"Customer Lists Books": [
DataFlow(
Actor("Customer"), Process("Nginx"), TLS(HTTP("GET /list, Login Cookie"))
),
DataFlow(
Process("Nginx"),
Process("Stock Database").inBoundary(Boundary("Back End")),
SQL("SELECT stock"),
),
DataFlow(
Process("Stock Database"),
Process("Nginx"),
SQL("Stock Items, Pagination token"),
),
DataFlow(Process("Nginx"), Actor("Customer"), TLS(HTTP("Page listings"))),
],
"Customer Views Details": [
DataFlow(
Actor("Customer"), Process("Nginx"), TLS(HTTP("GET /item, Login Cookie"))
),
DataFlow(Process("Nginx"), Process("User Database"), HTTP("Log viewed ID")),
DataFlow(Process("Nginx"), Process("Stock Database"), SQL("SELECT ID")),
DataFlow(
Process("Stock Database"),
Process("Nginx"),
SQL("Stock details, CDN image links"),
),
DataFlow(Process("Nginx"), Actor("Customer"), HTTP("Page html")),
DataFlow(
Actor("Customer"),
Process("CDN").inBoundary(Boundary("External CDN")),
HTTP("GET images"),
),
],
}
if __name__ == "__main__":
r = report(scenes, outputDir="bookstore", dfdLabels=True)