uhd-urz / elAPI

An extensible API client for eLabFTW
GNU Affero General Public License v3.0
5 stars 0 forks source link

Add patch command - [merged] #75

Closed alexander-haller closed 2 months ago

alexander-haller commented 8 months ago

In GitLab by @mhxion on Dec 16, 2023, 21:19

Merges add-patch-api -> dev

This PR adds a new patch command which makes HTTP PATCH requests. The goal was to discover the way to change member password. For now, we are able to make basic PATCH requests.

Change member password

Unfortunately, this isn't documented. I could only find it from eLabFTW's OpenAPI specification. For now, we can change a member password in the following simplest way as we intend to implement the full feature later.

# Change your own password
$ elapi patch users --id me -d '{"action": "updatepassword", "password": "<new password>"}'

patch usage

patch command can be really powerful as it allows us to make changes to eLabFTW server settings. E.g., we can update the time (in minutes) after which the authentication cookie will expire if we wish to logout every member.

$ elapi patch config -d '{"cookie_validity_time": 43200}'

We can also publish an announcement:

$ elapi patch config -d '{"announcement": "Server will be down tomorrow at midnight due to scheduled maintenance."}'
alexander-haller commented 8 months ago

In GitLab by @mhxion on Dec 16, 2023, 21:19

requested review from @alexander-haller

alexander-haller commented 8 months ago

In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Dec 16, 2023, 21:21

added 1 commit

Compare with previous version

alexander-haller commented 8 months ago

approved this merge request