Skip to content

Pickling a gitlab-python result includes the auth details #2777

Answered by JohnVillalovos
mikepurvis asked this question in Q&A
Discussion options

You must be logged in to vote

Have you considered using asdict() instead of pickling?

https://python-gitlab.readthedocs.io/en/main/api-usage.html#as-a-dictionary

Regarding the pickling:

As a note, if on each Project object you did project.manager.gitlab.private_token = "*masked*" before pickling, that would get rid of the token most likely.

But I have no idea how that will impact things when unpickling.

You can look at the pickle file with: python -m pickletools projects.pickle

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nejch
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2776 on January 25, 2024 16:14.