Add Caldav support for access checks #30

Merged
ahtlon merged 15 commits from caldav into master 2026-11-05 22:52:56 +01:00
Owner

This is a proposal, it adds an access check through caldav.

Access to groups is granted by putting their group name on an individual line within the description of the caldav event.
This allows easy access management through the calendar. I see many benefits in this, the main one is outsourcing the handling of complicated calendar logic, like reocurring events - which the current AccessAuths cant handle.

The calendar events are periodically cached for the next 7 days, that means it still works even if the calendar server is not available during the access check.

Current problems:
@ahtlon i struggle with updating the dependencies, the python caldav package needs to be added.
When entering a dev shell and then adding caldav with uv add caldav i get the following error on nix run .#:

warning: Git tree '/home/kalipso/proggn/malobeo/gatekeeper' is dirty
error: Cannot build '/nix/store/kfs62gppki16f5lhznbq1s0hwnwxg6ll-gatekeeper.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/fmkpjr6a3qcxzipj0xasv0sgazvzmwjd-gatekeeper
       Last 25 log lines:
       >   File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 366, in <module>
       >     main()
       >     ~~~~^^
       >   File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 359, in main
       >     merged = merge_inputs([out_root, *dependencies], skip_paths, ignore_collisions)
       >   File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 175, in merge_inputs
       >     return recurse(inputs, ())
       >   File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 128, in recurse
       >     return {k: recurse(v, stack=(*stack, k)) for k, v in entries.items()}
       >                ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 128, in recurse
       >     return {k: recurse(v, stack=(*stack, k)) for k, v in entries.items()}
       >                ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 128, in recurse
       >     return {k: recurse(v, stack=(*stack, k)) for k, v in entries.items()}
       >                ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
       >   [Previous line repeated 2 more times]
       >   File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 136, in recurse
       >     raise FileCollisionError(inputs)
       > FileCollisionError: Two or more packages are trying to provide the same file with different contents
       >
       >         Files: /nix/store/2bj7x53jfxrnfh27v7x88l71mldrps5s-urllib3-2.6.3/lib/python3.13/site-packages/urllib3/_request_methods.py /nix/store/j4x0aigkskhm6wasr89nbpdjfmzar9jm-urllib3-future-2.25.905/lib/python3.13/site-packages/urllib3/_request_methods.py
       >
       >
       >         See https://pyproject-nix.github.io/pyproject.nix/build/packages.html for strategies for dealing with file collisions
       For full logs, run:
         nix log /nix/store/kfs62gppki16f5lhznbq1s0hwnwxg6ll-gatekeeper.drv
error: Cannot build '/nix/store/zmbn7jbh85dk6ngbyfvf15wpfqrgviw6-gatekeeper.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/dql8rz1sv8lkzwjblyqf5dcb6nyv1kwg-gatekeeper
This is a proposal, it adds an access check through caldav. Access to groups is granted by putting their group name on an individual line within the description of the caldav event. This allows easy access management through the calendar. I see many benefits in this, the main one is outsourcing the handling of complicated calendar logic, like reocurring events - which the current AccessAuths cant handle. The calendar events are periodically cached for the next 7 days, that means it still works even if the calendar server is not available during the access check. Current problems: @ahtlon i struggle with updating the dependencies, the python `caldav` package needs to be added. When entering a dev shell and then adding `caldav` with `uv add caldav` i get the following error on `nix run .#`: ``` warning: Git tree '/home/kalipso/proggn/malobeo/gatekeeper' is dirty error: Cannot build '/nix/store/kfs62gppki16f5lhznbq1s0hwnwxg6ll-gatekeeper.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/fmkpjr6a3qcxzipj0xasv0sgazvzmwjd-gatekeeper Last 25 log lines: > File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 366, in <module> > main() > ~~~~^^ > File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 359, in main > merged = merge_inputs([out_root, *dependencies], skip_paths, ignore_collisions) > File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 175, in merge_inputs > return recurse(inputs, ()) > File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 128, in recurse > return {k: recurse(v, stack=(*stack, k)) for k, v in entries.items()} > ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ > File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 128, in recurse > return {k: recurse(v, stack=(*stack, k)) for k, v in entries.items()} > ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ > File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 128, in recurse > return {k: recurse(v, stack=(*stack, k)) for k, v in entries.items()} > ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ > [Previous line repeated 2 more times] > File "/nix/store/17k0c59cfwwmfxk42iabgr5qgy8kp9rr-make_venv.py", line 136, in recurse > raise FileCollisionError(inputs) > FileCollisionError: Two or more packages are trying to provide the same file with different contents > > Files: /nix/store/2bj7x53jfxrnfh27v7x88l71mldrps5s-urllib3-2.6.3/lib/python3.13/site-packages/urllib3/_request_methods.py /nix/store/j4x0aigkskhm6wasr89nbpdjfmzar9jm-urllib3-future-2.25.905/lib/python3.13/site-packages/urllib3/_request_methods.py > > > See https://pyproject-nix.github.io/pyproject.nix/build/packages.html for strategies for dealing with file collisions For full logs, run: nix log /nix/store/kfs62gppki16f5lhznbq1s0hwnwxg6ll-gatekeeper.drv error: Cannot build '/nix/store/zmbn7jbh85dk6ngbyfvf15wpfqrgviw6-gatekeeper.drv'. Reason: 1 dependency failed. Output paths: /nix/store/dql8rz1sv8lkzwjblyqf5dcb6nyv1kwg-gatekeeper ```
kalipso added 5 commits 2026-11-02 20:11:02 +01:00
add caldav dependencies
Pull-Request Vibe Check / ci-test (pull_request) Successful in 31s
Test python action / test (push) Failing after 1m29s
f7a157593b
kalipso added 1 commit 2026-11-02 20:14:35 +01:00
fix CaldavEventCache not found error
Pull-Request Vibe Check / ci-test (pull_request) Successful in 25s
Test python action / test (push) Failing after 27s
ba3e471bb9
Author
Owner

Related: #8

Related: #8
ahtlon added 1 commit 2026-11-03 15:54:36 +01:00
Ignore venv collisions
Pull-Request Vibe Check / ci-test (pull_request) Successful in 28s
Test python action / test (push) Failing after 32s
a8edc862bc
ahtlon added 1 commit 2026-11-03 21:57:47 +01:00
Fix caldav tests
Pull-Request Vibe Check / ci-test (pull_request) Successful in 28s
Test python action / test (push) Successful in 33s
b31413931b
Owner

@kalipso wo hast du den die teststruktur her XD

@kalipso wo hast du den die teststruktur her XD
ahtlon added 1 commit 2026-11-03 22:32:33 +01:00
Git squash from
Pull-Request Vibe Check / ci-test (pull_request) Successful in 27s
Test python action / test (push) Successful in 45s
af2f254937
Ruff format

Ruff autofix

Fix the rest of the issues
Owner

So, jetzt sind auch die ganzen linting Probleme weg

So, jetzt sind auch die ganzen linting Probleme weg
ahtlon added 1 commit 2026-11-05 13:03:24 +01:00
Add timezone marker to requests
Pull-Request Vibe Check / ci-test (pull_request) Successful in 24s
Test python action / test (push) Successful in 41s
ff170af935
Tests helpfully written by local-Qwen3.8
ahtlon added 2 commits 2026-11-05 19:25:30 +01:00
This was anoying to fix (and even debug)
so I used the local llm for some code changes

Assisted-by: local-qwen3.8 <localllm@ahtlon.de>
Remove timetable in favour of the new calendar stuff
Pull-Request Vibe Check / ci-test (pull_request) Successful in 28s
Test python action / test (push) Successful in 39s
63ea103793
ahtlon added 1 commit 2026-11-05 19:38:29 +01:00
Dang it bender...
Pull-Request Vibe Check / ci-test (pull_request) Successful in 27s
Test python action / test (push) Successful in 38s
db627c34dc
also config
ahtlon force-pushed caldav from 975433c26f to db627c34dc 2026-11-05 19:38:29 +01:00 Compare
ahtlon added 2 commits 2026-11-05 22:48:27 +01:00
This should fix that.
test_settings.py written by qwen3.8
Assisted-by: local-qwen3.8 <localllm@ahtlon.de>
Move caldav_handler to caldav.py
Pull-Request Vibe Check / ci-test (pull_request) Successful in 29s
Test python action / test (push) Successful in 38s
1d37be5317
Make the sleep interruptable
Add debug endpoints for caldav - gonna make a new endpoint for them i think...
Owner

So hab das caldav zeug getestet mit nem lokalen caldav server. Funktioniert gut! Werde erstmal in master mergen, verbesserungen kommen dann seperat drauf (zeilen mit leerzeichen als kommentare ignorieren etc)

So hab das caldav zeug getestet mit nem lokalen caldav server. Funktioniert gut! Werde erstmal in master mergen, verbesserungen kommen dann seperat drauf (zeilen mit leerzeichen als kommentare ignorieren etc)
ahtlon marked the pull request as ready for review 2026-11-05 22:52:46 +01:00
ahtlon merged commit d93491f466 into master 2026-11-05 22:52:56 +01:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: malobeo/gatekeeper#30