Add private CardDAV synchronization and contact revision recovery
Build and publish container images / images (push) Successful in 13m39s
Release container images / release (push) Successful in 18s

This commit is contained in:
Anya Tokugawa committed 2026-11-02 08:41:15 +09:00
1 parent 433169c7e7
commit 19e12f96a8
32 files changed
+1855 -47

No files matched your search

@@ -35,6 +35,12 @@ func SetDAVAuthOutcome(r *http.Request, outcome string) {
}
func davLogTarget(path string) string {
if path == "/.well-known/carddav" {
return "carddav_discovery"
}
if path == "/_/api/v1/carddav" || strings.HasPrefix(path, "/_/api/v1/carddav/") {
return "carddav"
}
const root = "/_/api/v1/caldav"
p := strings.TrimSuffix(path, "/")
switch p {
@@ -77,10 +77,12 @@ func TestDAVLogTarget(t *testing.T) {
for path, want := range map[string]string{
"/_/api/v1/caldav": "home", "/_/api/v1/caldav/": "home",
"/_/api/v1/caldav/tasks/": "task_home", "/_/api/v1/caldav/tasks/default": "task_collection",
"/_/api/v1/caldav/tasks/default/private.ics": "task_resource",
"/_/api/v1/caldav/private/": "calendar_collection",
"/.well-known/caldav": "well_known",
"/_/api/v1/caldav-credentials": "", "/health": "",
"/_/api/v1/caldav/tasks/default/private.ics": "task_resource",
"/_/api/v1/caldav/private/": "calendar_collection",
"/.well-known/caldav": "well_known",
"/.well-known/carddav": "carddav_discovery",
"/_/api/v1/carddav/private-owner/private.vcf": "carddav",
"/_/api/v1/caldav-credentials": "", "/health": "",
} {
if got := davLogTarget(path); got != want {
t.Errorf("%s: %q != %q", path, got, want)
+1 -1
View File
@@ -19,7 +19,7 @@ func NormalizePath(
// Hosted adapter assets use directory-relative module and worker URLs.
// DAV collections also require the slash: removing it conflicts with
// ServeMux's collection redirect and causes an infinite redirect loop.
if strings.HasPrefix(p, "/_/adaptor/") || strings.HasPrefix(p, "/_/api/v1/caldav/") {
if strings.HasPrefix(p, "/_/adaptor/") || strings.HasPrefix(p, "/_/api/v1/caldav/") || strings.HasPrefix(p, "/_/api/v1/carddav/") {
next.ServeHTTP(w, r)
return
}
+1 -1
View File
@@ -7,7 +7,7 @@ import (
)
func TestNormalizePathDAVCollections(t *testing.T) {
for _, path := range []string{"/_/api/v1/caldav/", "/_/api/v1/caldav/tasks/", "/_/api/v1/caldav/tasks/default/", "/_/api/v1/caldav/calendar-id/"} {
for _, path := range []string{"/_/api/v1/caldav/", "/_/api/v1/caldav/tasks/", "/_/api/v1/caldav/tasks/default/", "/_/api/v1/caldav/calendar-id/", "/_/api/v1/carddav/", "/_/api/v1/carddav/actor/contacts/"} {
mux := http.NewServeMux()
mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(401) })
for _, method := range []string{"GET", "OPTIONS", "PROPFIND", "REPORT"} {