4018 Commits

Author SHA1 Message Date
malve
fc4f6013db correctly emit error message when cancelling an event fails 2025-04-13 14:54:45 -07:00
Andrew Ruthven
8f38332fce Set DAVResource type correctly when restoring from memcache
Assuming we're always dealing with a Principal isn't correct.
2025-01-27 23:27:45 +13:00
Andrew Ruthven
1fec8fd111 Add debug logging for ACE changes 2025-01-27 23:27:45 +13:00
Andrew Ruthven
f6547bd376 Make some lines more readable 2025-01-27 23:27:45 +13:00
Andrew Ruthven
b4bcc6cc25 Fix DAV:current-user-principal for iPhone devices
iPhone devices incorrectly implement DAV:current-user-principal from
RFC 5397. They assume that current-user-principal is the href for the
resource being queried. The RFC says it should be the current resource.

See: https://gitlab.com/davical-project/davical/-/issues/335
2025-01-27 23:27:45 +13:00
Andrew Ruthven
c1cfd8eb0d Fix typo 2025-01-27 23:02:36 +13:00
Andrew Ruthven
734d5c1f99 The public access endpoint is public.php 2025-01-22 14:48:24 +13:00
Andrew Ruthven
11315dee47 Fix deprecation warning for explicit nullable type. 2024-12-30 20:17:22 +13:00
Andrew Ruthven
a9ffb1e67c We need rst2pdf installed for testing
Looks like this has been removed as a dependency from a package.
2024-12-30 20:17:18 +13:00
Jaydn
a2a9a57fdd Lowercase string when comparing HTTP header for debug output
HTTP/2 requests to Davical with debug mode result in logged
Authorization header as the comparison is currently case sensitive

https://datatracker.ietf.org/doc/rfc9113/
> 8.2.  HTTP Fields
> Field names MUST be converted to lowercase when constructing an HTTP/2
message.
2024-09-03 10:44:32 +09:30
Andrew Ruthven
4d06333f7e Drop the memcache only test, make the ldap+memcache test stage more comprehensive
The old memcache suite was gutted as it wasn't really much use and needed
LDAP to actually test auth caching correctly.
2024-05-27 09:46:12 +12:00
Andrew Ruthven
07c32697dd More testing of cached auth credentials
Test more scenarios, to make sure the cache is used or not used when
it should be.
2024-05-27 09:46:12 +12:00
Andrew Ruthven
d686ea4c3f Allow tests to dynamically set the DAViCal configuration 2024-05-27 09:46:12 +12:00
Andrew Ruthven
341707b045 Allow multiple curl requests per test file
This could still do with some more work to allow clearing previous settings,
it does now allow repeated URL lines per test file.
2024-05-03 23:35:26 +12:00
Andrew Ruthven
1077714a83 Make the log lines have consistent prefixes 2024-05-03 23:35:26 +12:00
Andrew Ruthven
af458f9d90 Remove default expiry times, make 0 disabled. 2024-05-03 23:35:26 +12:00
Andrew Ruthven
3c475a283c Switch to using hash_hmac, SHA256 and bcrypt for caching credentials
We also use a locally set password (aka a pepper) to ensure that the contents
of memcached isn't sufficient to perform dictionary attacks on the cached
credentials.
2024-05-03 23:35:26 +12:00
Andrew Ruthven
55feb03139 Include the username in the log messages. 2024-05-03 23:35:26 +12:00
Andrew Ruthven
ee26ee730f get can return the empty string, check for that.
While the credential checks were correctly failing when salt was the
empty string, it was giving confusing i.e., no log messages.
2024-05-03 23:35:26 +12:00
Andrew Ruthven
0b709c791d Fix the storing of cached credentials when an authentication hook is used.
Thank you LDAP tests for picking up this issue!
2024-05-03 23:35:26 +12:00
Andrew Ruthven
521594bc3f Add testing for LDAP with memcache 2024-05-03 23:35:25 +12:00
Andrew Ruthven
bd6a47bee6 Add tests for memcache 2024-05-03 23:34:43 +12:00
Andrew Ruthven
5826f5c3cf Cache password credentials received, and if they succeed or fail.
This is intended to reduce the load on external authentication sources
as most (all?) CalDAV clients use HTTPBasicAuth to authenticate and
if an external source is used, every request we receive requires
external authentication. This can place a large load on those external
sources.

Closes #254.
2024-05-03 23:34:42 +12:00
Andrew Ruthven
8f7da93a0d Return the Request ID if auth fails
Still only return it if in test_mode.
2024-05-03 23:33:25 +12:00
Andrew Ruthven
a02fffa4ca Ensure that request_id has no \r or \n characters. 2024-05-03 23:33:25 +12:00
Andrew Ruthven
87c3df891b Fix typo, remove sleep 60!! 2024-05-01 22:32:33 +12:00
Andrew Ruthven
fcbd72e310 Fix an exception if a LDAP group mentions a user that doesn't exist
This tickles a bug as reported by Thorsten Marquardt in
https://sourceforge.net/p/davical/mailman/message/58766531/ with this
error message reported:

    Exception [0] ldap_get_attributes(): Argument #2 ($entry) must be of
    type LDAP\ResultEntry, false given
    At line 718 of /usr/share/davical-master/inc/drivers_ldap.php

You need to look in 3da860e5d5e732c2dedb62a73c76608a2b7098a4 for that line
number as I've just made some improvements to the code the last few commits.
2024-05-01 22:32:33 +12:00
Andrew Ruthven
c273b38234 Test adding non-existant LDAP user to a group
This is to tickle my suspicion of the bug as reported by Thorsten Marquardt
in https://sourceforge.net/p/davical/mailman/message/58766531/ with this
error message reported:

Exception [0] ldap_get_attributes(): Argument #2 ($entry) must be of
type LDAP\ResultEntry, false given
At line 718 of /usr/share/davical-master/inc/drivers_ldap.php

You need to look in 3da860e5d5e732c2dedb62a73c76608a2b7098a4 for that line
number as I've just made some improvements to the code.

I have also improved the SQL to check if the users have been added, and
discovered that the result file *did not* have them. This test was failing
due to the test config file looking for memberUid, not member. Also, fix
that.
2024-05-01 22:32:33 +12:00
Andrew Ruthven
629789612e Prevent using undefined or non-existant variables 2024-05-01 22:32:33 +12:00
Andrew Ruthven
a50e3eae90 Be a bit more verbose in the logging 2024-05-01 22:32:33 +12:00
Andrew Ruthven
d2a93643bc Don't be afraid of whitespace 2024-05-01 22:32:33 +12:00
Andrew Ruthven
569b20d92f Allow tests to provide configuration over rides
Written to provide scope for Apache2 config overrides as well (I
think I'll need these to add Kerberos testing...)
2024-05-01 22:32:33 +12:00
Andrew Ruthven
3da860e5d5 ../awl isn't present in CI build, drop dep
Also drop dependency on dba/davical.sql as that is no longer checked
for the DB version.
2024-04-30 22:47:39 +12:00
Andrew Ruthven
24f6c8be18 Actually require AWL v0.65 2024-04-30 20:53:30 +12:00
Andrew Ruthven
e919bce20e Update so that git checkouts will work 2024-04-30 20:50:33 +12:00
Andrew Ruthven
4a64af43f8 Stop picking the DB version from dba/davical.sql as now we just use the patches 2024-04-30 20:50:16 +12:00
Andrew Ruthven
aa35bc6e6d Require the latest DB version 2024-04-30 20:39:14 +12:00
Andrew Ruthven
0c2bb61891 Add missing ChangeLog and CREDITS entries 2024-04-14 23:48:16 +12:00
Andrew Ruthven
2ce32a3ac7 Add info on how to use i_use_mode_kerberos 2024-04-14 23:12:40 +12:00
Andrew Ruthven
781ecff224 Update for stonewall's contribution 2024-04-14 22:42:18 +12:00
Stonewall Jackson
d3a0c89eca Retain original i_use_mode_kerberos behavior, add fallback option
Add a new value for i_use_mode_kerberos: "allow_fallback_ldap_auth",
which will fallback to username/password authentication when the
REMOTE_USER value is unset.
2024-04-10 14:25:23 -04:00
Stonewall Jackson
0ba94e91de Support fallback to LDAP password with i_use_mode_kerberos
Currently, when `i_use_mode_kerberos` is enabled in the LDAP driver,
Davical checks the `REMOTE_USER` server variable, followed by the
`REDIRECT_REMOTE_USER` variable, for a matching username. If a matching
username is not found, authentication fails immediately.

This commit modifies the LDAP driver to fallback to standard LDAP
password authentication when `i_use_mode_kerberos` is enabled and
neither of these server variables are set. This allows
non-kerberos-enabled clients to authenticate as well.

Fixes #323
2024-04-10 14:25:23 -04:00
Andrew Ruthven
786a9f5591 Remove the IMAP auth drivers
The PHP imap module is being retired. Closes #324.
2024-04-02 21:41:26 +13:00
Andrew Ruthven
e900dff28e If a URL test fails, display the Apache Request ID to aid debugging
This helps with #311.
2024-04-02 00:11:30 +13:00
Andrew Ruthven
7c47658bee Make the curl and SQL requests when we see them
This allows us to have more complex test files where an action is taken, then
we test something, then another action is taken, etc.

Changes to test files are required so that URL is defined after all the
required settings are set.

Changes to the result files are either whitespace changes due to above logic
changes, or printing out a SQL Result header before each result. I figured it
was useful.
2024-04-01 22:57:10 +13:00
Andrew Ruthven
7f2cccb94a Use isset when checking that the key exists
To resolve errors like this:

Warning:  Undefined array key "example.net" in /usr/share/davical/inc/iSchedule.php on line 207
2024-04-01 20:46:15 +13:00
Andrew Ruthven
901d82a293 Fix creation of dynamic properties
Add some properties to classes to fix errors like:

Creation of dynamic property iSchedule::$body_cannon is deprecated in /usr/share/davical/inc/iSchedule.php on line 533
Creation of dynamic property FakeSession::$user_active is deprecated in /usr/share/davical/inc/iSchedule-POST.php on line 23
2024-04-01 20:43:45 +13:00
Andrew Ruthven
452b9fa2ef regression-suite/2701-generate-date-tests.pl needs Perl modules
f
2024-04-01 20:29:20 +13:00
Andrew Ruthven
bdc65cc777 iSchedule tests now work, test in CI 2024-04-01 18:58:33 +13:00
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