Commit Graph

28 Commits

Author SHA1 Message Date
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
6eb702870c handle the case alias is in trash 2021-11-17 10:56:43 +01:00
Son
416eafaeb9 use the first alias suffix when creating a new random alias 2021-11-12 11:04:00 +01:00
Son
611fb8a20c take into account user.include_website_in_one_click_alias in /api/alias/random/new 2021-11-12 09:45:31 +01: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
David Siregar
1cc8f7f2e3 fixed wrong description of error 2021-09-14 21:28:51 +02:00
Son NK
0c62ac4b1f set rate limit for creating alias endpoint 2021-03-24 16:26:42 +01: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
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
48202e905f rename verify_api_key -> require_api_auth 2020-04-25 13:42:53 +02:00
Son NK
425fdc66c6 Move methods to api/serializer.py 2020-04-05 16:32:38 +02:00
Son NK
f15488f96b refactor: move get_alias_infos_with_pagination, get_alias_info to alias.py 2020-04-05 16:21:13 +02:00
Son NK
97dff83453 return full alias info in POST /api/alias/random/new 2020-03-26 19:50:22 +01:00
Son NK
7d4a9efb5d set user_id when creating AliasUsedOn 2020-03-20 12:29:11 +01:00
Son NK
2d90d35647 rename gen_email_id -> alias_id 2020-03-17 12:01:18 +01:00
Son NK
4f281bdbbb rename GenEmail -> Alias, gen_email to alias whenever possible 2020-03-17 11:51:40 +01:00
Son NK
ab082a5f9b fix get_json returns 400 2020-03-11 14:02:35 +01:00
Son NK
1098f17c0c Support note in POST /api/alias/random/new 2020-03-11 12:24:30 +01:00
Son NK
a6f4059d5d make sure to set mailbox_id when creating GenEmail 2020-03-05 17:03:07 +01:00
Son NK
e10981f85e able to create word-based or uuid-based in /api/alias/random/new endpoint 2020-02-07 21:30:46 +07:00
Son NK
377e6c657d add /api/alias/random/new 2020-01-05 21:15:16 +01:00
Son NK
e5079e48da remove can_create_new_random_alias() 2019-12-15 18:55:18 +02:00
Son NK
7f6267cc4a call LOG.error on obsolete endpoints: /alias/new and /alias/random/new 2019-12-15 18:55:17 +02:00
Son NK
d9c211d8da fix api create new custom alias 2019-12-15 18:55:17 +02:00
Son NK
d58ab8c808 fix create random alias: new alias not saved 2019-12-15 18:55:16 +02:00
Son NK
8250ab2f22 add /alias/custom/new and /alias/random/new 2019-12-15 18:55:16 +02:00