linotp.controllers.tools module

tools controller

class linotp.controllers.tools.ToolsController(name, install_name='', **kwargs)

Bases: BaseController

import_users()

POST /tools/import_users

import users from a csv file into an dedicated sql resolver

Parameters
  • file – the file containing the users

  • resolver – the resolver where the users should belong to

  • dryrun – only test a test run without real import of the users

  • format – the import file format ‘csv’ or ‘password’

  • skip_header – in case of a csv file the first line might contain a description of the columns and could be skiped

  • passwords_in_plaintext – bool - should the passwords be hashed?

  • column_mapping – in case of the csv, define the meaning of the colums

  • delimiter – in case of csv define the colum delimiter

  • quotechar – define how text is quoted

Returns

a json result with a boolean status and request result

Raises

Exception – if an error occurs an exception is serialized and returned

migrate_resolver()

POST /tools/migrate_resolver

migrate all users and their token into a new resolver

Raises:

Exception: _description_

Returns

a json result with a boolean status and request result

Raises

Exception – if an error occurs an exception is serialized and returned

setPassword()

POST /tools/setPassword

abilty to set password in managed / admin_user resolver

Parameters
  • old_password – the old password

  • new_password – the new password

Returns

a json result with a boolean status and request result

Raises

Exception – if an error occurs an exception is serialized and returned