- Notifications
You must be signed in to change notification settings - Fork675
feat(config): option to configure a helper to lookup the token#1359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecov-io commentedMar 6, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #1359 +/- ##==========================================- Coverage 80.21% 79.98% -0.24%========================================== Files 73 73 Lines 3801 4021 +220 ==========================================+ Hits 3049 3216 +167- Misses 752 805 +53
Flags with carried forward coverage won't be shown.Click here to find out more.
Continue to review full report at Codecov.
|
klorenz commentedMar 6, 2021
Hi@nejch , to fix commitlinting issues, I have squashed my commits and created better commit messages. |
nejch left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks a lot for this feature, this is really really neat :) People have requested native keyring support but I think this might be even more flexible as it can be used with any backend/CLI client like vault etc.
I've just added a few comments, sorry it's just a very user-facing feature so I thought it'd be good to agree on the approach from the start.
Also I think this deserves a mention in the docs, would you mind adding a section inhttps://github.com/python-gitlab/python-gitlab/blob/master/docs/cli-usage.rst?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
codecov-commenter commentedApr 18, 2021
Codecov Report
@@ Coverage Diff @@## master #1359 +/- ##========================================= Coverage ? 80.10% ========================================= Files ? 73 Lines ? 4061 Branches ? 0 ========================================= Hits ? 3253 Misses ? 808 Partials ? 0
Flags with carried forward coverage won't be shown.Click here to find out more.
Continue to review full report at Codecov.
|
klorenz commentedApr 18, 2021 via email
Hi@nejch, yes I am fine with your changes. This is a good compromisebetween convenience and security. Thanks :)Nejc Habjan ***@***.***> schrieb am So., 18. Apr. 2021, 12:11: … ***@***.**** commented on this pull request. ------------------------------ In gitlab/config.py <#1359 (comment)> : > @@ -150,6 +151,16 @@ def __init__( except Exception: pass + for attr in ("job_token", "http_password", "private_token", "oauth_token"): + value = getattr(self, attr) + prefix = "lookup:" + if isinstance(value, str) and value.lower().strip().startswith(prefix): + helper = value[len(prefix) :].strip() + value = ( + subprocess.check_output(helper, shell=True).decode("utf-8").strip() Thank you for the changes@klorenz <https://github.com/klorenz> and sorry for the delay! I'll be merging in a minute. I really liked the convenience of your initial implementation, and I don't want to block this PR any longer so I just pushed a small change (I credited you as the author still) - I went for a compromise where shell=False is still used and recommend wrappers for any scripts that require piping etc. I hope this is ok with you. I also expanded the docs and wrapped the call in a try/except block for people to have a meaningful erorr message on the CLI. See91ffb8e <91ffb8e>, let me know if you want to revisit this in a follow-up. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1359 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAE2WZADPHXO37LIOFOMXWLTJKV6JANCNFSM4YWO4IXA> . |
Uh oh!
There was an error while loading.Please reload this page.
I have stored my personal access token with all other secrets in UNIX password store.
For not having the token stored on the disk, I have implemented the option to let tokens be
looked up from a helper program.
Example:
whith a helper script
~/bin/pass-helper.sh: