app/vmbackup: introduce flags to take basic auth credentials and snapshot authkey #6223
+412
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
This PR includes changes in vmbackup to take the basic auth credentials (username and password) and the snapshot authKey via cli flags for the connections towards vmsingle/vmstorage.
Related issue: #5973
A few points related to the changes:
http://username:password@localhost:8428/snapshot/create?authKey=mykey
)-snapshot.authKey
, then the authKey will be passed via http headerX-AuthKey
towards vmsimgle/storage. For more context refer app/vmbackup: introduce new flag type URL #6152 (comment)X-AuthKey
is supported only forsnapshotAuthKey
flag. Later if needed, this can be modified for other authKeys like-reloadAuthKey
,-configAuthKey
etc.RedactedURL
is added under httputils package for masking sensitive info from the URLs. Note that this will just mask the URLs within the Victoria-Metrics logs. The sensitive info can still be exposed via the standard net/http package. See vmbackup:Facilitate Flag-Based Provisioning for Sensitive Data in snapshot.createURL #5973 (comment) and app/vmbackup: introduce new flag type URL #6152 (comment)@hagen1778 @zekker6 please let me know your thoughts/comments on this change. Will address them.
Checklist
The following checks are mandatory: