Merge lp://qastaging/~morphis/jenkins-launchpad-plugin/preemptive-auth-handler into lp://qastaging/jenkins-launchpad-plugin

Proposed by Simon Fels
Status: Needs review
Proposed branch: lp://qastaging/~morphis/jenkins-launchpad-plugin/preemptive-auth-handler
Merge into: lp://qastaging/jenkins-launchpad-plugin
Diff against target: 40 lines (+23/-2)
1 file modified
jlp/jsonjenkins.py (+23/-2)
To merge this branch: bzr merge lp://qastaging/~morphis/jenkins-launchpad-plugin/preemptive-auth-handler
Reviewer Review Type Date Requested Status
Jenkaas Hackers Pending
Review via email: mp+318871@code.qastaging.launchpad.net

Commit message

Use PreemptiveBasicAuthHandler authentication handler to make sure we
sent authentication headers with every request and not as urllib2 would
do when we receive a HTTP 403 error code.

Description of the change

Jenkins doesn't return a 401 HTTP error code to tell the client to retry with authentication details as urllib2 by default expects but sents a 403 error code straight away. See https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients and https://stackoverflow.com/questions/16907684/fetching-a-url-from-a-basic-auth-protected-jenkins-server-with-urllib2 for details on this.

To post a comment you must log in.
134. By Simon Fels

Add missing import for base64 package

Unmerged revisions

134. By Simon Fels

Add missing import for base64 package

133. By Simon Fels

Use PreemptiveBasicAuthHandler authentication handler to make sure we
sent authentication headers with every request and not as urllib2 would
do when we receive a HTTP 403 error code.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: