deislabs / bindle

Bindle: Object Storage for Collections
Apache License 2.0
263 stars 37 forks source link

feat - add label search argument to sign-invoice #330

Closed VishnuJin closed 2 years ago

VishnuJin commented 2 years ago

fixes #299

this PR adds optional ability to sign-invoice with a key that matches the given label

For example

--label-matching (partial match)

❯ bindle sign-invoice -o signed-invoice.toml invoice.toml --label-matching "Vishnu Jin"
Signed invoice.toml with role creator, label as 'Vishnu Jin <vishnujin@outlook.com>' and wrote to signed-invoice.toml

--label (exact match)

❯ bindle sign-invoice -o signed-invoice.toml invoice.toml --label "Vishnu Jin <vishnujin@outlook.com>"
Signed invoice.toml with role creator, label as 'Vishnu Jin <vishnujin@outlook.com>' and wrote to signed-invoice.toml
VishnuJin commented 2 years ago

Also, it would be great if we could have a --label that does an exact match, but that is optional

yeah that was my original intention as well.I will implement it

VishnuJin commented 2 years ago

@thomastaylor312 can we use the -l as short for --label and -m as short for --label-match ?

thomastaylor312 commented 2 years ago

Those sound like great shorthands

VishnuJin commented 2 years ago

@thomastaylor312 I have just modified the approach here, if you like this approach I will remove the earlier commits !! let me know your thoughts

VishnuJin commented 2 years ago

@thomastaylor312 this is ready for review now