- Groups:
Add ability to use email in Gitlab authentication
Review Request #5591 — Created March 8, 2014 and submitted
Older versions of Gitlab API v3 only allow authentication using email instead of "login" parameter that Review board currently uses.
See https://github.com/gitlabhq/gitlabhq/commit/559e83d30004e0c41a30f4ce3463f695eb7e26a1
Unit tests pass. Tested authentication with email againts different versions of Gitlab.
TO
TO
- Groups:
-
-
Using the ternary here in the key name isn't particularly readable. How about pulling the key out into a variable and using a plain conditional?
if self._is_email(username): login_key = 'email' else: login_key = 'login' rsp, headers = self._json_post( url=self._build_api_url(hosting_url, 'session'), fields={ login_key: username, 'password': password, })
You could maybe even replace the conditional with try/except and get rid of the
_is_email
method.
TO
- Change Summary:
-
Fix raised issues
- Commit:
-
80745993a779f405698d9c7697aecba60f01bc6e1cdeccf2d6fdf62c86d63052bad130267519da21
- Diff:
-
Revision 2 (+18 -1)
TO
- Commit:
-
1cdeccf2d6fdf62c86d63052bad130267519da213fb29b204fbeaf3edf1ac35aca1ae055b6a9408f
- Diff:
-
Revision 3 (+17 -1)