Skip to content

Command Reference

Santiago Torres edited this page Sep 23, 2014 · 4 revisions

Using Django_pph.

This page contains an in-depth description of the management commands provided by django_pph.

### promote_user
$ ./manage.py promote_user [username]

Arguments

Promote user only takes the desired username to promote as its first argument; further arguments will be ignored by the command.

The context doesn't need to be unlocked in order for the command to succeed.

Errors

This command will fail under the following scenarios:

  • The username does not exist.
  • There are repeated usernames (this means your database is malformed).
  • The username is already part of the threshold accounts.
### demote_user
./manage.py demote_user [username]

This command removes a user from the accounts that count towards the threshold in the secret-recombination phase. In case a user becomes inactive or shouldn't be trusted, we advise to run this command right away.

In contrast to promote_user, this command needs an unlocked store in order to demote a user.

Arguments

Promote user only takes the desired username to promote as its first argument; further arguments will be ignored by the command.

Errors

Demote user will fail in the following scenarios

  • There are not enough threshold accounts to unlock the store after demoting the target user
  • There are more than one usernames (the database is inconsistent)
  • The username didn't belong to a threshold account
  • The store is not unlocked.
### migrate_user
$ ./manage.py migrate_user [username]

This command takes a user account that has been stored using a hash algorithm that's not Django_pph. In this case, we will attempt to turn the existing hash into a proper Django_pph thresholdless account. After this, we can also promote it to be a threshold account using promote_user.

Arguments

Update_user only takes the desired username to update as its first argument; further arguments will be ignored by the command.

Errors

Demote user will fail in the following scenarios

  • There are more than one usernames (the database is inconsistent)
  • The username's passsword is already a Django_pph compliant hash.
  • The username's password has been stored in a hash that's not supported by Django_pph for migration.
### setup_store

*** Warning, this command is intended to be called only once! ***

./manage.py setup_store username1 username2 ... usernameN

Arguments

A list of threshold users for the initial PolyPasswordHasher setup.

Errors

Setup store will fail in the following scenarios:

  • If the list provided doesnt comprise enough accounts to meet the threshold
  • If it is not possible to update the database.
  • The original hashes are not supported by PolyPasswordHasher