Open CMCDragonkai opened 3 years ago
3 additional things missing in the wiki reference for sessions:
Client
when it tries to call simultaneously and results in conflict when updating the session token (and thus resolving the update by making usage of lock). The lock itself can be represented as another lifeline.Sequence diagrams should be able to make use of plantuml as these concepts should be well-established in uml formality.
The 3 diagrams that are useful across alot of domains:
Gitlab natively supports plantuml, but our wiki will need this provided via plantuml.com and embedded as an image see: https://blog.anoff.io/2018-07-31-diagrams-with-plantuml/. Use this: http://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000
The plantuml should be saved in the wiki as well though to prevent us from losing the diagram code.
@emmacasolin since you are getting sessions stuff working. Your diagrams and documentation work there would satisfy this issue.
You might want to clarify this too:
Explain how our session tokens are not OTP tokens but are similar to access-tokens in OAuth2 protocol that uses short lifetimes. It has a similar effect to OTP tokens.
But this issue also requires moving/copying some content regarding gestalts and identity claims into reference oriented docs too.
Gestalt discovery reference should take some ideas/diagrams from: https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/195#note_597545555
This may be related to the decentralized trust, although this can be a separate document.
Interaction of ACL requires reference documentation as well, it's always been a bit complicated:
People always forget how it works.
I've renamed the sessions wiki to "Service Authentication" (https://github.com/MatrixAI/js-polykey/wiki/Service-Authentication) to match the sidebar and updated the information there to include session interception, session token management, the CARL, and the new exceptions. Also created some puml diagrams which I've uploaded to the js-polykey wiki repo and embedded into the wiki page following these instructions: https://blog.anoff.io/2018-07-31-diagrams-with-plantuml/
Actually rename the service auth to session management. It's a better name anyway.
On 24 November 2021 4:16:05 pm AEDT, emmacasolin @.***> wrote:
I've renamed the sessions wiki to "Service Authentication" (https://github.com/MatrixAI/js-polykey/wiki/Service-Authentication) to match the sidebar and updated the information there to include session interception, session token management, the CARL, and the new exceptions. Also created some puml diagrams which I've uploaded to the js-polykey wiki repo and embedded into the wiki page following these instructions: https://blog.anoff.io/2018-07-31-diagrams-with-plantuml/
-- You are receiving this because you were assigned. Reply to this email directly or view it on GitHub: https://github.com/MatrixAI/js-polykey/issues/239#issuecomment-977540633 -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Renamed to "Session Management" and updated sidebar to match https://github.com/MatrixAI/js-polykey/wiki/Session-Management
@joshuakarp can you review the session management wiki?
@emmacasolin a quick glance, looks really nice. However I think it's missing an architectural diagram that can be derived from:
Both of these architectural diagrams should be brought together and integrated into your documentation. These will be essential to understanding where logic is located, not just the flow of execution as you currently have with your sequence diagrams.
Recommend copying the ASCII diagram verbatim, and then adapt the second diagram into ASCII too.
Also are you also diagramming the flow of acquiring parameters too? In terms of PK_PASSWORD
and PK_TOKEN
for determining unattended or attended?
Also please document the 3 modes of authentication. Details are on the MR comments. I bolded it and we discussed before.
3 modes discussed here: https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/213#note_730292155
Please indicate this by how the tlsConfig
is set and how that affects it. Document which modes we are using and why.
Some comments on the session management wiki article:
code
markdown style (e.g. ErrorClientAuthMissing
, and perhaps even PK_PASSWORD
)To be clear, session management and CARL is about "authentication" not "authorization".
I think it's missing an architectural diagram that can be derived from:
- MatrixAI/Polykey#236 (comment)
- https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/213#note_728972375
Draft combined diagram here. I tried to keep as much of both diagrams as I could without making it too confusing, but would appreciate feedback on how clear it is.
Might want to incorporate the https://excalidraw.com/#room=57543403694c95eba2e9,5qJFVQlpWc0vegUgEAQIpA diagram too.
And this:
┌────────────────┐
│ SessionManager │ SessionManager generates and verifies session tokens
Client on different host/user └────────┬───────┘
│
┌───────────────┐ ┌───────┴──────┐
│ PolykeyClient ├───────────────────► PolykeyAgent │ Agent accepts authenticated requests
└───────┬───────┘ └───────▲──────┘
│ │
┌────┴────┐ ┌─────────────────┼─────────────────┐
│ Session │ │ │ │
└─────────┘ ┌───────┴───────┐ ┌───────┴───────┐ ┌───────┴───────┐
│ PolykeyClient │ │ PolykeyClient │ │ PolykeyClient │ Multiple CLI & GUI clients on same host/user
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘
│ │ │
┌────┴────┐ ┌────┴────┐ ┌────┴────┐
│ Session │ │ Session │ │ Session │ Session manages token lifecycle
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
└─────────────────┼─────────────────┘
│
┌────────────┴────────────┐
│ ~/.polykey/client/token │ Concurrency managed via file lock
└─────────────────────────┘
Shared session token for authenticated requests
For component diagram wise.
Draft combined diagram here. I tried to keep as much of both diagrams as I could without making it too confusing, but would appreciate feedback on how clear it is.
You should change GRPC Agent
to GRPC Server
to avoid confusion between our client and agent "servers".
Discovery is complex and is worth diagramming. Also consider sequence diagrams for its edge conditions: https://github.com/MatrixAI/js-polykey/pull/311#issuecomment-1049484685
Session management and node protocols include:
These wiki articles should go into
Reference
underjs-polykey
. As these are library references for how the system works. They are not usecases nor are they theory.Keep them high level so they don't go out of date. However we should refer to the relevant exceptions expected.
Interacting side effects, and things to be ware of when programming with essential to document.
Use
asciiflow
to prototype the diagrams first, then useplantuml
to finish off, in particular the sequence diagrams. Component diagrams are a more freeform, so they can stay asasciiflow
diagrams.Refer to the network reference article as an example: https://github.com/MatrixAI/js-polykey/wiki/network
Target wiki article is located here: https://github.com/MatrixAI/js-polykey/wiki/Session-Management
Tasks