Commit Graph

31 Commits

Author SHA1 Message Date
Florent Daigniere
2db75921a2 Ensure we have an api_token 2024-04-20 08:46:47 +02:00
Florent Daigniere
4837a05c71 simplify the logic 2024-04-18 19:37:02 +02:00
Dimitri Huisman
9e468100a0 Fix issues with forward_destination in api and user form
* form
  * Fixed: Internal error occurred if an empty forward_destination was entered and forward_enabled was false
  * Fixed: form did not check if forward_destination is empty.
  * Fixed: form marked forward_destination field as read-only upon reloading form upon validation error
* api - create user and update/patch user
  * Create/Patch user did not check if forward_destination email address is valid
  * Create/Patch user did not check if forward_destination is present and forward_enabled is true
2024-03-23 14:14:43 +00:00
Dimitri Huisman
2558ae3bc9 Add automatic tests for RESTful API. Fix all remaining issues that I could find with the API. 2024-03-22 15:01:37 +00:00
bors-mailu[bot]
8bf5299f21 Merge #3194
3194: Fix 3113 r=mergify[bot] a=Diman0

## What type of PR?

bug-fix

## What does this PR do?
Fixes swaggerui documentation of all RESTful api end points. The API documentation should now be valid for each endpoint. 

### Related issue(s)
- close #3113 


## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [x] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Dimitri Huisman <diman@huisman.xyz>
2024-03-18 08:10:44 +00:00
Florent Daigniere
a1d8ff630f review2 2024-03-11 14:45:59 +01:00
Florent Daigniere
58b1738d8c api 2024-03-11 11:15:15 +01:00
Florent Daigniere
b2d37c4323 Make it clear that there may be more than one 2024-03-11 10:26:38 +01:00
Dimitri Huisman
6627dd2924 API: Create user did not handle exception of duplicate user 2024-01-24 10:57:30 +00:00
Dimitri Huisman
8f86ffc6fd Fix #3113. RESTful API was not correctly documented. 2024-01-22 10:44:30 +00:00
Dimitri Huisman
0026b8db24 Enhance RESTful API user retrieval with quota used bytes. This is the current size of the user's email box in bytes. 2023-10-11 15:49:52 +00:00
Dimitri Huisman
0718de824b Forgot to remove debug logging. Use rfc5737 for IP addresses in documentation. 2023-10-10 10:46:52 +00:00
Dimitri Huisman
3d9a8bc21f RESTful API bugfix for domains. Add authentication tokens to API 2023-10-09 16:19:20 +00:00
Florent Daigniere
0e4c29c269 Clarify further, use the API suggested by ghostwheel42 in (b) 2023-08-19 16:35:22 +02:00
Florent Daigniere
4c675009a2 Update core/admin/mailu/api/v1/user.py
doh

Co-authored-by: Dimitri Huisman <52963853+Diman0@users.noreply.github.com>
2023-08-18 17:45:40 +02:00
Florent Daigniere
a338e9c75e Fix API call 2023-08-17 23:41:15 +02:00
Florent Daigniere
7b13ceb693 API and cmdline 2023-08-12 08:51:42 +02:00
Florent Daigniere
786da5e08c clarify 2023-08-11 09:03:42 +02:00
Florent Daigniere
bd4c40b596 Prune sessions that are unrelated when changing passwords 2023-08-10 12:27:47 +02:00
Dimitri Huisman
d6e7314f05 Make API configurable via the setup utility
Fix some small bugs in the setup utility
Improve documentation on the API.
2023-01-25 15:30:25 +00:00
Dimitri Huisman
b0569035ae Change PUT method to PATCH method.
This better reflects what the interface does.
2023-01-12 10:55:49 +00:00
Dimitri Huisman
3cb8358090 Process review comments PR#2464
- When visiting root of WEB_API, the swaggerui is shown
- simplify the condition for endpoint WEB_API
2022-12-27 11:32:58 +01:00
Dimitri Huisman
39b0d44079 Use first() instead of all() for better performance
Actually return all data for Get user
Remove non-used code
2022-12-27 11:32:57 +01:00
Dimitri Huisman
f9b26bd934 Update User with newly introduced allow spoofing field 2022-12-27 11:32:57 +01:00
Dimitri Huisman
6347c18f8a Process review comments (PR2464) 2022-12-27 11:32:57 +01:00
Dimitri Huisman
61d092922c Process review comments (PR2464) 2022-12-27 11:32:57 +01:00
Dimitri Huisman
afb224e796 Update password hash description for user API endpoint 2022-12-27 11:32:57 +01:00
Dimitri Huisman
d4e5db5084 Remove unneeded comment 2022-12-27 11:32:56 +01:00
Dimitri Huisman
7a36f6bbb9 Use hmac.compare_digest to prevent timing attacks. 2022-12-27 11:32:56 +01:00
Dimitri Huisman
5c9cdfe1de Introduction of the Mailu RESTful API.
Anything that can be configured in the web administration interface,
can also be configured via the Mailu RESTful API.
See the section Advanced configuration in the configuration reference
for the relevant settings in mailu.env for enabling the API.
(API, WEB_API, API_TOKEN).
2022-12-27 11:32:54 +01:00
Alexander Graf
866ad89dfc first try at api using flask-restx & marshmallow 2022-12-27 11:20:59 +01:00