I have an instance with several thousand repos, where it's convenient to cache the top-level details for each in order to run various config checks. This boils down to:
gl = gitlab.Gitlab(GITLAB_URL, os.environ["GITLAB_PRIVATE_TOKEN"])
projects = gl.projects.list(get_all=True)
with open(CACHE_PATH / "projects.pickle", "wb") as f:
pickle.dump(projects, f)
But then when I look at the pickle file, it includes the private token. When I also save the gitlab object and do a gitlab.private_token = None first, the token shows up elsewhere.
Expected Behavior
It would be great if there was an easy way to exclude the token, or otherwise manage the "session" separately.
Specifications
- python-gitlab version: 4.4.0
- API version you are using (v3/v4): v4
- Gitlab server version: 15.6.6
I have an instance with several thousand repos, where it's convenient to cache the top-level details for each in order to run various config checks. This boils down to:
But then when I look at the pickle file, it includes the private token. When I also save the
gitlabobject and do agitlab.private_token = Nonefirst, the token shows up elsewhere.Expected Behavior
It would be great if there was an easy way to exclude the token, or otherwise manage the "session" separately.
Specifications