13.1.1.4. System endpoints

The code of this module is tested in tests/test_api_system.py

POST /system/setDefault
method:
system/set
description:
define default settings for tokens. These default settings are used when new tokens are generated. The default settings will not affect already enrolled tokens.
arguments:
DefaultMaxFailCount - Default value for the maximum allowed
authentication failures
DefaultSyncWindow - Default value for the synchronization
window

DefaultCountWindow - Default value for the coutner window DefaultOtpLen - Default value for the OTP value length –

usually 6 or 8
DefaultResetFailCount - Default value, if the FailCounter should
be reset on successful authentication [True|False]
returns:
a json result with a boolean
“result”: true
exception:
if an error occurs an exception is serialized and returned
POST /system/setConfig

set a configuration key or a set of configuration entries

parameter are generic keyname=value pairs.

*remark: In case of key-value pairs the type information could be
provided by an additional parameter with same keyname with the postfix ”.type”. Value could then be ‘password’ to trigger the storing of the value in an encrypted form
Parameters:
  • key – configuration entry name
  • value – configuration value
  • type – type of the value: int or string/text or password password will trigger to store the encrypted value
  • description – additional information for this config entry
  • or
Parameters:
  • pairs (key-value) – pair of &keyname=value pairs
Return:

a json result with a boolean “result”: true

GET /system/

This endpoint either returns all config entries or only the value of the one config key.

Parameters:
  • key – The key to return.
Return:

A json response or a single value, when queried with a key.

Rtype:

json or scalar

GET /system/(key)

This endpoint either returns all config entries or only the value of the one config key.

Parameters:
  • key – The key to return.
Return:

A json response or a single value, when queried with a key.

Rtype:

json or scalar

DELETE /system/(key)

delete a configuration key * if an error occurs an exception is serializedsetConfig and returned

Parameters:
  • key – configuration key name
Returns:

a json result with the deleted value