Skip to content

Feature request: ability to specify keystore parameters as environment variables #955

@lenkan

Description

@lenkan

Feature request description/rationale

I would like to be able to call kli commands that require keystore parameters such as --name, --base and possibly --passcode without having to supply them on the command line.

Example use:

export KERIPY_KEYSTORE_NAME="my_keystore"
export KERIPY_KEYSTORE_BASE="some_prefix"

# Now I can call kli incept without having to supply --name and --base parameters because they are stored in my environment.
kli incept --alias test --transferable --icount 1 --isith 1 --ncount 1 --nsith 1

# I can do more commands here without having to specify the keystore parameters
kli contacts list

The environment variables can be stored in files that I can source or load whichever way I want. If I run kli in a docker container, I would set the environment variables as part of the docker runtime.

Implementation

Implementation would be rather straightforward I think. We can just add default variables to the arguments.

parser.add_argument('--name', '-n', help='keystore name and file location of KERI keystore', required=True, default=os.getenv("KERIPY_KEYSTORE_NAME"))
parser.add_argument('--base', '-b', help='additional optional prefix to file location of KERI keystore', required=False, default=os.getenv("KERIPY_KEYSTORE_BASE") or "")

If you accept this feature request, I can open up a PR. Let me know your opinion. Also, whether or not you think the passcode can be added to the environment as well? If you think it is unsafe, we can add call it KERIPY_UNSAFE_PASSCODE or something, or skip it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions