Login gains an audit log
A sequence diff. A new audit log records each login, a locked-account branch is added, and the first message is renamed.






┌──────┐ ┌──────────┐ ┌──────────────┐ ┌──────────┐ ┌──────────────┐
│ User │ │ Web App │ │ Auth Service │ │ Database │ │ + Audit Log │
└──────┘ └──────────┘ └──────────────┘ └──────────┘ └──────────────┘
│ │ │ │ │
│ │ │ │ │
├ ~ submit credentials ─► │ │ │
│ ┃ │ │ │
│ ├ check credentials ─► │ │
│ │ ┃ │ │
│ │ ├─ lookup user ─► │
│ │ │ ┃ │
│ │ ◄╌ user record ╌┤ │
│ │ ┃ │ │
╔══ alt [~ valid] ═════════════╪════════════════════╪═══════════════╪═══════════════╪═══════╗
║ │ ◄╌╌╌╌╌╌╌ ok ╌╌╌╌╌╌╌╌╌┤ │ │ ║
║ │ ┃ │ │ │ ║
║ │ ┠───────────────── + record login ───┼───────────────▷ ║
║ │ ┃ │ │ │ ║
║ ◄╌╌╌╌╌╌╌ welcome ╌╌╌╌╌╌╌┤ │ │ │ ║
║ ┃ │ │ │ │ ║
╟╌╌ [invalid] ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╪╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╪╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╪╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╪╌╌╌╌╌╌╌╢
║ │ ◄╌╌╌╌╌ denied ╌╌╌╌╌╌╌┤ │ │ ║
║ │ ┃ │ │ │ ║
║ ◄╌╌╌╌╌╌╌╌ error ╌╌╌╌╌╌╌╌┤ │ │ │ ║
║ │ │ │ │ │ ║
╟╌╌ [+ locked] ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╪╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╪╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╪╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╪╌╌╌╌╌╌╌╢
║ │ ◄╌╌╌╌ + locked ╌╌╌╌╌╌┤ │ │ ║
║ │ ┃ │ │ │ ║
║ ◄╌╌ + account locked ╌╌╌┤ │ │ │ ║
╚══════╪═══════════════════════╪════════════════════╪═══════════════╪═══════════════╪═══════╝
│ │ │ │ │
┌──────┐ ┌──────────┐ ┌──────────────┐ ┌──────────┐ ┌──────────────┐
│ User │ │ Web App │ │ Auth Service │ │ Database │ │ + Audit Log │
└──────┘ └──────────┘ └──────────────┘ └──────────┘ └──────────────┘
sequence-login-v1.json → sequence-login-v2.json
added: actor Audit Log
added: message Web App -> Audit Log "record login"
added: message Auth Service -> Web App "locked"
added: message Web App -> User "account locked"
added: section [locked] of alt
changed: message User -> Web App: label "submit form" → "submit credentials"




Spec
{ "type": "sequence", "actors": [ {"id": "user", "label": "User"}, {"id": "web", "label": "Web App"}, {"id": "auth", "label": "Auth Service"}, {"id": "db", "label": "Database", "color": "red"} ], "interactions": [ {"from": "user", "to": "web", "label": "submit form"}, {"from": "web", "to": "auth", "label": "check credentials"}, {"from": "auth", "to": "db", "label": "lookup user"}, {"from": "db", "to": "auth", "label": "user record", "style": "dashed"}, {"from": "auth", "to": "web", "label": "ok", "style": "dashed"}, {"from": "web", "to": "user", "label": "welcome", "style": "dashed"}, {"from": "auth", "to": "web", "label": "denied", "style": "dashed"}, {"from": "web", "to": "user", "label": "error", "style": "dashed"} ], "fragments": [ { "type": "alt", "over": ["user", "web", "auth"], "sections": [ {"label": "valid", "start": 4, "end": 5}, {"label": "invalid", "start": 6, "end": 7} ] } ]}{ "type": "sequence", "actors": [ {"id": "user", "label": "User"}, {"id": "web", "label": "Web App"}, {"id": "auth", "label": "Auth Service"}, {"id": "db", "label": "Database", "color": "red"}, {"id": "audit", "label": "Audit Log"} ], "interactions": [ {"from": "user", "to": "web", "label": "submit credentials"}, {"from": "web", "to": "auth", "label": "check credentials"}, {"from": "auth", "to": "db", "label": "lookup user"}, {"from": "db", "to": "auth", "label": "user record", "style": "dashed"}, {"from": "auth", "to": "web", "label": "ok", "style": "dashed"}, {"from": "web", "to": "audit", "label": "record login", "style": "async"}, {"from": "web", "to": "user", "label": "welcome", "style": "dashed"}, {"from": "auth", "to": "web", "label": "denied", "style": "dashed"}, {"from": "web", "to": "user", "label": "error", "style": "dashed"}, {"from": "auth", "to": "web", "label": "locked", "style": "dashed"}, {"from": "web", "to": "user", "label": "account locked", "style": "dashed"} ], "fragments": [ { "type": "alt", "over": ["user", "web", "auth"], "sections": [ {"label": "valid", "start": 4, "end": 6}, {"label": "invalid", "start": 7, "end": 8}, {"label": "locked", "start": 9, "end": 10} ] } ]}Draw it yourself
diago diff login-change.v1.json login-change.v2.json > login-change.diff.svgOpen it in the playground to edit it in your browser.