Extends the KQL grammar with geo function values on any field, e.g.
location:geo.distance(lat, lon, 5km). Parses into GeoDistance/GeoBoundingBox/
GeoPolygon AST nodes; radius units (km/m/mi) are normalised to meters.
main moved the audit login records into a store of their own. Both sides
add an option to the OIDC authenticator, keep both.
Assisted-by: Claude Code:Claude Mythos 5.2
main brought the audit log and reva v3. Besides the textual conflicts, some
code of both sides no longer fits together and is adapted here:
- newOIDCAuthenticator and loadMiddlewares take the logout markers and the
audit emitter.
- The backchannel logout handler still writes the marker first. The logout is
audited once the user is resolved, whether or not the cached claims can be
removed afterwards, because the marker has ended the session by then.
- userForClaimKey reads the cached TokenRecord instead of a plain claims map.
- isExpectedTokenTimeError stays, because the audit log uses it to leave out
expired tokens. A token rejected by a logout marker is still audited as a
failed login, isExpectedTokenError only keeps it out of the error log.
- The audit test of the handler gets logout markers, an iat in the logout
token and the new format of the cached record.
- The middleware test of the command package passes no markers.
- The logout tests import the events of reva v3.
Assisted-by: Claude Code:Claude Mythos 5.2
Tags could be of any length. Assigning tags through the graph API now
rejects the whole request with 400 if one of the tags is longer than the
maximum, listing the tags that are too long. The length is counted in
characters, after the whitespace around each tag is removed. Tags that
already exist are not affected.
The maximum is 100 characters by default, and can be changed with
OC_MAX_TAG_LENGTH, or turned off with 0. The frontend service announces
it to clients as the graph.tags.max_tag_length capability, so that they
can check tags before sending them. Both services read the same
variable, without a service-specific alias, so that the announced limit
is always the one graph enforces.
Assisted-by: Claude Code:claude-opus-5-5
toAnchor removed every character except ASCII letters, digits and spaces,
so headings like "Read-Only" got the anchor "readonly", while GitHub and
Docusaurus create "read-only". Keep hyphens, underscores and non-ASCII
letters, and add a -1, -2, ... suffix to duplicate anchors, the same way
github-slugger does.
A request to export the personal data beyond the rate limit got the
plain text 429 of httprate, while the other errors of graph, also those
of the same route, are JSON with an error code.
RateLimitPerAuthenticatedUser takes a handler for the response beyond
the limit now, so that a service can answer in its own format; nil
keeps the plain text 429. Graph answers with activityLimitReached. The
Retry-After header is set before the handler is called, so it stays.
Assisted-by: Claude Code:claude-opus-5-5
Each personal data export collects all events of the user and writes
them into the user's personal space, so starting exports over and over
puts load on the system. Limit how many exports a user can start to 5
per minute, configurable with GRAPH_EXPORT_PERSONAL_DATA_RATE_LIMIT
(0 disables the limit). Requests beyond it get a 429 with a
Retry-After header.
The limit uses a new middleware, RateLimitPerAuthenticatedUser. It
counts requests by the id of the authenticated user rather than by the
URL, so that variations of the URL, such as a trailing slash, can't get
around it. It comes after the check that users only export their own
data, so that requests for other users don't count against any limit.
The counters are kept in memory by every instance of the graph service.
This adds the dependency github.com/go-chi/httprate v0.16.1 (MIT), from
the authors of the chi router that the service already uses. It is used
instead of a limiter of our own, because counting requests in sliding
time windows correctly under concurrency is easy to get wrong, and the
library is maintained and tested for exactly that. It brings no further
modules: the two it needs are already required. There are no known
vulnerabilities in it, and govulncheck reports none.
Assisted-by: Claude Code:claude-opus-5-5
A space image is only ever shown as a thumbnail. When a file larger
than the thumbnail generator accepts was set as the image of a space,
the PATCH of the drive succeeded, but no thumbnail could be made of the
file, so the space showed no image and nobody got an error.
Before setting the image, graph now looks up the size of the file, and
refuses a file above the limit with 413 Request Entity Too Large,
without changing the space. The limit is the one of the thumbnail
generator: graph reads it under the same names as the webdav and
thumbnails services (OC_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE and the
older THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE, 50MB by default, empty for
unlimited), so one setting keeps the three in agreement.
GRAPH_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE sets a lower limit for space
images alone.
The default of 50MB is now one constant, which the graph, webdav and
thumbnails services all use.
Only the file size is checked: the dimension limits of the generator
would need the whole image to be read. The space readme has no limit,
and an empty image id is passed on unchecked, as before.
Assisted-by: Claude Code:claude-opus-5-5
Multiple access tokens can be valid for one session, for example after a
refresh. A logout only removed the cached claims of the token in the session
lookup, so older tokens stayed accepted. With PROXY_OIDC_SKIP_USER_INFO=true,
even the removed token was accepted again, because a still valid JWT was
verified anew.
Write a marker on every verified logout and check it on every authenticated
request, for cached and uncached tokens. This also covers tokens the proxy
has not seen before the logout.
If the marker store cannot be read, the cached claims are not used and the
userinfo endpoint decides about the token. With
PROXY_OIDC_SKIP_USER_INFO=true there is no such check, so the request is
rejected. A corrupt marker always rejects.
The cached record now keeps the verified subject, session and issue time,
because a userinfo response can overwrite them in the claims. The cache
database is renamed to start with a fresh cache.
Markers get their own database because nats-js-kv only supports one TTL per
bucket. They are kept for the new PROXY_OIDC_MAX_ACCESS_TOKEN_LIFETIME plus a
buffer. A JWT access token with a longer lifetime or without an expiration
can outlive its marker, so the proxy logs a warning for it.
Logout tokens without iat are now rejected, as the spec requires the claim.
Publishing the logout event and removing cached records are now best effort,
so a failed publish no longer prevents the logout.
Starting with chi v5.4.0, ClientIPFromXFF panics when no trusted prefix
is given, so ClientIP would crash the proxy and collaboration services at
startup when no trusted proxies are configured. Without trusted proxies
every request uses the network address anyway, so return
ClientIPFromRemoteAddr.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
The health check calls the address the server listens on. For 0.0.0.0
that is the IP of the pod, not the loopback address. Compare the peer
with the local address of the connection instead.
The go-micro tracing wrappers and otelhttp inject and extract the trace
context with the global propagator. Nobody set it, so it stayed the
default no-op: no traceparent went over the wire and every go-micro
service (settings, policies, eventhistory, search) started a new trace
instead of joining the caller's.
GetTraceProvider now also sets the global propagator to the W3C
TraceContext and Baggage propagator we already use elsewhere.
fixes https://github.com/opencloud-eu/opencloud/issues/3856
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
chi's ClientIPFrom* header middlewares trust the header from anyone who can
reach us. Pick the middleware per request instead: headers are only read
when the peer is a trusted proxy, everyone else gets their network address.
- PROXY_TRUSTED_PROXIES, defaults to loopback and private ranges
- PROXY_CLIENT_IP_HEADER, defaults to X-Forwarded-For, e.g. CF-Connecting-IP
- drop the strategy setting and xff_trusted_hops
- pass the client address to the services in X-Forwarded-For instead of
X-Client-Ip, reva reads it e.g. for OCM
- same check in collaboration, traefik routes to it directly
- OC_TRUSTED_PROXIES and OC_CLIENT_IP_HEADER set both services
- the other services only drop RealIP, none of them reads the address
Taken from #3864 and https://github.com/opencloud-eu/opencloud/pull/3464#issuecomment-6494799883
# Conflicts:
# services/proxy/README.md
New leaf package (only gookit + pkg/config/defaults) so callers can bind a
yaml config file without importing the aggregate service config. pkg/config
keeps a backward-compatible re-export.