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
feat(cli): new storage config input from file when creating a repo #2756
feat(cli): new storage config input from file when creating a repo #2756
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2756 +/- ##
==========================================
+ Coverage 75.41% 75.43% +0.02%
==========================================
Files 459 459
Lines 36424 36445 +21
==========================================
+ Hits 27468 27493 +25
+ Misses 7041 7036 -5
- Partials 1915 1916 +1
☔ View full report in Codecov by Sentry. |
|
||
sps StorageProviderServices | ||
} | ||
|
||
func (c *storageFromConfigFlags) Setup(sps StorageProviderServices, cmd *kingpin.CmdClause) { | ||
cmd.Flag("file", "Path to the configuration file").StringVar(&c.connectFromConfigFile) | ||
cmd.Flag("token", "Configuration token").StringVar(&c.connectFromConfigToken) | ||
cmd.Flag("token-file", "Path to the configuration token file").StringVar(&c.connectFromTokenFile) |
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.
how about (also) adding a boolean token-stdin
or something similar ? This would make it work on Windows where /dev/stdin is not available.
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.
good idea, will do
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.
@jkowalski, According to my understanding, we want to introduce a flag token-stdin
, which is basically of boolean type. If the value is false than user have to pass the token file path and if true than user have to pass the value of token thru stdin ?
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.
added the --token-stdin
changes with the unit-test
c8ef5ff
to
341b530
Compare
341b530
to
69aeba9
Compare
@Shrekster nit: modified the PR description to remove |
Thanks for the change! |
Thank you, @Shrekster! 🎉 |
When creating a repo we are currently required to supply storage config secrets as CLI arguments. CLI commands often get logged which can accidentally expose these creds. This PR extends the
from-config
storage flags to be supplied at the time of creation with a dedicated--token-file
option or--token-stdin
option that reads from stdin.