change autoland to use bmo api-key for authentication instead of password

RESOLVED FIXED

Status

MozReview
Autoland
P1
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: glob, Assigned: glob)

Tracking

Production

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

a year ago
when autoland posts transplant results to review board it uses bugzilla username+password to authenticate.

as this is deprecated (rightly so) we need to switch to api-key auth.
Comment hidden (mozreview-request)

Comment 2

a year ago
mozreview-review
Comment on attachment 8832452 [details]
autoland: support both user/pass and user/api-key auth (bug 1332154)

https://reviewboard.mozilla.org/r/108730/#review111584

RB has support for plugging API authentication methods, which is what we should use if going down this path. Alternatively we already have an API key login endpoint that is used by things like the review repo, take a look at how it logs in.
Attachment #8832452 - Flags: review?(smacleod) → review-

Updated

a year ago
Priority: -- → P1
Comment hidden (mozreview-request)

Comment 4

a year ago
mozreview-review
Comment on attachment 8832452 [details]
autoland: support both user/pass and user/api-key auth (bug 1332154)

https://reviewboard.mozilla.org/r/108730/#review115998

::: autoland/autoland/mozreview.py:56
(Diff revision 2)
> +    """Username/API-Key authentication."""
> +
> +    _cookies = {}
> +
> +    def headers(self, pingback_url):
> +        """Track cookies for each Review Board instance."""

Doesn't have to be Review Board, it'll be hitting new autoland sometime in the future.

::: autoland/autoland/mozreview.py:62
(Diff revision 2)
> +        url = urlparse.urlparse(pingback_url)
> +        host = url.netloc
> +
> +        if host not in self._cookies:
> +            # Authenticate using api-key to get session cookie. This cannot
> +            # happen with the object is created, as requests may issue

"with the object is", when?
Attachment #8832452 - Flags: review?(smacleod) → review+
(Assignee)

Comment 5

a year ago
mozreview-review
Comment on attachment 8832452 [details]
autoland: support both user/pass and user/api-key auth (bug 1332154)

https://reviewboard.mozilla.org/r/108730/#review116224

::: autoland/autoland/mozreview.py:56
(Diff revision 2)
> +    """Username/API-Key authentication."""
> +
> +    _cookies = {}
> +
> +    def headers(self, pingback_url):
> +        """Track cookies for each Review Board instance."""

the current code is review board specific, both in how auth is done and the endpoints hit.

we can update the comments to reflect the new world at the same time the code is updated.
Comment hidden (mozreview-request)

Comment 7

a year ago
Pushed by bjones@mozilla.com:
https://hg.mozilla.org/hgcustom/version-control-tools/rev/0f9f77b77d3b
autoland: support both user/pass and user/api-key auth r=smacleod
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.