Package org.exoplatform.caldav.rest
Class CaldavRelayRest
java.lang.Object
org.exoplatform.caldav.rest.CaldavRelayRest
HTTP face of the CalDAV relay:
/caldav/rest/dav/{serverId}/**
forwards DAV requests of the authenticated user to the declared server the
id names, and /caldav/rest/connection/verify probes typed
credentials at connect time. Every decision — which targets are legal,
which methods and headers pass, whose credentials are injected — lives in
CaldavRelayService; this layer only moves bytes and maps the
service's exceptions onto statuses (404 unknown registration, 403 refused
target, 409 no connected account, 405 method outside the allow-list, 400
invalid path, 413 oversized body), each refusal carrying its
machine-readable code in the x-caldav-relay-code header so the
browser can tell a relay verdict from an upstream answer.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<byte[]> relay(jakarta.servlet.http.HttpServletRequest request, long serverId) Relays one DAV request to the declared server the path names.org.exoplatform.caldav.model.CaldavProbeResultverify(jakarta.servlet.http.HttpServletRequest request, org.exoplatform.caldav.model.CaldavUserSetting probe) Probes typed CalDAV credentials against a declared server, without storing anything: what the connect drawer calls before saving an account, now server-side so that servers sending no CORS headers — BlueMind — connect without any front proxy.
-
Constructor Details
-
CaldavRelayRest
public CaldavRelayRest()
-
-
Method Details
-
relay
@RequestMapping("/dav/{serverId}/**") @Secured("users") public org.springframework.http.ResponseEntity<byte[]> relay(jakarta.servlet.http.HttpServletRequest request, @PathVariable("serverId") long serverId) Relays one DAV request to the declared server the path names. Mapped without a method restriction on purpose: the DAV verbs the relay exists for — PROPFIND, REPORT, MKCALENDAR — are not in Spring's RequestMethod vocabulary, and the service enforces the actual method allow-list.- Parameters:
request- the HTTP request, carrying the authenticated user, the method, the body and the DAV path suffixserverId- technical identifier of the targeted registration- Returns:
- the upstream response, statuses passed through, hrefs rewritten
-
verify
@PostMapping("/connection/verify") @Secured("users") public org.exoplatform.caldav.model.CaldavProbeResult verify(jakarta.servlet.http.HttpServletRequest request, @RequestBody org.exoplatform.caldav.model.CaldavUserSetting probe) Probes typed CalDAV credentials against a declared server, without storing anything: what the connect drawer calls before saving an account, now server-side so that servers sending no CORS headers — BlueMind — connect without any front proxy.- Parameters:
request- the HTTP request, carrying the authenticated userprobe- the typed credentials and the targeted registration id (null resolves the seed registration, like every legacy account)- Returns:
- the classified probe outcome
-