implementation of multi-session support and non-interactive login#34
implementation of multi-session support and non-interactive login#34RafsanNeloy wants to merge 5 commits intoaces:mainfrom
Conversation
Signed-off-by: rafsanneloy <rafsanneloy@gmail.com>
|
Mistakenly removed some lines which are not supposed to be removed..adding right away asap |
Signed-off-by: rafsanneloy <rafsanneloy@gmail.com>
|
Nice work on the multi-session support! I noticed that in your main.py changes, the version command still seems to be located after some initial setup logic. In my PR for Issue #28, I found that moving it to the absolute top of main() and redirecting its output to stderr was necessary to satisfy the automated capture tests. Might be worth coordinating our changes to ensure we hit those TOFIX requirements! |
Signed-off-by: RafsanNeloy <rafsanneloy@gmail.com>
Login to a named sessionLogout a specific sessionLogout ALL sessionsSwitch the default session (no --session needed for future commands)After switching, bare commands auto-use that sessionList all saved sessions (shows active one with *)Show who you're logged in as (for current/active session)Verbose token verificationSee both sessionsSwitch default to prodAll future commands use prod without typing --sessionImplemented |
Sorry, I am not sure what are you trying to say. Can you elaborate more please?? |
|
Hey @RafsanNeloy great implementation! To clarify that automated capture tests for this project expect the "--version" flag to be handled with zero overhead. Currently, in your main.py the code performs some initialization (like checking config files or setting up the API client) before it check for the version flag if a user does not have a config file yet "cbrain --version" might throw an error or warning which it should not. In my PR for #28 I moved the version check to the very first line of the execution entry point i also ensured it prints to stderr so that when researchers use pipes (eg. cbrain list > files.txt) the version info does not accidentally end up inside their data files. since your PR is quite large and touches main.py we should make sure that your new --session logic does not bury that version check again. happy to help you look at the specific lines if you did like! |
Command.prompt.mp4Tried to use |
|
not sure why use .config/cbrain.json instead .config/cbrain/credentials? btw I think version command was fixed already |
In the issue #28 body I see the comment like -
Should we want to make the credential file name like ~/.config/credentials.json ? |
|
At the moment I just trying to see are there any serious benefits in the suggested solution. Present solution ~/.config/cbrain/ folders follows XDG, a widespread Linux standard, and allows adding more files (such as preferences, history, cache |
Signed-off-by: RafsanNeloy <rafsanneloy@gmail.com>
Signed-off-by: RafsanNeloy <rafsanneloy@gmail.com>
|
I agree with Sergiy that if we can follow a standard, we should. |
Implemented multi-session concurrency by storing credentials in a keyed
~/.config/cbrain.jsonfile, accessible via the new --session flag. It also adds non-interactive login support using --username, --password, and --server arguments for better automation. Additionally, logout now intelligently handles clearing multiple sessions, and the version command has been moved to a public access level.updated the session command like -
closes #28