Skip to content

Add a -f option to let a user pass a filename for creating secrets#1595

Merged
diogomonica merged 1 commit into
moby:masterfrom
cyli:secret-create-ui
Oct 19, 2016
Merged

Add a -f option to let a user pass a filename for creating secrets#1595
diogomonica merged 1 commit into
moby:masterfrom
cyli:secret-create-ui

Conversation

@cyli
Copy link
Copy Markdown
Contributor

@cyli cyli commented Sep 30, 2016

#1589 This would read the secret from the file instead of STDIN.

This PR also servers as a platform for continuing the discussion from #1567 (comment) and doing a design discussion of what docker secret create <secret-name> should look like.

A summary of that discussion and some IRL discussions:

@aluzzardi suggests the following UI:

  • Pass as an argument: docker secret create foo bar
  • Pass to stdin: echo bar | docker secret create foo -
  • Pass as a file: echo bar > value.txt && docker secret create foo -f value.txt

The reason the current design does not to accept the secret itself as an argument is that we do not want to encourage users to type the secret into a command. If we did accept a secret as a direct argument, then it would be available in the shell history of any user that created one, unless they explicitly removed it.

With STDIN and file, we can't prevent them from echoing to STDIN or a file, but it doesn't legitimize that as a way to add a secret.

cc @dmp42 on UI
cc @diogomonica

…DIN.

Signed-off-by: cyli <ying.li@docker.com>
@codecov-io
Copy link
Copy Markdown

Current coverage is 53.89% (diff: 100%)

Merging #1595 into master will increase coverage by 0.06%

@@             master      #1595   diff @@
==========================================
  Files            84         84          
  Lines         13942      13937     -5   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           7504       7511     +7   
+ Misses         5429       5420     -9   
+ Partials       1009       1006     -3   

Sunburst

Powered by Codecov. Last update 670003b...fa9fbb3

Copy link
Copy Markdown
Contributor

@diogomonica diogomonica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't have preferences here as long as we chose our examples in the docs wisely.

@aaronlehmann
Copy link
Copy Markdown
Collaborator

Looks fine to me. I'm sure the real debate will play out when the Docker PR is reviewed, though.

@diogomonica diogomonica merged commit 3642025 into moby:master Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants