-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest_flow.tuned.d2
More file actions
72 lines (62 loc) · 1.87 KB
/
Copy pathrequest_flow.tuned.d2
File metadata and controls
72 lines (62 loc) · 1.87 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
direction: down
title: Request Flow with Audit Trail (tuned) {
near: top-center
shape: text
style.font-size: 22
style.bold: true
}
# rank_groups force each audit row onto the same rank as the service
# step that writes it. Without this, dot minimises edge length and
# parks the audit nodes at whatever rank the edges happen to allow,
# which is rarely the one that reads correctly.
vars: {
d2-config: {
data: {
graphviz: |
{
"rank_groups": [
["flow.service.receive", "flow.audit.log_in"],
["flow.service.validate", "flow.audit.log_decision"],
["flow.service.respond", "flow.audit.log_out"]
]
}
|
}
}
}
flow: "" {
direction: right
style.fill: transparent
style.stroke: transparent
service: Primary Service {
direction: down
style.fill: "#eef6ff"
style.stroke: "#6699cc"
receive: RECEIVE REQUEST {style.fill: "#ddeeff"}
auth: AUTHENTICATE {style.fill: "#ddeeff"}
rate_limit: RATE-LIMIT CHECK {style.fill: "#ddeeff"}
validate: VALIDATE PAYLOAD {style.fill: "#ddeeff"}
process: PROCESS {style.fill: "#FFD700"; style.bold: true}
serialize: SERIALIZE RESPONSE {style.fill: "#ddeeff"}
respond: RESPOND {style.fill: "#90EE90"; style.bold: true}
receive -> auth
auth -> rate_limit
rate_limit -> validate
validate -> process
process -> serialize
serialize -> respond
}
audit: Audit Trail {
direction: down
style.fill: "#fdf5e6"
style.stroke: "#d4a017"
log_in: LOG INBOUND {style.fill: "#ffeebb"}
log_decision: LOG DECISION {style.fill: "#ffeebb"}
log_out: LOG OUTBOUND {style.fill: "#ffeebb"}
log_in -> log_decision
log_decision -> log_out
}
}
flow.service.receive -> flow.audit.log_in: write
flow.service.validate -> flow.audit.log_decision: write
flow.service.respond -> flow.audit.log_out: write