Commit Graph

1179 Commits

Author SHA1 Message Date
Unrud
3b71ab960e Log exceptions (Fixes #447)
Exceptions were just written to stderr but not into logs.
2016-08-25 05:24:24 +02:00
Unrud
c091399f5e Write log to stderr
Be consistent with python's default behavior and play nice with CGI.
2016-08-25 05:19:38 +02:00
Unrud
14515cfe27 Fix logger configuration
Apply patch from #485
2016-08-25 04:29:02 +02:00
Guillaume Ayoub
79bfa9c1d3 Merge pull request #482 from Unrud/smallimprovements
Some small cosmetic improvements for xmlutils
2016-08-24 18:11:06 +02:00
Guillaume Ayoub
c532948348 Merge pull request #487 from Unrud/filter
Fix empty filter
2016-08-24 18:10:03 +02:00
Unrud
f9cabfb20b Test empty filter
Test for d1dbd1df54
2016-08-24 17:52:39 +02:00
Unrud
d1dbd1df54 Fix empty filter
DAVdroid sends <CARD:filter />, which causes an exception.
2016-08-24 17:45:10 +02:00
Unrud
469efbb032 Cosmetics 2016-08-13 04:52:51 +02:00
Unrud
453a8ba636 Fix "fix this" in xmlutils 2016-08-13 04:51:42 +02:00
Unrud
ecd0a16214 Remove unused variable path 2016-08-13 04:48:59 +02:00
Unrud
1c6e626979 Simplify name_from_path and add error check 2016-08-13 04:47:35 +02:00
Guillaume Ayoub
3b29a56c81 Merge pull request #480 from Unrud/currentuserprincipal
Ask for authentication if current-user-principal is requested
2016-08-13 04:25:55 +02:00
Guillaume Ayoub
c9ac3114af Merge pull request #481 from Unrud/patch-35
Revert 1ffc171
2016-08-13 04:22:13 +02:00
Unrud
c29fd1ca61 Check that item is a collection 2016-08-13 00:19:14 +02:00
Unrud
cf4a6ef749 Revert 1ffc171f35
Maybe I misunderstand the RFC, but this properties are related to a principal collection. DAVdroid without preemptive authentication doesn't like this and tries to create calendars and addressbooks in /.
2016-08-13 00:17:50 +02:00
Unrud
4438d2ba9a Require user for current-user-principal
DAVdroid dropped support for preemptive authentication in version 1.2.3.
Returning the DAV:unauthenticated pseudo-principal as specified in RFC 5397 doesn't seem to work for DAVdroid.
2016-08-12 23:41:34 +02:00
Unrud
6515062bcd Return HTTP status in xmlutils.propfind 2016-08-12 23:34:08 +02:00
Guillaume Ayoub
2e29b0a21c Merge pull request #479 from Kozea/upload_all
Add an upload_all method for subsequent optimizations.
2016-08-12 15:08:59 +02:00
Florian Mounier
c95437367f This is very important 2016-08-12 15:05:05 +02:00
Florian Mounier
416f9ddef1 Add an upload_all method for subsequent optimizations. 2016-08-12 14:58:32 +02:00
Guillaume Ayoub
8d863e52b2 Re-enable properties storage on al collections
Fix #475.
2016-08-11 12:07:19 +02:00
Guillaume Ayoub
d3d29802ad Merge pull request #474 from Unrud/patch-31
PROPFIND rights checking
2016-08-11 11:44:43 +02:00
Guillaume Ayoub
e66a35e996 Merge pull request #476 from Unrud/closelockfile
Add option to close lock file
2016-08-11 11:43:40 +02:00
Guillaume Ayoub
f395e256ff Merge pull request #478 from Unrud/patch-33
Correctly write line endings to files
2016-08-11 11:43:18 +02:00
Guillaume Ayoub
f6ebccec57 Merge pull request #477 from Unrud/patch-32
Remove etags from raw data
2016-08-11 11:41:47 +02:00
Unrud
9e84b459ae Correctly write line endings to files
vobject uses \r\n as line endings. Writing this to a file is not a problem on Linux and newer versions of MacOS. On Windows \r\r\n gets written to disk and on older versions of MacOS \r\r gets written to disk, because python replaces \n by the system depended line ending.
2016-08-11 05:43:18 +02:00
Unrud
7a01f905de Enable close_lock_file for tests 2016-08-11 05:20:31 +02:00
Unrud
3f5dd70580 Add option to close lock file
Close the lock file, when no more clients are waiting.
This option is not very useful in general, but on Windows files that are opened cannot be deleted. This causes tests to fail, because the deletion of the temporary filesystem folder fails.
2016-08-11 05:19:23 +02:00
Unrud
0060130c3b Remove etags from raw data
Remove all etags that are directly calculated from data that's read from files.
1. They are not used anywhere (luckily).
2. Etags that are send to clients are calculated from the output of vobject's serialize method. If files are edited externally and vobject normalizes them (like wrapping long lines or replacing all line endings by \r\n), the etags that are sent to the client and the etags that are calculated from raw data will never match. If a new version of vobject is released and the formatting changes slightly, the checks will also always fail.
2016-08-11 05:05:10 +02:00
Guillaume Ayoub
35d12ee97e Merge pull request #472 from Unrud/patch-30
Use os.replace instead of os.rename
2016-08-11 04:23:56 +02:00
Guillaume Ayoub
69386410e5 Merge pull request #473 from Unrud/tests
Tests
2016-08-11 04:23:23 +02:00
Guillaume Ayoub
ac556f2bcc Merge pull request #471 from Unrud/logger
Fix logger
2016-08-11 04:22:41 +02:00
Unrud
4eb04e3526 PROPFIND rights checking
Return 404 and 403 only when it's appropriate. Don't ask users for passwords if an item just doesn't exist (e.g. mistyped URL).
2016-08-11 02:19:48 +02:00
Unrud
30b3273efa Test that the requests fails if the hook fails 2016-08-11 00:37:19 +02:00
Unrud
2b45cffa0e Test that hook gets executed when the principal collection is created
Test for ee5b8facda
2016-08-11 00:37:19 +02:00
Unrud
080ed31d27 Test that storage is locked when hook runs
Test for 65af0592d3
2016-08-11 00:37:19 +02:00
Unrud
952609deee Test that hook gets executed on write accesses 2016-08-11 00:37:19 +02:00
Unrud
893051645e Test fsync
Enable syncing for at least one test.
Test for 5c2075cb6c.
2016-08-11 00:37:19 +02:00
Unrud
6d80b70b8c Test that the root collection always exists
Test for 6c3e59fd11
2016-08-11 00:37:19 +02:00
Unrud
97edacd71a Test implicit creation of principal collection
Test for 81b04890f1
2016-08-11 00:37:19 +02:00
Unrud
62892e3423 Test PROPPATCH 2016-08-11 00:37:13 +02:00
Unrud
51bf95f00d Don't run all tests twice
Only verify that custom backend loading works with a simple test.
2016-08-11 00:32:24 +02:00
Unrud
c8e8993ec2 Refactor: Move common code into BaseFileSystemTest 2016-08-11 00:32:24 +02:00
Unrud
e2b87d145f Cosmetics: Don't use % for logging 2016-08-10 23:43:32 +02:00
Unrud
9192a7751b Remove incorrect argument
In rare cases this can cause a crash.
2016-08-10 23:41:19 +02:00
Unrud
b8126f8d24 Use os.replace instead of os.rename
On Windows os.replace sets the MOVEFILE_REPLACE_EXISTING flag for MoveFileEx.
On POSIX it's the same as os.rename.
2016-08-10 19:26:07 +02:00
Guillaume Ayoub
5c2075cb6c Fix _atomic_write 2016-08-08 14:55:01 +02:00
Guillaume Ayoub
5e5b8b844f Cosmetics 2016-08-08 13:39:01 +02:00
Guillaume Ayoub
1e5c9f63a0 Merge pull request #468 from Unrud/disablefsync
Add option to disable syncing to disk
2016-08-08 13:00:12 +02:00
Guillaume Ayoub
c4cf918bf2 Merge pull request #470 from Unrud/readcontent
Read content after access checks
2016-08-08 12:57:59 +02:00