710 Commits

Author SHA1 Message Date
Andrew Ruthven
d67c43790a Fix Free/Busy tests for iSchedule
We need to have some events in the time period being checked.

Note in the tests what they're trying to check.
2024-04-01 18:53:12 +13:00
Andrew Ruthven
c97a0719ff Slight wrapping change to lines in a test result, and now have ^M returned 2024-04-01 18:34:33 +13:00
Andrew Ruthven
7459a68b76 We need the sample data for tests for the test files to run 2024-04-01 18:34:33 +13:00
Andrew Ruthven
aaf89bed66 Trust the DKIM key used for ischedule tests 2024-03-30 20:10:41 +13:00
Andrew Ruthven
b26d48fced Put a trailing newline on error messages 2024-03-30 19:03:39 +13:00
Andrew Ruthven
4e03cb1343 Include the request ID used in logging in the Fatal Error message. 2024-03-11 00:41:37 +13:00
Andrew Ruthven
f69480ce77 Test that deletion of a principal's items are secure
Test that other users can't delete:
 - collections
 - tickets
 - bindings

No significant change, just return an error message rather than assume that
things worked.
2024-03-10 00:37:11 +13:00
Andrew Ruthven
0c9e0d6a87 Test more dates in the past and future
There is now a Perl script that'll generate tests and result files to a
wide variety of dates. From this we currently don't support < 1 AD or >
9999 AD.

run_regressions is modified to remove the UNTIL option as I want to use a
character after the test number to allow "subtests".
2024-03-03 21:30:22 +13:00
Andrew Ruthven
9c10ef5eb2 Support start or end missing from free-busy-query REPORT
Previously if either start or end were missing then the current time was
used. This would almost never be the expected behaviour.
2024-03-03 21:30:21 +13:00
Andrew Ruthven
014ee35372 Rename the ICS file to match the test name 2024-03-01 23:42:56 +13:00
Andrew Ruthven
dd1e75d23d Eh, etag changed.
It is tempting to exclude etag from test result checks.
2024-03-01 23:42:55 +13:00
Andrew Ruthven
9421dbd7e3 Add an event in the year 500. 2024-03-01 23:42:53 +13:00
Andrew Ruthven
3defc7b266 Add test for an event in the far future 2024-03-01 23:42:50 +13:00
Benedikt Spranger
ce67c2c839 Add events starting before 1900 test
postgresql is fussy about dates before 1900. Add a test with a recuring
event startting before 1900.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
2024-03-01 23:26:26 +13:00
Andrew Ruthven
cb2e4523f3 Add test for invalidating the CSRF token 2024-02-29 00:43:50 +13:00
Andrew Ruthven
974d7d3924 Check that all UI pages load without PHP warnings or deprecation messages 2024-02-29 00:43:49 +13:00
Andrew Ruthven
a102105f27 Hide many sections unless the user can modify the principal
There is potential to leak information when viewing the principal
page for another principal. I think it makes more sense to just
not include all of this information unles the user can change the
principal.
2024-02-29 00:43:49 +13:00
Andrew Ruthven
15e9231ae3 Unescape URLs passed in as external bindings.
Previously PHP was escaping things like ampersands, which then caused
us to have broken URLs.

These aren't displayed anywhere in the UI, so no need to encode them anywhere.

Closes #314.
2024-02-29 00:43:49 +13:00
Andrew Ruthven
c2a054d28e Add initial tests for the web UI
Use Test::WWW::Mechanize to test the UI.

Closes #310
2024-02-29 00:43:47 +13:00
Andrew Ruthven
28d9105810 Update database result results in tests. 2024-02-18 01:51:56 +13:00
Andrew Ruthven
e989e1cf97 Fix PROPFIND with Depth 1 if external bind is included
Previously something like this would be logged if debugging is enabled:

davical: LOG: Principal: Query: DBGQ: SELECT * FROM collection WHERE user_no= :user_no
davical: LOG: Principal: Query: DBGQ:  ":user_no" => ""
davical: BUG: :DAViCal Fatal Error: [42883] SQLSTATE[42883]: Undefined function: 7 ERROR:  operator does not exist: integer = boolean\nLINE 1: SELECT * FROM collection WHERE user_no= FALSE\n                                              ^\nHINT:  No operator matches the given name and argument types. You might need to add explicit type casts. at /home/puck/work/Calendar/awl/inc/AwlDatabase.php:94

And this would be returned as a response:

DAViCal Fatal Error

user_no doesn't get set when construction the Collection for the external
bind, so, just handle that instead of sending the empty string to the
database as a user_no.

Modify the tests from ccc7e182ba4cbfba66a4fe96e1c0620e46390b95 to tickle the
bug.

Closes #175.
2024-02-18 01:51:56 +13:00
Andrew Ruthven
a065435a99 Create tests for 'external' calendars 2024-02-18 00:04:29 +13:00
Andrew Ruthven
eb4d120bbf Honour do_not_sync_from_ldap when sync'ing group members
This had been working as a side effect of the way the SQL insert
statement was working, but better to be explict about skipping them.
2024-02-17 02:25:25 +00:00
Andrew Ruthven
9494256f03 Extend LDAP sync tests, test for DNs in member fields. 2024-02-17 02:25:25 +00:00
Andrew Ruthven
146ab4d068 Update test results for database creation.
I've rebased onto master which has a new DB version.
2024-02-17 02:25:25 +00:00
Andrew Ruthven
b15c99fe1b Add tests for LDAP sync of users and groups. 2024-02-17 02:25:25 +00:00
Andrew Ruthven
30b05549d0 Remove tests related to memcache, add BPS to copyright
I re-used some of the test LDAP logic from the test suite of Request
Tracker by BPS.
2024-02-17 02:25:25 +00:00
Andrew Ruthven
353a2d1b13 Add testing for LDAP with memcache 2024-02-17 02:25:25 +00:00
Andrew Ruthven
9dc52a5e25 Updates to other tests as side effects of adding room1 and room2 principals 2024-01-21 19:12:42 +13:00
Andrew Ruthven
1ca8284bdc Add ROOM as a principal type
This hopefully resolves #282.
2024-01-21 19:12:42 +13:00
Andrew Ruthven
ecda4395e8 Update to reflect change in tests 2024-01-19 19:49:02 +13:00
Andrew Ruthven
f137dd788e Update test to straddle the DST change
As pointed out in
https://gitlab.com/davical-project/davical/-/merge_requests/86#note_1209576949
the issue is when events straddle the DST change.
2024-01-19 19:48:03 +13:00
Andrew Ruthven
ff403b84a9 Update ETag, why?! 2024-01-19 19:13:07 +13:00
Andrew Ruthven
5ef5c756f8 Tests to try and tickle an issue raised in MR 86
However, the result is what it should be? Interesting.

https://gitlab.com/davical-project/davical/-/merge_requests/86
2024-01-19 19:13:07 +13:00
Andrew Ruthven
aaa70a83f8 Remove sis.redsys.es from CSP
As raised in https://sourceforge.net/p/davical/mailman/message/47766326/
2023-10-23 17:56:54 +13:00
Andrew Ruthven
6ac6b30c7a Additional record to CONFIDENTIAL resources
Update due to 5ab4f4391406bda5a6f1bc7b2288844bb6fefa06
2023-05-02 10:44:52 +00:00
Andrew Ruthven
720eb89adb Add tests for checking that CONFIDENTIAL resources include all recurrance information
This is to tickle #291. The only test that is actually required is
2603-GET-resource-confidential, but I want to make sure all the options were
correct.

In this commit 2603-GET-resource-confidential is expected to fail.
2023-05-02 10:44:52 +00:00
Andrew Ruthven
d4b91f2627 Set UNTIL for some RRULEs
This is to get these events out of the way for some new tests.
2023-05-02 10:44:52 +00:00
Florian Schlichting
effc004741 use "." to concatenate strings, not "+" (fixes #288)
Unsupported operand types: string + string at /usr/share/davical/inc/caldav-ACL.php:146
2023-03-23 22:17:23 +01:00
Andrew Ruthven
b40c96debb If time-range is set, only return matching events.
Closes #280
2023-03-12 20:19:10 +01:00
Andrew Ruthven
15d01c8bed Store DTSTART and DTEND from user in shadow columns
We want to store the calculated dtstart and dtend in the database so we can
use SQL to fetch records. However, we also need what the user sent us so we
can allow prop-filters to be used as well.

So we store what the user sends us in dtstart_orig and dtend_orig and only
use for relevant prop-filter reports.
2023-03-12 20:17:43 +01:00
Andrew Ruthven
5a73991496 DTSTART on VTODO is optional, don't force it to be set.
If we force setting DTSTART, then you can't use prop-filter to find VTODOs
with a DUE set and DTSTART unset. And, well, why should DTSTART be set to DUE?

This was introduced in 18150d702d91fa1a687801baa582d967e79fff8d .
2023-03-12 20:05:48 +01:00
Andrew Ruthven
badeca53c7 Update tests that check for CLASS in the database.
We no longer force CLASS to be PUBLIC in the database if it isn't set.
2023-03-12 20:05:48 +01:00
Andrew Ruthven
149ec3555f CLASS is an optional field, don't set it to PUBLIC
As specified in RFC5545 the CLASS field is optional, and if it isn't present
is treated as PUBLIC. To allow a is-not-defined prop-filter to find
resources without CLASS set, we need to not store in the database. This
turns out to be okay, because to enforce privacy we always check to see if
it is PRIVATE or CONFIDENTIAL. We never check to see if it is PUBLIC.

Closes #284.
2023-03-12 20:05:48 +01:00
Andrew Ruthven
4a380b12a2 Fixes to is-defined and is-not-defined prop-filter
Gosh, this was completely broken previously. A number of different scenarios now work.

I have used some of the state I've seen in a largish production database with the
presence of NULL and empty strings. I've assumed that empty string should be treated
as is-not-defined. Happy to be talked out of that.

Closes #281.
2023-03-12 20:05:48 +01:00
Andrew Ruthven
6819d6d7d1 Add a primary_key to the addressbook_addresses_* tables
This is part of the fix for #276.
2023-02-15 07:42:34 +00:00
Andrew Ruthven
c3970f3be2 Fix RRULE for BYHOUR, BYMINUTE and BYSECOND
Closes #283.
2023-02-15 07:28:35 +00:00
Andrew Ruthven
be60ec1778 Improve on SQL syntax fix to keep logging working, and add regression test.
Closes #279.
2023-02-04 03:09:40 +00:00
Andrew Ruthven
a323ba8dae Don't change the day of the month to 28, if it is > 28
Gosh. The logic was saying, if the modified date has a day of the
month > 28, change it to 28. Which is rather odd. Don't do that.

This closes #248. It also fixes a bug with FREQ=MONTHLY;BYMONTHDAY=-1
as it turns out.
2022-12-18 13:52:48 +13:00
Andrew Ruthven
7d0e2f2435 Test Free/Busy results for MONTHLY with BYMONTHDAY
Tests https://gitlab.com/davical-project/davical/-/issues/248
2022-12-18 13:52:48 +13:00