Commit graph

53 commits

Author SHA1 Message Date
samm81
0d741022a9
http: add rate limiting (mainly for google)
- google calendar uses the `403` and `429` codes to perform rate limiting [1][2]. this pr adds `tenacity` to perform exponential back off as suggested in google calendar's docs [3].

[1]: https://developers.google.com/workspace/calendar/api/guides/errors#403_rate_limit_exceeded
[2]: https://developers.google.com/workspace/calendar/api/guides/errors#429_too_many_requests
[3]: https://developers.google.com/workspace/calendar/api/guides/quota#backoff
2025-09-12 16:20:44 +07:00
Mike A.
35f299679f Rewrite guess auth test for unsupported status 2024-09-11 12:04:05 +02:00
Mike A.
67e1c0ded5 Make tests pass 2024-09-11 12:04:05 +02:00
Hugo Osvaldo Barrera
b50f9def00 Ensure type annotations are backwards compatible
Related: https://github.com/pimutils/todoman/issues/544
2023-10-29 16:04:23 +01:00
Hugo Osvaldo Barrera
2fbb0ab7a5 Clean up some invalid TLS configuration branches 2022-09-20 23:01:50 +02:00
Hugo Osvaldo Barrera
60352f84fe Untangle auth handling
This was a bit entangled and messed up due to recent changes.
2022-09-20 23:01:50 +02:00
Hugo Osvaldo Barrera
5b8f00e720 Sort imports 2021-07-25 18:35:47 +02:00
Hugo Osvaldo Barrera
1a1f6f0788 Initial async support
Add asyncio to the storage backends and most of the codebase. A lot of
it merely uses asyncio APIs, but still doesn't actually run several
things concurrently internally. Further improvements will be added on
top of these changes

Thanks to  Thomas Grainger (@graingert) for a few useful pointers
related to asyncio.
2021-06-26 13:40:35 +02:00
Hugo Osvaldo Barrera
d2d41e5df1 Use black to auto-format the codebase 2021-05-06 19:28:54 +02:00
Hugo Osvaldo Barrera
b1b4dd92fe Sort imports
I don't want to ever have to sort imports again. It's a poor use of
developer time. Automate this with a pre-commit hook, and check this on
CI.

Developers: I suggest you configure your editor to use
`reorder_python_imports`. It uses the standard sorting, and detects
first/third party libs well.
2020-06-09 14:34:45 +02:00
Hugo Osvaldo Barrera
308289febf Remove python2 leftover code 2020-06-08 18:40:33 +02:00
Markus Unterwaditzer
5a257ec2cd config: Add warning about unquoted strings 2016-10-23 01:40:04 +02:00
Markus Unterwaditzer
dd5f76ca5d ignore UIDs in http storage 2016-09-25 14:03:46 +02:00
Markus Unterwaditzer
e4a0afcf00 Make auth = basic the default again (#477)
Fix #461
Fix #457
2016-06-17 14:35:06 +02:00
Markus Unterwaditzer
d24f3835ef Replace text/icalendar with text/calendar
Fix #455
2016-05-25 19:23:25 +02:00
Markus Unterwaditzer
a90815f5df Improve errorhandling for enduser 2015-04-28 17:57:00 +02:00
Markus Unterwaditzer
8c7af4bfc9 Disallow verify=false 2015-04-28 16:56:05 +02:00
Markus Unterwaditzer
575d270e06 Use FingerprintAdapter from req-toolbelt
Fix #187
2015-04-11 15:03:07 +02:00
Markus Unterwaditzer
5ce0d97f91 Remove copyright headers 2015-01-21 13:02:30 +01:00
Markus Unterwaditzer
5509868958 Revert "Revert "Tls fingerprints"" 2014-08-20 18:43:34 +02:00
Markus Unterwaditzer
c86ad88c96 Revert "Tls fingerprints" 2014-08-20 18:38:59 +02:00
Thomas Weißschuh
d5e8be4979 [tests] directly monkeypatch requests Session
need for later changes
2014-08-18 19:11:07 +00:00
Markus Unterwaditzer
2fd4aaead3 Add tests for prepare_auth 2014-08-15 18:29:11 +02:00
Markus Unterwaditzer
201c840e88 Import beautification 2014-06-19 00:07:54 +02:00
Markus Unterwaditzer
fc9ca4177f Add a test for HttpStorage.read_only 2014-06-12 15:14:36 +02:00
Markus Unterwaditzer
c1eb55c241 Copyright and contributor stuff
Fix #60
2014-05-22 12:50:43 +02:00
Markus Unterwaditzer
bcf6c0612e Move vobject utils to own module 2014-05-16 13:51:55 +02:00
Markus Unterwaditzer
46f7a0cb05 Flake8 2014-05-15 15:18:25 +02:00
Markus Unterwaditzer
61ef8b3ee3 Use icalendar for parsing 2014-05-15 15:14:06 +02:00
Markus Unterwaditzer
cb29c2567f Allow uploading of items without UID 2014-05-14 14:48:50 +02:00
Markus Unterwaditzer
d3cff80beb Fix #51 2014-05-13 19:25:16 +02:00
Markus Unterwaditzer
2656ac7a92 Small refactoring for http storage 2014-05-12 20:16:17 +02:00
Markus Unterwaditzer
d781ac1101 Kill it with fire. 2014-05-03 21:52:05 +02:00
Markus Unterwaditzer
bb579a8879 Fix some imports 2014-05-02 19:30:38 +02:00
Markus Unterwaditzer
eb386c8dac TIMEZONE issue
Some URLs such as
https://mozorg.cdn.mozilla.net/media/caldata/JapanHolidays.ics

have VTIMEZONES at the top.
2014-05-01 22:08:13 +02:00
Markus Unterwaditzer
6e55e6d2c7 Remove useless class 2014-05-01 22:08:13 +02:00
Markus Unterwaditzer
969ebb653d Fix bug with multiline values
The URL that showed this error up was

https://mozorg.cdn.mozilla.net/media/caldata/GermanHolidays.ics

with the following entry:

BEGIN:VEVENT
CREATED:20061023T132503Z
LAST-MODIFIED:20101214T141313Z
DTSTAMP:20101214T141313Z
UID:917544590
SUMMARY:Heilige drei Könige
STATUS:CONFIRMED
RRULE:FREQ=YEARLY;BYMONTH=1
CATEGORIES:Feiertag
DTSTART;VALUE=DATE:20060106
DTEND;VALUE=DATE:20060107
DESCRIPTION:Christlicher Feiertag. Nur in Baden-Württemberg\, Bayern und
 Sachsen-Anhalt.
X-MOZ-GENERATION:1
END:VEVENT
2014-05-01 11:25:22 +02:00
Markus Unterwaditzer
4c492c06f3 Flake8 2014-04-30 00:41:51 +02:00
Markus Unterwaditzer
e66b43c839 Be Python 3 compatible
Not that anybody actually uses Python 3, but this helps very much with
finding obscure bugs.
2014-04-16 15:28:01 +02:00
Markus Unterwaditzer
65e6397806 Flake8 2014-04-11 15:49:15 +02:00
Markus Unterwaditzer
70b446e673 Merge branch 'issue29'
Conflicts:
	tests/storage/test_http.py
	vdirsyncer/storage/dav.py
2014-04-11 15:35:30 +02:00
Markus Unterwaditzer
633a7de28c Some rewrites to requests handling
Conflicts:
	tests/storage/test_http.py
	vdirsyncer/storage/dav.py
2014-04-11 15:27:31 +02:00
Markus Unterwaditzer
0c14b14f17 See #29 2014-04-11 15:03:38 +02:00
Markus Unterwaditzer
11cd1c7a05 Oh yeah, and... 2014-04-04 13:34:57 +02:00
Markus Unterwaditzer
58b24ad176 More tests for HTTPStorage 2014-04-04 13:32:39 +02:00
Markus Unterwaditzer
f4cdde9a52 Ability to handle missing UIDs. 2014-04-04 13:20:18 +02:00
Markus Unterwaditzer
d14dfcd5f8 More copyright headers
[ci skip]
2014-04-01 21:09:40 +02:00
Markus Unterwaditzer
8f1531a4b2 Fix http storage tests 2014-03-28 20:45:02 +01:00
Markus Unterwaditzer
736b7359a6 Flake8 2014-03-17 19:33:55 +01:00
Markus Unterwaditzer
17f9ccc895 Remove unittest inheritance 2014-03-17 19:30:39 +01:00