Commit Graph

73 Commits

Author SHA1 Message Date
Adrià Casajús 31896ff262
Replace black and flake8 with ruff (#1943) 2023-11-21 16:42:18 +01:00
Adrià Casajús 7f9ce5641f
Feat: Added parallel limiter to prevent sqlalchemy transaction issues (#1360)
* Feat: Added parallel limiter to prevent sqlalchemy transaction issues

* Remove logs

* Moved initialization to its own file

* Throw exception

* Added test

* Add redis to gh actions

* Added v6 to the name

* Removed debug prints

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-10-27 10:07:02 +02:00
Adrià Casajús 25fde11a86
Refactor alias suffix (#1194)
* Extract suffix generation and validation to a module

* Updated tests

* Make custom alias use signed suffixes

* Added the signature check to the module

* Fix invalid route

* Move more suffix related stuff

* Fix tests

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-07-27 17:40:22 +02:00
Son 9ff323c746 make sure to set custom_domain_id when creating a new alias 2022-01-06 15:29:37 +01:00
Son b7e8324e5a move get_custom_domain() to alias_utils 2022-01-06 15:20:09 +01:00
Son 61226545c2 handle the 2 consecutive dots in alias 2021-12-31 11:15:24 +01:00
Son eec2880c41 fix case signed_suffix is None 2021-12-15 17:12:27 +01:00
Son 226ce9333c return error if invalid alias address 2021-12-02 16:17:41 +01:00
Son b5c2d9ee2a fix custom domain not correctly set on /v2/alias/custom/new and /v3/alias/custom/new 2021-11-22 16:20:50 +01:00
Son 4a90c79753 make sure mailbox_ids is a list in /api/v3/alias/custom/new 2021-10-23 15:55:39 +02:00
Son ecdce2307f make sure input of /api/v3/alias/custom/new is a dict 2021-10-23 15:52:17 +02:00
Son 372466ab06 do not use flask-sqlalchemy
- add __tablename__ for all models
- use sa and orm instead of db
- rollback all changes in tests
- remove session in @app.teardown_appcontext
2021-10-12 14:36:47 +02:00
Son Nguyen Kim 5ac78f2694 reformat 2021-09-08 11:29:55 +02:00
Son NK 3308919906 Remove /alias/custom/new 2021-06-05 17:41:28 +02:00
Son NK aa667851e9 log user-agent in deprecated endpoint 2021-05-28 17:46:34 +02:00
Son NK 8cfd5e01dc add alerts on /alias/custom/new and /v3/alias/options and below 2021-05-25 19:36:45 +02:00
Son NK d5de99afe9 Restore /alias/custom/new as currently used by safari 2021-03-31 14:41:32 +02:00
Son NK 1cac625a90 restore /v2/alias/custom/new as used by browser extension 2021-03-25 19:18:50 +01:00
Son NK acc285abf0 remove /alias/custom/new, /v2/alias/custom/new, refactor test 2021-03-24 16:39:49 +01:00
Son NK 0c62ac4b1f set rate limit for creating alias endpoint 2021-03-24 16:26:42 +01:00
Son NK 66abbf2614 make sure to remove \n from alias name 2020-12-02 12:25:23 +01:00
Son NK 5b9dc88c67 make sure alias prefix cannot be more than 40 chars 2020-11-18 10:38:35 +01:00
Son NK a890557c7f Use check_alias_prefix() to check alias prefix 2020-11-03 10:39:08 +01:00
Son NK 2d395f99bb make sure to remove whitespace in alias 2020-09-02 09:56:16 +02:00
Son NK fdedc24358 black new version 2020-08-27 10:20:48 +02:00
Son NK 9237f43c19 use warning log level for tampered alias 2020-08-24 19:58:21 +02:00
Son NK 6437ee46e0 use LOG.exception instead of LOG.error to provide stacktrace 2020-07-17 12:59:07 +02:00
Son NK 8f17cda794 use warning error for alias expiration error 2020-07-13 20:40:26 +02:00
Son NK 28c96d0d35 return 412 when alias ceration time is expired 2020-07-11 19:23:56 +02:00
Son NK c91b44fa97 set rate limit to 5/minute on new alias routes 2020-06-24 10:32:22 +02:00
Son NK 774ffcae3b enable CORS on /api endpoints 2020-06-24 10:30:01 +02:00
Son NK ee6a1a672d fix POST /v2/alias/custom/new when DISABLE_ALIAS_SUFFIX is set 2020-06-15 23:35:20 +02:00
Son NK 1a22d0cf9b fix domain can be null in self-hosting
# Conflicts:
#	app/api/views/new_custom_alias.py
#	app/dashboard/views/custom_alias.py
2020-06-15 15:58:05 +02:00
Son NK 9fc0748fcc Support setting alias name in POST /api/v3/alias/custom/new 2020-06-03 21:22:29 +02:00
Son NK 48dc0dd1cc change mailboxes to mailbox_ids 2020-06-02 20:06:32 +02:00
Son NK d055989239 Create POST /api/v3/alias/custom/new 2020-06-02 09:33:56 +02:00
Son NK adce27b88b Add DomainDeletedAlias.get_by check when creating custom alias 2020-05-23 19:49:40 +02:00
Son NK 1d598252e7 format 2020-05-23 19:18:50 +02:00
Son NK 42b3666f45 use the alias v2 format for GET /api/aliases/:alias_id, POST /api/v2/alias/custom/new, POST /api/v2/alias/random/new 2020-05-23 19:18:24 +02:00
Son NK 2fbc2c171b check domain trash when creating custom alias in api 2020-05-23 12:02:01 +02:00
Son NK cb036f651d do not call lower() on signed_suffix 2020-05-20 18:23:13 +02:00
Son NK 93d972df09 make sure to use lowercase for alias email 2020-05-20 18:12:14 +02:00
Son NK b95b758692 Optimize imports 2020-05-09 20:49:38 +02:00
Son NK 2f5a03dcad make sure to add alias into global trash when deleting it 2020-05-07 22:27:27 +02:00
Son NK 806f7016ae fix: wrongly set alias custom_domain when custom_domain is in EMAIL_ALIAS 2020-05-07 20:48:11 +02:00
Son NK 35b1972730 increase the expired alias creation session to 600 secs 2020-05-06 10:10:47 +02:00
Son NK d9e9a54082 add more info in "alias expire" error 2020-05-06 10:09:17 +02:00
Son NK 62bec84900 Add obsolete warnings 2020-05-02 16:23:40 +02:00
Son NK d32669f515 Add /api/v2/alias/custom/new 2020-05-02 16:22:17 +02:00
Son NK 0edcc25289 refactor verify_prefix_suffix: remove user_custom_domains param 2020-05-02 12:27:54 +02:00