| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ example: | |||
| 48 | 48 | ||
| 49 | 49 | [elsewhere] | |
| 50 | 50 | url = http://else.whe.re:8080 | |
| 51 | - private_token = CkqsjqcQSFH5FQKDccu4 | ||
| 51 | + private_token = lookup: pass show path/to/password | ||
| 52 | 52 | timeout = 1 | |
| 53 | 53 | ||
| 54 | 54 | The ``default`` option of the ``[global]`` section defines the GitLab server to | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | import os | |
| 19 | 19 | import configparser | |
| 20 | + import subprocess | ||
| 20 | 21 | from typing import List, Optional, Union | |
| 21 | 22 | ||
| 22 | 23 | from gitlab.const import USER_AGENT | |
@@ -150,6 +151,16 @@ def __init__( | |||
| 150 | 151 | except Exception: | |
| 151 | 152 | pass | |
| 152 | 153 | ||
| 154 | + for attr in ("job_token", "http_password", "private_token", "oauth_token"): | ||
| 155 | + value = getattr(self, attr) | ||
| 156 | + prefix = "lookup:" | ||
| 157 | + if isinstance(value, str) and value.lower().strip().startswith(prefix): | ||
| 158 | + helper = value[len(prefix) :].strip() | ||
| 159 | + value = ( | ||
| 160 | + subprocess.check_output(helper, shell=True).decode("utf-8").strip() | ||
| 161 | + ) | ||
| 162 | + setattr(self, attr, value) | ||
| 163 | + | ||
| 153 | 164 | self.api_version = "4" | |
| 154 | 165 | try: | |
| 155 | 166 | self.api_version = self._config.get("global", "api_version") | |
| Back | FazBrowse Home | New Git URL |
0 commit comments