-
Notifications
You must be signed in to change notification settings - Fork 4
Support for user auth(). #202
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
Changes from 1 commit
45df374
6ee5c05
5afcc01
01972de
b5c4507
cf9ba3c
f8bfd20
a5fe541
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,6 +117,10 @@ class Meta: | |
| 'methods': ['post'], | ||
| 'path': '/users/{id}/reset_key/', | ||
| }, | ||
| 'auth': { | ||
| 'methods': ['post'], | ||
| 'path': '/user/auth/', | ||
| }, | ||
| 'list': { | ||
| 'methods': ['get'], | ||
| 'path': '/users/', | ||
|
|
@@ -133,6 +137,18 @@ def reset_key(self): | |
| connection = self._get_connection() | ||
| return connection.request('POST', endpoint) | ||
|
|
||
| def auth(self): | ||
| properties = self.get_endpoint_data() | ||
| endpoint = self._meta.resolve_endpoint('auth', properties) | ||
| connection = self._get_connection() | ||
|
|
||
| data = { | ||
| 'username': connection.username, | ||
| 'password' : connection.password | ||
| } | ||
|
|
||
| return connection.request('POST', endpoint, data=data) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should set user key automatically after auth?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, but there is other place to do that - this only simply to test credentials. For that, I think that we should refactor a little bit user auth in connection.py. |
||
|
|
||
| def _user_groups_method(self, group_id=None, method='GET'): | ||
| properties = self.get_endpoint_data() | ||
| endpoint = self._meta.resolve_endpoint('groups', properties) | ||
|
|
||
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.
obsolete whitespace before
: