-
-
Notifications
You must be signed in to change notification settings - Fork 176
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use curl netrc file instead of --user
#399
Conversation
I intend to fixup/rewrite the tests after getting some initial feedback. |
Should probably implement a similar fix for the wget provider. Annoyingly, wget can also use netrc files, but it appears you can't actually specify a path to such a file. It only looks in ~/.netrc (which we can't overwrite!) |
You can use a WGETRC environment variable. Since the implementation wouldn't have too much in common, and since you have to go out of your way to select wget as the provider, I'll probably just leave this for a separate PR. |
and we can't use Sensitive type in a puppet type? |
Type properties automatically work with Sensitive types. When puppet syncs the property it just knows to redact the change. But With parameters, you can pass a Sensitive value if you like and it will work. But you'll get a warning like:
I suppose you could suppress the warning by converting the parameter into a property that is fudged to always be in sync (like in puppetlabs/puppetlabs-stdlib#786) But since we don't (in this fix of this provider), pass the password to the command being executed, we don't have to do something crazy like in https://github.com/puppetlabs/puppetlabs-vcsrepo/pull/416/files |
By switching to using a netrc file, I think we avoid all the hassle of having to conditionally redact command output by calling Puppet::Util::Execution directly instead of using the autogenerated helper. If we couldn't have used netrc, then I don't think I'd even check to see if password was Sensitive, but always consider it so. |
I'm unclear as to why in https://github.com/puppetlabs/puppetlabs-vcsrepo/pull/416/files#diff-574463866055cc3f49ee013638f6652aR81 they have to call |
I like this approach. One reason to do this regardless of the use of |
c206747
to
f91ef8f
Compare
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.
Is this still WIP?
98ad0c8
to
7fd3572
Compare
This stops credentials appearing in the process list and failed downloads won't result in the credentials being logged in puppet reports and agent log output. Fixes voxpupuli#397
--user
--user
Thanks! |
This stops credentials appearing in the process list and failed
downloads won't result in the credentials being logged in puppet reports
and agent log output.
Fixes #397