#1872 hub: getUser: default krb_princs value is changed to True
Merged 4 years ago by tkopecek. Opened 4 years ago by julian8628.
julian8628/koji issue/1822  into  master

file modified
+9 -9
@@ -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'):

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

4 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

4 years ago

Commit 18744dd fixes this pull-request

Pull-Request has been merged by tkopecek

4 years ago