← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~thomir/launchpad/devel-add-ssh-add-key-api into lp:launchpad

 

Review: Approve code



Diff comments:

> 
> === modified file 'lib/lp/registry/model/person.py'
> --- lib/lp/registry/model/person.py	2016-05-23 03:17:16 +0000
> +++ lib/lp/registry/model/person.py	2016-05-24 03:58:24 +0000
> @@ -3474,6 +3475,20 @@
>              return None
>          return [s.getFullKeyText() for s in IPerson(account).sshkeys]
>  
> +    def addSSHKeyForPersonFromSSO(self, user, openid_identifier, key_text,
> +                                  dry_run):
> +        """See `IPersonSet`"""
> +        if user != getUtility(ILaunchpadCelebrities).ubuntu_sso:
> +            raise Unauthorized()
> +        try:
> +            account = getUtility(IAccountSet).getByOpenIDIdentifier(
> +                openid_identifier)
> +        except LookupError:
> +            raise NoSuchAccount("No account found for openid identifier '%s'"
> +                                % openid_identifier)
> +        if not dry_run:
> +            getUtility(ISSHKeySet).new(IPerson(account), key_text, False)

This bypasses the vulnkey etc. checks in the dry_run case, which is possibly not what we want.

> +
>      def newTeam(self, teamowner, name, display_name, teamdescription=None,
>                  membership_policy=TeamMembershipPolicy.MODERATED,
>                  defaultmembershipperiod=None, defaultrenewalperiod=None,
> @@ -4051,7 +4066,7 @@
>          # For security reasons we want to notify the preferred email address
>          # that this sshkey has been removed.
>          self.person.security_field_changed(
> -            "SSH Key removed from your Launchpad account.",
> +            "SSH Key removed SS your Launchpad account.",

Unintentional?

>              "The SSH Key %s was removed from your account." % self.comment)
>          super(SSHKey, self).destroySelf()
>  


-- 
https://code.launchpad.net/~thomir/launchpad/devel-add-ssh-add-key-api/+merge/295537
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References