summaryrefslogtreecommitdiff
path: root/gitlab/config.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-11-10 09:39:17 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2017-11-10 09:39:17 +0100
commit07328263c317d7ee78723fee8b66f48abffcfb36 (patch)
tree1922a5ae37ed1903d1e02d35e725f6205081ac56 /gitlab/config.py
parente9b158363e5b0ea451638b1c3a660f138a24521d (diff)
downloadgitlab-07328263c317d7ee78723fee8b66f48abffcfb36.tar.gz
Add support for oauth and anonymous auth in config/CLI
Diffstat (limited to 'gitlab/config.py')
-rw-r--r--gitlab/config.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/gitlab/config.py b/gitlab/config.py
index d1c29d0..9cf208c 100644
--- a/gitlab/config.py
+++ b/gitlab/config.py
@@ -53,7 +53,6 @@ class GitlabConfigParser(object):
try:
self.url = self._config.get(self.gitlab_id, 'url')
- self.token = self._config.get(self.gitlab_id, 'private_token')
except Exception:
raise GitlabDataError("Impossible to get gitlab informations from "
"configuration (%s)" % self.gitlab_id)
@@ -96,6 +95,29 @@ class GitlabConfigParser(object):
except Exception:
pass
+ self.private_token = None
+ try:
+ self.private_token = self._config.get(self.gitlab_id,
+ 'private_token')
+ except Exception:
+ pass
+
+ self.oauth_token = None
+ try:
+ self.oauth_token = self._config.get(self.gitlab_id, 'oauth_token')
+ except Exception:
+ pass
+
+ self.http_username = None
+ self.http_password = None
+ try:
+ self.http_username = self._config.get(self.gitlab_id,
+ 'http_username')
+ self.http_password = self._config.get(self.gitlab_id,
+ 'http_password')
+ except Exception:
+ pass
+
self.http_username = None
self.http_password = None
try: