kramphub / kiya

manage secrets for development and infrastructure deployment using Google Cloud Platform
Other
16 stars 7 forks source link

copy to clipboard using simple list index #13

Closed emicklei closed 5 years ago

emicklei commented 5 years ago

The list changes to this:

+-----------------+----------------------------------------------+---------------------+--------------------------+
|  To Clipboard   |                     Key                      |       Created       |         Creator          |
+-----------------+----------------------------------------------+---------------------+--------------------------+
| kiya optimus 1  | api-keys/xxxxxx-staging/catlyn    | 16 Nov 18 14:32 UTC | user-yyyyyyyy |
| kiya optimus 2  | api-keys/xxxxxxx-staging/ciske     | 13 Nov 18 15:28 UTC | user-yyyyyyy |
| kiya optimus 3  | api-keys/xxxxxxxx-staging/dagobert  | 13 Nov 18 13:51 UTC | user-yyyyyy|

The following command will copy the unencrypted value of api-keys/xxxxxxxx-staging/dagobert to the clipboard:

kiya optimus 3

but so does

kiya optimus copy api-keys/xxxxxxxx-staging/dagobert
emicklei commented 5 years ago

problem with this change is that users may think that the index is fixed, e.g. kiya optimus 1 always refers to api-keys/xxxxxx-staging/catlyn which is not the case. The number is valid for this snapshot of sorted keys. If in the meantime some user adds a key that the number could refer to a different key. One way to notify the user about this is to print the actual command being exectued. E.g printing

kiya optimus copy api-keys/xxxxxx-staging/catlyn

emicklei commented 5 years ago

i think in practice, one will anyway copy an expression from the output in the terminal instead of acutally typing "kiya optimus 1".

Therefore, I propose to close this as "yagni"