-
Notifications
You must be signed in to change notification settings - Fork 20
CMLDEV-727 JWT authentication #182
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
base: dev
Are you sure you want to change the base?
CMLDEV-727 JWT authentication #182
Conversation
getpass for password test fixes
|
IMHO there is one downside to using ClientConfig for storing configuration - it is NamedTuple, so once created, we are unable to update it without completely rewriting it. Right now, it is not a problem, because we are not altering in anywhere in code, but we have to have it in mind in the future... |
| raise InitializationError(exc) | ||
| user_info = response.json() | ||
| self.user_id = user_info.get("id") | ||
| self.admin = user_info.get("admin", False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need user_id and admin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would fetch user_id at least for all auth methods (i.e. when doing user/pass); I recall some model actually wanted to know it at some point, and maybe fetches it on the fly. Knowing whether we are an admin can become useful too.
| self.user_id = user_info.get("id") | ||
| self.admin = user_info.get("admin", False) | ||
| if self.username is None: | ||
| self.username = user_info.get("username") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd overwrite username all the time
authokurl changed toauthenticationauthenticationchanged fromauth_testtoauth, because we are using also for getting username when authorized with JWT