| |
@@ -3667,7 +3667,7 @@
|
| |
return repos
|
| |
|
| |
|
| |
- def get_user(userInfo=None, strict=False, krb_princs=False):
|
| |
+ def get_user(userInfo=None, strict=False, krb_princs=True):
|
| |
"""Return information about a user.
|
| |
|
| |
:param userInfo: a str (Kerberos principal or name) or an int (user id)
|
| |
@@ -3675,8 +3675,8 @@
|
| |
- id: User's ID
|
| |
- name: User's name
|
| |
- krb_principal: Kerberos principal
|
| |
- :param strict: whether raising Error when no user found
|
| |
- :param krb_princs: whether show krb_principals in result
|
| |
+ :param bool strict: whether raising Error when no user found
|
| |
+ :param bool krb_princs: whether show krb_principals in result
|
| |
:return: a dict as user's information:
|
| |
id: user id
|
| |
name: user name
|
| |
@@ -3757,7 +3757,7 @@
|
| |
|
| |
def _edit_user(userInfo, name=None, krb_principal_mappings=None):
|
| |
"""Edit information for an existing user."""
|
| |
- user = get_user(userInfo, strict=True, krb_princs=True)
|
| |
+ user = get_user(userInfo, strict=True)
|
| |
if name and user['name'] != name:
|
| |
# attempt to update user name
|
| |
values = {
|
| |
@@ -3836,12 +3836,12 @@
|
| |
return query.execute() or []
|
| |
|
| |
|
| |
- def get_user_by_krb_principal(krb_principal, strict=False, krb_princs=False):
|
| |
+ def get_user_by_krb_principal(krb_principal, strict=False, krb_princs=True):
|
| |
"""get information about a user by kerberos principal.
|
| |
|
| |
- :param krb_principal: full user kerberos principals
|
| |
- :param strict: whether raising Error when no user found
|
| |
- :param krb_princs: whether show krb_principals in result
|
| |
+ :param str krb_principal: full user kerberos principals
|
| |
+ :param bool strict: whether raising Error when no user found
|
| |
+ :param bool krb_princs: whether show krb_principals in result
|
| |
:return: a dict as user's information:
|
| |
id: user id
|
| |
name: user name
|
| |
@@ -11930,7 +11930,7 @@
|
| |
in the same format as getUser(), plus the authtype. If there is no
|
| |
currently logged-in user, return None."""
|
| |
if context.session.logged_in:
|
| |
- me = self.getUser(context.session.user_id, krb_princs=True)
|
| |
+ me = self.getUser(context.session.user_id)
|
| |
me['authtype'] = context.session.authtype
|
| |
# backward compatible for cli moshimoshi, but it's not real
|
| |
if me.get('krb_principals'):
|
| |
fixes: #1822