14.6.4. crate_anon.nlp_webserver.manage_users

crate_anon/nlp_webserver/manage_users.py


Copyright (C) 2015, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (rnc1001@cam.ac.uk).

This file is part of CRATE.

CRATE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

CRATE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CRATE. If not, see <https://www.gnu.org/licenses/>.


Manages the user authentication file for CRATE’s implementation of an NLPRP server.

crate_anon.nlp_webserver.manage_users.add_user(username: str, password: str) None[source]

Adds a username/password combination to the users file, hashing the password en route.

crate_anon.nlp_webserver.manage_users.change_password(username: str, password: str) None[source]

Changes a user’s password by rewriting the user file.

crate_anon.nlp_webserver.manage_users.get_users() Dict[str, str][source]

Reads the user file and returns a dictionary mapping usernames to hashed passwords.

crate_anon.nlp_webserver.manage_users.main() None[source]

Command-line entry point.

crate_anon.nlp_webserver.manage_users.rm_user(username: str) None[source]

Removes a user from the user file.