A NATS server in operator (JWT) mode authenticates a client with a
user JWT and an NKey seed. oCIS could connect to NATS only with a
username and a password.
All NATS connections now accept JWT credentials: events, caches,
persistent stores, the service registry, and the health checks.
- OCIS_NATS_CREDS_FILE: the path of a .creds file
(nats.UserCredentials). The file is read again on each reconnect.
- OCIS_NATS_CREDS: the content of a .creds file
(nats.UserCredentialBytes). It takes precedence over the file.
- Each events, cache and store struct has the fields CredsFile and
Creds with a per-service override, for example
PROXY_EVENTS_CREDS_FILE.
- The registry reads MICRO_REGISTRY_AUTH_CREDS_FILE and
MICRO_REGISTRY_AUTH_CREDS. If they are empty, it uses the
OCIS_NATS_* variables.
- store.Credentials is passed next to each store.Authentication call.
The revaconfig maps pass the new reva keys.
- The new checks.NewNatsCheckWithConfig uses the authentication and
TLS settings of the service. The NATS health checks connected
without credentials and without TLS before.
This change needs the reva commit with pkg/natsauth and the natsjs
plugin with the NatsOptions option. go.mod and vendor/ follow when
these changes are pushed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: the public share configuration and fixed graceful shutdown
* fix: [OCISDEV-1433] remove GRPC_MAX_CONNECTION_AGE
The setting closed healthy grpc connections on a timer so that clients would redo
their DNS lookup. It never helped against the failure it was reached for - a
connection whose peer stopped answering - because the age limit is enforced by
the server, the grace period was left at infinity so a request already in flight
was never ended, and any value without a unit suffix silently disabled it again.
Detecting a peer that stops answering is now the job of the grpc clients, which
ping the peer while a request is in flight. The servers here got the matching
enforcement policy so they accept those pings; the client side arrives with the
next reva bump.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix: Added the new variable OCDAV_DISABLE_PROPFIND_PUBLIC_LINK_RESOLUTION that disable the resolution of public link shares when answering PROPFIND requests.
* chore: bump reva
* fix: The keepalive added to grpc clinet
* chore: bump reva
* build(deps): bump go 1.26.8, grpc-go dependency
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
For now, only some hardcoded paths will check the claims (if there is a
checker configured). If the check fails for those paths, the
authentication will fail and it will return a 401 error
otelchi and other custom solutions have been replaced with otelhttp to
trace HTTP requests; new middleware is provided to be used across the
platform.
The proxy service will use a custom HTTP client to forward the headers
needed for telemetry automatically (also based on otelhttp)
Every time the OIDC middleware sees a new access token (i.e when it needs
to update the userinfo cache) we consider that as a new login. In this case
the middleware add a new flag to the context, which is then used by the
accountresolver middleware to publish a UserSignedIn event.
The event needs to be sent by the accountresolver middleware, because only
at that point we know the user id of the user that just logged in.
(It would probably makes sense to merge the auth and account middleware into a
single component to avoid passing flags around via context)
When auto-provisioning user accounts we used a fixed mapping for claims
for the userinfo response to user attributes. This change introduces
configuration options to defined which claims should be user for the
username, display name and email address of the auto-provisioned
accounts.
This also removes the automatic fallback to use the 'mail' claim as the
username when the 'preferred_username' claim does not exist.
Fixes: #8635
* feat: add CSP and other security related headers in the oCIS proxy service
* fix: consolidate security related headers - drop middleware.Secure
* fix: use github.com/DeepDiver1975/secure
* fix: acceptance tests
* feat: support env var replacements in csp.yaml