Skip to content

Commit 966ddf7

Browse files
committed
add transaction token depp dive image
1 parent 234571a commit 966ddf7

20 files changed

Lines changed: 201 additions & 0 deletions
620 KB
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
direction: down
2+
3+
User: "User"
4+
GW: "API Gateway" {
5+
style.fill: "#e3f2fd"
6+
style.stroke: "#1565c0"
7+
style.font-color: "#0a0f25"
8+
}
9+
OrderSvc: "Order Service" {
10+
style.fill: "#fff3e0"
11+
style.stroke: "#e65100"
12+
style.font-color: "#0a0f25"
13+
}
14+
RiskSvc: "Risk Service" {
15+
style.fill: "#fce4ec"
16+
style.stroke: "#c62828"
17+
style.font-color: "#0a0f25"
18+
}
19+
PaySvc: "Payment Service" {
20+
style.fill: "#fce4ec"
21+
style.stroke: "#c62828"
22+
style.font-color: "#0a0f25"
23+
}
24+
25+
User -> GW: "OAuth access token"
26+
GW -> OrderSvc: "forwards the same token"
27+
OrderSvc -> RiskSvc: "forwards the same token"
28+
RiskSvc -> PaySvc: "forwards the same token"
699 KB
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
direction: down
2+
3+
TrustDomain: "Trust Domain" {
4+
style.fill: "#e8f5e9"
5+
style.stroke: "#2e7d32"
6+
style.font-color: "#0a0f25"
7+
8+
TTS: "Txn-Token Service\n(TTS)" {
9+
style.fill: "#c8e6c9"
10+
style.stroke: "#2e7d32"
11+
style.font-color: "#0a0f25"
12+
}
13+
GW: "API Gateway"
14+
OrderSvc: "Order Service"
15+
RiskSvc: "Risk Service"
16+
PaySvc: "Payment Service"
17+
18+
GW -> TTS: "1. request a Txn-Token"
19+
TTS -> GW: "2. issue a signed Txn-Token"
20+
GW -> OrderSvc: "3. attach the Txn-Token"
21+
OrderSvc -> RiskSvc: "forward the same Txn-Token"
22+
RiskSvc -> PaySvc: "forward the same Txn-Token"
23+
}
24+
25+
User: "User"
26+
User -> TrustDomain.GW: "OAuth access token"
2.17 MB
Loading
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
shape: sequence_diagram
2+
3+
User: "External Client"
4+
GW: "External Endpoint\n(API Gateway)"
5+
TTS: "Txn-Token Service\n(TTS)"
6+
Svc1: "Order Service"
7+
Svc2: "Risk Service"
8+
9+
User -> GW: "1. API request + access token"
10+
GW -> TTS: "2. Token Exchange (RFC 8693)\nsubject_token = access token\nscope = trade.stocks\nrequest_details = {BUY MSFT}"
11+
TTS -> TTS: "authenticate, verify subject_token,\nevaluate scope, sign"
12+
TTS -> GW: "Txn-Token (short-lived JWT)" {style.stroke-dash: 3}
13+
GW -> Svc1: "3. request + Txn-Token"
14+
Svc1 -> Svc1: "verify (JWS sig, aud, exp)"
15+
Svc1 -> Svc2: "forward Txn-Token unchanged"
16+
Svc2 -> Svc2: "verify Txn-Token"
17+
Svc2 -> Svc1: "response" {style.stroke-dash: 3}
18+
Svc1 -> GW: "response" {style.stroke-dash: 3}
19+
GW -> User: "4. API response" {style.stroke-dash: 3}
2.5 MB
Loading
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
shape: sequence_diagram
2+
3+
Trigger: "Scheduler"
4+
Svc0: "Initiator"
5+
TTS: "TTS"
6+
Svc1: "Workload 1"
7+
Svc2: "Workload 2"
8+
9+
Trigger -> Svc0: "timer fires / condition met"
10+
Svc0 -> TTS: "request Txn-Token\nsubject_token = Self-Signed JWT"
11+
TTS -> TTS: "authenticate + authorize requester"
12+
TTS -> Svc0: "issue the Txn-Token" {style.stroke-dash: 3}
13+
Svc0 -> Svc1: "request + Txn-Token"
14+
Svc1 -> Svc2: "forward Txn-Token unchanged"
15+
Svc2 -> Svc1: "response" {style.stroke-dash: 3}
16+
Svc1 -> Svc0: "response" {style.stroke-dash: 3}
1.6 MB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
direction: down
2+
3+
Req: "Receive a Txn-Token Request"
4+
V1: "Authenticate the workload\n(client auth)" {shape: diamond}
5+
V2: "Verify subject_token\nsignature and expiry" {shape: diamond}
6+
V3: "Requested scope <=\nsubject_token scope?" {shape: diamond}
7+
V4: "Is this workload allowed to get\na Txn-Token for this scope?" {shape: diamond}
8+
Build: "Build the Txn-Token:\n- sub (unique in Trust Domain)\n- iat = now, exp = short lifetime\n- aud = Trust Domain\n- txn = unique ID\n- req_wl = workload ID\n- rctx from request_context\n- tctx from request_details"
9+
Sign: "Sign and return\ntoken_type: N_A\nissued_token_type: txn_token" {
10+
style.fill: "#c8e6c9"
11+
style.stroke: "#2e7d32"
12+
style.font-color: "#0a0f25"
13+
}
14+
Err: "Error response\n(RFC 6749 Section 5.2)" {
15+
style.fill: "#ffcdd2"
16+
style.stroke: "#c62828"
17+
style.font-color: "#0a0f25"
18+
}
19+
20+
Req -> V1
21+
V1 -> Err: "auth fails"
22+
V1 -> V2: "OK"
23+
V2 -> Err: "invalid"
24+
V2 -> V3: "OK"
25+
V3 -> Err: "scope exceeds"
26+
V3 -> V4: "OK"
27+
V4 -> Err: "not allowed"
28+
V4 -> Build: "OK"
29+
Build -> Sign

0 commit comments

Comments
 (0)