4000 Commits

Author SHA1 Message Date
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
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
d2d36399d3 Create the Timezone if we need to
Detected now due to a change from a few years ago to use a clean database
for each set of tests.
2024-04-01 18:34:33 +13:00
Andrew Ruthven
ec9159fd69 Fix some warnings about using undefined keys, simplify dns strings
Fixes:
- PHP Warning:  Trying to access array offset on value of type null in inc/iSchedule.php on line 83
- PHP Warning:  Undefined array key "t" in inc/iSchedule.php on line 165
- PHP Warning:  Undefined array key "t" in inc/iSchedule.php on line 167
- PHP Warning:  Undefined array key "p" in inc/iSchedule.php on line 184

Concatenate the DNS entry we're going to look up once rather than everytime
we need it.
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
ba4c1eb989 Skip the "text/calendar" record, so we don't run code that expects "="
Prevents this warning:
  PHP Warning:  Undefined array key 1 in inc/iSchedule-POST.php on line 96
2024-03-30 20:08:14 +13:00
Andrew Ruthven
b26d48fced Put a trailing newline on error messages 2024-03-30 19:03:39 +13:00
Andrew Ruthven
0fc1abd976 Drop datetime check as minimum PHP version is 5.4 2024-03-11 00:41:39 +13:00
Andrew Ruthven
ee16fbf6af Update the translation PO files. 2024-03-11 00:41: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
658bd4e786 Use request ID 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
7e663b3a2b iSchedule should advertise the full date range that we support. 2024-03-04 00:44:12 +13:00
Andrew Ruthven
19ec65eb3f Add entry for extending date ranges 2024-03-04 00:44:12 +13:00
Andrew Ruthven
c5b3e385b3 Allow changing directory when running a script
This also involves changing scripts to be run at the time they're mentioned,
not accruing them to run at the end.
2024-03-03 21:30:22 +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