diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-05-27 13:50:48 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-05-27 13:50:48 +0200 |
commit | bd303d27301f4a3cf9b1322d6b0fc63e24a7d154 (patch) | |
tree | 30b154bb538d9befb97eeabdd18deaa7b77bb1b8 /cgit | |
parent | clone to NAME.git folders (diff) | |
download | cgitize-bd303d27301f4a3cf9b1322d6b0fc63e24a7d154.tar.gz cgitize-bd303d27301f4a3cf9b1322d6b0fc63e24a7d154.zip |
"access_token"/"app_password" -> "token"
Diffstat (limited to '')
-rw-r--r-- | cgitize/config.py | 24 | ||||
-rw-r--r-- | cgitize/github.py | 4 | ||||
-rw-r--r-- | cgitize/gitlab.py | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/cgitize/config.py b/cgitize/config.py index 5b5fb32..af7c195 100644 --- a/cgitize/config.py +++ b/cgitize/config.py @@ -85,12 +85,12 @@ class GitHubSection(ServiceSection): self.orgs = OrgsSection(self.impl.get('organizations', {})) @property - def access_token(self): - return self._get_config_or_env('access_token', 'CGITIZE_GITHUB_ACCESS_TOKEN') + def token(self): + return self._get_config_or_env('token', 'CGITIZE_GITHUB_TOKEN') @property def url_auth(self): - return self.access_token + return self.token def enum_repositories(self, cfg): yield from super().enum_repositories(cfg) @@ -103,7 +103,7 @@ class GitHubSection(ServiceSection): yield repo def connect_to_service(self): - return GitHub(self.access_token) + return GitHub(self.token) def two_part_url_auth(username, password): @@ -114,8 +114,8 @@ def two_part_url_auth(username, password): class BitbucketSection(ServiceSection): @property - def app_password(self): - return self._get_config_or_env('app_password', 'CGITIZE_BITBUCKET_APP_PASSWORD') + def token(self): + return self._get_config_or_env('token', 'CGITIZE_BITBUCKET_TOKEN') @property def username(self): @@ -123,16 +123,16 @@ class BitbucketSection(ServiceSection): @property def url_auth(self): - return two_part_url_auth(self.username, self.app_password) + return two_part_url_auth(self.username, self.token) def connect_to_service(self): - return Bitbucket(self.username, self.app_password) + return Bitbucket(self.username, self.token) class GitLabSection(ServiceSection): @property - def access_token(self): - return self._get_config_or_env('access_token', 'CGITIZE_GITLAB_ACCESS_TOKEN') + def token(self): + return self._get_config_or_env('token', 'CGITIZE_GITLAB_TOKEN') @property def username(self): @@ -140,10 +140,10 @@ class GitLabSection(ServiceSection): @property def url_auth(self): - return two_part_url_auth(self.username, self.access_token) + return two_part_url_auth(self.username, self.token) def connect_to_service(self): - return GitLab(self.access_token) + return GitLab(self.token) class UsersSection(Section): diff --git a/cgitize/github.py b/cgitize/github.py index 5bbf8d8..b3dcc19 100644 --- a/cgitize/github.py +++ b/cgitize/github.py @@ -11,8 +11,8 @@ from cgitize.repo import Repo class GitHub: - def __init__(self, access_token): - self._impl = Github(access_token) + def __init__(self, token): + self._impl = Github(token) def get_repo(self, repo): try: diff --git a/cgitize/gitlab.py b/cgitize/gitlab.py index 3589472..5728dfe 100644 --- a/cgitize/gitlab.py +++ b/cgitize/gitlab.py @@ -12,8 +12,8 @@ from cgitize.repo import Repo class GitLab: - def __init__(self, access_token): - self._impl = Gitlab('https://gitlab.com', private_token=access_token) + def __init__(self, token): + self._impl = Gitlab('https://gitlab.com', private_token=token) def get_repo(self, repo): try: |