Commit Graph
13 Commits
Author SHA1 Message Date
Roman PerekhodandClaude Opus 5.5 3c56d2cffc fix: [OCSRE-1629] apply the scope rules to the NATS username and fix the NATS checks
- A service-specific username or password now takes precedence over the
  global NATS JWT credentials. Before, OCIS_NATS_CREDS_FILE always
  replaced a value like GRAPH_CACHE_AUTH_USERNAME. The service registry
  uses the same rule for MICRO_REGISTRY_AUTH_USERNAME and
  MICRO_REGISTRY_AUTH_PASSWORD.
- The NATS health check keeps one connection and uses it again for each
  probe. Before, each probe read the .creds file and opened a new
  connection. A probe could read a rotated file before the write was
  complete. The proxy, ocs and gateway services now build the check once.
- The startup check of the store credentials runs only for the nats-js
  and nats-js-kv store types. Other store types do not use the
  credentials.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 19:25:09 +01:00
Roman PerekhodandClaude Opus 5.5 c564134624 fix(proxy): [OCSRE-1629] mask all secret values in the debug output
go-masker copies a field without a mask tag unchanged, also a nested
struct. A mask:"password" tag thus has an effect only when every
parent field on the path has mask:"struct". Several parent fields did
not have this tag, and some secret fields had no mask tag.

- Add mask:"struct" to the proxy fields OIDC, OIDC.UserinfoCache,
  PreSignedURL, PreSignedURL.SigningKeys, ServiceAccount and Events,
  and to the shared Commons.Cache field.
- Add mask:"password" to the AuthPassword fields of the proxy and of
  the shared cache, and to ServiceAccountSecret.
- Add a test that sets a marker in every secret field of the proxy
  config and checks that the debug output does not show it. The test
  also fails when a secret-like field has no mask:"password" tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 16:23:56 +02:00
Roman PerekhodandClaude Opus 5.5 66342f5bf7 fix(proxy): [OCSRE-1629] use the events endpoint for the nats health check
The proxy health check used Events.Cluster, the cluster ID of the
event system, as the NATS address. The check thus never reached the
NATS server.

The check now uses Events.Endpoint. The proxy uses NATS only to
publish events, and an empty endpoint disables the events. So the
check returns no error when the endpoint is empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:34:32 +02:00
Roman PerekhodandClaude Opus 5.5 a6c51801b8 feat: [OCSRE-1629] add NATS JWT authentication with a .creds file
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>
2026-10-23 14:15:55 +02:00
Roman Perekhod c16a2ea2cf checks added 2024-10-17 19:03:14 +02:00
Florian Schade 66ff86bd35 enhancement: simplify ready and health check handler usage 2024-10-16 20:26:00 +02:00
Christian Richter 535df48b54 add http checks to proxy & settings
Signed-off-by: Christian Richter <crichter@owncloud.com>
2024-10-15 13:54:47 +02:00
Florian Schade 0671039474 enhancement: add readyz and healthz check handler 2024-10-14 08:39:42 +02:00
Florian Schade c82a7c560e enhancement: use global ready and health handlers 2024-10-14 08:39:42 +02:00
Thomas Müller 07f0cd5574 fix: typos, naming clashes, error messages and deprecations 2024-04-03 15:34:36 +02:00
Willy Kloucek 627c79dea1 mask sensitive values in /config proxy debug server endpoint 2022-07-04 14:22:44 +02:00
Christian Richter f8f1320501 refactor extensions -> services
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-06-27 14:05:36 +02:00
Christian Richter 78064e6bab rename folder extensions -> services
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-06-27 14:05:36 +02:00