dwp / queue-triage

DLQ processing support
MIT License
5 stars 4 forks source link

Password for the Mongo create user script should be configurable #154

Closed amcghie closed 6 years ago

amcghie commented 6 years ago

The password for the failedMessageUser in the mongo-queue-triage-users.sh script is currently hardcoded. It should be possible to pass in a password to the script.

amcghie commented 6 years ago

The following scripts were updated:

amcghie commented 6 years ago

Output from mongo-queue-triage-roles.sh --help:

usage: mongo-queue-triage-roles.sh [-h] [--authUser AUTHUSER]
                                   [--authPassword [AUTHPASSWORD]]
                                   [--authDb AUTHDB] [--dbAddress DBADDRESS]
                                   [--appDb APPDB]

optional arguments:
  -h, --help                     show this help message and exit
  --authUser     AUTHUSER        username for authentication (default: admin)
  --authPassword [AUTHPASSWORD]  password for authentication (default: Passw0rd)
  --authDb       AUTHDB          database for authentication (default: admin)
  --dbAddress    DBADDRESS       database address (default: localhost:27017)
  --appDb        APPDB           database for the queue-triage application (default: queue-triage)

Output from mongo-queue-triage-users.sh --help:

$ ./core/dao-mongo/src/main/resources/mongo-queue-triage-users.sh --help
usage: mongo-queue-triage-users.sh [-h] [--authUser AUTHUSER]
                                   [--authPassword [AUTHPASSWORD]]
                                   [--authDb AUTHDB] [--dbAddress DBADDRESS]
                                   [--appDb APPDB] [--appUser APPUSER]
                                   [--appPassword [APPPASSWORD]]

optional arguments:
  -h, --help                     show this help message and exit
  --authUser     AUTHUSER        username for authentication (default: admin)
  --authPassword [AUTHPASSWORD]  password for authentication (default: Passw0rd)
  --authDb       AUTHDB          database for authentication (default: admin)
  --dbAddress    DBADDRESS       database address (default: localhost:27017)
  --appDb        APPDB           database for the queue-triage application (default: queue-triage)
  --appUser      APPUSER         username for the queue-triage application (default: failedMessageUser)
  --appPassword  [APPPASSWORD]   password for the application user (default: Passw0rd)

Output from mongo-queue-triage-indexes.sh --help:

usage: mongo-queue-triage-indexes.sh [-h] [--authUser AUTHUSER]
                                   [--authPassword [AUTHPASSWORD]]
                                   [--authDb AUTHDB] [--dbAddress DBADDRESS]
                                   [--appDb APPDB]

optional arguments:
  -h, --help                     show this help message and exit
  --authUser     AUTHUSER        username for authentication (default: admin)
  --authPassword [AUTHPASSWORD]  password for authentication (default: Passw0rd)
  --authDb       AUTHDB          database for authentication (default: admin)
  --dbAddress    DBADDRESS       database address (default: localhost:27017)
  --appDb        APPDB           database for the queue-triage application (default: queue-triage)
amcghie commented 6 years ago

The gradle tasks need to be ordered so that the createMongoUsers task executes after the createMongoRoles.

Reopening