SuccessChanges

Summary

  1. Add a script to setup the DB auth for a simple scenario (commit: b090a41b42e82bb8cabd6fcde26ecdd8434e7757) (details)
Commit b090a41b42e82bb8cabd6fcde26ecdd8434e7757 by shankari
Add a script to setup the DB auth for a simple scenario
More complex scenarios can be created using the APIs in
https://docs.mongodb.com/manual/reference/command/usersInfo/
Testing done:
```
(emission) $ ./e-mission-py.bash setup/db_auth.py  -s Created admin
user, result = {'ok': 1.0} At current state, list of users = {'users':
[{'_id': 'admin.test-admin', 'user': 'test-admin', 'db': 'admin',
'roles': [{'role': 'userAdminAnyDatabase', 'db': 'admin'}]}], 'ok': 1.0}
Created RW user, result = {'ok': 1.0} At current state, list of users =
{'users': [{'_id': 'admin.test-admin', 'user': 'test-admin', 'db':
'admin', 'roles': [{'role': 'userAdminAnyDatabase', 'db': 'admin'}]},
{'_id': 'admin.test-rw', 'user': 'test-rw', 'db': 'admin', 'roles':
[{'role': 'readWrite', 'db': 'Stage_database'}]}], 'ok': 1.0} Created
new role, result = {'ok': 1.0} At current state, list of roles =
{'roles': [{'role': 'createIndex', 'db': 'Stage_database', 'isBuiltin':
False, 'roles': [], 'inheritedRoles': [], 'privileges': [{'resource':
{'db': 'Stage_database', 'collection': ''}, 'actions':
['createIndex']}], 'inheritedPrivileges': [{'resource': {'db':
'Stage_database', 'collection': ''}, 'actions': ['createIndex']}]}],
'ok': 1.0} Created RO user, result = {'ok': 1.0} At current state, list
of users = {'users': [{'_id': 'admin.test-admin', 'user': 'test-admin',
'db': 'admin', 'roles': [{'role': 'userAdminAnyDatabase', 'db':
'admin'}]}, {'_id': 'admin.test-rw', 'user': 'test-rw', 'db': 'admin',
'roles': [{'role': 'readWrite', 'db': 'Stage_database'}]}, {'_id':
'admin.test-ro', 'user': 'test-ro', 'db': 'admin', 'roles': [{'role':
'readWrite', 'db': 'Stage_database'}]}], 'ok': 1.0}
```
```
(emission) $ ./e-mission-py.bash setup/db_auth.py  -t Dropped new role,
result = {'ok': 1.0} At current state, list of roles = {'roles': [],
'ok': 1.0} Dropped RO user, result = {'ok': 1.0} At current state, list
of users = {'users': [{'_id': 'admin.test-admin', 'user': 'test-admin',
'db': 'admin', 'roles': [{'role': 'userAdminAnyDatabase', 'db':
'admin'}]}, {'_id': 'admin.test-rw', 'user': 'test-rw', 'db': 'admin',
'roles': [{'role': 'readWrite', 'db': 'Stage_database'}]}], 'ok': 1.0}
Dropped RW user, result = {'ok': 1.0} At current state, list of users =
{'users': [{'_id': 'admin.test-admin', 'user': 'test-admin', 'db':
'admin', 'roles': [{'role': 'userAdminAnyDatabase', 'db': 'admin'}]}],
'ok': 1.0} Dropped admin user, result = {'ok': 1.0} At current state,
list of users = {'users': [], 'ok': 1.0}
```
(commit: b090a41b42e82bb8cabd6fcde26ecdd8434e7757)
The file was addedsetup/db_auth.py