Skip to content
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

feature request - file input #79

Closed
ozbillwang opened this issue May 22, 2016 · 4 comments
Closed

feature request - file input #79

ozbillwang opened this issue May 22, 2016 · 4 comments

Comments

@ozbillwang
Copy link

ozbillwang commented May 22, 2016

I knew @ can be used to input the file as value. But it looks weird.

And how to deal with a value start with @

credstash put my-github-password @secure123
usage: credstash put [-h] [-k KEY] [-v VERSION] [-a]
                     credential value [context [context ...]]
credstash put: error: argument value: Unable to read file secure123

Can we have an option such as -f, so we can input the file as:

credstash put my-github-password -f password.file 
@ozbillwang
Copy link
Author

ozbillwang commented May 22, 2016

and can we have auto-version (-a option) as default option?

This also looks weird.

$ credstash list
my-github-password -- version 0000000000000000001
my-github-password -- version 0000000000000000003   # run with -a
my-github-password -- version 2      # run with -v 2

@alex-luminal
Copy link
Contributor

The DDB field that holds the item version is a string. This is great, because it means you can chose whatever versioning scheme you want. So, if you want to use natural numbers, you can, but you can also have versions like 2016-01-01. The downside to storing versions as strings is it means that the sort order goes to pot when you get past 9 versions of a key. The lexicographic sort order of 11 key versions might be:

foo - 1
foo - 10
foo - 11
foo - 2
foo - 3
 ... etc

So, we left-pad the version if you use -a. If you want to chose some other versioning scheme, you do that instead.

@alex-luminal
Copy link
Contributor

alex-luminal commented May 22, 2016

-f for file sounds like a totally reasonable thing to do. We need to keep @ as well, so as to not break anyone who has written automation with it. We should figure out how to cope with values that start with @.

nathan-muir added a commit to 3stack-software/credsmash that referenced this issue Sep 28, 2016
The goal was to clean up some of the CLI, and to modularise
the api for calling kms/dynamodb.

This will let us add new features like setting default options
from a configuration file, and writing configuration templates.

Fixes fugue#93 allowing boto3/botocore to configure itself.

Fixes fugue#79 as file input is the default for put/put-many

Closes fugue#88 as `put` only allows for files , so you
 must use `printf`/`echo` to put any value.
@ozbillwang
Copy link
Author

Seems -f has been used as --format, to avoid inconsistently, I think this feature is not required anymore.

  -f {json,yaml,csv}, --format {json,yaml,csv}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants