Skip to main content

User Management

users/config

The user configuration. Can be updated with users/add, users/modify, users/remove and users/http_auth_update.

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/users/config
{
"users": [
{
"next_user_id": 5,
"http_auth_enabled": true,
// Not returned
"http_auth_username": null,
// Not returned
"digest_hash": null,
"users": [
// Example data
{
"id": 1,
"roles": 15,
"current": 32000,
"display_name": "Anonymous User",
"username": "anonymous",
"digest_hash": ""
}
]
}
],
// Nutzer 2 und 4 wurden gelöscht.
"next_user_id": 5,
"http_auth_enabled": true
}
NameDescription
users
object[17]

The users

  • [0..16] - A user
NameDescription
id
int

ID of the user (1-255)

roles
int

Permissions of the user. Not yet used.

current
int (mA)

Charging current allowed for this user 6000 (=6 Ampere) to 32000 (=32 Ampere) or 0 to prohibit charging for this user

display_name
string

Display name of the user. Also used in the charge tracker.

username
string

Username for logging into the web interface and HTTP API.

digest_hash
string

HTTP Digest hash. Returned as empty string if login is disabled for this user. Returned as null if login is enabled for this user.

next_user_id
int

ID of the next user to be created.

http_auth_enabled
bool

Indicates whether credentials are required to use the web interface and HTTP API.

  • true - If credentials should be required.
  • false - If not.



users/add

Adds a new user.

Example
# $HOST e.g. warp-AbCd

Write

curl http://$HOST/users/add -d '{
"id": 5,
"roles": 65535,
"current": 32000,
"display_name": "Neuer Benutzer",
"username": "testuser",
"digest_hash": "926011006c2686471698e86690b7e500"
}'

id muss der next_user_id aus users/config entsprechen, damit der Nutzer angelegt wird. digest_hash = MD5("testuser:esp32-lib:testpass")

NameDescription
id
int

ID of the user to be created. Must match the current value of next_user_id from users/config.

roles
int

Permissions of the user. Not yet used.

current
int (mA)

Charging current allowed for this user 6000 (=6 Ampere) to 32000 (=32 Ampere) or 0 to prohibit charging for this user

display_name
string

Display name of the user. Also used in the charge tracker.

username
string

Username for logging into the web interface and HTTP API.

digest_hash
string

HTTP Digest hash of the user to be created. An empty string prohibits login to the web interface.




users/remove

Deletes a user.

Example
# $HOST e.g. warp-AbCd

Write

curl http://$HOST/users/remove -d '{ "id": 4 }'

or abbreviated:

curl http://$HOST/users/remove -d '4'
NameDescription
id
int

ID of the user to be deleted




users/modify

Modifies a user.

Example
# $HOST e.g. warp-AbCd

Write

curl http://$HOST/users/modify -d '{
"id": 5,
"roles": null,
"current": null,
"display_name": "Neuer Benutzer (ohne Login)",
"username": null,
"digest_hash": ""
}'

Ändert beispielsweise nur den Anzeigenamen vom Benutzer mit der ID 5 und löscht dessen Passwort. Dieser Nutzer kann sich dann nicht mehr im Webinterface einloggen oder die HTTP-API verwenden.

NameDescription
id
int

ID of the user to be modified.

roles
int

Permissions of the user. Not yet used.

current
int (mA)

Charging current allowed for this user 6000 (=6 Ampere) to 32000 (=32 Ampere) or 0 to prohibit charging for this user

display_name
string

Display name of the user. Also used in the charge tracker.

username
string

Username for logging into the web interface and HTTP API.

digest_hash
string

HTTP Digest hash of the user. An empty string prohibits login to the web interface.




users/http_auth_update

Writes http_auth_enabled from users/config.

Example
# $HOST e.g. warp-AbCd

Write

curl http://$HOST/users/http_auth_update -d '{ "enabled": false }'

or abbreviated:

curl http://$HOST/users/http_auth_update -d 'false'
NameDescription
enabled
bool

Specifies whether credentials are required to use the web interface and HTTP API.

  • true - If credentials should be required.
  • false - If not.



users/all_usernames

For charge tracking, the display names of deleted users are stored separately in flash. This function returns all display names that may appear in tracked charging sessions in a binary format.