Management Commands

Django manage.py get_secret command: decrypt and display the value of a named Secret.

Usage:

python manage.py get_secret --name <secret name> --username <username>

The Secret is looked up by name among those the user may read: their own, and those shared with them. The decrypted value is printed to stdout, so use the command only where the console output is private.

class smarter.apps.secret.management.commands.get_secret.Command(*args, **kwargs)[source]

Bases: SmarterCommand

Django manage.py get_secret command, which decrypts and displays the value of a Secret.

add_arguments(parser)[source]

Add arguments to the command.

handle(*args, **options)[source]

Decrypt the Secret and write its value to stdout.

Django manage.py update_secret command: replace the value of a user’s Secret.

Usage:

python manage.py update_secret --name <secret name> --username <username> [--value <value>]

The Secret must be owned by the user. Without --value, the command prompts for the value, so that it is not recorded in the shell’s history. The value is encrypted before it is saved.

class smarter.apps.secret.management.commands.update_secret.Command(*args, **kwargs)[source]

Bases: SmarterCommand

Django manage.py update_secret command, which encrypts and saves a new value for a Secret.

add_arguments(parser)[source]

Add arguments to the command.

handle(*args, **options)[source]

Encrypt the new value, and save it to the Secret.