api23-gate-token-js.msd 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #//# --------------------------------------------------------------------------------------
  2. #//# Created using Sequence Diagram for Mac
  3. #//# https://www.macsequencediagram.com
  4. #//# https://itunes.apple.com/gb/app/sequence-diagram/id1195426709?mt=12
  5. #//# --------------------------------------------------------------------------------------
  6. title "How to Create GateToken and Use for Api23 of Js Service"
  7. participant JsApp_Origin as origin
  8. participant Frontend_Laravel as frontend
  9. participant Backend_Golang as backend
  10. participant ErpDB as erpdb
  11. participant MemoryDB as bunt_db
  12. participant SsoServer as sso_svr
  13. activate origin
  14. activate frontend
  15. origin->frontend: request /api23-js \n Api23Key@HtmHeader, \n Json @htmBody
  16. activate backend
  17. frontend->backend: request /gate-token-get-api23hash \n {Api23Key}(j)
  18. backend->backend: extract Api23Hash %Api23Key
  19. bunt_db->backend: get GateToken @Api23Hash
  20. backend->frontend: [if GateToken exists] \n response 200 %{GateToke} \n else \n response 505
  21. deactivate backend
  22. alt [ if response was 505 ]
  23. frontend<->backend: /gate-token-get Process
  24. note over frontend, backend
  25. response _{GateToken}
  26. end note
  27. end
  28. #alt [if AppType=js]
  29. # frontend->origin: response 200 \n !%(json)
  30. #else [ else ]
  31. # frontend->origin: response 200 \n %{GateToken}
  32. #end
  33. deactivate backend
  34. frontend->frontend: insert GateToken, \n Referer @Htm Header
  35. activate backend
  36. frontend->backend: request regular Dabory API
  37. backend->frontend: response Dabory API result
  38. deactivate backend
  39. frontend->origin: response Js API result
  40. deactivate frontend
  41. deactivate origin