Skip to content

Commit 422b163

Browse files
author
Gauvain Pocentek
committed
Merge pull request #121 from PeterMosmans/httpauthextended
Added HTTPauth support for even more methods :)
2 parents 6220308 + 40d7969 commit 422b163

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

gitlab/__init__.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,10 @@ def delete(self, obj, id=None, **kwargs):
529529
params=params,
530530
headers=headers,
531531
verify=self.ssl_verify,
532-
timeout=self.timeout)
532+
timeout=self.timeout,
533+
auth=requests.auth.HTTPBasicAuth(
534+
self.http_username,
535+
self.http_password))
533536
except Exception as e:
534537
raise GitlabConnectionError(
535538
"Can't connect to GitLab server (%s)" % e)
@@ -576,7 +579,10 @@ def create(self, obj, **kwargs):
576579
r = self.session.post(url, data=data,
577580
headers=headers,
578581
verify=self.ssl_verify,
579-
timeout=self.timeout)
582+
timeout=self.timeout,
583+
auth=requests.auth.HTTPBasicAuth(
584+
self.http_username,
585+
self.http_password))
580586
except Exception as e:
581587
raise GitlabConnectionError(
582588
"Can't connect to GitLab server (%s)" % e)
@@ -626,7 +632,10 @@ def update(self, obj, **kwargs):
626632
r = self.session.put(url, data=data,
627633
headers=headers,
628634
verify=self.ssl_verify,
629-
timeout=self.timeout)
635+
timeout=self.timeout,
636+
auth=requests.auth.HTTPBasicAuth(
637+
self.http_username,
638+
self.http_password))
630639
except Exception as e:
631640
raise GitlabConnectionError(
632641
"Can't connect to GitLab server (%s)" % e)

0 commit comments

Comments
 (0)