-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session Management Commands #204
Comments
For all CLI commands, the exact options |
When running
Basically a new token is created. |
When unlocking the agent and creating a session, you should show the information about the session. In particular show that the session has an expiry date. One question do you refresh the session on each command. So if you do:
Is each However if you are refreshing the session each time, you have you write the session file onto the disk. Note that when you do this, you may clobber the file or be writing at the same time as some other command.
The above will run the command twice at the same time. We would want to avoid refreshing the session file and clobbering each other. One way to resolve this is to acquire a lock on the session file. This very similar to the lockfile being used by the agent to ensure that one node state has one agent instance. You can have a procedure like:
You will also need to resolve how to lock the file if the file doesn't exist. Perhaps you can use the same lockfile mechanism and abstract it for this usecase? |
Also @DrFacepalm please ensure you have a mutex in your You have to beware of concurrency here, all our code is running asynchronously! |
https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/189 should fix everything except for making normal commands refresh the session, and dealing with the concurrency issues that come with that. |
Already merged, so this just requires review. @tegefaulkes I think since you are going to be rebasing on the client-refactoring to make use of this for identities CLI, your comments are going to be relevant. |
@joshuakarp since you're starting on the Nodes CLI. You can check basically whether everything here is addressed, and if not, the remaining issue is #211 (automatic session refresh on commands and expiry information). If so, then this issue can be closed. Otherwise subissues should be created. |
So for the bin CLI commands, they should require session authentication now. This means for all the Instead of relying on a default file path for the session token, it should be able to be passed in directly via a command line parameter or an environment variable, or a path to a file containing the session information. |
@joshuakarp best done while you're working on the Nodes CLI: https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/198 @tegefaulkes might have to add some additional stuff to https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/201 |
Some review notes for https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/189:
|
Changes addressing the above should go into |
This will go into new issue. |
Closing this, review points going to #211. |
Specification
Additional context
This is all done as part of client-refactoring for now.
Tasks
pk agent unlock
- for authenticating a session for the CLIpk agent lock
- for destroying the current session for the CLI (delete client's session token)pk agent lockall
- for changing the session key and ensuring that all sessions should be made invalidThe text was updated successfully, but these errors were encountered: