Compare commits

...
44 Commits
Author SHA1 Message Date
Michal Klos c7f9cac8ce fix: govulncheck 2026-10-01 14:48:02 +02:00
Michal Klos 01b441f639 test: reva ocisdev-855 2026-10-01 10:10:11 +02:00
Roman PerekhodandClaude Opus 4.8 dbfd742112 fix: [backport] correct introductionVersion for OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL (#12949)
Change the documented introductionVersion of the
OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL environment variable from 8.0.0 to 8.3.0.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-14 18:59:02 +02:00
Roman Perekhod 8cc1953d55 fix: [stable-8.0] Remove the unmarshalable request body field from graph log messages (#12918)
fix: Remove the unmarshalable request body field from graph log messages
2026-09-14 07:07:30 +00:00
Michal Klosandkobergj ad3b71e0d7 fix(storage-users): [stable-8.0] add --orphaned upload session filter (#12919)
Backport of #12739. Bump reva (stable-8.0 backport, reva#730, merged as
40663c5) to pick up the fix for upload sessions whose node metadata can no
longer be read, and wire up the new Orphaned session filter:

    ocis storage-users uploads sessions --orphaned
    ocis storage-users uploads sessions --orphaned --clean

backports: https://github.com/owncloud/ocis/pull/12739

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
Co-authored-by: kobergj <jkoberg@owncloud.com>
2026-09-11 10:08:30 +02:00
Roman Perekhod aca3df1078 fix: [OCISDEV-1115] harden nats communication (#12927) 2026-09-11 10:05:34 +02:00
Michal Klos 686aa52fe7 fix(graph): [stable-8.0] set introductionVersion 8.2.0 for GRAPH_RECEIVED_SHARES_STAT_TIMEOUT (#12867)
fix(graph): [stable-8.0] set correct introductionVersion 8.2.0 for GRAPH_RECEIVED_SHARES_STAT_TIMEOUT

PR #12862 merged this env var with introductionVersion:"NEXT", a placeholder
the docs process rejects. The variable was introduced in 8.2.0 (matching
master and stable-8.2), so pin it to 8.2.0.
2026-09-02 11:09:09 +02:00
Michal KlosandDavid Walter db40ce2a02 fix(graph): [stable-8.0] keep shares visible in sharedWithMe when a resource cannot be statted (#12862)
fix(graph): keep shares visible in sharedWithMe when a resource cannot be statted (#12430)

Co-authored-by: David Walter <115982880+dj4oC@users.noreply.github.com>
2026-09-01 11:01:20 +02:00
Roman Perekhod f6236debaf build(deps): bump go to 1.25.13 (#12832) 2026-08-21 06:55:20 +02:00
Roman Perekhod 13bb950ee3 build(deps): bump vips to 8.18.5-r0 (#12831) 2026-08-20 17:04:54 +00:00
Roman Perekhod 29b620a4fb build(deps): bump the minor-and-patch group with 9 updates (#12822)
Bumps the minor-and-patch group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) | `2.14.4` | `2.14.5` |
| [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) | `1.52.0` | `1.53.1` |
| [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) | `2.32.0` | `2.32.1` |
| [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) | `1.9.4` | `1.10.0` |
| [golang.org/x/crypto](https://github.com/golang/crypto) | `0.54.0` | `0.55.0` |
| [golang.org/x/image](https://github.com/golang/image) | `0.44.0` | `0.45.0` |
| [golang.org/x/net](https://github.com/golang/net) | `0.57.0` | `0.58.0` |
| [golang.org/x/text](https://github.com/golang/text) | `0.40.0` | `0.41.0` |
| google.golang.org/protobuf | `1.36.11` | `1.36.12` |
2026-08-20 16:16:23 +00:00
Roman Perekhod 17ae8fbac0 [full-ci] Release 8.0.8 (#12830)
Release 8.0.8
2026-08-20 17:09:42 +02:00
Roman Perekhod 8ac40ec030 fix: [OCISDEV-1360] Cache LDAP instance mapper lookups (#12823) 2026-08-20 11:05:31 +02:00
Martin cde8eda368 fix: fix the introduction version of envvar in stable (#12812) 2026-08-18 08:39:28 +00:00
LarsJurgensen ffabec20f8 chore: bump golang.org/x/image to v0.45.0 (#12808) 2026-08-18 10:12:41 +02:00
Martin 3829f5cfc6 docs: [8.0] fix the introduction version of two envvars (#12802) 2026-08-14 12:15:40 +00:00
Michal Klos 8cbe43b3bb feat: [stable-8.0][OCISDEV-855] receivedsharecache: retry on transient storage errors in CAS loop (#12787)
feat: [OCISDEV-855] receivedsharecache: retry on transient storage errors in CAS loop (#12621)
2026-08-14 13:10:21 +02:00
Michal Klos fcbfecf376 feat: [stable-8.0][OCISDEV-1115] harden nats communication (#12790)
feat: [OCISDEV-1115] harden nats communication (#12777)

* feat: [OCISDEV-1115] harden nats communication

* feat: bump reva for tls-enabled stores
2026-08-14 12:13:42 +02:00
Michal Klos e3916a06ea chore: [stable-8.0] bump go packages (#12773)
chore: bump go and web packages (#12765)

* chore: bump go packages

* chore: bump web packages
2026-08-12 13:29:22 +02:00
Michal Klos 6172ce5495 test: [stable-8.0] e2e ldap (#12702)
* test: e2e ldap

* test: e2e ldap distributed
2026-08-06 10:04:45 +02:00
Michal Klos 4282e66a6d fix: [OCISDEV-1031][OCISDEV-1032][stable-8.0] LDAP introductionVersion values (#12732)
fix: introductionVersion values
2026-08-06 10:02:54 +02:00
Roman Perekhod d725a6f499 chore: bump libvips to 8.18.4-r1 (#12700) 2026-07-31 14:46:52 +02:00
Roman Perekhod fb07886cd0 chore: bump axios to 1.19.0 (#12693) 2026-07-31 11:22:20 +00:00
Roman Perekhod 3b5acbf9f7 [full-ci] Release 8.0.7 (#12687)
Release 8.0.7
2026-07-31 12:13:18 +02:00
Michal KlosandRoman Perekhod cdb3ba2f67 feat: [OCISDEV-1032] ldap config and retry policy (#12672)
* feat: ldap config and retry policy

Co-authored-by: Roman Perekhod <2403905@gmail.com>
2026-07-30 18:49:55 +02:00
Roman Perekhod 359b145c9d [docs-only] chore: update the changelog (#12679)
chore: update the changelog
2026-07-30 11:48:21 +02:00
Lukas Hirt 9d9a03747c feat(ldap): [OCISDEV-1031] add opt-in LDAP connection pool (#12660)
* feat(ldap): [OCISDEV-1031] add opt-in LDAP connection pool

Bump the vendored reva dependency to pick up the opt-in bounded LDAP
connection pool (owncloud/reva#658, #665), and wire it into oCIS: add
pool_enabled/pool_size/pool_checkout_timeout config to auth-basic,
users, groups and graph, forward it into the reva config map for the
first three, and unify graph's identity backend onto reva's LDAP
client (utils.GetLDAPClientFromConfig) instead of its own hand-rolled
reconnecting client, now that reva implements PasswordModify and
ModifyWithResult on both LDAP clients. Pooling is off by default and
fully backwards compatible.

Signed-off-by: Lukas Hirt <info@hirt.cz>

* test(ldap): [OCISDEV-1031] run graph LDAP suites with pooling enabled in CI

Add a dedicated ldap-pool-tests job to acceptance-tests.yml that reruns
apiGraphUser/apiGraph/apiGraphGroup with OCIS_LDAP_POOL_ENABLED=true, so
concurrent behat requests exercise checkout/release, eviction and the
pooled PasswordModify/ModifyWithResult path end-to-end, in addition to
the existing pooling-disabled runs of the same suites.

Signed-off-by: Lukas Hirt <info@hirt.cz>

---------

Signed-off-by: Lukas Hirt <info@hirt.cz>
2026-07-30 09:34:52 +02:00
kobergjandClaude Opus 5 6950f47885 fix(webdav): log unmapped thumbnail errors at error level (#12663)
Failures of the thumbnails service were logged at debug level only, so
errors which are not a property of the requested file — such as the
thumbnails service being unreachable — were invisible at production log
levels. A complete preview outage produced HTTP 500 responses without a
single log line explaining them.

Unmapped errors are now logged at error level, while expected per-file
outcomes such as an unsupported file type or a file still being processed
stay at debug level. Two of the four thumbnail handlers also logged
without the request context, so their messages carried no request id.

Also add the missing codesEnum entries for 403, 425 and 429 and fall back
to a generic exception name for any remaining unmapped status code, so
error responses no longer render an empty <s:exception></s:exception>.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 10:51:10 +02:00
Lukas Hirt f28552c629 chore(deps): bump go-chi/chi/v5 and otel to fix govulncheck failures (#12662)
CI's govulncheck step fails on stable-8.0 HEAD due to newly disclosed,
fixable CVEs against the currently pinned versions: GO-2026-5774/5775/5777
(IP spoofing via X-Forwarded-For in chi's RealIP middleware) and
GO-2026-5158 (unbounded baggage header parsing in otel). Bump
github.com/go-chi/chi/v5 to v5.3.0 and go.opentelemetry.io/otel (plus
metric/trace) to v1.44.0 to pick up the fixes.

Signed-off-by: Lukas Hirt <info@hirt.cz>
2026-07-28 09:03:04 +02:00
Roman PerekhodandClaude Opus 4.8 67deb75f7d feat(graph): [OCISDEV-1033] eliminate LDAP read-after-write on create/update (#12618)
* feat(graph): eliminate LDAP read-after-write on create/update

Every graph LDAP create/update wrote the entry, then immediately re-read it
back by DN solely to recover the entry ID for the response model. Against a
replicated directory reached through a proxy, that read-back can hit a lagging
replica and fail or return stale data.

When oCIS generates the UUID itself (GRAPH_LDAP_SERVER_UUID disabled, the
default), the read-back returns nothing new: create responses are now
synthesized from the data already sent, and update responses are built by
folding the applied modifications onto the entry read before the write. When
the directory assigns the ID (GRAPH_LDAP_SERVER_UUID enabled), creates keep the
existing read-back since the generated ID cannot otherwise be recovered.

New ldap_writeback.go with two pure helpers:
- attrsFromAddRequest: flatten an AddRequest for ldap.NewEntry (create paths)
- applyModifyToEntry: fold a ModifyRequest (Replace/Add/Delete,
  case-insensitive, non-mutating, ByteValues populated for octet-string id
  parity) onto a copy of the pre-read entry (update paths)

All 9 write sites updated:
- creates (user, group, education user/class/school): synthesize when the ID is
  client-generated, keep the read-back when the server assigns it
- updates (user, education user): fold the ModifyRequest onto the pre-read
  entry; the AccountEnabled trailing override and the rename read-back inside
  changeUserName are preserved (rename is out of scope)
- education school update: updateSchoolProperties now returns its ModifyRequest
  so the caller can fold it; the displayName ModifyDN rename is folded as a
  displayName attribute replace
- education class update: pre-read widened from name/id only to the full
  education-class attribute set so classification/externalID are not dropped
  from the response; the externalID ModifyDN rename is folded as an attribute
  replace

Model builders are untouched, preserving the response shape. Existing update
tests were reconciled: read-back Search mocks that are no longer issued were
removed and the pre-read fixtures now carry the full baseline entry, with all
assertions unchanged.

OCISDEV-1033

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: hardcoded groupAttributeMap.id and wrong getLDAPGroup filter

* fix(graph): reject octet-string IDs without server-assigned UUIDs

Octet-string ID attributes (e.g. Active Directory's objectGUID) are assigned by
the directory server and require GRAPH_LDAP_SERVER_UUID=true. With
GRAPH_LDAP_SERVER_UUID=false oCIS generates the ID and writes it as a string
UUID, so an octet-string ID attribute would be decoded from raw string bytes
and produce a corrupt ID on both the read-back and the synthesize path.
NewLDAPBackend now rejects this incompatible combination at startup instead of
silently returning bad IDs.

Also adds regression tests for the id-attribute and group-name lookup fixes:
- CreateGroup / CreateEducationClass synthesize the response id under the
  configured GroupIDAttribute (not a hardcoded attribute name)
- getLDAPGroupByNameOrID filters by the group name attribute, not the user one

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: update the staled DN

* test(graph): assert no read-back by search scope, not hard-coded DN

The synthesize-on-create test matched the read-back on a hard-coded
createdDN whose correctness relied on the school base DN being empty.
Match on ScopeBaseObject instead: DN-independent and precise about the
read-back being eliminated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: fixed calling it with a nil argumets. prevent the slice mutations

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 13:59:45 +02:00
8951c623ae fix(graph): [OCISDEV-751] return correct issuerAssignedId on /me (#12635)
fix(graph): [OCISDEV-751] return correct issuerAssignedId on /me (#12411)

The /graph/v1.0/me endpoint reported the internal user UUID as
identities[].issuerAssignedId instead of the OIDC sub. The fast path
built the user model from the CS3 context user, which does not carry the
external identity. /me now always resolves the user through the identity
backend; group memberships are still only expanded on $expand=memberOf.



(cherry picked from commit 61a97e162b)

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
Co-authored-by: kobergj <jkoberg@owncloud.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 09:23:29 +02:00
kobergj 5344650298 fix: upgrade Go to 1.25.12 (#12602)
fix: upgrade Go to 1.25.12 (CVE-2026-39822)

The release image Trivy scan blocks on CVE-2026-39822 in the Go stdlib
(os.Root symlink following / directory traversal, HIGH), present in the
Go 1.25.11 binary and fixed in 1.25.12.

Bump the go directive in go.mod to 1.25.12 (this drives the golang-alpine
build image the docker-build job derives from go.mod) and update the
pinned GOLANG_BUILD_IMAGE in release.yml to the matching 1.25.12 digest.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-07-17 10:53:55 +02:00
kobergj 8481d02fa5 fix: bump pinned vips to 8.18.4-r0 (#12596)
Alpine's rolling edge/community repository no longer offers
vips=8.18.3-r0 (it moved to 8.18.4-r0), so the exact pin in the
release Dockerfiles is unsatisfiable and the docker-build job fails
with 'unable to select packages: vips-8.18.4-r0 breaks world[vips=8.18.3-r0]'.

Bump the pin to the currently-available 8.18.4-r0 in all four linux
Dockerfiles to unblock the v8.0.6 release build.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-07-16 09:45:19 +00:00
kobergj 845ed39133 fix: downgrade the trivy action (#12592)
Downgrade the trivy-action in the build job from v0.36.0 to v0.35.0
(pinned to an allowed action hash). The v0.36.0 hash is not on the
owncloud/ocis allowed-actions list, which fails the release pipeline.

Backport of the relevant part of #12504 to stable-8.0.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-07-16 09:22:10 +02:00
kobergj 70d99100a3 chore: release 8.0.6 (#12579)
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-07-15 16:51:16 +02:00
b0d2d53538 [backport stable-8.0] feat(graph): allow disabling the last sign-in timestamp update (#12532)
* feat(graph): allow disabling the last sign-in timestamp update (#12522)

* feat(graph): [OCISDEV-1022] allow disabling last sign-in timestamp update

Add a new setting OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE /
GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE (default true) to disable maintaining the
'oCLastSignInTimestamp' LDAP attribute on user sign-in. When set to false the
graph service no longer listens for UserSignedIn events and does not write the
attribute, without having to disable all LDAP writes or the events consumer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(changelog): [OCISDEV-1022] fix PR link to 12522

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(graph): [OCISDEV-1022] cover last sign-in toggle; address review

- Add unit test covering both branches of StartListenForLogonEvents
  (subscribes when UpdateUserLastSignInDate is enabled, not when disabled).
- Set introductionVersion to 8.2.0.
- Reword the config description: the two settings are independent, the
  timestamp is only persisted when OCIS_LDAP_SERVER_WRITE_ENABLED is enabled
  rather than the toggle requiring it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Martin <github@diemattels.at>
(cherry picked from commit 49c897e37a)

* chore: bump go-git

* chore: bump crypto

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Martin <github@diemattels.at>
Co-authored-by: Michal Klos <michal.klos@kiteworks.com>
2026-07-13 13:36:55 +02:00
Michal Klos 9def991c40 feat: [backport] ci, changelog lint (#12481)
* feat: ci, changelog lint

* chore: bump
2026-06-30 16:23:27 +02:00
kobergj 00449d3104 chore: release 8.0.5 (#12446)
* chore: release 8.0.5

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

* ci: stop publishing release images to Docker Hub

Image build & push now lives in a separate repository. This pipeline keeps
all safety gates (Trivy fs scan, Trivy image scan on the locally-built image,
license check) but no longer logs in or pushes to Docker Hub.

Removes the docker-scan, docker-manifest and docker-readme jobs (all
publish-only or redundant with the docker-build image scan) and the now-unused
docker_repos / is_production plumbing.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

* fix(idp): bump form-data to 4.0.6 (CVE-2026-12143)

Trivy flagged form-data 4.0.4 (direct dep) and 4.0.5 (via axios) as HIGH
CVE-2026-12143, fixed in 4.0.6. Bump the direct pin and add a pnpm override
so the transitive copy resolves to >=4.0.6 as well.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

* chore: shorten education-user-delete changelog title

calens enforces an 80-character limit on changelog titles; the existing
title was 98 chars and failed the release changelog generation. Shorten it
and move the endpoint detail into the body.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

* fix: bump pinned libvips to 8.18.3-r0 in Docker images

The Docker images pin an exact vips version from Alpine's rolling
edge/community repo. 8.18.2-r0 was dropped from edge (replaced by
8.18.3-r0), so the build failed with 'unable to select packages:
vips-8.18.3-r0 breaks world[vips=8.18.2-r0]'. Bump the pin to the
version edge currently ships.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

* fix: bump Go to 1.25.11 (CVE-2026-42504)

The release image Trivy scan flagged the Go stdlib (v1.25.10) for HIGH
CVE-2026-42504, a MIME header decoding DoS, fixed in 1.25.11. Bump the
go directive in go.mod and the pinned GOLANG_BUILD_IMAGE accordingly.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

---------

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-06-23 10:07:56 +02:00
kobergjandClaude Opus 4.8 c099c8a356 fix(deps): [OCISDEV-834] recover from dead NATS connections in nats-js-kv (stable-8.0) (#12401)
fix(deps): [OCISDEV-834] recover from dead NATS connections in nats-js-kv

Bumps the kobergj/plugins nats-js-kv replace pin to fc78af4, which fixes
hasConn() to treat a permanently-closed NATS connection as no connection.
Previously hasConn() only checked n.conn != nil, so once the client
exhausted its reconnect attempts the connection stayed non-nil but dead,
initConn() never re-ran, and every KV operation failed with
'nats: connection closed' until the pod was restarted.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 14:23:00 +02:00
kobergjandClaude Opus 4.7 b6dea02d1a fix(graph): [OCISDEV-964] education user delete uses wrong id (#12395)
* chore: bump high criticality dependencies

Bumps golang.org/x/net to v0.55.0 and golang.org/x/image to v0.41.0 to
clear 8 govulncheck advisories (HTML/IDNA/BMP/TIFF) that started failing
CI on stable-8.0 after the vulnerability database was updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

* ci: pin node to 24.15.0 to unbreak e2e playwright install

Node 24.16.0 ships a yauzl regression that makes Playwright's post-download
zip extraction hang indefinitely, consuming the entire 6h job budget without
producing any output after the chromium download finishes.

Backported from master, see microsoft/playwright#40724.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

* fix(graph): [OCISDEV-964] education user delete uses wrong id

DeleteEducationUser called the LDAP backend with user.GetExternalID(),
while the regular /users handler and the pre-v8.0 code path used
user.GetId(). With the default RequireExternalID=false, the LDAP backend
looked up the user by name-or-UUID, so the externalID never matched, the
LDAP entry was never removed, and the response was a 404.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

---------

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 09:46:08 +02:00
kobergj 0b9e2d9d58 Release 8.0.4 (#12352)
chore: Release 8.0.4

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-05-22 11:36:28 +02:00
Michal Klos e23737705e fix: [backport][OCISDEV-873] *WithoutTrashbin space editor roles render files read-only in Web frontend (#12351)
fix: [OCISDEV-873] *WithoutTrashbin space editor roles render files read-only in Web frontend (#12346)

* fix: [OCISDEV-873] *WithoutTrashbin space editor roles render files as read-only in Web frontend

* fix: ci after godata bump

ocis CI bumped github.com/CiscoM31/godata from v1.0.10 → v1.0.11 as a transitive dependency of the reva bump. The new godata version parses "mail add 10 (invalid operator) as a parse error → 400 instead of unsupported operation → 501.

* fix ci: more precise role

* fix: bump reva to pull fix merged into reva
2026-05-21 17:51:05 +02:00
Michal Klos 84ea676e1b fix: [OCISDEV-865] CI, release pipeline steps ordering (#12310) (#12320)
* fix: ci, release pipeline steps ordering

* chore: security bump

* fix: ignore for trivy scan, steps order
# Conflicts:
#	services/idp/package.json
#	services/idp/pnpm-lock.yaml
2026-05-18 15:46:38 +02:00
Michal Klos 2617422fd8 fix: [OCISDEV-864] CI, fix passing version string value to image (#12309) (#12319)
* fix: release fix passing version string value to image

* fix: bump release tag

* chore: bump go-git

* fix: missing fcntl64 int the build image due to GHA image update
2026-05-18 10:43:22 +00:00
2648 changed files with 283720 additions and 109600 deletions

No files matched your search

+100 -2
View File
@@ -41,6 +41,7 @@ jobs:
make govulncheck > /tmp/govulncheck.log 2>&1 & PIDS+=($!)
make ci-node-generate > /tmp/node-gen.log 2>&1 & PIDS+=($!)
make ci-go-generate > /tmp/go-gen.log 2>&1 & PIDS+=($!)
make changelog-lint > /tmp/changelog-lint.log 2>&1 & PIDS+=($!)
FAILED=0
for PID in "${PIDS[@]}"; do wait "$PID" || FAILED=1; done
@@ -63,6 +64,7 @@ jobs:
echo "=== govulncheck ===" && cat /tmp/govulncheck.log
echo "=== ci-node-generate ===" && cat /tmp/node-gen.log
echo "=== ci-go-generate ===" && cat /tmp/go-gen.log
echo "=== changelog-lint ===" && cat /tmp/changelog-lint.log
exit $FAILED
@@ -243,6 +245,38 @@ jobs:
- name: Run ${{ matrix.suite }}
run: BEHAT_SUITES="${{ matrix.suite }}" python3 tests/acceptance/run-github.py
ldap-pool-tests:
needs: [build-and-test]
name: ldapPool-${{ matrix.suite }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
- apiGraphUser,apiGraph,apiGraphGroup
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24"
- name: Enable pnpm
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
- uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
with:
php-version: "8.4"
extensions: curl, xml, mbstring, zip, ldap, gd
tools: composer
- name: Run ${{ matrix.suite }} with OCIS_LDAP_POOL_ENABLED=true
run: BEHAT_SUITES="${{ matrix.suite }}" OCIS_LDAP_POOL_ENABLED=true python3 tests/acceptance/run-github.py
core-api-tests:
name: ${{ matrix.suite }}
needs: [build-and-test]
@@ -361,7 +395,9 @@ jobs:
cache: true
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24"
# 24.16.0 breaks playwright install (yauzl zip extraction hangs); pin to last known good.
# https://github.com/microsoft/playwright/issues/40724
node-version: "24.15.0"
- name: Enable pnpm
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
- name: Generate code
@@ -493,8 +529,70 @@ jobs:
- name: Run WOPI validator (cs3)
run: python3 tests/acceptance/run-wopi.py --type cs3
external-ldap-tests:
name: external-ldap-smoke
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24"
- name: Enable pnpm
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
# web/idp assets must be embedded for `ocis server` to come up (same as run-github.py)
- name: Generate assets
run: make ci-node-generate
- name: Build oCIS
run: make -C ocis build
# Boots an external osixia LDAP + oCIS (embedded idm excluded) and runs the
# smoke scope against the graph API — exercises the external-directory
# read-after-write / retry path (OCISDEV-1030/1032/1033) that the embedded-idm
# acceptance jobs never hit.
- name: Run external-LDAP smoke
run: tests/ldap-smoke/run.sh
external-ldap-distributed-tests:
name: external-ldap-distributed-smoke
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24"
- name: Enable pnpm
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
# web/idp assets must be embedded for `ocis server` to come up (same as run-github.py)
- name: Generate assets
run: make ci-node-generate
- name: Build oCIS
run: make -C ocis build
# Distributed LDAP topology (proxy over an async syncrepl replica + write master);
# the replication lag exercises the retry / read-after-write path (OCISDEV-1030/1032/1033).
- name: Run external-LDAP distributed smoke
run: tests/ldap-smoke-distributed/run.sh
all-acceptance-tests:
needs: [local-api-tests, cli-tests, core-api-tests, litmus, cs3api, wopi-builtin, wopi-cs3, e2e-tests]
needs: [local-api-tests, cli-tests, ldap-pool-tests, core-api-tests, litmus, cs3api, wopi-builtin, wopi-cs3, e2e-tests, external-ldap-tests, external-ldap-distributed-tests]
runs-on: ubuntu-latest
if: always()
steps:
+28 -106
View File
@@ -14,21 +14,16 @@ on:
default: ''
env:
PRODUCTION_RELEASE_TAGS: '5.0,7,8'
DOCKER_REPO_ROLLING: owncloud/ocis-rolling
DOCKER_REPO_PRODUCTION: owncloud/ocis
NODE_VERSION: '24'
PNPM_VERSION: '10.28.1'
GOLANG_BUILD_IMAGE: 'golang:1.25.10-alpine3.23@sha256:8d22e29d960bc50cd025d93d5b7c7d220b1ee9aa7a239b3c8f55a57e987e8d45'
GOLANG_BUILD_IMAGE: 'golang:1.25.13-alpine3.23@sha256:42fc3368d1c50170a452f2bf4a1dfd292a065870c3f258d799aad4316671cb69'
jobs:
determine-release-type:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.info.outputs.version }}
is_production: ${{ steps.info.outputs.is_production }}
is_prerelease: ${{ steps.info.outputs.is_prerelease }}
docker_repos: ${{ steps.info.outputs.docker_repos }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: ${{ github.ref_type == 'branch' || (github.event_name == 'workflow_dispatch' && inputs.version_override == '') }}
@@ -61,26 +56,14 @@ jobs:
VERSION="${GITHUB_REF#refs/tags/v}"
fi
IS_PRODUCTION=false
for TAG in ${PRODUCTION_RELEASE_TAGS//,/ }; do
[[ "$VERSION" == "$TAG"* ]] && IS_PRODUCTION=true && break
done
[[ "$VERSION" == *"-"* ]] && IS_PRERELEASE=true || IS_PRERELEASE=false
if [[ "$IS_PRODUCTION" == "true" && "$IS_PRERELEASE" == "false" ]]; then
REPOS=[\"$DOCKER_REPO_ROLLING\",\"$DOCKER_REPO_PRODUCTION\"]
else
REPOS=[\"$DOCKER_REPO_ROLLING\"]
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "is_production=$IS_PRODUCTION" >> $GITHUB_OUTPUT
echo "is_prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
echo "docker_repos=$REPOS" >> $GITHUB_OUTPUT
generate-code:
runs-on: ubuntu-latest
needs: [determine-release-type]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
@@ -99,6 +82,10 @@ jobs:
- run: make ci-go-generate
env:
BUF_TOKEN: ${{ secrets.BUF_API_TOKEN }}
- name: bump LatestTag
run: |
VERSION="${{ needs.determine-release-type.outputs.version }}"
sed -i "s/LatestTag = \".*\"/LatestTag = \"$VERSION\"/" ocis-pkg/version/version.go
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: generated-code
@@ -107,19 +94,16 @@ jobs:
!.git
retention-days: 1
# Builds the release image locally and runs the Trivy security gate against it.
# Image publishing to Docker Hub happens in a separate repository; this job only
# builds (load, no push) so the vulnerability gate still blocks a bad release.
docker-build:
name: docker-build (${{ matrix.arch }}, ${{ matrix.repo }})
name: docker-build (${{ matrix.arch }})
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
needs: [determine-release-type, generate-code]
outputs:
digest-amd64-rolling: ${{ steps.digest.outputs.digest-amd64-rolling }}
digest-arm64-rolling: ${{ steps.digest.outputs.digest-arm64-rolling }}
digest-amd64: ${{ steps.digest.outputs.digest-amd64 }}
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
needs: [determine-release-type, generate-code, security-scan-trivy]
strategy:
matrix:
arch: [amd64, arm64]
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
@@ -127,59 +111,44 @@ jobs:
name: generated-code
path: .
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
- id: goversion
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
go-version-file: go.mod
- run: |
ALPINE_VERSION=$(grep '^FROM.*alpine:' ocis/docker/Dockerfile.linux.${{ matrix.arch }} | grep -o 'alpine:[0-9.]*' | cut -d: -f2 | cut -d. -f1,2)
docker run --rm \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
${{ env.GOLANG_BUILD_IMAGE }} \
"golang:${{ steps.goversion.outputs.go-version }}-alpine${ALPINE_VERSION}" \
sh -c "apk add --no-cache bash gcc musl-dev vips-dev make git && \
git config --global --add safe.directory /workspace && \
CGO_ENABLED=1 ENABLE_VIPS=true \
CGO_ENABLED=1 ENABLE_VIPS=true VERSION=${{ needs.determine-release-type.outputs.version }} \
make -C ocis release-linux-docker-${{ matrix.arch }}"
- id: tags
run: |
VERSION="${{ needs.determine-release-type.outputs.version }}"
REPO="${{ matrix.repo }}"
ARCH="${{ matrix.arch }}"
printf "tags<<EOF\n%s\nEOF\n" \
"${REPO}:${VERSION}-linux-${ARCH}" >> $GITHUB_OUTPUT
"owncloud/ocis:${VERSION}-linux-${ARCH}" >> $GITHUB_OUTPUT
- id: build
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: ocis
file: ocis/docker/Dockerfile.linux.${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
push: true
load: true
push: false
provenance: false
build-args: |
REVISION=${{ github.sha }}
VERSION=${{ needs.determine-release-type.outputs.version }}
tags: ${{ steps.tags.outputs.tags }}
- id: digest
run: |
[[ "${{ matrix.repo }}" == *"rolling"* ]] \
&& echo "digest-${{ matrix.arch }}-rolling=${{ steps.build.outputs.digest }}" >> $GITHUB_OUTPUT \
|| echo "digest-${{ matrix.arch }}=${{ steps.build.outputs.digest }}" >> $GITHUB_OUTPUT
docker-scan:
name: docker-scan (${{ matrix.arch }}, ${{ matrix.repo }})
runs-on: ubuntu-latest
needs: [determine-release-type, docker-build]
strategy:
matrix:
arch: [amd64]
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
id: trivy
- id: trivy
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
continue-on-error: true
with:
image-ref: ${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-${{ matrix.arch }}
image-ref: ${{ steps.tags.outputs.tags }}
format: table
exit-code: 1
severity: HIGH,CRITICAL
@@ -188,54 +157,12 @@ jobs:
hide-progress: true
env:
TRIVY_IGNOREFILE: .trivyignore
- name: Block on vulnerabilities
if: steps.trivy.outcome == 'failure'
run: |
echo "::error title=Security scan blocked release::Image ${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-${{ matrix.arch }} has HIGH or CRITICAL vulnerabilities (see Trivy report above). Fix all findings before releasing."
echo "::error title=Security scan blocked release::Image ${{ steps.tags.outputs.tags }} has HIGH or CRITICAL vulnerabilities (see Trivy report above). Fix all findings before releasing."
exit 1
docker-manifest:
name: docker-manifest (${{ matrix.repo }})
runs-on: ubuntu-latest
needs: [determine-release-type, docker-build]
strategy:
matrix:
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
steps:
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- if: ${{ contains(matrix.repo, 'rolling') }}
run: |
docker buildx imagetools create \
-t "${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}" \
"${{ needs.docker-build.outputs.digest-amd64-rolling }}" \
"${{ needs.docker-build.outputs.digest-arm64-rolling }}"
- if: ${{ !contains(matrix.repo, 'rolling') }}
run: |
docker buildx imagetools create \
-t "${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}" \
"${{ needs.docker-build.outputs.digest-amd64 }}" \
"${{ needs.docker-build.outputs.digest-arm64 }}"
docker-readme:
name: docker-readme (${{ matrix.repo }})
runs-on: ubuntu-latest
needs: [determine-release-type, docker-manifest]
strategy:
matrix:
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ matrix.repo }}
readme-filepath: ocis/README.md
build-binaries:
name: build-binaries (${{ matrix.os }})
runs-on: ubuntu-latest
@@ -272,8 +199,9 @@ jobs:
with:
scan-type: fs
format: table
exit-code: 0
exit-code: 1
severity: CRITICAL,HIGH
trivy-config: .trivy.yaml
license-check:
runs-on: ubuntu-latest
@@ -325,7 +253,7 @@ jobs:
create-github-release:
runs-on: ubuntu-latest
needs: [determine-release-type, build-binaries, license-check, generate-changelog]
needs: [determine-release-type, build-binaries, license-check, generate-changelog, security-scan-trivy, docker-build]
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
@@ -357,9 +285,6 @@ jobs:
- determine-release-type
- generate-code
- docker-build
- docker-scan
- docker-manifest
- docker-readme
- build-binaries
- security-scan-trivy
- license-check
@@ -383,7 +308,7 @@ jobs:
python3 scripts/audit-release.py \
--version "${{ needs.determine-release-type.outputs.version }}" \
--dir release-assets/ \
--github-release --docker
--github-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -394,9 +319,6 @@ jobs:
- determine-release-type
- generate-code
- docker-build
- docker-scan
- docker-manifest
- docker-readme
- build-binaries
- security-scan-trivy
- license-check
+1 -5
View File
@@ -29,11 +29,7 @@ ifndef OUTPUT
endif
ifndef VERSION
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
STRING ?= $(shell git rev-parse --short HEAD)
endif
STRING ?= $(shell git rev-parse --short HEAD)
endif
ifndef DATE
+3
View File
@@ -0,0 +1,3 @@
scan:
skip-files:
- vendor/github.com/crewjam/saml/xmlenc/fuzz.go
+2 -7
View File
@@ -2,10 +2,5 @@
# Add CVE IDs or file paths here to suppress known/accepted findings.
# See: https://aquasecurity.github.io/trivy/latest/docs/configuration/filtering/#trivyignore
# Alpine 3.23.3 ships vulnerable package versions; no fixed base image exists yet.
# Fix: bump FROM alpine:3.23.3 → alpine:3.23.4 once released, or add
# RUN apk upgrade --no-cache
# to Dockerfile.linux.amd64 and Dockerfile.linux.arm64.
CVE-2026-28390 # libcrypto3/libssl3 3.5.5-r0 → fixed in 3.5.6-r0 (openssl DoS)
CVE-2026-22184 # zlib 1.3.1-r2 → fixed in 1.3.2-r0 (buffer overflow in untgz)
CVE-2026-40200 # musl/musl-utils 1.2.5-r21 → fixed in 1.2.5-r23 (stack-based arbitrary code execution / DoS)
CVE-2026-32284 # github.com/shamaton/msgpack/v2 v2.4.0 — no fix available upstream
vendor/github.com/crewjam/saml/xmlenc/fuzz.go # test RSA key used in fuzz corpus, not a real secret
+518 -29
View File
@@ -1,6 +1,13 @@
# Table of Contents
* [Changelog for unreleased](#changelog-for-unreleased-unreleased)
* [Changelog for 8.0.8](#changelog-for-808-2026-08-20)
* [Changelog for 8.0.7](#changelog-for-807-2026-07-31)
* [Changelog for 8.0.6](#changelog-for-806-2026-07-15)
* [Changelog for 8.0.5](#changelog-for-805-2026-06-18)
* [Changelog for 8.0.4](#changelog-for-804-2026-05-22)
* [Changelog for 8.0.2](#changelog-for-802-2026-04-30)
* [Changelog for 8.0.1](#changelog-for-801-2026-03-09)
* [Changelog for 8.0.0](#changelog-for-800-2026-02-13)
* [Changelog for 7.3.1](#changelog-for-731-2025-11-24)
* [Changelog for 7.3.0](#changelog-for-730-2025-10-13)
* [Changelog for 7.2.0](#changelog-for-720-2025-07-14)
@@ -38,8 +45,8 @@
* [Changelog for 3.0.0](#changelog-for-300-2023-06-06)
* [Changelog for 2.0.0](#changelog-for-200-2022-11-30)
* [Changelog for 1.20.0](#changelog-for-1200-2022-04-13)
* [Changelog for 1.19.0](#changelog-for-1190-2022-03-29)
* [Changelog for 1.19.1](#changelog-for-1191-2022-03-29)
* [Changelog for 1.19.0](#changelog-for-1190-2022-03-29)
* [Changelog for 1.18.0](#changelog-for-1180-2022-03-03)
* [Changelog for 1.17.0](#changelog-for-1170-2022-02-16)
* [Changelog for 1.16.0](#changelog-for-1160-2021-12-10)
@@ -60,11 +67,470 @@
* [Changelog for 1.1.0](#changelog-for-110-2021-01-22)
* [Changelog for 1.0.0](#changelog-for-100-2020-12-17)
# Changelog for [unreleased] (UNRELEASED)
# Changelog for [8.0.8] (2026-08-20)
The following sections list the changes for unreleased.
The following sections list the changes for 8.0.8.
[unreleased]: https://github.com/owncloud/ocis/compare/v7.3.1...master
[8.0.8]: https://github.com/owncloud/ocis/compare/v8.0.7...v8.0.8
## Summary
* Security - Bump golang.org/x/image to v0.45.0: [#12808](https://github.com/owncloud/ocis/pull/12808)
* Security - Bump Go to 1.25.13: [#12832](https://github.com/owncloud/ocis/pull/12832)
* Bugfix - Cache LDAP instance mapper lookups: [#12823](https://github.com/owncloud/ocis/pull/12823)
* Bugfix - Fix share metadata corruption during concurrent share operations: [#12621](https://github.com/owncloud/ocis/pull/12621)
* Enhancement - Add TLS support for NATS store and registry connections: [#12765](https://github.com/owncloud/ocis/pull/12765)
## Details
* Security - Bump golang.org/x/image to v0.45.0: [#12808](https://github.com/owncloud/ocis/pull/12808)
Upgraded golang.org/x/image from v0.44.0 to v0.45.0 to address
GO-2026-6222: excessive memory allocation during VP8L decoding.
https://github.com/owncloud/ocis/pull/12808
* Security - Bump Go to 1.25.13: [#12832](https://github.com/owncloud/ocis/pull/12832)
Fixes a stdlib CVE vulnerability flagged by the release image scan.
https://github.com/owncloud/ocis/pull/12832
* Bugfix - Cache LDAP instance mapper lookups: [#12823](https://github.com/owncloud/ocis/pull/12823)
In multi-instance deployments, resolving a user's instance name/ID during
`GET /graph/v1.0/users` (and group member expansion) issued a fresh, uncached
LDAP search per instance/guest attribute value on every request. Under load
this multiplied into large numbers of redundant LDAP round-trips per page of
users, saturating the LDAP connection pool and causing request timeouts. The
LDAP identity backend now caches instance mapper lookups, including negative
(not-found) results, for a configurable TTL
(`OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL`, default 60s).
https://github.com/owncloud/ocis/pull/12823
* Bugfix - Fix share metadata corruption during concurrent share operations: [#12621](https://github.com/owncloud/ocis/pull/12621)
When multiple sharing service replicas processed share operations concurrently
for the same user, the share metadata could become corrupted with references to
missing data, making all shares inaccessible to that user. The received share
cache now uses compare-and-swap (etag) validation to detect concurrent writes
and retries gracefully, preventing metadata corruption.
https://github.com/owncloud/ocis/pull/12621
* Enhancement - Add TLS support for NATS store and registry connections: [#12765](https://github.com/owncloud/ocis/pull/12765)
All `nats-js-kv` store, cache, and service registry connections now support
TLS. Configure via `OCIS_CACHE_ENABLE_TLS`, `OCIS_PERSISTENT_STORE_ENABLE_TLS`,
and `MICRO_REGISTRY_ENABLE_TLS`, with corresponding `*_TLS_INSECURE` and
`*_TLS_ROOT_CA_CERTIFICATE` variants per connection type.
https://github.com/owncloud/ocis/pull/12765
# Changelog for [8.0.7] (2026-07-31)
The following sections list the changes for 8.0.7.
[8.0.7]: https://github.com/owncloud/ocis/compare/v8.0.6...v8.0.7
## Summary
* Bugfix - Return correct issuerAssignedId on /me: [#12635](https://github.com/owncloud/ocis/pull/12635)
* Bugfix - Log unmapped thumbnail errors and always report a sabredav exception: [#12663](https://github.com/owncloud/ocis/pull/12663)
* Enhancement - Eliminate redundant LDAP read-after-write on create and update: [#12618](https://github.com/owncloud/ocis/pull/12618)
* Enhancement - Add an opt-in bounded LDAP connection pool: [#12660](https://github.com/owncloud/ocis/pull/12660)
* Enhancement - Retry LDAP operations against a lagging replica: [#12672](https://github.com/owncloud/ocis/pull/12672)
## Details
* Bugfix - Return correct issuerAssignedId on /me: [#12635](https://github.com/owncloud/ocis/pull/12635)
The `/graph/v1.0/me` endpoint reported the internal user UUID as
`identities[].issuerAssignedId` instead of the issuer-assigned identity (the
OIDC `sub`). The endpoint took a fast path that built the user model from the
CS3 user in the request context, which does not carry the external identity, so
it fell back to the internal UUID. `/me` now always resolves the user through
the identity backend, which reads the stored external identity and returns the
correct value. Group memberships are still only expanded when `$expand=memberOf`
is requested.
https://github.com/owncloud/ocis/pull/12635
* Bugfix - Log unmapped thumbnail errors and always report a sabredav exception: [#12663](https://github.com/owncloud/ocis/pull/12663)
The webdav service logged failures of the thumbnails service at debug level
only. Errors which are not a property of the requested file, such as the
thumbnails service being unreachable, were therefore invisible at production log
levels: a complete preview outage produced HTTP 500 responses without a single
log line explaining them. Unmapped errors are now logged at error level, while
expected per-file outcomes such as an unsupported file type or a file still
being processed stay at debug level. Two of the four thumbnail handlers also
logged without the request context, so their messages carried no request id.
In addition, `codesEnum` only mapped four status codes, so error responses for
all other codes were rendered with an empty `<s:exception></s:exception>`
element. The missing entries for 403, 425 and 429 have been added and any
remaining unmapped code now falls back to a generic exception name, so clients
always receive a usable exception.
https://github.com/owncloud/ocis/pull/12663
* Enhancement - Eliminate redundant LDAP read-after-write on create and update: [#12618](https://github.com/owncloud/ocis/pull/12618)
The graph LDAP backend no longer re-reads an entry immediately after writing it
just to recover the entry ID for the response. When oCIS generates the ID itself
(GRAPH_LDAP_SERVER_UUID disabled), the create response is now synthesized from
the data already sent to the directory, and update responses are built by
folding the applied modifications onto the entry that was read before the write.
This avoids a round-trip that, against a replicated directory reached through a
proxy, could hit a lagging replica and fail or return stale data.
When the directory assigns the ID (GRAPH_LDAP_SERVER_UUID enabled), creates keep
the existing read-back, since the generated ID cannot otherwise be recovered.
https://github.com/owncloud/ocis/pull/12618
* Enhancement - Add an opt-in bounded LDAP connection pool: [#12660](https://github.com/owncloud/ocis/pull/12660)
The auth-basic, users, groups and graph services can now be switched from a
single long-lived reconnecting LDAP connection to a bounded pool of connections,
so concurrent requests no longer serialize on one socket. Connections are dialed
and bound lazily on checkout, unhealthy connections are discarded and lazily
re-dialed rather than eagerly reconnected, and checkout blocks with a
configurable timeout once the pool is exhausted.
Pooling is off by default and fully backwards compatible. Enable it per service
via 'OCIS_LDAP_POOL_ENABLED' (or the service-specific
'<SERVICE>_LDAP_POOL_ENABLED' override), and tune it with 'OCIS_LDAP_POOL_SIZE'
(default 5) and 'OCIS_LDAP_POOL_CHECKOUT_TIMEOUT' (default 30s).
The graph service's identity backend now shares the same LDAP client
implementation used by the reva auth/user/group managers instead of maintaining
its own separate reconnecting client.
https://github.com/owncloud/ocis/pull/12660
* Enhancement - Retry LDAP operations against a lagging replica: [#12672](https://github.com/owncloud/ocis/pull/12672)
The graph LDAP backend can now retry operations against a replicated directory
where a write to the primary is followed by a read that lands on a replica which
has not yet caught up. This covers the read-back that recovers a
directory-assigned ID after a create (GRAPH_LDAP_SERVER_UUID enabled), which is
retried until the entry becomes visible. The retry count and backoff are tunable
through `GRAPH_LDAP_RETRY_MAX_COUNT`, `GRAPH_LDAP_RETRY_BASE_DELAY` and
`GRAPH_LDAP_RETRY_MAX_DELAY`; the defaults keep the previous behaviour (a single
immediate retry with no delay), so existing deployments are unaffected.
Retries now distinguish reads from writes: a write is no longer retried on a
network error, which can surface after the request was already sent and would
otherwise apply the mutation twice.
https://github.com/owncloud/ocis/pull/12672
# Changelog for [8.0.6] (2026-07-15)
The following sections list the changes for 8.0.6.
[8.0.6]: https://github.com/owncloud/ocis/compare/v8.0.5...v8.0.6
## Summary
* Security - Upgrade libvips to 8.18.4: [#12596](https://github.com/owncloud/ocis/pull/12596)
* Security - Upgrade Go to 1.25.12: [#12602](https://github.com/owncloud/ocis/pull/12602)
* Enhancement - Allow disabling the last sign-in timestamp update: [#12522](https://github.com/owncloud/ocis/pull/12522)
## Details
* Security - Upgrade libvips to 8.18.4: [#12596](https://github.com/owncloud/ocis/pull/12596)
Bumped libvips to 8.18.4 in all Docker images. The previous pin (8.18.3-r0) was
dropped from the Alpine edge/community repository, which broke the image build.
https://github.com/owncloud/ocis/pull/12596
* Security - Upgrade Go to 1.25.12: [#12602](https://github.com/owncloud/ocis/pull/12602)
Bumped the Go toolchain used to build the release binaries and Docker images
from 1.25.11 to 1.25.12. Go 1.25.11 is affected by CVE-2026-39822 (os.Root
symlink following allows directory traversal), which is fixed in 1.25.12 and was
blocking the release image security scan.
https://github.com/owncloud/ocis/pull/12602
* Enhancement - Allow disabling the last sign-in timestamp update: [#12522](https://github.com/owncloud/ocis/pull/12522)
The graph service maintains the 'oCLastSignInTimestamp' LDAP attribute of a user
on every sign-in (when the LDAP identity backend has write access). This can
cause a significant amount of LDAP write load, especially when the proxy's OIDC
userinfo cache has a short TTL and sign-in events are emitted frequently.
A new setting 'OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE' /
'GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE' (default 'true') allows disabling the
update of the last sign-in timestamp without having to disable all LDAP writes
('OCIS_LDAP_SERVER_WRITE_ENABLED') or the graph events consumer. When set to
'false' the graph service no longer listens for 'UserSignedIn' events and does
not write the 'oCLastSignInTimestamp' attribute.
https://github.com/owncloud/ocis/issues/9942
https://github.com/owncloud/ocis/pull/12522
# Changelog for [8.0.5] (2026-06-18)
The following sections list the changes for 8.0.5.
[8.0.5]: https://github.com/owncloud/ocis/compare/v8.0.4...v8.0.5
## Summary
* Security - Bump Go to 1.25.11: [#12446](https://github.com/owncloud/ocis/pull/12446)
* Security - Upgrade libvips to 8.18.3: [#12446](https://github.com/owncloud/ocis/pull/12446)
* Bugfix - Education user delete no longer 404s and leaves the LDAP entry behind: [#12395](https://github.com/owncloud/ocis/pull/12395)
* Bugfix - Recover from permanently-closed NATS connections in the nats-js-kv store: [#12401](https://github.com/owncloud/ocis/pull/12401)
## Details
* Security - Bump Go to 1.25.11: [#12446](https://github.com/owncloud/ocis/pull/12446)
Fixes CVE-2026-42504, a stdlib MIME header decoding vulnerability flagged by the
release image scan.
https://github.com/owncloud/ocis/pull/12446
* Security - Upgrade libvips to 8.18.3: [#12446](https://github.com/owncloud/ocis/pull/12446)
Bumped libvips to 8.18.3 in all Docker images. The previous pin (8.18.2-r0) was
dropped from the Alpine edge/community repository, which broke the image build.
https://github.com/owncloud/ocis/pull/12446
* Bugfix - Education user delete no longer 404s and leaves the LDAP entry behind: [#12395](https://github.com/owncloud/ocis/pull/12395)
`DELETE /graph/v1.0/education/users/{id}` previously returned a 404 without
removing the user. The education user delete handler used `user.GetExternalID()`
for the backend DELETE, while the regular `/users` handler and the pre-v8.0 code
path used `user.GetId()`. With the default `RequireExternalID=false`, the LDAP
backend looked up the user by name-or-UUID, so the externalID never matched, the
LDAP entry was never removed, and the response was a 404. This is now fixed.
https://github.com/owncloud/ocis/pull/12395
* Bugfix - Recover from permanently-closed NATS connections in the nats-js-kv store: [#12401](https://github.com/owncloud/ocis/pull/12401)
The `nats-js-kv` go-micro store plugin's `hasConn()` only checked whether the
connection object was non-nil, not whether it was still alive. Once the
underlying NATS client exhausted its reconnect attempts (e.g. a NATS pod restart
longer than the client's reconnect window), the connection stayed non-nil but
permanently closed. Because connection initialization is gated on `!hasConn()`,
it never re-ran, so every subsequent KV operation failed with `nats: connection
closed` until the affected pod was restarted.
This surfaced as several user-visible failures backed by the NATS KV cache, e.g.
all spaces becoming invisible (`storage-users` `ListStorageSpaces`) and download
failures from missing signing keys (`ocs`).
The store plugin now treats a closed connection as no connection, so the next
operation transparently re-initializes it.
https://github.com/owncloud/ocis/pull/12401
# Changelog for [8.0.4] (2026-05-22)
The following sections list the changes for 8.0.4.
[8.0.4]: https://github.com/owncloud/ocis/compare/v8.0.2...v8.0.4
## Summary
* Security - Upgrade libvips to 8.18.2: [#12301](https://github.com/owncloud/ocis/pull/12301)
* Security - Bump Go to 1.25.10: [#12306](https://github.com/owncloud/ocis/pull/12306)
* Bugfix - SpaceEditorWithoutTrashbin roles now correctly allow file editing: [#12346](https://github.com/owncloud/ocis/pull/12346)
## Details
* Security - Upgrade libvips to 8.18.2: [#12301](https://github.com/owncloud/ocis/pull/12301)
Bumped libvips to 8.18.2 in all Docker images to pick up the fix for a stack
buffer overflow.
https://github.com/owncloud/ocis/pull/12301
* Security - Bump Go to 1.25.10: [#12306](https://github.com/owncloud/ocis/pull/12306)
Fixes CVE-2026-33811, CVE-2026-33814, CVE-2026-39820, CVE-2026-39836,
CVE-2026-42499.
https://github.com/owncloud/ocis/pull/12306
* Bugfix - SpaceEditorWithoutTrashbin roles now correctly allow file editing: [#12346](https://github.com/owncloud/ocis/pull/12346)
Fixed a bug where the *WithoutTrashbin space editor roles were rendered as
read-only in the Web frontend. The OCS PermissionWrite bit was not set for these
roles because the RoleFromResourcePermissions round-trip required
RestoreRecycleItem, which these roles intentionally omit.
https://github.com/owncloud/ocis/pull/12346
# Changelog for [8.0.2] (2026-04-30)
The following sections list the changes for 8.0.2.
[8.0.2]: https://github.com/owncloud/ocis/compare/v8.0.1...v8.0.2
## Summary
* Bugfix - Fix OCM share permission change notification: [#12190](https://github.com/owncloud/ocis/pull/12190)
* Bugfix - Fix the internal links: [#12231](https://github.com/owncloud/ocis/pull/12231)
* Bugfix - Return 200 OK for WOPI Lock requests in read-only and view-only modes: [#12257](https://github.com/owncloud/ocis/pull/12257)
* Bugfix - Fix space management middleware removing users from spaces on download: [#12285](https://github.com/owncloud/ocis/pull/12285)
* Enhancement - Add spaceid to REPORT: [#12241](https://github.com/owncloud/ocis/pull/12241)
* Enhancement - Allow multiple objectClasses on group creation: [#12242](https://github.com/owncloud/ocis/pull/12242)
* Enhancement - Add SpaceEditorWithoutVersionsWithoutTrashbin space membership role: [#12245](https://github.com/owncloud/ocis/pull/12245)
* Enhancement - Bump Web to 12.3.3: [#13705](https://github.com/owncloud/web/pull/13705)
## Details
* Bugfix - Fix OCM share permission change notification: [#12190](https://github.com/owncloud/ocis/pull/12190)
Fix the OCM share permission change notification handling.
https://github.com/owncloud/ocis/pull/12190
* Bugfix - Fix the internal links: [#12231](https://github.com/owncloud/ocis/pull/12231)
We fixed the internal links access control
https://github.com/owncloud/ocis/pull/12231
* Bugfix - Return 200 OK for WOPI Lock requests in read-only and view-only modes: [#12257](https://github.com/owncloud/ocis/pull/12257)
OnlyOffice sends a WOPI Lock request when opening any document, even when the
user only has read access. The WOPI Lock handler was attempting to acquire a CS3
write lock regardless of the view mode, causing a permission error for read-only
tokens that OnlyOffice displayed as an error message on load.
The Lock handler now returns 200 OK immediately for READ_ONLY and VIEW_ONLY view
modes without attempting to acquire a lock, consistent with the WOPI spec.
https://github.com/owncloud/ocis/pull/12257
* Bugfix - Fix space management middleware removing users from spaces on download: [#12285](https://github.com/owncloud/ocis/pull/12285)
The space management middleware ran on every authenticated request, including
signed URL requests used for file downloads. Since signed URL auth does not
carry OIDC claims, the middleware interpreted the absence of claims as "user
should have no space access" and removed the user from all project spaces. On
the next OIDC request the user was re-added, causing an oscillating add/remove
cycle that led to intermittent download failures and transient "space not found"
errors.
The middleware now skips reconciliation entirely when no OIDC claims are present
in the request context.
https://github.com/owncloud/ocis/issues/12285
https://github.com/owncloud/ocis/pull/12285
* Enhancement - Add spaceid to REPORT: [#12241](https://github.com/owncloud/ocis/pull/12241)
Added the `spaceid` to the REPORT responses. This is aligning the `REPORT`
method with the `PROPFIND` method.
https://github.com/owncloud/ocis/pull/12241
* Enhancement - Allow multiple objectClasses on group creation: [#12242](https://github.com/owncloud/ocis/pull/12242)
Added support for configuring additional LDAP objectClasses when creating
groups. The new `OCIS_LDAP_GROUP_ADDITIONAL_OBJECTCLASSES` /
`GRAPH_LDAP_GROUP_ADDITIONAL_OBJECTCLASSES` environment variable accepts a list
of extra objectClasses that are set alongside the primary
`GRAPH_LDAP_GROUP_OBJECTCLASS` when a new group is created in LDAP.
https://github.com/owncloud/ocis/pull/12242
* Enhancement - Add SpaceEditorWithoutVersionsWithoutTrashbin space membership role: [#12245](https://github.com/owncloud/ocis/pull/12245)
Added a new space membership role "Can edit"
(SpaceEditorWithoutVersionsWithoutTrashbin) that grants full editor permissions
(create, upload, download, edit, move, delete) on a space without access to file
versions or the trashbin.
https://github.com/owncloud/ocis/pull/12245
* Enhancement - Bump Web to 12.3.3: [#13705](https://github.com/owncloud/web/pull/13705)
- Bugfix [owncloud/web#13638](https://github.com/owncloud/web/pull/13638): Share
button not usable when role dropdown text is too long - Bugfix
[owncloud/web#13667](https://github.com/owncloud/web/pull/13667): Shared with
does not show members - Bugfix
[owncloud/web#13680](https://github.com/owncloud/web/pull/13680): Escape strings
when returned from server
https://github.com/owncloud/web/pull/13705
https://github.com/owncloud/web/releases/tag/v12.3.3
# Changelog for [8.0.1] (2026-03-09)
The following sections list the changes for 8.0.1.
[8.0.1]: https://github.com/owncloud/ocis/compare/v8.0.0...v8.0.1
## Summary
* Bugfix - Don't use hardcoded groupOfNames in group creation: [#11776](https://github.com/owncloud/ocis/pull/11776)
* Bugfix - Expose the signature-auth attribute: [#12052](https://github.com/owncloud/ocis/pull/12052)
* Bugfix - Don't write empty externalID to LDAP: [#12085](https://github.com/owncloud/ocis/pull/12085)
* Enhancement - Bump Web to 12.3.2: [#12074](https://github.com/owncloud/ocis/pull/12074)
* Enhancement - Bump reva: [#12097](https://github.com/owncloud/ocis/pull/12097)
## Details
* Bugfix - Don't use hardcoded groupOfNames in group creation: [#11776](https://github.com/owncloud/ocis/pull/11776)
Formerly, when creating a group with a different objectClass, it will always use
groupOfNames instead of the one provided in the config. Now, the server creates
groups using the objectClass defined in the config.
https://github.com/owncloud/ocis/pull/11776
* Bugfix - Expose the signature-auth attribute: [#12052](https://github.com/owncloud/ocis/pull/12052)
Expose the "oc:signature-auth" attribute for the subfolders in the public link
propfinds. This is a necessary change to be able to support archive downloads in
password protected public links.
https://github.com/owncloud/ocis/pull/12052
* Bugfix - Don't write empty externalID to LDAP: [#12085](https://github.com/owncloud/ocis/pull/12085)
When creating new users in the graph service, the externalID attribute was being
written to LDAP even when it was empty. Now, the externalID attribute is only
written when it has a non-empty value.
https://github.com/owncloud/ocis/pull/12085
* Enhancement - Bump Web to 12.3.2: [#12074](https://github.com/owncloud/ocis/pull/12074)
- Enhancement
[owncloud/ocis#11963](https://github.com/owncloud/ocis/issues/11963): Use
signature auth
https://github.com/owncloud/ocis/pull/12074
https://github.com/owncloud/web/releases/tag/v12.3.2
* Enhancement - Bump reva: [#12097](https://github.com/owncloud/ocis/pull/12097)
Bumped reva to the latest version. This includes a refactoring of the scope
expansion and verification logic, as well as a fix for the signature-auth
propfind attribute that now correctly supports archive downloads in
password-protected public links.
https://github.com/owncloud/ocis/pull/12097
# Changelog for [8.0.0] (2026-02-13)
The following sections list the changes for 8.0.0.
[8.0.0]: https://github.com/owncloud/ocis/compare/v7.3.1...v8.0.0
## Summary
@@ -76,6 +542,7 @@ The following sections list the changes for unreleased.
* Bugfix - Fix error code when a user can't disable a space: [#11845](https://github.com/owncloud/ocis/pull/11845)
* Bugfix - Fix Sharingroles: [#11898](https://github.com/owncloud/ocis/pull/11898)
* Bugfix - Fix the error handling for empty name on space update: [#11933](https://github.com/owncloud/ocis/pull/11933)
* Bugfix - Fix group creation in ocis-multi example: [#12019](https://github.com/owncloud/ocis/pull/12019)
* Change - Remove deprecated OCIS_SHOW_USER_EMAIL_IN_RESULTS: [#11942](https://github.com/owncloud/ocis/pull/11942)
* Enhancement - Bump Reva: [#460](https://github.com/owncloud/reva/pull/460)
* Enhancement - Set Referrer-Policy to no-referrer: [#11722](https://github.com/owncloud/ocis/pull/11722)
@@ -99,6 +566,8 @@ The following sections list the changes for unreleased.
* Enhancement - Update the traefik image for some deployment examples: [#11915](https://github.com/owncloud/ocis/pull/11915)
* Enhancement - Add users instances: [#11925](https://github.com/owncloud/ocis/pull/11925)
* Enhancement - Introduce external shares permission: [#11931](https://github.com/owncloud/ocis/pull/11931)
* Enhancement - Update to go 1.25: [#12004](https://github.com/owncloud/ocis/pull/12004)
* Enhancement - Bump Web to 12.3.1: [#12016](https://github.com/owncloud/ocis/pull/12016)
* Enhancement - Bump Web to 12.3.0: [#13519](https://github.com/owncloud/web/pull/13519)
## Details
@@ -166,6 +635,12 @@ The following sections list the changes for unreleased.
https://github.com/owncloud/ocis/issues/11887
https://github.com/owncloud/ocis/pull/11933
* Bugfix - Fix group creation in ocis-multi example: [#12019](https://github.com/owncloud/ocis/pull/12019)
Group creation was not working in ocis.ocm instance
https://github.com/owncloud/ocis/pull/12019
* Change - Remove deprecated OCIS_SHOW_USER_EMAIL_IN_RESULTS: [#11942](https://github.com/owncloud/ocis/pull/11942)
Deprecated OCIS_SHOW_USER_EMAIL_IN_RESULTS environment variable was removed from
@@ -394,6 +869,20 @@ The following sections list the changes for unreleased.
https://github.com/owncloud/ocis/pull/11931
* Enhancement - Update to go 1.25: [#12004](https://github.com/owncloud/ocis/pull/12004)
We have updated go to version 1.25 and alpine to version 3.23.3
https://github.com/owncloud/ocis/pull/12004
* Enhancement - Bump Web to 12.3.1: [#12016](https://github.com/owncloud/ocis/pull/12016)
Bugfix [owncloud/web#13553](https://github.com/owncloud/web/pull/13553): Search
Text Overalps With Search Icon In The Search Bar
https://github.com/owncloud/ocis/pull/12016
https://github.com/owncloud/web/releases/tag/v12.3.1
* Enhancement - Bump Web to 12.3.0: [#13519](https://github.com/owncloud/web/pull/13519)
Bugfix [owncloud/web#13406](https://github.com/owncloud/web/pull/13406): Prevent
@@ -10012,7 +10501,7 @@ The following sections list the changes for 2.0.0.
* Enhancement - Update linkshare capabilities: [#3579](https://github.com/owncloud/ocis/pull/3579)
* Enhancement - Wrap metadata storage with dedicated reva gateway: [#3602](https://github.com/owncloud/ocis/pull/3602)
* Enhancement - Align service naming: [#3606](https://github.com/owncloud/ocis/pull/3606)
* Enhancement - Added `share_jail` and `projects` feature flags in spaces capability: [#3626](https://github.com/owncloud/ocis/pull/3626)
* Enhancement - Added share_jail and projects feature flags in spaces capability: [#3626](https://github.com/owncloud/ocis/pull/3626)
* Enhancement - Add initial version of the search extensions: [#3635](https://github.com/owncloud/ocis/pull/3635)
* Enhancement - Don't setup demo role assignments on default: [#3661](https://github.com/owncloud/ocis/issues/3661)
* Enhancement - Restrict admins from self-removal: [#3713](https://github.com/owncloud/ocis/issues/3713)
@@ -11137,7 +11626,7 @@ The following sections list the changes for 2.0.0.
https://github.com/owncloud/ocis/issues/3603
https://github.com/owncloud/ocis/pull/3606
* Enhancement - Added `share_jail` and `projects` feature flags in spaces capability: [#3626](https://github.com/owncloud/ocis/pull/3626)
* Enhancement - Added share_jail and projects feature flags in spaces capability: [#3626](https://github.com/owncloud/ocis/pull/3626)
We've added feature flags to the `spaces` capability to indicate to clients
which features are supposed to be shown to users.
@@ -12409,7 +12898,7 @@ The following sections list the changes for 2.0.0.
The following sections list the changes for 1.20.0.
[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0
[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0
## Summary
@@ -12583,11 +13072,29 @@ The following sections list the changes for 1.20.0.
https://github.com/owncloud/ocis/pull/3509
https://github.com/owncloud/web/releases/tag/v5.4.0
# Changelog for [1.19.1] (2022-03-29)
The following sections list the changes for 1.19.1.
[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1
## Summary
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
## Details
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
URLs for Special items (space image, readme) were broken.
https://github.com/owncloud/ocis/pull/3419
# Changelog for [1.19.0] (2022-03-29)
The following sections list the changes for 1.19.0.
[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0
[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0
## Summary
@@ -12761,24 +13268,6 @@ The following sections list the changes for 1.19.0.
https://github.com/owncloud/ocis/pull/3375
https://github.com/owncloud/web/releases/tag/v5.3.0
# Changelog for [1.19.1] (2022-03-29)
The following sections list the changes for 1.19.1.
[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1
## Summary
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
## Details
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
URLs for Special items (space image, readme) were broken.
https://github.com/owncloud/ocis/pull/3419
# Changelog for [1.18.0] (2022-03-03)
The following sections list the changes for 1.18.0.
@@ -15253,7 +15742,7 @@ The following sections list the changes for 1.2.0.
* Change - Update ownCloud Web to v2.0.0: [#1661](https://github.com/owncloud/ocis/pull/1661)
* Enhancement - Introduce ADR: [#1042](https://github.com/owncloud/ocis/pull/1042)
* Enhancement - Functionality to map home directory to different storage providers: [#1186](https://github.com/owncloud/ocis/pull/1186)
* Enhancement - Use a default protocol parameter instead of explicitly disabling tus: [#1331](https://github.com/cs3org/reva/pull/1331)
* Enhancement - Use default upload protocol instead of explicitly disabling tus: [#1331](https://github.com/cs3org/reva/pull/1331)
* Enhancement - Switch to opencontainers annotation scheme: [#1381](https://github.com/owncloud/ocis/pull/1381)
* Enhancement - Update reva to v1.5.2-0.20210125114636-0c10b333ee69: [#1482](https://github.com/owncloud/ocis/pull/1482)
* Enhancement - Migrate ocis-graph to ocis monorepo: [#1594](https://github.com/owncloud/ocis/pull/1594)
@@ -15337,7 +15826,7 @@ The following sections list the changes for 1.2.0.
https://github.com/owncloud/ocis/pull/1186
https://github.com/cs3org/reva/pull/1142
* Enhancement - Use a default protocol parameter instead of explicitly disabling tus: [#1331](https://github.com/cs3org/reva/pull/1331)
* Enhancement - Use default upload protocol instead of explicitly disabling tus: [#1331](https://github.com/cs3org/reva/pull/1331)
https://github.com/cs3org/reva/pull/1331
https://github.com/owncloud/ocis/pull/1374
+1 -1
View File
@@ -31,7 +31,7 @@ RUN make ci-go-generate build ENABLE_VIPS=true
FROM alpine:3.23.3
RUN apk add --no-cache attr ca-certificates curl mailcap tree \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.2-r0" \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.5-r0" \
&& echo 'hosts: files dns' >| /etc/nsswitch.conf
LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
+11
View File
@@ -326,6 +326,17 @@ endif
mkdir -p ocis/dist
$(CALENS) --version $(CHANGELOG_VERSION) -o ocis/dist/CHANGELOG.md
.PHONY: changelog-lint
changelog-lint:
@FAILED=0; \
while IFS= read -r -d '' f; do \
title=$$(head -1 "$$f"); \
if [ $${#title} -gt 80 ]; then \
echo "$$f: title too long ($${#title}/80)"; FAILED=1; \
fi; \
done < <(find changelog -mindepth 2 -name "*.md" -print0); \
exit $$FAILED
.PHONY: changelog-csv
changelog-csv: $(CALENS)
mkdir -p ocis/dist
@@ -1,4 +1,4 @@
Enhancement: Use a default protocol parameter instead of explicitly disabling tus
Enhancement: Use default upload protocol instead of explicitly disabling tus
https://github.com/cs3org/reva/pull/1331
https://github.com/owncloud/ocis/pull/1374
@@ -1,4 +1,4 @@
Enhancement: Added `share_jail` and `projects` feature flags in spaces capability
Enhancement: Added share_jail and projects feature flags in spaces capability
We've added feature flags to the `spaces` capability to indicate to clients which features are supposed to be shown to users.
@@ -0,0 +1,8 @@
Bugfix: SpaceEditorWithoutTrashbin roles now correctly allow file editing
Fixed a bug where the *WithoutTrashbin space editor roles were rendered as read-only
in the Web frontend. The OCS PermissionWrite bit was not set for these roles because
the RoleFromResourcePermissions round-trip required RestoreRecycleItem, which these
roles intentionally omit.
https://github.com/owncloud/ocis/pull/12346
@@ -0,0 +1,10 @@
Bugfix: Education user delete no longer 404s and leaves the LDAP entry behind
`DELETE /graph/v1.0/education/users/{id}` previously returned a 404 without
removing the user. The education user delete handler used `user.GetExternalID()` for the backend
DELETE, while the regular `/users` handler and the pre-v8.0 code path used
`user.GetId()`. With the default `RequireExternalID=false`, the LDAP backend
looked up the user by name-or-UUID, so the externalID never matched, the LDAP
entry was never removed, and the response was a 404. This is now fixed.
https://github.com/owncloud/ocis/pull/12395
@@ -0,0 +1,18 @@
Bugfix: Recover from permanently-closed NATS connections in the nats-js-kv store
The `nats-js-kv` go-micro store plugin's `hasConn()` only checked whether the
connection object was non-nil, not whether it was still alive. Once the
underlying NATS client exhausted its reconnect attempts (e.g. a NATS pod
restart longer than the client's reconnect window), the connection stayed
non-nil but permanently closed. Because connection initialization is gated on
`!hasConn()`, it never re-ran, so every subsequent KV operation failed with
`nats: connection closed` until the affected pod was restarted.
This surfaced as several user-visible failures backed by the NATS KV cache,
e.g. all spaces becoming invisible (`storage-users` `ListStorageSpaces`) and
download failures from missing signing keys (`ocs`).
The store plugin now treats a closed connection as no connection, so the next
operation transparently re-initializes it.
https://github.com/owncloud/ocis/pull/12401
@@ -0,0 +1,6 @@
Security: Bump Go to 1.25.11
Fixes CVE-2026-42504, a stdlib MIME header decoding vulnerability flagged by
the release image scan.
https://github.com/owncloud/ocis/pull/12446
@@ -0,0 +1,7 @@
Security: Upgrade libvips to 8.18.3
Bumped libvips to 8.18.3 in all Docker images. The previous pin (8.18.2-r0)
was dropped from the Alpine edge/community repository, which broke the image
build.
https://github.com/owncloud/ocis/pull/12446
@@ -0,0 +1,16 @@
Enhancement: Allow disabling the last sign-in timestamp update
The graph service maintains the 'oCLastSignInTimestamp' LDAP attribute of a user
on every sign-in (when the LDAP identity backend has write access). This can
cause a significant amount of LDAP write load, especially when the proxy's OIDC
userinfo cache has a short TTL and sign-in events are emitted frequently.
A new setting 'OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE' / 'GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE'
(default 'true') allows disabling the update of the last sign-in timestamp
without having to disable all LDAP writes ('OCIS_LDAP_SERVER_WRITE_ENABLED') or
the graph events consumer. When set to 'false' the graph service no longer
listens for 'UserSignedIn' events and does not write the 'oCLastSignInTimestamp'
attribute.
https://github.com/owncloud/ocis/pull/12522
https://github.com/owncloud/ocis/issues/9942
@@ -0,0 +1,8 @@
Security: Upgrade Go to 1.25.12
Bumped the Go toolchain used to build the release binaries and Docker images
from 1.25.11 to 1.25.12. Go 1.25.11 is affected by CVE-2026-39822 (os.Root
symlink following allows directory traversal), which is fixed in 1.25.12 and
was blocking the release image security scan.
https://github.com/owncloud/ocis/pull/12602
@@ -0,0 +1,7 @@
Security: Upgrade libvips to 8.18.4
Bumped libvips to 8.18.4 in all Docker images. The previous pin (8.18.3-r0)
was dropped from the Alpine edge/community repository, which broke the image
build.
https://github.com/owncloud/ocis/pull/12596
@@ -0,0 +1,19 @@
Enhancement: Add an opt-in bounded LDAP connection pool
The auth-basic, users, groups and graph services can now be switched from a
single long-lived reconnecting LDAP connection to a bounded pool of connections,
so concurrent requests no longer serialize on one socket. Connections are dialed
and bound lazily on checkout, unhealthy connections are discarded and lazily
re-dialed rather than eagerly reconnected, and checkout blocks with a configurable
timeout once the pool is exhausted.
Pooling is off by default and fully backwards compatible. Enable it per service
via 'OCIS_LDAP_POOL_ENABLED' (or the service-specific '<SERVICE>_LDAP_POOL_ENABLED'
override), and tune it with 'OCIS_LDAP_POOL_SIZE' (default 5) and
'OCIS_LDAP_POOL_CHECKOUT_TIMEOUT' (default 30s).
The graph service's identity backend now shares the same LDAP client
implementation used by the reva auth/user/group managers instead of maintaining
its own separate reconnecting client.
https://github.com/owncloud/ocis/pull/12660
@@ -0,0 +1,14 @@
Enhancement: Eliminate redundant LDAP read-after-write on create and update
The graph LDAP backend no longer re-reads an entry immediately after writing it
just to recover the entry ID for the response. When oCIS generates the ID itself
(GRAPH_LDAP_SERVER_UUID disabled), the create response is now synthesized from the
data already sent to the directory, and update responses are built by folding the
applied modifications onto the entry that was read before the write. This avoids a
round-trip that, against a replicated directory reached through a proxy, could hit
a lagging replica and fail or return stale data.
When the directory assigns the ID (GRAPH_LDAP_SERVER_UUID enabled), creates keep
the existing read-back, since the generated ID cannot otherwise be recovered.
https://github.com/owncloud/ocis/pull/12618
@@ -0,0 +1,16 @@
Enhancement: Retry LDAP operations against a lagging replica
The graph LDAP backend can now retry operations against a replicated directory
where a write to the primary is followed by a read that lands on a replica which
has not yet caught up. This covers the read-back that recovers a directory-assigned
ID after a create (GRAPH_LDAP_SERVER_UUID enabled), which is retried until the entry
becomes visible. The retry count and backoff are tunable through
`GRAPH_LDAP_RETRY_MAX_COUNT`, `GRAPH_LDAP_RETRY_BASE_DELAY` and
`GRAPH_LDAP_RETRY_MAX_DELAY`; the defaults keep the previous behaviour (a single
immediate retry with no delay), so existing deployments are unaffected.
Retries now distinguish reads from writes: a write is no longer retried on a network
error, which can surface after the request was already sent and would otherwise apply
the mutation twice.
https://github.com/owncloud/ocis/pull/12672
@@ -0,0 +1,13 @@
Bugfix: Return correct issuerAssignedId on /me
The `/graph/v1.0/me` endpoint reported the internal user UUID as
`identities[].issuerAssignedId` instead of the issuer-assigned identity (the
OIDC `sub`). The endpoint took a fast path that built the user model from the
CS3 user in the request context, which does not carry the external identity, so
it fell back to the internal UUID. `/me` now always resolves the user through
the identity backend, which reads the stored external identity and returns the
correct value. Group memberships are still only expanded when
`$expand=memberOf` is requested.
https://github.com/owncloud/ocis/pull/12635
@@ -0,0 +1,18 @@
Bugfix: Log unmapped thumbnail errors and always report a sabredav exception
The webdav service logged failures of the thumbnails service at debug level only.
Errors which are not a property of the requested file, such as the thumbnails
service being unreachable, were therefore invisible at production log levels: a
complete preview outage produced HTTP 500 responses without a single log line
explaining them. Unmapped errors are now logged at error level, while expected
per-file outcomes such as an unsupported file type or a file still being
processed stay at debug level. Two of the four thumbnail handlers also logged
without the request context, so their messages carried no request id.
In addition, `codesEnum` only mapped four status codes, so error responses for
all other codes were rendered with an empty `<s:exception></s:exception>`
element. The missing entries for 403, 425 and 429 have been added and any
remaining unmapped code now falls back to a generic exception name, so clients
always receive a usable exception.
https://github.com/owncloud/ocis/pull/12663
@@ -0,0 +1,12 @@
Bugfix: Cache LDAP instance mapper lookups
In multi-instance deployments, resolving a user's instance name/ID during
`GET /graph/v1.0/users` (and group member expansion) issued a fresh, uncached
LDAP search per instance/guest attribute value on every request. Under load
this multiplied into large numbers of redundant LDAP round-trips per page of
users, saturating the LDAP connection pool and causing request timeouts. The
LDAP identity backend now caches instance mapper lookups, including negative
(not-found) results, for a configurable TTL
(`OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL`, default 60s).
https://github.com/owncloud/ocis/pull/12823
@@ -0,0 +1,9 @@
Bugfix: Fix share metadata corruption during concurrent share operations
When multiple sharing service replicas processed share operations concurrently
for the same user, the share metadata could become corrupted with references to
missing data, making all shares inaccessible to that user. The received share
cache now uses compare-and-swap (etag) validation to detect concurrent writes
and retries gracefully, preventing metadata corruption.
https://github.com/owncloud/ocis/pull/12621
@@ -0,0 +1,8 @@
Enhancement: Add TLS support for NATS store and registry connections
All `nats-js-kv` store, cache, and service registry connections now support
TLS. Configure via `OCIS_CACHE_ENABLE_TLS`, `OCIS_PERSISTENT_STORE_ENABLE_TLS`,
and `MICRO_REGISTRY_ENABLE_TLS`, with corresponding `*_TLS_INSECURE` and
`*_TLS_ROOT_CA_CERTIFICATE` variants per connection type.
https://github.com/owncloud/ocis/pull/12765
@@ -0,0 +1,5 @@
Security: Bump Go to 1.25.13
Fixes a stdlib CVE vulnerability flagged by the release image scan.
https://github.com/owncloud/ocis/pull/12832
@@ -0,0 +1,6 @@
Security: Bump golang.org/x/image to v0.45.0
Upgraded golang.org/x/image from v0.44.0 to v0.45.0 to address
GO-2026-6222: excessive memory allocation during VP8L decoding.
https://github.com/owncloud/ocis/pull/12808
@@ -0,0 +1,13 @@
Bugfix: Remove the unmarshalable request body field from graph log messages
We've removed the `body` field from the log messages of the graph service's HTTP
handlers. The field was set from `http.Request.Body`, an `io.ReadCloser`, which
can never be serialized into a useful log value.
The tracing middleware replaces the request body with a wrapper that carries an
exported function field, so serializing it failed outright and the log line was
emitted with `"body": "marshaling error: json: unsupported type: func(int64)"`
instead of the payload. Without the tracing middleware the field serialized to an
empty object. In both cases the intended payload was never logged.
https://github.com/owncloud/ocis/pull/12918
@@ -0,0 +1,28 @@
Bugfix: Release the quota of upload sessions with unreadable node metadata
When an upload's target node lost its metadata, e.g. because an ancestor was
moved to the trash while the upload was still in flight, the upload could never
finish processing. It stayed in "Processing" forever, could not be downloaded or
deleted, and kept consuming the space quota.
Cleaning such a session up with `ocis storage-users uploads sessions --clean`
did not help either: it removed the uploaded bytes and the session info file
before failing to revert the node, so it destroyed the only copy of the data
without releasing any quota.
Cleanup now reverts the node before removing anything irreversible and falls
back to the session metadata when the node cannot be read, so the quota is
released and the orphaned node is removed. If the quota cannot be released the
upload is kept so it can be retried instead of being lost.
A new `--orphaned` filter lists the affected sessions:
```
ocis storage-users uploads sessions --orphaned
ocis storage-users uploads sessions --orphaned --clean
```
Note that evaluating the filter reads the node metadata of every session, so it
is only done when the flag is set.
https://github.com/owncloud/ocis/pull/12739
@@ -0,0 +1,25 @@
Bugfix: Keep shares visible in sharedWithMe when a resource cannot be statted
The graph `sharedWithMe` handler resolves each received share by fanning out a per-resource
`Stat` call with a concurrency limit, all sharing the request context. When a `Stat` failed
for any reason (slow or stuck downstream, deleted space, gateway error, deadline exceeded)
the worker logged at debug and returned without emitting a drive item, so the share was
silently omitted from the response and the handler still returned `200 OK` with a partial,
non-deterministic list. A single chronically-slow share could therefore make other,
recently-accepted shares intermittently invisible, and repeated calls returned different
subsets of the user's shares.
The handler now:
- bounds each per-share `Stat` with its own timeout derived from the request context, so one
slow resource can no longer consume the deadline shared by all the other shares. The bound
is configurable via `GRAPH_RECEIVED_SHARES_STAT_TIMEOUT` (default `10s`);
- returns a degraded drive item built from the data already present in the share record
(ids, permissions, grantees, timestamps, mountpoint name) when the resource cannot be statted
due to a transient or indeterminate failure (timeout, slow or unavailable downstream), so the
share stays visible instead of intermittently disappearing. A genuinely missing resource or
revoked access (for example after the sharer was deleted) still drops the share, as before;
- logs the dropped/degraded shares at warning level with a per-request count for operator
visibility.
https://github.com/owncloud/ocis/pull/12430
@@ -0,0 +1,10 @@
Enhancement: Add TLS support for the frontend stat cache store connection
The frontend service was the only remaining place where a `nats-js-kv` store
connection could not be secured. Its OCS stat cache forwarded the store type,
nodes, database, table, TTL and credentials to reva, but not the TLS settings,
so the connection stayed plaintext with no operator toggle to change it. The
stat cache now honours `OCIS_CACHE_ENABLE_TLS`, `OCIS_CACHE_TLS_INSECURE` and
`OCIS_CACHE_TLS_ROOT_CA_CERTIFICATE` like every other cache and store.
https://github.com/owncloud/ocis/pull/12777
@@ -0,0 +1,6 @@
Bugfix: Correct introduction version for OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL
We changed the documented introduction version of the
OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL from 8.0.0 to 8.3.0.
https://github.com/owncloud/ocis/pull/12949
+135 -134
View File
@@ -1,29 +1,30 @@
module github.com/owncloud/ocis/v2
go 1.25.10
go 1.25.13
require (
dario.cat/mergo v1.0.2
github.com/CiscoM31/godata v1.0.10
github.com/CiscoM31/godata v1.0.11
github.com/KimMachineGun/automemlimit v0.7.5
github.com/Masterminds/semver v1.5.0
github.com/MicahParks/keyfunc/v2 v2.1.0
github.com/Nerzal/gocloak/v13 v13.9.0
github.com/bbalet/stopwords v1.0.0
github.com/beevik/etree v1.6.0
github.com/blevesearch/bleve/v2 v2.5.7
github.com/beevik/etree v1.7.0
github.com/blevesearch/bleve/v2 v2.6.0
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.17.0
github.com/cenkalti/backoff/v5 v5.0.3
github.com/coreos/go-oidc/v3 v3.20.0
github.com/cs3org/go-cs3apis v0.0.0-20241105092511-3ad35d174fc1
github.com/davidbyttow/govips/v2 v2.16.0
github.com/davidbyttow/govips/v2 v2.18.0
github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
github.com/egirna/icap-client v0.1.1
github.com/gabriel-vasile/mimetype v1.4.13
github.com/gabriel-vasile/mimetype v1.4.15
github.com/ggwhite/go-masker v1.1.0
github.com/go-chi/chi/v5 v5.2.4
github.com/go-chi/chi/v5 v5.3.1
github.com/go-chi/render v1.0.3
github.com/go-ldap/ldap/v3 v3.4.12
github.com/go-ldap/ldap/v3 v3.4.14
github.com/go-ldap/ldif v0.0.0-20200320164324-fd88d9b715b3
github.com/go-micro/plugins/v4/client/grpc v1.2.1
github.com/go-micro/plugins/v4/logger/zerolog v1.2.0
@@ -33,78 +34,78 @@ require (
github.com/go-micro/plugins/v4/store/nats-js-kv v0.0.0-20240726082623-6831adfdcdc4
github.com/go-micro/plugins/v4/wrapper/monitoring/prometheus v1.2.0
github.com/go-micro/plugins/v4/wrapper/trace/opentelemetry v1.2.0
github.com/go-playground/validator/v10 v10.30.1
github.com/go-playground/validator/v10 v10.30.3
github.com/gofrs/uuid v4.4.0+incompatible
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.7.0
github.com/google/go-tika v0.3.1
github.com/google/uuid v1.6.0
github.com/gookit/config/v2 v2.2.7
github.com/gookit/config/v2 v2.2.9
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.4
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0
github.com/invopop/validation v0.8.0
github.com/jellydator/ttlcache/v2 v2.11.1
github.com/jellydator/ttlcache/v3 v3.4.0
github.com/jellydator/ttlcache/v3 v3.4.1
github.com/jinzhu/now v1.1.5
github.com/justinas/alice v1.2.0
github.com/kovidgoyal/imaging v1.8.7
github.com/kovidgoyal/imaging v1.8.23
github.com/leonelquinteros/gotext v1.7.2
github.com/libregraph/idm v0.5.0
github.com/libregraph/lico v0.66.0
github.com/libregraph/lico v0.67.0
github.com/mitchellh/mapstructure v1.5.0
github.com/mna/pigeon v1.3.0
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/nats-io/nats-server/v2 v2.12.6
github.com/nats-io/nats.go v1.49.0
github.com/olekukonko/tablewriter v1.1.0
github.com/nats-io/nats-server/v2 v2.14.4
github.com/nats-io/nats.go v1.52.0
github.com/olekukonko/tablewriter v1.1.4
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.27.5
github.com/onsi/gomega v1.39.0
github.com/open-policy-agent/opa v1.12.3
github.com/onsi/ginkgo/v2 v2.32.0
github.com/onsi/gomega v1.42.1
github.com/open-policy-agent/opa v1.19.0
github.com/orcaman/concurrent-map v1.0.0
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260116104114-10074a92be64
github.com/owncloud/reva/v2 v2.0.0-20260424080655-488fb352f575
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245
github.com/owncloud/reva/v2 v2.0.0-20261001074810-94c6e48f5c45
github.com/pkg/errors v0.9.1
github.com/pkg/xattr v0.4.12
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/client_golang v1.24.1
github.com/r3labs/sse/v2 v2.10.0
github.com/rogpeppe/go-internal v1.14.1
github.com/rogpeppe/go-internal v1.16.0
github.com/rs/cors v1.11.1
github.com/rs/zerolog v1.34.0
github.com/shamaton/msgpack/v2 v2.4.0
github.com/rs/zerolog v1.35.1
github.com/shamaton/msgpack/v2 v2.4.1
github.com/sirupsen/logrus v1.9.4
github.com/spf13/afero v1.15.0
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.11.1
github.com/test-go/testify v1.1.4
github.com/thejerf/suture/v4 v4.0.6
github.com/tidwall/gjson v1.18.0
github.com/tus/tusd/v2 v2.8.0
github.com/tidwall/gjson v1.19.0
github.com/tus/tusd/v2 v2.10.0
github.com/unrolled/secure v1.17.0
github.com/urfave/cli/v2 v2.27.7
github.com/xhit/go-simple-mail/v2 v2.16.0
go-micro.dev/v4 v4.11.0
go.etcd.io/bbolt v1.4.3
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.64.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0
go.opentelemetry.io/contrib/zpages v0.64.0
go.opentelemetry.io/otel v1.43.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0
go.opentelemetry.io/contrib/zpages v0.70.0
go.opentelemetry.io/otel v1.45.0
go.opentelemetry.io/otel/exporters/jaeger v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0
go.opentelemetry.io/otel/sdk v1.43.0
go.opentelemetry.io/otel/trace v1.43.0
golang.org/x/crypto v0.50.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0
go.opentelemetry.io/otel/sdk v1.45.0
go.opentelemetry.io/otel/trace v1.45.0
golang.org/x/crypto v0.55.0
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f
golang.org/x/image v0.39.0
golang.org/x/net v0.53.0
golang.org/x/image v0.45.0
golang.org/x/net v0.58.0
golang.org/x/oauth2 v0.36.0
golang.org/x/sync v0.20.0
golang.org/x/term v0.42.0
golang.org/x/text v0.36.0
google.golang.org/genproto/googleapis/api v0.0.0-20260319201613-d00831a3d3e7
google.golang.org/grpc v1.80.0
google.golang.org/protobuf v1.36.11
golang.org/x/sync v0.22.0
golang.org/x/term v0.45.0
golang.org/x/text v0.41.0
google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d
google.golang.org/grpc v1.83.2
google.golang.org/protobuf v1.36.12
gopkg.in/yaml.v2 v2.4.0
gotest.tools/v3 v3.5.2
stash.kopano.io/kgol/rndm v1.1.2
@@ -112,85 +113,86 @@ require (
require (
contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
filippo.io/edwards25519 v1.2.0 // indirect
github.com/Azure/go-ntlmssp v0.1.1 // indirect
github.com/BurntSushi/toml v1.6.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Masterminds/semver/v3 v3.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.1.6 // indirect
github.com/RoaringBitmap/roaring/v2 v2.4.5 // indirect
github.com/ProtonMail/go-crypto v1.4.1 // indirect
github.com/RoaringBitmap/roaring/v2 v2.14.5 // indirect
github.com/agnivade/levenshtein v1.2.1 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/alexedwards/argon2id v1.0.0 // indirect
github.com/amoghe/go-crypt v0.0.0-20220222110647-20eada5f5964 // indirect
github.com/antithesishq/antithesis-sdk-go v0.6.0-default-no-op // indirect
github.com/antithesishq/antithesis-sdk-go v0.7.2-default-no-op // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go v1.55.8 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/bits-and-blooms/bitset v1.22.0 // indirect
github.com/blevesearch/bleve_index_api v1.2.11 // indirect
github.com/blevesearch/geo v0.2.4 // indirect
github.com/blevesearch/go-faiss v1.0.26 // indirect
github.com/bits-and-blooms/bitset v1.24.2 // indirect
github.com/blevesearch/bleve_index_api v1.3.11 // indirect
github.com/blevesearch/geo v0.2.5 // indirect
github.com/blevesearch/go-faiss v1.1.0 // indirect
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
github.com/blevesearch/gtreap v0.1.1 // indirect
github.com/blevesearch/mmap-go v1.0.4 // indirect
github.com/blevesearch/scorch_segment_api/v2 v2.3.13 // indirect
github.com/blevesearch/mmap-go v1.2.0 // indirect
github.com/blevesearch/scorch_segment_api/v2 v2.4.7 // indirect
github.com/blevesearch/segment v0.9.1 // indirect
github.com/blevesearch/snowballstem v0.9.0 // indirect
github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect
github.com/blevesearch/vellum v1.1.0 // indirect
github.com/blevesearch/zapx/v11 v11.4.2 // indirect
github.com/blevesearch/zapx/v12 v12.4.2 // indirect
github.com/blevesearch/zapx/v13 v13.4.2 // indirect
github.com/blevesearch/zapx/v14 v14.4.2 // indirect
github.com/blevesearch/zapx/v15 v15.4.2 // indirect
github.com/blevesearch/zapx/v16 v16.2.8 // indirect
github.com/blevesearch/vellum v1.2.0 // indirect
github.com/blevesearch/zapx/v11 v11.4.3 // indirect
github.com/blevesearch/zapx/v12 v12.4.3 // indirect
github.com/blevesearch/zapx/v13 v13.4.3 // indirect
github.com/blevesearch/zapx/v14 v14.4.3 // indirect
github.com/blevesearch/zapx/v15 v15.4.3 // indirect
github.com/blevesearch/zapx/v16 v16.3.4 // indirect
github.com/blevesearch/zapx/v17 v17.1.2 // indirect
github.com/bluele/gcache v0.0.2 // indirect
github.com/bombsimon/logrusr/v3 v3.1.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/ceph/go-ceph v0.37.0 // indirect
github.com/ceph/go-ceph v0.40.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cevaris/ordered_map v0.0.0-20190319150403-3adeae072e73 // indirect
github.com/cloudflare/circl v1.6.3 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/cloudflare/circl v1.6.5 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.6.0 // indirect
github.com/coreos/go-systemd/v22 v22.7.0 // indirect
github.com/cornelk/hashmap v1.0.8 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/crewjam/httperr v0.2.0 // indirect
github.com/crewjam/saml v0.4.14 // indirect
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
github.com/cyphar/filepath-securejoin v0.7.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect
github.com/desertbit/timer v1.0.1 // indirect
github.com/dgraph-io/ristretto v0.2.0 // indirect
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/dlclark/regexp2 v1.12.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/egirna/icap v0.0.0-20181108071049-d5ee18bd70bc // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/emvi/iso-639-1 v1.1.1 // indirect
github.com/evanphx/json-patch/v5 v5.5.0 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/gdexlab/go-render v1.0.1 // indirect
github.com/go-acme/lego/v4 v4.35.2 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 // indirect
github.com/go-acme/lego/v4 v4.34.0 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.8 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.8.0 // indirect
github.com/go-git/go-git/v5 v5.17.1 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-git/go-billy/v5 v5.9.1 // indirect
github.com/go-git/go-git/v5 v5.19.2 // indirect
github.com/go-jose/go-jose/v3 v3.0.5 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-micro/plugins/v4/events/natsjs v1.2.2 // indirect
github.com/go-micro/plugins/v4/store/nats-js v1.2.1 // indirect
@@ -199,7 +201,7 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/go-resty/resty/v2 v2.17.2 // indirect
github.com/go-sql-driver/mysql v1.9.3 // indirect
github.com/go-sql-driver/mysql v1.10.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/go-test/deep v1.1.0 // indirect
@@ -208,24 +210,24 @@ require (
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.2.1 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/goccy/go-json v0.10.6 // indirect
github.com/goccy/go-yaml v1.19.2 // indirect
github.com/gofrs/flock v0.13.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/gomodule/redigo v1.9.3 // indirect
github.com/google/go-querystring v1.2.0 // indirect
github.com/google/go-tpm v0.9.8 // indirect
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
github.com/google/renameio/v2 v2.0.1 // indirect
github.com/gookit/goutil v0.7.1 // indirect
github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect
github.com/google/renameio/v2 v2.0.2 // indirect
github.com/gookit/goutil v0.8.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/schema v1.4.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-plugin v1.7.0 // indirect
github.com/hashicorp/go-plugin v1.8.0 // indirect
github.com/hashicorp/yamux v0.1.2 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
@@ -236,20 +238,19 @@ require (
github.com/jonboulle/clockwork v0.5.0 // indirect
github.com/json-iterator/go v1.1.13-0.20220915233716-71ac16282d12 // indirect
github.com/juliangruber/go-intersect v1.1.0 // indirect
github.com/kettek/apng v0.0.0-20250827064933-2bb5f5fcf253 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.18.4 // indirect
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
github.com/kevinburke/ssh_config v1.6.0 // indirect
github.com/klauspost/compress v1.19.1 // indirect
github.com/klauspost/cpuid/v2 v2.4.0 // indirect
github.com/klauspost/crc32 v1.3.0 // indirect
github.com/kovidgoyal/go-parallel v1.1.1 // indirect
github.com/kovidgoyal/go-shm v1.0.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
github.com/lestrrat-go/dsig v1.0.0 // indirect
github.com/lestrrat-go/dsig v1.2.1 // indirect
github.com/lestrrat-go/dsig-secp256k1 v1.0.0 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc/v3 v3.0.1 // indirect
github.com/lestrrat-go/jwx/v3 v3.0.12 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/lestrrat-go/httprc/v3 v3.0.5 // indirect
github.com/lestrrat-go/jwx/v3 v3.1.1 // indirect
github.com/lestrrat-go/option/v2 v2.0.0 // indirect
github.com/libregraph/oidc-go v1.1.0 // indirect
github.com/longsleep/go-metrics v1.0.0 // indirect
@@ -257,59 +258,57 @@ require (
github.com/mattermost/xml-roundtrip-validator v0.1.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.21 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-sqlite3 v1.14.33 // indirect
github.com/mattn/go-runewidth v0.0.23 // indirect
github.com/mattn/go-sqlite3 v1.14.49 // indirect
github.com/maxymania/go-system v0.0.0-20170110133659-647cc364bf0b // indirect
github.com/mendsley/gojwk v0.0.0-20141217222730-4d5ec6e58103 // indirect
github.com/miekg/dns v1.1.72 // indirect
github.com/mileusna/useragent v1.3.5 // indirect
github.com/minio/crc64nvme v1.1.0 // indirect
github.com/minio/highwayhash v1.0.4-0.20251030100505-070ab1a87a76 // indirect
github.com/minio/crc64nvme v1.1.1 // indirect
github.com/minio/highwayhash v1.0.4 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/minio-go/v7 v7.0.97 // indirect
github.com/minio/minio-go/v7 v7.2.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nats-io/jwt/v2 v2.8.1 // indirect
github.com/nats-io/nkeys v0.4.15 // indirect
github.com/nats-io/jwt/v2 v2.8.2 // indirect
github.com/nats-io/nkeys v0.4.16 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/oklog/run v1.2.0 // indirect
github.com/olekukonko/errors v1.1.0 // indirect
github.com/olekukonko/ll v0.0.9 // indirect
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect
github.com/olekukonko/errors v1.2.0 // indirect
github.com/olekukonko/ll v0.1.6 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
github.com/pablodz/inotifywaitgo v0.0.9 // indirect
github.com/pablodz/inotifywaitgo v0.0.12 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/philhofer/fwd v1.2.0 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pierrec/lz4/v4 v4.1.26 // indirect
github.com/pjbgf/sha1cd v0.6.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pquerna/cachecontrol v0.2.0 // indirect
github.com/prometheus/alertmanager v0.30.1 // indirect
github.com/prometheus/alertmanager v0.33.1 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.4 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/prometheus/common v0.70.1 // indirect
github.com/prometheus/procfs v0.21.1 // indirect
github.com/prometheus/statsd_exporter v0.22.8 // indirect
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/russellhaering/goxmldsig v1.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd // indirect
github.com/segmentio/asm v1.2.1 // indirect
github.com/segmentio/kafka-go v0.4.50 // indirect
github.com/segmentio/kafka-go v0.4.51 // indirect
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/sercand/kuberesolver/v5 v5.1.1 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/sethvargo/go-password v0.3.1 // indirect
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92 // indirect
github.com/skeema/knownhosts v1.3.1 // indirect
github.com/sethvargo/go-password v0.4.0 // indirect
github.com/skeema/knownhosts v1.3.2 // indirect
github.com/spacewander/go-suffix-tree v0.0.0-20191010040751-0865e368c784 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/stretchr/objx v0.5.3 // indirect
@@ -317,36 +316,38 @@ require (
github.com/tchap/go-patricia/v2 v2.3.3 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tinylib/msgp v1.3.0 // indirect
github.com/tinylib/msgp v1.6.1 // indirect
github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208 // indirect
github.com/trustelem/zxcvbn v1.0.1 // indirect
github.com/valyala/fastjson v1.6.4 // indirect
github.com/vektah/gqlparser/v2 v2.5.31 // indirect
github.com/valyala/fastjson v1.6.10 // indirect
github.com/vektah/gqlparser/v2 v2.5.36 // indirect
github.com/wk8/go-ordered-map v1.0.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/yashtewari/glob-intersection v0.2.0 // indirect
go.etcd.io/etcd/api/v3 v3.6.7 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.6.7 // indirect
go.etcd.io/etcd/client/v3 v3.6.7 // indirect
github.com/zeebo/xxh3 v1.1.0 // indirect
go.etcd.io/etcd/api/v3 v3.6.11 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.6.11 // indirect
go.etcd.io/etcd/client/v3 v3.6.11 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0 // indirect
go.opentelemetry.io/otel/metric v1.45.0 // indirect
go.opentelemetry.io/proto/otlp v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/sys v0.43.0 // indirect
go.uber.org/zap v1.27.1 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/mod v0.40.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.44.0 // indirect
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
golang.org/x/tools v0.49.0 // indirect
google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
gopkg.in/ini.v1 v1.67.3 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
@@ -359,7 +360,7 @@ replace github.com/egirna/icap-client => github.com/kobergj/icap-client v0.0.0-2
replace github.com/unrolled/secure => github.com/DeepDiver1975/secure v0.0.0-20240611112133-abc838fb797c
replace github.com/go-micro/plugins/v4/store/nats-js-kv => github.com/kobergj/plugins/v4/store/nats-js-kv v0.0.0-20240807130109-f62bb67e8c90
replace github.com/go-micro/plugins/v4/store/nats-js-kv => github.com/kobergj/plugins/v4/store/nats-js-kv v0.0.0-20260609111813-fc78af4c9138
replace go-micro.dev/v4 => github.com/kobergj/go-micro/v4 v4.0.0-20250610135441-d0b187215699
+280 -309
View File
File diff suppressed because it is too large. Load diff
+23 -3
View File
@@ -22,8 +22,8 @@ var (
ErrUnsupportedType = errors.New("unsupported type")
)
// OcisLocale based on gotext.Locale, helps to pass go 1.24 vet on non-constant strings
// Without the interface, go 1.24 vet will complain about non-constant strings used in gotext printf
// OcisLocale based on gotext.Locale, helps to pass go vet on non-constant strings
// Without the interface, go vet will complain about non-constant strings used in gotext printf
// Alternatives would be to use a different workaround or a different library
type OcisLocale interface {
Get(str string, vars ...interface{}) string
@@ -32,6 +32,26 @@ type OcisLocale interface {
GetNC(str, plural string, n int, ctx string, vars ...interface{}) string
}
// ocisLocale forwards to gotext.Locale through func fields instead of embedding it directly.
// go vet's printf analyzer statically detects gotext.Locale.Get as a printf-wrapper and flags
// every non-constant call to it, even through the OcisLocale interface; routing calls through
// func fields hides that static trail.
type ocisLocale struct {
get func(str string, vars ...interface{}) string
getN func(str, plural string, n int, vars ...interface{}) string
getC func(str, ctx string, vars ...interface{}) string
getNC func(str, plural string, n int, ctx string, vars ...interface{}) string
}
func (o ocisLocale) Get(str string, vars ...interface{}) string { return o.get(str, vars...) }
func (o ocisLocale) GetN(str, plural string, n int, vars ...interface{}) string {
return o.getN(str, plural, n, vars...)
}
func (o ocisLocale) GetC(str, ctx string, vars ...interface{}) string { return o.getC(str, ctx, vars...) }
func (o ocisLocale) GetNC(str, plural string, n int, ctx string, vars ...interface{}) string {
return o.getNC(str, plural, n, ctx, vars...)
}
// Template marks a string as translatable
func Template(s string) string { return s }
@@ -75,7 +95,7 @@ func (t Translator) Locale(locale string) OcisLocale {
l = gotext.NewLocaleFS(t.defaultLocale, t.fs)
l.AddDomain(t.domain) // make domain configurable only if needed
}
return l
return ocisLocale{get: l.Get, getN: l.GetN, getC: l.GetC, getNC: l.GetNC}
}
// TranslateEntity function provides the generic way to translate a struct, array or slice.
+30 -4
View File
@@ -3,6 +3,7 @@ package natsjsregistry
import (
"context"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
@@ -14,6 +15,7 @@ import (
natsjskv "github.com/go-micro/plugins/v4/store/nats-js-kv"
"github.com/nats-io/nats.go"
"github.com/owncloud/ocis/v2/ocis-pkg/generators"
revastore "github.com/owncloud/reva/v2/pkg/store"
"go-micro.dev/v4/registry"
"go-micro.dev/v4/server"
"go-micro.dev/v4/store"
@@ -21,10 +23,13 @@ import (
)
var (
_registryName = "nats-js-kv"
_registryAddressEnv = "MICRO_REGISTRY_ADDRESS"
_registryUsernameEnv = "MICRO_REGISTRY_AUTH_USERNAME"
_registryPasswordEnv = "MICRO_REGISTRY_AUTH_PASSWORD"
_registryName = "nats-js-kv"
_registryAddressEnv = "MICRO_REGISTRY_ADDRESS"
_registryUsernameEnv = "MICRO_REGISTRY_AUTH_USERNAME"
_registryPasswordEnv = "MICRO_REGISTRY_AUTH_PASSWORD"
_registryEnableTLSEnv = "MICRO_REGISTRY_ENABLE_TLS"
_registryTLSInsecureEnv = "MICRO_REGISTRY_TLS_INSECURE"
_registryTLSRootCAEnv = "MICRO_REGISTRY_TLS_ROOT_CA_CERTIFICATE"
_serviceDelimiter = "@"
)
@@ -211,6 +216,10 @@ func (n *storeregistry) storeOptions(opts registry.Options) []store.Option {
natsOptions := nats.GetDefaultOptions()
natsOptions.Name = generators.GenerateConnectionName(serviceName, generators.NTypeRegistry)
natsOptions.User, natsOptions.Password = getAuth()
if tlsConf := getTLS(); tlsConf != nil {
natsOptions.TLSConfig = tlsConf
natsOptions.Secure = true
}
natsOptions.ReconnectedCB = func(_ *nats.Conn) {
if err := n.Init(); err != nil {
fmt.Println("cannot reconnect to nats")
@@ -233,3 +242,20 @@ func (n *storeregistry) storeOptions(opts registry.Options) []store.Option {
func getAuth() (string, string) {
return os.Getenv(_registryUsernameEnv), os.Getenv(_registryPasswordEnv)
}
var (
_tlsOnce sync.Once
_tlsConfig *tls.Config
)
func getTLS() *tls.Config {
_tlsOnce.Do(func() {
if os.Getenv(_registryEnableTLSEnv) != "true" {
return
}
insecure := os.Getenv(_registryTLSInsecureEnv) == "true"
rootCA := os.Getenv(_registryTLSRootCAEnv)
_tlsConfig = revastore.BuildNatsTLSConfig(insecure, rootCA)
})
return _tlsConfig
}
+5 -2
View File
@@ -62,8 +62,11 @@ type Cache struct {
Table string `yaml:"table" env:"OCIS_CACHE_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL" desc:"Time to live for events in the store. The duration can be set as number followed by a unit identifier like s, m or h." introductionVersion:"pre5.0"`
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
AuthUsername string `yaml:"auth_username" env:"OCIS_CACHE_AUTH_USERNAME" desc:"The username to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"pre5.0"`
AuthPassword string `yaml:"auth_password" env:"OCIS_CACHE_AUTH_PASSWORD" desc:"The password to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"pre5.0"`
AuthUsername string `yaml:"auth_username" env:"OCIS_CACHE_AUTH_USERNAME" desc:"The username to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"pre5.0"`
AuthPassword string `yaml:"auth_password" env:"OCIS_CACHE_AUTH_PASSWORD" desc:"The password to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"pre5.0"`
EnableTLS bool `yaml:"enable_tls" env:"OCIS_CACHE_ENABLE_TLS" desc:"Activate TLS for the connection to the NATS store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSInsecure bool `yaml:"tls_insecure" env:"OCIS_CACHE_TLS_INSECURE" desc:"Disable TLS certificate verification for the NATS store connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSRootCACertificate string `yaml:"tls_root_ca_certificate" env:"OCIS_CACHE_TLS_ROOT_CA_CERTIFICATE" desc:"Path to the PEM-encoded root CA certificate used to validate the NATS store TLS certificate. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
}
// Commons holds configuration that are common to all extensions. Each extension can then decide whether
+1 -1
View File
@@ -16,7 +16,7 @@ var (
// LatestTag is the latest released version plus the dev meta version.
// Will be overwritten by the release pipeline
// Needs a manual change for every tagged release
LatestTag = "8.0.2"
LatestTag = "8.0.8"
// Date indicates the build date.
// This has been removed, it looks like you can only replace static strings with recent go versions
+3 -2
View File
@@ -3,8 +3,9 @@ FROM amd64/alpine:3.23.4
ARG VERSION=""
ARG REVISION=""
RUN apk add --no-cache attr bash ca-certificates curl inotify-tools libc6-compat mailcap tree patch \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.2-r0" \
RUN apk upgrade --no-cache \
&& apk add --no-cache attr bash ca-certificates curl inotify-tools libc6-compat mailcap tree patch \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.5-r0" \
&& echo 'hosts: files dns' >| /etc/nsswitch.conf
LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
+3 -2
View File
@@ -3,8 +3,9 @@ FROM arm64v8/alpine:3.23.4
ARG VERSION=""
ARG REVISION=""
RUN apk add --no-cache attr bash ca-certificates curl inotify-tools libc6-compat mailcap tree patch \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.2-r0" \
RUN apk upgrade --no-cache \
&& apk add --no-cache attr bash ca-certificates curl inotify-tools libc6-compat mailcap tree patch \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.5-r0" \
&& echo 'hosts: files dns' >| /etc/nsswitch.conf
LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
+3 -2
View File
@@ -3,8 +3,9 @@ FROM amd64/alpine:latest
ARG VERSION=""
ARG REVISION=""
RUN apk add --no-cache attr bash ca-certificates curl delve inotify-tools libc6-compat mailcap tree patch \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.2-r0" \
RUN apk upgrade --no-cache \
&& apk add --no-cache attr bash ca-certificates curl delve inotify-tools libc6-compat mailcap tree patch \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.5-r0" \
&& echo 'hosts: files dns' >| /etc/nsswitch.conf
LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
+3 -2
View File
@@ -3,8 +3,9 @@ FROM arm64v8/alpine:latest
ARG VERSION=""
ARG REVISION=""
RUN apk add --no-cache attr bash ca-certificates curl delve inotify-tools libc6-compat mailcap tree patch \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.2-r0" \
RUN apk upgrade --no-cache \
&& apk add --no-cache attr bash ca-certificates curl delve inotify-tools libc6-compat mailcap tree patch \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.5-r0" \
&& echo 'hosts: files dns' >| /etc/nsswitch.conf
LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
@@ -90,6 +90,7 @@ func Server(cfg *config.Config) *cli.Command {
microstore.Database(cfg.Store.Database),
microstore.Table(cfg.Store.Table),
store.Authentication(cfg.Store.AuthUsername, cfg.Store.AuthPassword),
store.TLS(cfg.Store.EnableTLS, cfg.Store.TLSInsecure, cfg.Store.TLSRootCACertificate),
)
tm, err := pool.StringToTLSMode(cfg.GRPCClientTLS.Mode)
+5 -2
View File
@@ -52,8 +52,11 @@ type Store struct {
Database string `yaml:"database" env:"ACTIVITYLOG_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
Table string `yaml:"table" env:"ACTIVITYLOG_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_PERSISTENT_STORE_TTL;ACTIVITYLOG_STORE_TTL" desc:"Time to live for events in the store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;ACTIVITYLOG_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;ACTIVITYLOG_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;ACTIVITYLOG_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;ACTIVITYLOG_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
EnableTLS bool `yaml:"enable_tls" env:"OCIS_PERSISTENT_STORE_ENABLE_TLS;ACTIVITYLOG_STORE_ENABLE_TLS" desc:"Activate TLS for the connection to the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSInsecure bool `yaml:"tls_insecure" env:"OCIS_PERSISTENT_STORE_TLS_INSECURE;ACTIVITYLOG_STORE_TLS_INSECURE" desc:"Disable TLS certificate verification for the store connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSRootCACertificate string `yaml:"tls_root_ca_certificate" env:"OCIS_PERSISTENT_STORE_TLS_ROOT_CA_CERTIFICATE;ACTIVITYLOG_STORE_TLS_ROOT_CA_CERTIFICATE" desc:"Path to the PEM-encoded root CA certificate for the store TLS connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
}
// ServiceAccount is the configuration for the used service account
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: Catalan (https://app.transifex.com/owncloud-org/teams/6149/ca/)\n"
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: German (https://app.transifex.com/owncloud-org/teams/6149/de/)\n"
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: English (United Kingdom) (https://app.transifex.com/owncloud-org/teams/6149/en_GB/)\n"
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: English (United States) (https://app.transifex.com/owncloud-org/teams/6149/en_US/)\n"
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Victor Vinuela <vinuela.victor@dissectio.com>, 2026\n"
"Language-Team: Spanish (https://app.transifex.com/owncloud-org/teams/6149/es/)\n"
@@ -0,0 +1,106 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Markus Sorola, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-07-20 03:13+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Markus Sorola, 2026\n"
"Language-Team: Finnish (Finland) (https://app.transifex.com/owncloud-org/teams/6149/fi_FI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fi_FI\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: pkg/service/response.go:44
msgid "description"
msgstr "kuvaus"
#: pkg/service/response.go:43
msgid "display name"
msgstr "näyttönimi"
#: pkg/service/response.go:42
msgid "expiration date"
msgstr "vanhenemispäivä"
#: pkg/service/response.go:41
msgid "password"
msgstr "salasana"
#: pkg/service/response.go:40
msgid "permission"
msgstr "käyttöoikeus"
#: pkg/service/response.go:45
msgid "shared-with-me"
msgstr "jaettu minulle"
#: pkg/service/response.go:39
msgid "some field"
msgstr "jokin kenttä"
#: pkg/service/response.go:26
msgid "{resource} was downloaded via public link {token}"
msgstr "{resource} ladattiin julkisen linkin {token} kautta"
#: pkg/service/response.go:24
msgid "{user} added {resource} to {folder}"
msgstr "{user} lisäsi kohteen {resource} kansioon {folder}"
#: pkg/service/response.go:36
msgid "{user} added {sharee} as member of {space}"
msgstr "{user} lisäsi käyttäjän {sharee} tilan {space} jäseneksi"
#: pkg/service/response.go:27
msgid "{user} deleted {resource} from {folder}"
msgstr "{user} poisti kohteen {resource} kansiosta {folder}"
#: pkg/service/response.go:28
msgid "{user} moved {resource} to {folder}"
msgstr "{user} siirsi kohteen {resource} kansioon {folder}"
#: pkg/service/response.go:35
msgid "{user} removed link to {resource}"
msgstr "{user} poisti kohteen {resource} linkin"
#: pkg/service/response.go:32
msgid "{user} removed {sharee} from {resource}"
msgstr "{user} poisti käyttäjän {sharee} kohteesta {resource}"
#: pkg/service/response.go:37
msgid "{user} removed {sharee} from {space}"
msgstr "{user} poisti käyttäjän {sharee} tilasta {space}"
#: pkg/service/response.go:29
msgid "{user} renamed {oldResource} to {resource}"
msgstr "{user} nimesi kohteen {oldResource} uudelleen nimellä {resource}"
#: pkg/service/response.go:33
msgid "{user} shared {resource} via link"
msgstr "{user} jakoi kohteen {resource} linkillä"
#: pkg/service/response.go:30
msgid "{user} shared {resource} with {sharee}"
msgstr "{user} jakoi kohteen {resource} käyttäjälle {sharee}"
#: pkg/service/response.go:34
msgid "{user} updated {field} for a link {token} on {resource}"
msgstr "{user} päivitti kentän {field} kohteen {resource} linkille {token}"
#: pkg/service/response.go:31
msgid "{user} updated {field} for the {resource}"
msgstr "{user} päivitti kohteen {resource} kentän {field}"
#: pkg/service/response.go:25
msgid "{user} updated {resource} in {folder}"
msgstr "{user} päivitti kohteen {resource} kansiossa {folder}"
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Cesare Capoferri, 2026\n"
"Language-Team: Italian (https://app.transifex.com/owncloud-org/teams/6149/it/)\n"
@@ -5,15 +5,16 @@
#
# Translators:
# Martin <github@diemattels.at>, 2026
# miyasaka miyabi, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-29 03:09+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Last-Translator: miyasaka miyabi, 2026\n"
"Language-Team: Japanese (https://app.transifex.com/owncloud-org/teams/6149/ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -43,11 +44,11 @@ msgstr "許可"
#: pkg/service/response.go:45
msgid "shared-with-me"
msgstr ""
msgstr "共有されたアイテム"
#: pkg/service/response.go:39
msgid "some field"
msgstr ""
msgstr "一部のフィールド"
#: pkg/service/response.go:26
msgid "{resource} was downloaded via public link {token}"
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-05-01 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: BoneNI, 2026\n"
"Language-Team: Lao (https://app.transifex.com/owncloud-org/teams/6149/lo/)\n"
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: Portuguese (https://app.transifex.com/owncloud-org/teams/6149/pt/)\n"
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: Portuguese (Brazil) (https://app.transifex.com/owncloud-org/teams/6149/pt_BR/)\n"
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-24 03:11+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: Russian (https://app.transifex.com/owncloud-org/teams/6149/ru/)\n"
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-05-03 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Miha Podobnik, 2026\n"
"Language-Team: Slovenian (https://app.transifex.com/owncloud-org/teams/6149/sl/)\n"
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: Albanian (https://app.transifex.com/owncloud-org/teams/6149/sq/)\n"
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: Uyghur (https://app.transifex.com/owncloud-org/teams/6149/ug/)\n"
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-24 03:11+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Martin <github@diemattels.at>, 2026\n"
"Language-Team: Ukrainian (https://app.transifex.com/owncloud-org/teams/6149/uk/)\n"
@@ -5,15 +5,16 @@
#
# Translators:
# 許明凱 <yuteson@gmail.com>, 2026
# 振东 刘, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-31 03:12+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: 許明凱 <yuteson@gmail.com>, 2026\n"
"Last-Translator: 振东 刘, 2026\n"
"Language-Team: Chinese Traditional (https://app.transifex.com/owncloud-org/teams/6149/zh-Hant/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -27,7 +28,7 @@ msgstr "描述"
#: pkg/service/response.go:43
msgid "display name"
msgstr ""
msgstr "显示名称"
#: pkg/service/response.go:42
msgid "expiration date"
@@ -35,7 +36,7 @@ msgstr "設置到期日期"
#: pkg/service/response.go:41
msgid "password"
msgstr ""
msgstr "密码"
#: pkg/service/response.go:40
msgid "permission"
@@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: 許明凱 <yuteson@gmail.com>, 2026\n"
"Language-Team: Chinese (https://app.transifex.com/owncloud-org/teams/6149/zh/)\n"
@@ -5,17 +5,17 @@
#
# Translators:
# Martin <github@diemattels.at>, 2026
# guanu244, 2026
# 許明凱 <yuteson@gmail.com>, 2026
# 振东 刘, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-31 03:12+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: 許明凱 <yuteson@gmail.com>, 2026\n"
"Last-Translator: 振东 刘, 2026\n"
"Language-Team: Chinese (China) (https://app.transifex.com/owncloud-org/teams/6149/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -29,31 +29,31 @@ msgstr "描述"
#: pkg/service/response.go:43
msgid "display name"
msgstr "顯示名稱"
msgstr "显示名称"
#: pkg/service/response.go:42
msgid "expiration date"
msgstr "設置到期日期"
msgstr "过期日期"
#: pkg/service/response.go:41
msgid "password"
msgstr "密碼"
msgstr "密码"
#: pkg/service/response.go:40
msgid "permission"
msgstr "權限"
msgstr "权限"
#: pkg/service/response.go:45
msgid "shared-with-me"
msgstr "與我共享"
msgstr "已与我共享"
#: pkg/service/response.go:39
msgid "some field"
msgstr "部分欄位"
msgstr "部分字段"
#: pkg/service/response.go:26
msgid "{resource} was downloaded via public link {token}"
msgstr "{resource} 透過公開連結{token} 被下載了"
msgstr "{resource} 已通过公开链接 {token} 下载"
#: pkg/service/response.go:24
msgid "{user} added {resource} to {folder}"
@@ -97,7 +97,7 @@ msgstr "{user} 通过 {sharee} 共享了 {resource}"
#: pkg/service/response.go:34
msgid "{user} updated {field} for a link {token} on {resource}"
msgstr "{user} 更新了 {resource} 連結 {token} 的 {field} 欄位"
msgstr "{user} 修改了 {resource} 上链接 {token} 的 {field} 属性"
#: pkg/service/response.go:31
msgid "{user} updated {field} for the {resource}"
@@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: 許明凱 <yuteson@gmail.com>, 2026\n"
"Language-Team: Chinese (Hong Kong) (https://app.transifex.com/owncloud-org/teams/6149/zh_HK/)\n"
@@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-29 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: 許明凱 <yuteson@gmail.com>, 2026\n"
"Language-Team: Chinese (Taiwan) (https://app.transifex.com/owncloud-org/teams/6149/zh_TW/)\n"
+8
View File
@@ -2,6 +2,7 @@ package config
import (
"context"
"time"
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
)
@@ -66,6 +67,9 @@ type LDAPProvider struct {
Insecure bool `yaml:"insecure" env:"OCIS_LDAP_INSECURE;AUTH_BASIC_LDAP_INSECURE" desc:"Disable TLS certificate validation for the LDAP connections. Do not set this in production environments." introductionVersion:"pre5.0"`
BindDN string `yaml:"bind_dn" env:"OCIS_LDAP_BIND_DN;AUTH_BASIC_LDAP_BIND_DN" desc:"LDAP DN to use for simple bind authentication with the target LDAP server." introductionVersion:"pre5.0"`
BindPassword string `yaml:"bind_password" env:"OCIS_LDAP_BIND_PASSWORD;AUTH_BASIC_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'." introductionVersion:"pre5.0"`
RetryMaxCount int `yaml:"retry_max_count" env:"OCIS_LDAP_RETRY_MAX_COUNT;AUTH_BASIC_LDAP_RETRY_MAX_COUNT" desc:"Maximum number of retries for failed LDAP operations. Applies to both read and write operations (with different retryable error sets). Default 1." introductionVersion:"8.2.0"`
RetryBaseDelay time.Duration `yaml:"retry_base_delay" env:"OCIS_LDAP_RETRY_BASE_DELAY;AUTH_BASIC_LDAP_RETRY_BASE_DELAY" desc:"Base delay for exponential backoff between LDAP retries (e.g. '100ms'). Set to 0 to disable backoff." introductionVersion:"8.2.0"`
RetryMaxDelay time.Duration `yaml:"retry_max_delay" env:"OCIS_LDAP_RETRY_MAX_DELAY;AUTH_BASIC_LDAP_RETRY_MAX_DELAY" desc:"Maximum delay cap for exponential backoff between LDAP retries (e.g. '5s'). 0 (default) uses the library default cap of 60s." introductionVersion:"8.2.0"`
UserBaseDN string `yaml:"user_base_dn" env:"OCIS_LDAP_USER_BASE_DN;AUTH_BASIC_LDAP_USER_BASE_DN" desc:"Search base DN for looking up LDAP users." introductionVersion:"pre5.0"`
GroupBaseDN string `yaml:"group_base_dn" env:"OCIS_LDAP_GROUP_BASE_DN;AUTH_BASIC_LDAP_GROUP_BASE_DN" desc:"Search base DN for looking up LDAP groups." introductionVersion:"pre5.0"`
UserScope string `yaml:"user_scope" env:"OCIS_LDAP_USER_SCOPE;AUTH_BASIC_LDAP_USER_SCOPE" desc:"LDAP search scope to use when looking up users. Supported values are 'base', 'one' and 'sub'." introductionVersion:"pre5.0"`
@@ -80,6 +84,10 @@ type LDAPProvider struct {
LdapDisabledUsersGroupDN string `yaml:"ldap_disabled_users_group_dn" env:"OCIS_LDAP_DISABLED_USERS_GROUP_DN;AUTH_BASIC_DISABLED_USERS_GROUP_DN" desc:"The distinguished name of the group to which added users will be classified as disabled when 'disable_user_mechanism' is set to 'group'." introductionVersion:"pre5.0"`
UserSchema LDAPUserSchema `yaml:"user_schema"`
GroupSchema LDAPGroupSchema `yaml:"group_schema"`
PoolEnabled bool `yaml:"pool_enabled" env:"OCIS_LDAP_POOL_ENABLED;AUTH_BASIC_LDAP_POOL_ENABLED" desc:"Enable a bounded pool of LDAP connections instead of a single long-lived reconnecting connection. Concurrent requests then no longer serialize on one connection." introductionVersion:"8.2.0"`
PoolSize int `yaml:"pool_size" env:"OCIS_LDAP_POOL_SIZE;AUTH_BASIC_LDAP_POOL_SIZE" desc:"Maximum number of concurrently open LDAP connections when 'OCIS_LDAP_POOL_ENABLED' is 'true'. Defaults to 5 when unset or <= 0." introductionVersion:"8.2.0"`
PoolCheckoutTimeout time.Duration `yaml:"pool_checkout_timeout" env:"OCIS_LDAP_POOL_CHECKOUT_TIMEOUT;AUTH_BASIC_LDAP_POOL_CHECKOUT_TIMEOUT" desc:"Maximum time to wait for a pooled LDAP connection to become available once the pool is exhausted. Defaults to 30s when unset or <= 0. See the Environment Variable Types description for more details." introductionVersion:"8.2.0"`
}
type LDAPUserSchema struct {
@@ -2,6 +2,7 @@ package defaults
import (
"path/filepath"
"time"
"github.com/owncloud/ocis/v2/ocis-pkg/config/defaults"
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
@@ -51,9 +52,13 @@ func DefaultConfig() *config.Config {
UserObjectClass: "inetOrgPerson",
GroupObjectClass: "groupOfNames",
BindDN: "uid=reva,ou=sysusers,o=libregraph-idm",
RetryMaxCount: 1,
DisableUserMechanism: "attribute",
LdapDisabledUsersGroupDN: "cn=DisabledUsersGroup,ou=groups,o=libregraph-idm",
IDP: "https://localhost:9200",
PoolEnabled: false,
PoolSize: 5,
PoolCheckoutTimeout: 30 * time.Second,
UserSchema: config.LDAPUserSchema{
ID: "ownclouduuid",
Mail: "mail",
@@ -62,6 +62,9 @@ func ldapConfigFromString(cfg config.LDAPProvider) map[string]interface{} {
"insecure": cfg.Insecure,
"bind_username": cfg.BindDN,
"bind_password": cfg.BindPassword,
"retry_max_count": cfg.RetryMaxCount,
"retry_base_delay": cfg.RetryBaseDelay,
"retry_max_delay": cfg.RetryMaxDelay,
"user_base_dn": cfg.UserBaseDN,
"group_base_dn": cfg.GroupBaseDN,
"user_filter": cfg.UserFilter,
@@ -75,6 +78,9 @@ func ldapConfigFromString(cfg config.LDAPProvider) map[string]interface{} {
"user_enabled_property": cfg.UserSchema.Enabled,
"group_local_disabled_dn": cfg.LdapDisabledUsersGroupDN,
"idp": cfg.IDP,
"pool_enabled": cfg.PoolEnabled,
"pool_size": cfg.PoolSize,
"pool_checkout_timeout": cfg.PoolCheckoutTimeout,
"user_schema": map[string]interface{}{
"id": cfg.UserSchema.ID,
"idIsOctetString": cfg.UserSchema.IDIsOctetString,
@@ -83,6 +83,7 @@ func Server(cfg *config.Config) *cli.Command {
microstore.Database(cfg.Store.Database),
microstore.Table(cfg.Store.Table),
store.Authentication(cfg.Store.AuthUsername, cfg.Store.AuthPassword),
store.TLS(cfg.Store.EnableTLS, cfg.Store.TLSInsecure, cfg.Store.TLSRootCACertificate),
)
gr := runner.NewGroup()
+5 -2
View File
@@ -9,6 +9,9 @@ type Store struct {
Database string `yaml:"database" env:"COLLABORATION_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"7.0.0"`
Table string `yaml:"table" env:"COLLABORATION_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"7.0.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_PERSISTENT_STORE_TTL;COLLABORATION_STORE_TTL" desc:"Time to live for events in the store. Defaults to '30m' (30 minutes). See the Environment Variable Types description for more details." introductionVersion:"7.0.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;COLLABORATION_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"7.0.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;COLLABORATION_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"7.0.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;COLLABORATION_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"7.0.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;COLLABORATION_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"7.0.0"`
EnableTLS bool `yaml:"enable_tls" env:"OCIS_PERSISTENT_STORE_ENABLE_TLS;COLLABORATION_STORE_ENABLE_TLS" desc:"Activate TLS for the connection to the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSInsecure bool `yaml:"tls_insecure" env:"OCIS_PERSISTENT_STORE_TLS_INSECURE;COLLABORATION_STORE_TLS_INSECURE" desc:"Disable TLS certificate verification for the store connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSRootCACertificate string `yaml:"tls_root_ca_certificate" env:"OCIS_PERSISTENT_STORE_TLS_ROOT_CA_CERTIFICATE;COLLABORATION_STORE_TLS_ROOT_CA_CERTIFICATE" desc:"Path to the PEM-encoded root CA certificate for the store TLS connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
}
@@ -72,6 +72,7 @@ func Server(cfg *config.Config) *cli.Command {
microstore.Database(cfg.Store.Database),
microstore.Table(cfg.Store.Table),
store.Authentication(cfg.Store.AuthUsername, cfg.Store.AuthPassword),
store.TLS(cfg.Store.EnableTLS, cfg.Store.TLSInsecure, cfg.Store.TLSRootCACertificate),
)
service := grpc.NewService(
+5 -2
View File
@@ -42,8 +42,11 @@ type Store struct {
Database string `yaml:"database" env:"EVENTHISTORY_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
Table string `yaml:"table" env:"EVENTHISTORY_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_PERSISTENT_STORE_TTL;EVENTHISTORY_STORE_TTL" desc:"Time to live for events in the store. Defaults to '336h' (2 weeks). See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;EVENTHISTORY_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;EVENTHISTORY_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;EVENTHISTORY_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;EVENTHISTORY_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
EnableTLS bool `yaml:"enable_tls" env:"OCIS_PERSISTENT_STORE_ENABLE_TLS;EVENTHISTORY_STORE_ENABLE_TLS" desc:"Activate TLS for the connection to the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSInsecure bool `yaml:"tls_insecure" env:"OCIS_PERSISTENT_STORE_TLS_INSECURE;EVENTHISTORY_STORE_TLS_INSECURE" desc:"Disable TLS certificate verification for the store connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSRootCACertificate string `yaml:"tls_root_ca_certificate" env:"OCIS_PERSISTENT_STORE_TLS_ROOT_CA_CERTIFICATE;EVENTHISTORY_STORE_TLS_ROOT_CA_CERTIFICATE" desc:"Path to the PEM-encoded root CA certificate for the store TLS connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
}
// Events combines the configuration options for the event bus.
+15 -12
View File
@@ -131,18 +131,21 @@ type DataGateway struct {
}
type OCS struct {
Prefix string `yaml:"prefix" desc:"URL path prefix for the OCS service. Note that the string must not start with '/'." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
SharePrefix string `yaml:"share_prefix" desc:"Path prefix for shares as part of an ocis resource. Note that the path must start with '/'." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
HomeNamespace string `yaml:"home_namespace" desc:"Home namespace identifier." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
AdditionalInfoAttribute string `yaml:"additional_info_attribute" desc:"Additional information attribute for the user like {{.Mail}}." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
StatCacheType string `yaml:"stat_cache_type" env:"OCIS_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_STORE in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheNodes []string `yaml:"stat_cache_nodes" env:"OCIS_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_STORE_NODES in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheDatabase string `yaml:"stat_cache_database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_DATABASE in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheTable string `yaml:"stat_cache_table" desc:"The database table the store should use." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
StatCacheTTL time.Duration `yaml:"stat_cache_ttl" env:"OCIS_CACHE_TTL" desc:"Default time to live for user info in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_TTL in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheDisablePersistence bool `yaml:"stat_cache_disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE" desc:"Disable persistence of the cache. Only applies when using the 'nats-js-kv' store type. Defaults to false." introductionVersion:"5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_DISABLE_PERSISTENCE in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheAuthUsername string `yaml:"stat_cache_auth_username" env:"OCIS_CACHE_AUTH_USERNAME" desc:"The username to use for authentication. Only applies when using the 'nats-js-kv' store type." introductionVersion:"5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_AUTH_USERNAME in the frontend service is deprecated because the OCS API is deprecated OCS API is deprecated" deprecationReplacement:""`
StatCacheAuthPassword string `yaml:"stat_cache_auth_password" env:"OCIS_CACHE_AUTH_PASSWORD" desc:"The password to use for authentication. Only applies when using the 'nats-js-kv' store type." introductionVersion:"5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_AUTH_PASSWORD in the frontend service is deprecated because the OCS API is deprecated OCS API is deprecated" deprecationReplacement:""`
Prefix string `yaml:"prefix" desc:"URL path prefix for the OCS service. Note that the string must not start with '/'." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
SharePrefix string `yaml:"share_prefix" desc:"Path prefix for shares as part of an ocis resource. Note that the path must start with '/'." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
HomeNamespace string `yaml:"home_namespace" desc:"Home namespace identifier." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
AdditionalInfoAttribute string `yaml:"additional_info_attribute" desc:"Additional information attribute for the user like {{.Mail}}." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
StatCacheType string `yaml:"stat_cache_type" env:"OCIS_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_STORE in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheNodes []string `yaml:"stat_cache_nodes" env:"OCIS_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_STORE_NODES in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheDatabase string `yaml:"stat_cache_database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_DATABASE in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheTable string `yaml:"stat_cache_table" desc:"The database table the store should use." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The OCS API is deprecated" deprecationReplacement:""`
StatCacheTTL time.Duration `yaml:"stat_cache_ttl" env:"OCIS_CACHE_TTL" desc:"Default time to live for user info in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_TTL in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheDisablePersistence bool `yaml:"stat_cache_disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE" desc:"Disable persistence of the cache. Only applies when using the 'nats-js-kv' store type. Defaults to false." introductionVersion:"5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_DISABLE_PERSISTENCE in the frontend service is deprecated because the OCS API is deprecated" deprecationReplacement:""`
StatCacheAuthUsername string `yaml:"stat_cache_auth_username" env:"OCIS_CACHE_AUTH_USERNAME" desc:"The username to use for authentication. Only applies when using the 'nats-js-kv' store type." introductionVersion:"5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_AUTH_USERNAME in the frontend service is deprecated because the OCS API is deprecated OCS API is deprecated" deprecationReplacement:""`
StatCacheAuthPassword string `yaml:"stat_cache_auth_password" env:"OCIS_CACHE_AUTH_PASSWORD" desc:"The password to use for authentication. Only applies when using the 'nats-js-kv' store type." introductionVersion:"5.0" deprecationVersion:"7.0.0" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"The use of OCIS_CACHE_AUTH_PASSWORD in the frontend service is deprecated because the OCS API is deprecated OCS API is deprecated" deprecationReplacement:""`
StatCacheEnableTLS bool `yaml:"stat_cache_enable_tls" env:"OCIS_CACHE_ENABLE_TLS" desc:"Activate TLS for the connection to the stat cache store. Only applies when using the 'nats-js-kv' store type." introductionVersion:"8.3.0"`
StatCacheTLSInsecure bool `yaml:"stat_cache_tls_insecure" env:"OCIS_CACHE_TLS_INSECURE" desc:"Disable TLS certificate verification for the stat cache store connection. Only applies when using the 'nats-js-kv' store type." introductionVersion:"8.3.0"`
StatCacheTLSRootCACertificate string `yaml:"stat_cache_tls_root_ca_certificate" env:"OCIS_CACHE_TLS_ROOT_CA_CERTIFICATE" desc:"Path to the PEM-encoded root CA certificate for the stat cache store TLS connection. Only applies when using the 'nats-js-kv' store type." introductionVersion:"8.3.0"`
CacheWarmupDriver string `yaml:"cache_warmup_driver,omitempty"` // not supported by the oCIS product, therefore not part of docs
CacheWarmupDrivers CacheWarmupDrivers `yaml:"cache_warmup_drivers,omitempty"` // not supported by the oCIS product, therefore not part of docs
+11 -8
View File
@@ -163,14 +163,17 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
"share_prefix": cfg.OCS.SharePrefix,
"home_namespace": cfg.OCS.HomeNamespace,
"stat_cache_config": map[string]interface{}{
"cache_store": cfg.OCS.StatCacheType,
"cache_nodes": cfg.OCS.StatCacheNodes,
"cache_database": cfg.OCS.StatCacheDatabase,
"cache_table": cfg.OCS.StatCacheTable,
"cache_ttl": cfg.OCS.StatCacheTTL,
"cache_disable_persistence": cfg.OCS.StatCacheDisablePersistence,
"cache_auth_username": cfg.OCS.StatCacheAuthUsername,
"cache_auth_password": cfg.OCS.StatCacheAuthPassword,
"cache_store": cfg.OCS.StatCacheType,
"cache_nodes": cfg.OCS.StatCacheNodes,
"cache_database": cfg.OCS.StatCacheDatabase,
"cache_table": cfg.OCS.StatCacheTable,
"cache_ttl": cfg.OCS.StatCacheTTL,
"cache_disable_persistence": cfg.OCS.StatCacheDisablePersistence,
"cache_auth_username": cfg.OCS.StatCacheAuthUsername,
"cache_auth_password": cfg.OCS.StatCacheAuthPassword,
"cache_enable_tls": cfg.OCS.StatCacheEnableTLS,
"cache_tls_insecure": cfg.OCS.StatCacheTLSInsecure,
"cache_tls_root_ca_certificate": cfg.OCS.StatCacheTLSRootCACertificate,
},
"prefix": cfg.OCS.Prefix,
"additional_info_attribute": func() string {
@@ -0,0 +1,39 @@
package revaconfig
import (
"testing"
"github.com/owncloud/ocis/v2/ocis-pkg/config/envdecode"
"github.com/owncloud/ocis/v2/ocis-pkg/log"
"github.com/owncloud/ocis/v2/services/frontend/pkg/config/defaults"
)
func TestStatCacheTLSPlumbing(t *testing.T) {
t.Setenv("OCIS_CACHE_ENABLE_TLS", "true")
t.Setenv("OCIS_CACHE_TLS_INSECURE", "true")
t.Setenv("OCIS_CACHE_TLS_ROOT_CA_CERTIFICATE", "/etc/ocis/ca.crt")
cfg := defaults.FullDefaultConfig()
if err := envdecode.Decode(cfg); err != nil {
t.Fatal(err)
}
revaCfg, err := FrontendConfigFromStruct(cfg, log.NopLogger())
if err != nil {
t.Fatal(err)
}
statCache := revaCfg["http"].(map[string]interface{})["services"].(map[string]interface{})["ocs"].(map[string]interface{})["stat_cache_config"].(map[string]interface{})
t.Logf("cache_enable_tls=%v cache_tls_insecure=%v cache_tls_root_ca_certificate=%v",
statCache["cache_enable_tls"], statCache["cache_tls_insecure"], statCache["cache_tls_root_ca_certificate"])
if statCache["cache_enable_tls"] != true {
t.Errorf("cache_enable_tls = %v, want true", statCache["cache_enable_tls"])
}
if statCache["cache_tls_insecure"] != true {
t.Errorf("cache_tls_insecure = %v, want true", statCache["cache_tls_insecure"])
}
if statCache["cache_tls_root_ca_certificate"] != "/etc/ocis/ca.crt" {
t.Errorf("cache_tls_root_ca_certificate = %v, want /etc/ocis/ca.crt", statCache["cache_tls_root_ca_certificate"])
}
}
+13 -7
View File
@@ -42,10 +42,13 @@ type Config struct {
AuthServiceEndpoint string `yaml:"auth_service_endpoint" env:"GATEWAY_AUTH_SERVICE_ENDPOINT" desc:"The endpoint of the auth-service service. Can take a service name or a gRPC URI with the dns, kubernetes or unix protocol." introductionVersion:"7.0.0"`
StoragePublicLinkEndpoint string `yaml:"storage_public_link_endpoint" env:"GATEWAY_STORAGE_PUBLIC_LINK_ENDPOINT" desc:"The endpoint of the storage-publiclink service. Can take a service name or a gRPC URI with the dns, kubernetes or unix protocol." introductionVersion:"7.0.0"`
StorageUsersEndpoint string `yaml:"storage_users_endpoint" env:"GATEWAY_STORAGE_USERS_ENDPOINT" desc:"The endpoint of the storage-users service. Can take a service name or a gRPC URI with the dns, kubernetes or unix protocol." introductionVersion:"7.0.0"`
StorageUsersVaultEndpoint string `yaml:"storage_users_vault_endpoint" env:"GATEWAY_STORAGE_USERS_VAULT_ENDPOINT" desc:"The endpoint of the storage-users-vault service. The storage-users-vault is an additional storage-users service that runs in vault mode. It can take a service name or a gRPC URI with the dns, kubernetes or unix protocol." introductionVersion:"8.1.0"`
StorageSharesEndpoint string `yaml:"storage_shares_endpoint" env:"GATEWAY_STORAGE_SHARES_ENDPOINT" desc:"The endpoint of the storage-shares service. Can take a service name or a gRPC URI with the dns, kubernetes or unix protocol." introductionVersion:"7.0.0"`
AppRegistryEndpoint string `yaml:"app_registry_endpoint" env:"GATEWAY_APP_REGISTRY_ENDPOINT" desc:"The endpoint of the app-registry service. Can take a service name or a gRPC URI with the dns, kubernetes or unix protocol." introductionVersion:"7.0.0"`
OCMEndpoint string `yaml:"ocm_endpoint" env:"GATEWAY_OCM_ENDPOINT" desc:"The endpoint of the ocm service. Can take a service name or a gRPC URI with the dns, kubernetes or unix protocol." introductionVersion:"7.0.0"`
EnableVaultMode bool `yaml:"enable_vault_mode" env:"OCIS_ENABLE_VAULT_MODE;GATEWAY_ENABLE_VAULT_MODE" desc:"Set this to true to enable the default rule for vault storage provider configuration. Only applicable if the storage-users-vault service, a specially configured storage-users service, is configured." introductionVersion:"8.1.0"`
StorageRegistry StorageRegistry `yaml:"storage_registry"` // TODO: should we even support switching this?
Context context.Context `yaml:"-"`
@@ -85,13 +88,16 @@ type StorageRegistry struct {
// Cache holds cache config
type Cache struct {
ProviderCacheStore string `yaml:"provider_cache_store" env:"OCIS_CACHE_STORE;GATEWAY_PROVIDER_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details." introductionVersion:"pre5.0"`
ProviderCacheNodes []string `yaml:"provider_cache_nodes" env:"OCIS_CACHE_STORE_NODES;GATEWAY_PROVIDER_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
ProviderCacheDatabase string `yaml:"provider_cache_database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
ProviderCacheTTL time.Duration `yaml:"provider_cache_ttl" env:"OCIS_CACHE_TTL;GATEWAY_PROVIDER_CACHE_TTL" desc:"Default time to live for user info in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
ProviderCacheDisablePersistence bool `yaml:"provider_cache_disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;GATEWAY_PROVIDER_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the provider cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
ProviderCacheAuthUsername string `yaml:"provider_cache_auth_username" env:"OCIS_CACHE_AUTH_USERNAME;GATEWAY_PROVIDER_CACHE_AUTH_USERNAME" desc:"The username to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
ProviderCacheAuthPassword string `yaml:"provider_cache_auth_password" env:"OCIS_CACHE_AUTH_PASSWORD;GATEWAY_PROVIDER_CACHE_AUTH_PASSWORD" desc:"The password to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
ProviderCacheStore string `yaml:"provider_cache_store" env:"OCIS_CACHE_STORE;GATEWAY_PROVIDER_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details." introductionVersion:"pre5.0"`
ProviderCacheNodes []string `yaml:"provider_cache_nodes" env:"OCIS_CACHE_STORE_NODES;GATEWAY_PROVIDER_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
ProviderCacheDatabase string `yaml:"provider_cache_database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
ProviderCacheTTL time.Duration `yaml:"provider_cache_ttl" env:"OCIS_CACHE_TTL;GATEWAY_PROVIDER_CACHE_TTL" desc:"Default time to live for user info in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
ProviderCacheDisablePersistence bool `yaml:"provider_cache_disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;GATEWAY_PROVIDER_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the provider cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
ProviderCacheAuthUsername string `yaml:"provider_cache_auth_username" env:"OCIS_CACHE_AUTH_USERNAME;GATEWAY_PROVIDER_CACHE_AUTH_USERNAME" desc:"The username to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
ProviderCacheAuthPassword string `yaml:"provider_cache_auth_password" env:"OCIS_CACHE_AUTH_PASSWORD;GATEWAY_PROVIDER_CACHE_AUTH_PASSWORD" desc:"The password to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
ProviderCacheEnableTLS bool `yaml:"provider_cache_enable_tls" env:"OCIS_CACHE_ENABLE_TLS;GATEWAY_PROVIDER_CACHE_ENABLE_TLS" desc:"Activate TLS for the connection to the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
ProviderCacheTLSInsecure bool `yaml:"provider_cache_tls_insecure" env:"OCIS_CACHE_TLS_INSECURE;GATEWAY_PROVIDER_CACHE_TLS_INSECURE" desc:"Disable TLS certificate verification for the cache store connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
ProviderCacheTLSRootCACertificate string `yaml:"provider_cache_tls_root_ca_certificate" env:"OCIS_CACHE_TLS_ROOT_CA_CERTIFICATE;GATEWAY_PROVIDER_CACHE_TLS_ROOT_CA_CERTIFICATE" desc:"Path to the PEM-encoded root CA certificate for the cache store TLS connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
CreateHomeCacheStore string `yaml:"create_home_cache_store" env:"OCIS_CACHE_STORE;GATEWAY_CREATE_HOME_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details." introductionVersion:"pre5.0"`
CreateHomeCacheNodes []string `yaml:"create_home_cache_nodes" env:"OCIS_CACHE_STORE_NODES;GATEWAY_CREATE_HOME_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
CreateHomeCacheDatabase string `yaml:"create_home_cache_database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
+5 -2
View File
@@ -72,8 +72,11 @@ func GatewayConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]i
"cache_table": "provider",
"cache_ttl": cfg.Cache.ProviderCacheTTL,
"disable_persistence": cfg.Cache.ProviderCacheDisablePersistence,
"cache_auth_username": cfg.Cache.ProviderCacheAuthUsername,
"cache_auth_password": cfg.Cache.ProviderCacheAuthPassword,
"cache_auth_username": cfg.Cache.ProviderCacheAuthUsername,
"cache_auth_password": cfg.Cache.ProviderCacheAuthPassword,
"cache_enable_tls": cfg.Cache.ProviderCacheEnableTLS,
"cache_tls_insecure": cfg.Cache.ProviderCacheTLSInsecure,
"cache_tls_root_ca_certificate": cfg.Cache.ProviderCacheTLSRootCACertificate,
},
"create_personal_space_cache_config": map[string]interface{}{
"cache_store": cfg.Cache.CreateHomeCacheStore,
+5 -2
View File
@@ -10,6 +10,9 @@ type Cache struct {
Table string `yaml:"table" env:"GRAPH_CACHE_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;GRAPH_CACHE_TTL" desc:"Time to live for cache records in the graph. Defaults to '336h' (2 weeks). See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;GRAPH_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;GRAPH_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
AuthPassword string `yaml:"password" env:"OCIS_CACHE_AUTH_PASSWORD;GRAPH_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;GRAPH_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
AuthPassword string `yaml:"password" env:"OCIS_CACHE_AUTH_PASSWORD;GRAPH_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
EnableTLS bool `yaml:"enable_tls" env:"OCIS_CACHE_ENABLE_TLS;GRAPH_CACHE_ENABLE_TLS" desc:"Activate TLS for the connection to the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSInsecure bool `yaml:"tls_insecure" env:"OCIS_CACHE_TLS_INSECURE;GRAPH_CACHE_TLS_INSECURE" desc:"Disable TLS certificate verification for the cache store connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
TLSRootCACertificate string `yaml:"tls_root_ca_certificate" env:"OCIS_CACHE_TLS_ROOT_CA_CERTIFICATE;GRAPH_CACHE_TLS_ROOT_CA_CERTIFICATE" desc:"Path to the PEM-encoded root CA certificate for the cache store TLS connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
}
+21 -9
View File
@@ -2,6 +2,7 @@ package config
import (
"context"
"time"
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
)
@@ -33,6 +34,8 @@ type Config struct {
UnifiedRoles UnifiedRoles `yaml:"unified_roles"`
MaxConcurrency int `yaml:"max_concurrency" env:"OCIS_MAX_CONCURRENCY;GRAPH_MAX_CONCURRENCY" desc:"The maximum number of concurrent requests the service will handle." introductionVersion:"7.0.0"`
ReceivedSharesStatTimeout time.Duration `yaml:"received_shares_stat_timeout" env:"GRAPH_RECEIVED_SHARES_STAT_TIMEOUT" desc:"The maximum duration to wait for the storage to respond while resolving a single received share's resource when listing 'sharedWithMe'. Bounding each resource lookup individually prevents one slow or unreachable resource from consuming the request deadline shared by all the other shares. A share whose resource cannot be statted within this time is still listed as a degraded item instead of being dropped. Defaults to '10s'. See the Environment Variable Types description for more details." introductionVersion:"8.2.0"`
Keycloak Keycloak `yaml:"keycloak"`
ServiceAccount ServiceAccount `yaml:"service_account"`
MultiInstance MultiInstanceConfig `yaml:"multi_instance"`
@@ -55,15 +58,23 @@ type Spaces struct {
}
type LDAP struct {
URI string `yaml:"uri" env:"OCIS_LDAP_URI;GRAPH_LDAP_URI" desc:"URI of the LDAP Server to connect to. Supported URI schemes are 'ldaps://' and 'ldap://'" introductionVersion:"pre5.0"`
CACert string `yaml:"cacert" env:"OCIS_LDAP_CACERT;GRAPH_LDAP_CACERT" desc:"Path/File name for the root CA certificate (in PEM format) used to validate TLS server certificates of the LDAP service. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH/idm." introductionVersion:"pre5.0"`
Insecure bool `yaml:"insecure" env:"OCIS_LDAP_INSECURE;GRAPH_LDAP_INSECURE" desc:"Disable TLS certificate validation for the LDAP connections. Do not set this in production environments." introductionVersion:"pre5.0"`
BindDN string `yaml:"bind_dn" env:"OCIS_LDAP_BIND_DN;GRAPH_LDAP_BIND_DN" desc:"LDAP DN to use for simple bind authentication with the target LDAP server." introductionVersion:"pre5.0"`
BindPassword string `yaml:"bind_password" env:"OCIS_LDAP_BIND_PASSWORD;GRAPH_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'." introductionVersion:"pre5.0"`
UseServerUUID bool `yaml:"use_server_uuid" env:"GRAPH_LDAP_SERVER_UUID" desc:"If set to true, rely on the LDAP Server to generate a unique ID for users and groups, like when using 'entryUUID' as the user ID attribute." introductionVersion:"pre5.0"`
UsePasswordModExOp bool `yaml:"use_password_modify_exop" env:"GRAPH_LDAP_SERVER_USE_PASSWORD_MODIFY_EXOP" desc:"Use the 'Password Modify Extended Operation' for updating user passwords." introductionVersion:"pre5.0"`
WriteEnabled bool `yaml:"write_enabled" env:"OCIS_LDAP_SERVER_WRITE_ENABLED;GRAPH_LDAP_SERVER_WRITE_ENABLED" desc:"Allow creating, modifying and deleting LDAP users via the GRAPH API. This can only be set to 'true' when keeping default settings for the LDAP user and group attribute types (the 'OCIS_LDAP_USER_SCHEMA_* and 'OCIS_LDAP_GROUP_SCHEMA_* variables)." introductionVersion:"pre5.0"`
RefintEnabled bool `yaml:"refint_enabled" env:"GRAPH_LDAP_REFINT_ENABLED" desc:"Signals that the server has the refint plugin enabled, which makes some actions not needed." introductionVersion:"pre5.0"`
URI string `yaml:"uri" env:"OCIS_LDAP_URI;GRAPH_LDAP_URI" desc:"URI of the LDAP Server to connect to. Supported URI schemes are 'ldaps://' and 'ldap://'" introductionVersion:"pre5.0"`
CACert string `yaml:"cacert" env:"OCIS_LDAP_CACERT;GRAPH_LDAP_CACERT" desc:"Path/File name for the root CA certificate (in PEM format) used to validate TLS server certificates of the LDAP service. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH/idm." introductionVersion:"pre5.0"`
Insecure bool `yaml:"insecure" env:"OCIS_LDAP_INSECURE;GRAPH_LDAP_INSECURE" desc:"Disable TLS certificate validation for the LDAP connections. Do not set this in production environments." introductionVersion:"pre5.0"`
BindDN string `yaml:"bind_dn" env:"OCIS_LDAP_BIND_DN;GRAPH_LDAP_BIND_DN" desc:"LDAP DN to use for simple bind authentication with the target LDAP server." introductionVersion:"pre5.0"`
BindPassword string `yaml:"bind_password" env:"OCIS_LDAP_BIND_PASSWORD;GRAPH_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'." introductionVersion:"pre5.0"`
UseServerUUID bool `yaml:"use_server_uuid" env:"GRAPH_LDAP_SERVER_UUID" desc:"If set to true, rely on the LDAP Server to generate a unique ID for users and groups, like when using 'entryUUID' as the user ID attribute." introductionVersion:"pre5.0"`
UsePasswordModExOp bool `yaml:"use_password_modify_exop" env:"GRAPH_LDAP_SERVER_USE_PASSWORD_MODIFY_EXOP" desc:"Use the 'Password Modify Extended Operation' for updating user passwords." introductionVersion:"pre5.0"`
WriteEnabled bool `yaml:"write_enabled" env:"OCIS_LDAP_SERVER_WRITE_ENABLED;GRAPH_LDAP_SERVER_WRITE_ENABLED" desc:"Allow creating, modifying and deleting LDAP users via the GRAPH API. This can only be set to 'true' when keeping default settings for the LDAP user and group attribute types (the 'OCIS_LDAP_USER_SCHEMA_* and 'OCIS_LDAP_GROUP_SCHEMA_* variables)." introductionVersion:"pre5.0"`
UpdateUserLastSignInDate bool `yaml:"update_user_last_sign_in_date" env:"OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE;GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE" desc:"Update the 'oCLastSignInTimestamp' LDAP attribute of a user when the user signs in. The attribute is only persisted when 'OCIS_LDAP_SERVER_WRITE_ENABLED' is also enabled. Set this to 'false' to avoid an LDAP write on every sign-in, e.g. when the last sign-in timestamp is not needed or the LDAP write load should be reduced." introductionVersion:"8.0.6"`
RetryMaxCount int `yaml:"retry_max_count" env:"OCIS_LDAP_RETRY_MAX_COUNT;GRAPH_LDAP_RETRY_MAX_COUNT" desc:"Maximum number of retries for failed LDAP operations. Reads retry on transient and network errors; writes retry only when the connection failed before the request was sent (e.g. a reused idle connection found closed), so the request provably never reached the server and cannot be double-applied. Default 1." introductionVersion:"8.2.0"`
RetryBaseDelay time.Duration `yaml:"retry_base_delay" env:"OCIS_LDAP_RETRY_BASE_DELAY;GRAPH_LDAP_RETRY_BASE_DELAY" desc:"Base delay for exponential backoff between LDAP retries (e.g. '100ms'). Set to 0 to disable backoff." introductionVersion:"8.2.0"`
RetryMaxDelay time.Duration `yaml:"retry_max_delay" env:"OCIS_LDAP_RETRY_MAX_DELAY;GRAPH_LDAP_RETRY_MAX_DELAY" desc:"Maximum delay cap for exponential backoff between LDAP retries (e.g. '5s'). 0 (default) uses the library default cap of 60s." introductionVersion:"8.2.0"`
RefintEnabled bool `yaml:"refint_enabled" env:"GRAPH_LDAP_REFINT_ENABLED" desc:"Signals that the server has the refint plugin enabled, which makes some actions not needed." introductionVersion:"pre5.0"`
PoolEnabled bool `yaml:"pool_enabled" env:"OCIS_LDAP_POOL_ENABLED;GRAPH_LDAP_POOL_ENABLED" desc:"Enable a bounded pool of LDAP connections instead of a single long-lived reconnecting connection. Concurrent requests then no longer serialize on one connection." introductionVersion:"8.2.0"`
PoolSize int `yaml:"pool_size" env:"OCIS_LDAP_POOL_SIZE;GRAPH_LDAP_POOL_SIZE" desc:"Maximum number of concurrently open LDAP connections when 'OCIS_LDAP_POOL_ENABLED' is 'true'. Defaults to 5 when unset or <= 0." introductionVersion:"8.2.0"`
PoolCheckoutTimeout time.Duration `yaml:"pool_checkout_timeout" env:"OCIS_LDAP_POOL_CHECKOUT_TIMEOUT;GRAPH_LDAP_POOL_CHECKOUT_TIMEOUT" desc:"Maximum time to wait for a pooled LDAP connection to become available once the pool is exhausted. Defaults to 30s when unset or <= 0. See the Environment Variable Types description for more details." introductionVersion:"8.2.0"`
UserBaseDN string `yaml:"user_base_dn" env:"OCIS_LDAP_USER_BASE_DN;GRAPH_LDAP_USER_BASE_DN" desc:"Search base DN for looking up LDAP users." introductionVersion:"pre5.0"`
UserSearchScope string `yaml:"user_search_scope" env:"OCIS_LDAP_USER_SCOPE;GRAPH_LDAP_USER_SCOPE" desc:"LDAP search scope to use when looking up users. Supported scopes are 'base', 'one' and 'sub'." introductionVersion:"pre5.0"`
@@ -106,6 +117,7 @@ type LDAP struct {
InstanceMapperIDAttribute string `yaml:"instance_mapper_id_attribute" env:"OCIS_LDAP_INSTANCE_MAPPER_ID_ATTRIBUTE" desc:"LDAP Attribute of the instance ID. Requires OCIS_MULTI_INSTANCE_ENABLED." introductionVersion:"8.0.0"`
CrossInstanceReferenceTemplate string `yaml:"cross_instance_reference_template" env:"OCIS_LDAP_CROSS_INSTANCE_REFERENCE_TEMPLATE" desc:"Template for the users unique reference across oCIS instances. Requires OCIS_MULTI_INSTANCE_ENABLED." introductionVersion:"8.0.0"`
InstanceURLTemplate string `yaml:"instance_url_template" env:"OCIS_LDAP_INSTANCE_URL_TEMPLATE" desc:"Template for the instance URL. Requires OCIS_MULTI_INSTANCE_ENABLED." introductionVersion:"8.0.0"`
InstanceMapperCacheTTL int `yaml:"instance_mapper_cache_ttl" env:"OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL" desc:"Max TTL in seconds for the LDAP instance mapper cache. Requires OCIS_MULTI_INSTANCE_ENABLED." introductionVersion:"8.3.0"`
}
// LDAPEducationConfig represents the LDAP configuration for education related resources
@@ -87,9 +87,14 @@ func DefaultConfig() *config.Config {
Insecure: false,
CACert: path.Join(defaults.BaseDataPath(), "idm", "ldap.crt"),
BindDN: "uid=libregraph,ou=sysusers,o=libregraph-idm",
PoolEnabled: false,
PoolSize: 5,
PoolCheckoutTimeout: 30 * time.Second,
UseServerUUID: false,
UsePasswordModExOp: true,
WriteEnabled: true,
UpdateUserLastSignInDate: true,
RetryMaxCount: 1,
UserBaseDN: "ou=users,o=libregraph-idm",
UserSearchScope: "sub",
UserFilter: "",
@@ -113,6 +118,8 @@ func DefaultConfig() *config.Config {
GroupMemberAttribute: "member",
GroupIDAttribute: "owncloudUUID",
EducationResourcesEnabled: false,
// 1 minute
InstanceMapperCacheTTL: 60,
},
},
Cache: &config.Cache{
@@ -126,7 +133,8 @@ func DefaultConfig() *config.Config {
Cluster: "ocis-cluster",
EnableTLS: false,
},
MaxConcurrency: 20,
MaxConcurrency: 20,
ReceivedSharesStatTimeout: 10 * time.Second,
UnifiedRoles: config.UnifiedRoles{
AvailableRoles: nil, // will be populated with defaults in EnsureDefaults
},
@@ -213,4 +221,5 @@ func Sanitize(cfg *config.Config) {
cfg.Spaces.ExtendedSpacePropertiesCacheTTL = cfg.Spaces.ExtendedSpacePropertiesCacheTTL * int(time.Second)
cfg.Spaces.GroupsCacheTTL = cfg.Spaces.GroupsCacheTTL * int(time.Second)
cfg.Spaces.UsersCacheTTL = cfg.Spaces.UsersCacheTTL * int(time.Second)
cfg.Identity.LDAP.InstanceMapperCacheTTL = cfg.Identity.LDAP.InstanceMapperCacheTTL * int(time.Second)
}
+124 -18
View File
@@ -12,8 +12,10 @@ import (
"time"
"github.com/CiscoM31/godata"
backoff "github.com/cenkalti/backoff/v5"
"github.com/go-ldap/ldap/v3"
"github.com/google/uuid"
"github.com/jellydator/ttlcache/v3"
"github.com/libregraph/idm/pkg/ldapdn"
libregraph "github.com/owncloud/libre-graph-api-go"
@@ -53,6 +55,11 @@ type LDAP struct {
refintEnabled bool
usePwModifyExOp bool
// bounds for the read-back retry in readBackAfterWrite
retryMaxCount int
retryBaseDelay time.Duration
retryMaxDelay time.Duration
userBaseDN string
userFilter string
userObjectClass string
@@ -63,14 +70,14 @@ type LDAP struct {
disableUserMechanism DisableUserMechanismType
localUserDisableGroupDN string
groupBaseDN string
groupCreateBaseDN string
groupFilter string
groupObjectClass string
groupAdditionalObjectClasses []string
groupIDisOctetString bool
groupScope int
groupAttributeMap groupAttributeMap
groupBaseDN string
groupCreateBaseDN string
groupFilter string
groupObjectClass string
groupAdditionalObjectClasses []string
groupIDisOctetString bool
groupScope int
groupAttributeMap groupAttributeMap
educationConfig educationConfig
@@ -88,8 +95,19 @@ type LDAP struct {
instanceMapperIDAttribute string
crossInstanceReferenceTemplate *template.Template
instanceURLTemplate *template.Template
instanceCache *ttlcache.Cache[string, string]
}
// instanceCacheKeySep separates the fields of an instanceCache key. A NUL byte can't
// appear in an LDAP attribute name or search value, so it can't cause key collisions
// between different (searchAttribute, resultAttribute, searchValue) triples.
const instanceCacheKeySep = "\x00"
// instanceCacheNotFound is stored in instanceCache to negatively cache a lookup
// that resolved to ErrNotFound, so repeatedly requested stale instance references
// don't cost a fresh LDAP round-trip on every call.
const instanceCacheNotFound = instanceCacheKeySep + "not-found"
type userAttributeMap struct {
displayName string
id string
@@ -147,6 +165,15 @@ func NewLDAPBackend(lc ldap.Client, config config.LDAP, logger *log.Logger, inst
if config.GroupNameAttribute == "" || config.GroupIDAttribute == "" {
return nil, errors.New("invalid group attribute mappings")
}
// Octet-string ID attributes (e.g. Active Directory's objectGUID) are assigned by
// the directory server, which requires UseServerUUID=true. With UseServerUUID=false
// oCIS generates the ID and writes it as a string UUID, so an octet-string ID
// attribute would be decoded from raw string bytes and produce a corrupt ID. Reject
// this incompatible combination at startup instead of silently returning bad IDs.
if !config.UseServerUUID && (config.UserIDIsOctetString || config.GroupIDIsOctetString) {
return nil, errors.New("invalid config: octet-string ID attributes require GRAPH_LDAP_SERVER_UUID=true")
}
gam := groupAttributeMap{
name: config.GroupNameAttribute,
id: config.GroupIDAttribute,
@@ -190,9 +217,18 @@ func NewLDAPBackend(lc ldap.Client, config config.LDAP, logger *log.Logger, inst
}
}
instanceCache := ttlcache.New(
ttlcache.WithTTL[string, string](time.Duration(config.InstanceMapperCacheTTL)),
ttlcache.WithDisableTouchOnHit[string, string](),
)
go instanceCache.Start()
return &LDAP{
useServerUUID: config.UseServerUUID,
usePwModifyExOp: config.UsePasswordModExOp,
retryMaxCount: config.RetryMaxCount,
retryBaseDelay: config.RetryBaseDelay,
retryMaxDelay: config.RetryMaxDelay,
userBaseDN: config.UserBaseDN,
userFilter: config.UserFilter,
userObjectClass: config.UserObjectClass,
@@ -223,6 +259,7 @@ func NewLDAPBackend(lc ldap.Client, config config.LDAP, logger *log.Logger, inst
instanceMapperIDAttribute: config.InstanceMapperIDAttribute,
crossInstanceReferenceTemplate: crossInstanceReferenceTemplate,
instanceURLTemplate: instanceURLTemplate,
instanceCache: instanceCache,
}, nil
}
@@ -263,10 +300,21 @@ func (i *LDAP) CreateUser(ctx context.Context, user libregraph.User) (*libregrap
}
}
// Read back user from LDAP to get the generated UUID
e, err := i.getUserByDN(ar.DN, "")
if err != nil {
return nil, err
var e *ldap.Entry
if i.useServerUUID {
// The directory assigns the ID and conn.Add cannot return it, so we must
// read the entry back to recover the generated UUID.
e, err = i.readBackAfterWrite(func() (*ldap.Entry, error) {
return i.getUserByDN(ar.DN, "")
})
if err != nil {
return nil, err
}
} else {
// oCIS generated the ID and wrote it into the AddRequest, so everything the
// model builder needs is already in hand — synthesize the entry instead of
// reading it back (avoids a read-after-write against a lagging replica).
e = ldap.NewEntry(ar.DN, attrsFromAddRequest(ar))
}
return i.createUserModelFromLDAP(e), nil
}
@@ -436,11 +484,12 @@ func (i *LDAP) UpdateUser(ctx context.Context, nameOrID string, user libregraph.
}
}
// Read back user from LDAP to get the generated UUID
e, err = i.getUserByDN(e.DN, "")
if err != nil {
return nil, err
}
// Fold the applied changes onto the pre-read entry instead of reading it back.
// The ID is immutable on update (rejected above) and every field the model builder
// reads is either already on e or in the ModifyRequest just applied, so no
// read-after-write is needed. The rename branch (changeUserName) is handled above
// and keeps its own read-back.
e = applyModifyToEntry(e, &mr)
returnUser := i.createUserModelFromLDAP(e)
@@ -520,6 +569,13 @@ func (i *LDAP) getEntryByDN(dn string, attrs []string, filter string) (*ldap.Ent
Msg("getEntryByDN")
res, err := i.conn.Search(searchRequest)
if err != nil {
// A lagging replica returns NoSuchObject(32) for a base search on a
// not-yet-replicated DN; a slower one returns success with 0 entries. Both
// mean "not there yet", so map to the same ErrNotFound that readBackAfterWrite
// retries on.
if ldap.IsErrorWithCode(err, ldap.LDAPResultNoSuchObject) {
return nil, ErrNotFound
}
i.logger.Error().Err(err).Str("backend", "ldap").Str("dn", dn).Msg("Search ldap by DN failed")
return nil, errorcode.New(errorcode.ItemNotFound, "user lookup failed")
}
@@ -530,7 +586,40 @@ func (i *LDAP) getEntryByDN(dn string, attrs []string, filter string) (*ldap.Ent
return res.Entries[0], nil
}
// readBackAfterWrite runs readFn, retrying on ErrNotFound with backoff. A 0-entry
// read after a successful write means the read hit a replica lagging behind the
// primary; the connection-level retry only sees error codes, not this empty result,
// so the retry happens here. Bounds default to one immediate re-read (count=1,
// delay=0) and are tunable via the shared LDAP retry config.
func (i *LDAP) readBackAfterWrite(readFn func() (*ldap.Entry, error)) (*ldap.Entry, error) {
maxRetries := i.retryMaxCount
if maxRetries < 1 {
maxRetries = 1
}
var bo *backoff.ExponentialBackOff
for try := 0; ; try++ {
e, err := readFn()
if !errors.Is(err, ErrNotFound) || try >= maxRetries {
return e, err
}
if i.retryBaseDelay > 0 {
if bo == nil {
bo = backoff.NewExponentialBackOff()
bo.InitialInterval = i.retryBaseDelay
if i.retryMaxDelay > 0 {
bo.MaxInterval = i.retryMaxDelay
}
bo.Reset()
}
time.Sleep(bo.NextBackOff())
}
}
}
func (i *LDAP) searchLDAPEntryByFilter(basedn string, attrs []string, filter string) (*ldap.Entry, error) {
i.logger.Debug().Str("backend", "ldap").Msg("searchLDAPEntryByFilter")
if filter == "" {
filter = "(objectclass=*)"
}
@@ -590,6 +679,7 @@ func (i *LDAP) getLDAPUserByID(id string) (*ldap.Entry, error) {
}
func (i *LDAP) getLDAPUserByNameOrID(nameOrID string) (*ldap.Entry, error) {
i.logger.Debug().Str("backend", "ldap").Msg("getLDAPUserByNameOrID")
idString, err := filterEscapeUUID(i.userIDisOctetString, nameOrID)
// err != nil just means that this is not an uuid, so we can skip the uuid filter part
// and just filter by name
@@ -1155,6 +1245,7 @@ func (i *LDAP) getUserLDAPDN(user libregraph.User) string {
}
func (i *LDAP) userToAddRequest(user libregraph.User) (*ldap.AddRequest, error) {
i.logger.Debug().Str("backend", "ldap").Msg("userToAddRequest")
ar := ldap.NewAddRequest(i.getUserLDAPDN(user), nil)
attrMap, err := i.userToLDAPAttrValues(user)
@@ -1532,6 +1623,14 @@ func (i *LDAP) getInstance(searchValue, searchAttribute, resultAttribute string)
return searchValue, nil
}
cacheKey := searchAttribute + instanceCacheKeySep + resultAttribute + instanceCacheKeySep + searchValue
if item := i.instanceCache.Get(cacheKey); item != nil {
if item.Value() == instanceCacheNotFound {
return "", ErrNotFound
}
return item.Value(), nil
}
searchRequest := ldap.NewSearchRequest(
i.instanceMapperBaseDN,
ldap.ScopeWholeSubtree,
@@ -1543,23 +1642,30 @@ func (i *LDAP) getInstance(searchValue, searchAttribute, resultAttribute string)
res, err := i.conn.Search(searchRequest)
if err != nil {
// Not cached: this is a transient LDAP failure, not a definitive answer.
i.logger.Error().Err(err).Str("backend", "ldap").Str("dn", i.instanceMapperBaseDN).Str("searchValue", searchValue).Str("searchAttribute", searchAttribute).Str("resultAttribute", resultAttribute).Msg("Search instance failed")
return "", errorcode.New(errorcode.ItemNotFound, "instanceid search failed")
}
if len(res.Entries) == 0 {
// expected behaviour - we log debug in case something is fishy. This log can be removed when the feature proves stable
i.logger.Debug().Str("backend", "ldap").Str("dn", i.instanceMapperBaseDN).Str("searchValue", searchValue).Interface("result", res).Msg("Search instance empty")
i.instanceCache.Set(cacheKey, instanceCacheNotFound, ttlcache.DefaultTTL)
return "", ErrNotFound
}
if len(res.Entries) > 1 {
// Not cached: ambiguous data, don't freeze it in.
i.logger.Error().Str("backend", "ldap").Str("dn", i.instanceMapperBaseDN).Str("searchValue", searchValue).Interface("result", res).Msg("Search instance returned multiple responses.")
return "", errorcode.New(errorcode.ItemNotFound, "instanceid search returned multiple responses")
}
if len(res.Entries[0].Attributes) == 0 || len(res.Entries[0].Attributes[0].Values) == 0 {
// Not cached: malformed data, don't freeze it in.
i.logger.Error().Str("backend", "ldap").Str("dn", i.instanceMapperBaseDN).Str("searchValue", searchValue).Interface("result", res).Msg("Search instance returned malformed response")
return "", errorcode.New(errorcode.ItemNotFound, "instanceid search response malformed")
}
return res.Entries[0].Attributes[0].Values[0], nil
value := res.Entries[0].Attributes[0].Values[0]
i.instanceCache.Set(cacheKey, value, ttlcache.DefaultTTL)
return value, nil
}
func (i *LDAP) getInstanceID(instancename string) (string, error) {
@@ -1,414 +0,0 @@
package ldap
// LDAP automatic reconnection mechanism, inspired by:
// https://gist.github.com/emsearcy/cba3295d1a06d4c432ab4f6173b65e4f#file-ldap_snippet-go
import (
"context"
"crypto/tls"
"errors"
"fmt"
"time"
"github.com/go-ldap/ldap/v3"
"github.com/owncloud/ocis/v2/ocis-pkg/log"
)
var (
errMaxRetries = errors.New("max retries")
)
type ldapConnection struct {
Conn *ldap.Conn
Error error
}
// ConnWithReconnect implements the ldap.Client interface
type ConnWithReconnect struct {
conn chan ldapConnection
reset chan *ldap.Conn
retries int
logger *log.Logger
}
type Config struct {
URI string
BindDN string
BindPassword string
TLSConfig *tls.Config
}
func NewLDAPWithReconnect(logger *log.Logger, config Config) ConnWithReconnect {
conn := ConnWithReconnect{
conn: make(chan ldapConnection),
reset: make(chan *ldap.Conn),
retries: 1,
logger: logger,
}
go conn.ldapAutoConnect(config)
return conn
}
// Search implements the ldap.Client interface
func (c ConnWithReconnect) Search(sr *ldap.SearchRequest) (*ldap.SearchResult, error) {
conn, err := c.GetConnection()
if err != nil {
return nil, err
}
var res *ldap.SearchResult
for try := 0; try <= c.retries; try++ {
res, err = conn.Search(sr)
if !ldap.IsErrorWithCode(err, ldap.ErrorNetwork) {
// non network error, return it to the client
return res, err
}
c.logger.Debug().Msgf("Network Error. attempt %d", try)
conn, err = c.reconnect(conn)
if err != nil {
return nil, err
}
c.logger.Debug().Msg("retrying LDAP Search")
}
// if we get here we reached the maximum retries. So return an error
return nil, ldap.NewError(ldap.ErrorNetwork, errMaxRetries)
}
// Add implements the ldap.Client interface
func (c ConnWithReconnect) Add(a *ldap.AddRequest) error {
conn, err := c.GetConnection()
if err != nil {
return err
}
for try := 0; try <= c.retries; try++ {
err = conn.Add(a)
if !ldap.IsErrorWithCode(err, ldap.ErrorNetwork) {
// non network error, return it to the client
return err
}
c.logger.Debug().Msgf("Network Error. attempt %d", try)
conn, err = c.reconnect(conn)
if err != nil {
return err
}
c.logger.Debug().Msg("retrying LDAP Add")
}
// if we get here we reached the maximum retries. So return an error
return ldap.NewError(ldap.ErrorNetwork, errMaxRetries)
}
// Del implements the ldap.Client interface
func (c ConnWithReconnect) Del(d *ldap.DelRequest) error {
conn, err := c.GetConnection()
if err != nil {
return err
}
for try := 0; try <= c.retries; try++ {
err = conn.Del(d)
if !ldap.IsErrorWithCode(err, ldap.ErrorNetwork) {
// non network error, return it to the client
return err
}
c.logger.Debug().Msgf("Network Error. attempt %d", try)
conn, err = c.reconnect(conn)
if err != nil {
return err
}
c.logger.Debug().Msg("retrying LDAP Del")
}
// if we get here we reached the maximum retries. So return an error
return ldap.NewError(ldap.ErrorNetwork, errMaxRetries)
}
// Modify implements the ldap.Client interface
func (c ConnWithReconnect) Modify(m *ldap.ModifyRequest) error {
conn, err := c.GetConnection()
if err != nil {
return err
}
for try := 0; try <= c.retries; try++ {
err = conn.Modify(m)
if !ldap.IsErrorWithCode(err, ldap.ErrorNetwork) {
// non network error, return it to the client
return err
}
c.logger.Debug().Msgf("Network Error. attempt %d", try)
conn, err = c.reconnect(conn)
if err != nil {
return err
}
c.logger.Debug().Msg("retrying LDAP Modify")
}
// if we get here we reached the maximum retries. So return an error
return ldap.NewError(ldap.ErrorNetwork, errMaxRetries)
}
// PasswordModify implements the ldap.Client interface
func (c ConnWithReconnect) PasswordModify(m *ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error) {
conn, err := c.GetConnection()
if err != nil {
return nil, err
}
var res *ldap.PasswordModifyResult
for try := 0; try <= c.retries; try++ {
res, err = conn.PasswordModify(m)
if !ldap.IsErrorWithCode(err, ldap.ErrorNetwork) {
// non network error, return it to the client
return res, err
}
c.logger.Debug().Msgf("Network Error. attempt %d", try)
conn, err = c.reconnect(conn)
if err != nil {
return nil, err
}
c.logger.Debug().Msg("retrying LDAP Password Modify")
}
// if we get here we reached the maximum retries. So return an error
return nil, ldap.NewError(ldap.ErrorNetwork, errMaxRetries)
}
// ModifyDN implements the ldap.Client interface
func (c ConnWithReconnect) ModifyDN(m *ldap.ModifyDNRequest) error {
conn, err := c.GetConnection()
if err != nil {
return err
}
for try := 0; try <= c.retries; try++ {
err = conn.ModifyDN(m)
if !ldap.IsErrorWithCode(err, ldap.ErrorNetwork) {
// non network error, return it to the client
return err
}
c.logger.Debug().Msgf("Network Error. attempt %d", try)
conn, err = c.reconnect(conn)
if err != nil {
return err
}
c.logger.Debug().Msg("retrying LDAP ModifyDN")
}
// if we get here we reached the maximum retries. So return an error
return ldap.NewError(ldap.ErrorNetwork, errMaxRetries)
}
// GetConnection implements the ldap.Client interface
func (c ConnWithReconnect) GetConnection() (*ldap.Conn, error) {
conn := <-c.conn
if conn.Conn != nil && !ldap.IsErrorWithCode(conn.Error, ldap.ErrorNetwork) {
c.logger.Debug().Msg("using existing Connection")
return conn.Conn, conn.Error
}
return c.reconnect(conn.Conn)
}
// ldapAutoConnect implements the ldap.Client interface
func (c ConnWithReconnect) ldapAutoConnect(config Config) {
var (
l *ldap.Conn
err error
)
for {
select {
case resConn := <-c.reset:
// Only close the connection and reconnect if the current
// connection, matches the one we got via the reset channel.
// If they differ we already reconnected
if l != nil && l == resConn {
c.logger.Debug().Msgf("closing connection %v", &l)
l.Close()
}
if l == resConn || l == nil {
c.logger.Debug().Msg("reconnecting to LDAP")
l, err = c.ldapConnect(config)
} else {
c.logger.Debug().Msg("already reconnected")
}
case c.conn <- ldapConnection{l, err}:
}
}
}
// ldapConnect implements the ldap.Client interface
func (c ConnWithReconnect) ldapConnect(config Config) (*ldap.Conn, error) {
c.logger.Debug().Msgf("Connecting to %s", config.URI)
var err error
var l *ldap.Conn
if config.TLSConfig != nil {
l, err = ldap.DialURL(config.URI, ldap.DialWithTLSConfig(config.TLSConfig))
} else {
l, err = ldap.DialURL(config.URI)
}
if err != nil {
c.logger.Error().Err(err).Msg("could not get ldap Connection")
} else {
c.logger.Debug().Msg("LDAP Connected")
if config.BindDN != "" {
c.logger.Debug().Msgf("Binding as %s", config.BindDN)
err = l.Bind(config.BindDN, config.BindPassword)
if err != nil {
c.logger.Error().Err(err).Msg("Bind failed")
l.Close()
return nil, err
}
}
}
return l, err
}
// reconnect implements the ldap.Client interface
func (c ConnWithReconnect) reconnect(resetConn *ldap.Conn) (*ldap.Conn, error) {
c.logger.Debug().Msg("LDAP connection reset")
c.reset <- resetConn
c.logger.Debug().Msg("Waiting for new connection")
result := <-c.conn
return result.Conn, result.Error
}
// Extended implements the ldap.Client interface
func (c ConnWithReconnect) Extended(req *ldap.ExtendedRequest) (*ldap.ExtendedResponse, error) {
conn, err := c.GetConnection()
if err != nil {
return nil, err
}
// TODO: in reva there is a good retry util function
var res *ldap.ExtendedResponse
for try := 0; try <= c.retries; try++ {
res, err = conn.Extended(req)
if !ldap.IsErrorWithCode(err, ldap.ErrorNetwork) {
// Non network error, return it to the client
return res, err
}
c.logger.Debug().Msgf("Network Error. attempt %d", try)
conn, err = c.reconnect(conn)
if err != nil {
return nil, err
}
c.logger.Debug().Msg("retrying LDAP Extended")
}
// Return error when reached the maximum retries.
return nil, ldap.NewError(ldap.ErrorNetwork, errMaxRetries)
}
// Remaining methods to fulfill ldap.Client interface
func (c ConnWithReconnect) Start() {}
// StartTLS implements the ldap.Client interface
func (c ConnWithReconnect) StartTLS(*tls.Config) error {
return ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// Close implements the ldap.Client interface
func (c ConnWithReconnect) Close() (err error) {
conn, err := c.GetConnection()
if err != nil {
return err
}
return conn.Close()
}
// GetLastError implements the ldap.Client interface
func (c ConnWithReconnect) GetLastError() error {
conn, err := c.GetConnection()
if err != nil {
return err
}
return conn.GetLastError()
}
// IsClosing implements the ldap.Client interface
func (c ConnWithReconnect) IsClosing() bool {
return false
}
// SetTimeout implements the ldap.Client interface
func (c ConnWithReconnect) SetTimeout(time.Duration) {}
// Bind implements the ldap.Client interface
func (c ConnWithReconnect) Bind(username, password string) error {
return ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// UnauthenticatedBind implements the ldap.Client interface
func (c ConnWithReconnect) UnauthenticatedBind(username string) error {
return ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// SimpleBind implements the ldap.Client interface
func (c ConnWithReconnect) SimpleBind(*ldap.SimpleBindRequest) (*ldap.SimpleBindResult, error) {
return nil, ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// ExternalBind implements the ldap.Client interface
func (c ConnWithReconnect) ExternalBind() error {
return ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// ModifyWithResult implements the ldap.Client interface
func (c ConnWithReconnect) ModifyWithResult(m *ldap.ModifyRequest) (*ldap.ModifyResult, error) {
conn, err := c.GetConnection()
if err != nil {
return nil, err
}
return conn.ModifyWithResult(m)
}
// Compare implements the ldap.Client interface
func (c ConnWithReconnect) Compare(dn, attribute, value string) (bool, error) {
return false, ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// Compare implements the ldap.Client interface
func (c ConnWithReconnect) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error) {
return nil, ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// SearchAsync implements the ldap.Client interface
func (c ConnWithReconnect) SearchAsync(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int) ldap.Response {
// unimplemented
return nil
}
// NTLMUnauthenticatedBind implements the ldap.Client interface
func (c ConnWithReconnect) NTLMUnauthenticatedBind(domain, username string) error {
return ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// TLSConnectionState implements the ldap.Client interface
func (c ConnWithReconnect) TLSConnectionState() (tls.ConnectionState, bool) {
return tls.ConnectionState{}, false
}
// Unbind implements the ldap.Client interface
func (c ConnWithReconnect) Unbind() error {
return ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// DirSync implements the ldap.Client interface
func (c ConnWithReconnect) DirSync(searchRequest *ldap.SearchRequest, flags, maxAttrCount int64, cookie []byte) (*ldap.SearchResult, error) {
return nil, ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// DirSyncAsync implements the ldap.Client interface
func (c ConnWithReconnect) DirSyncAsync(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, flags, maxAttrCount int64, cookie []byte) ldap.Response {
// unimplemented
return nil
}
// Syncrepl implements the ldap.Client interface
func (c ConnWithReconnect) Syncrepl(ctx context.Context, searchRequest *ldap.SearchRequest, bufferSize int, mode ldap.ControlSyncRequestMode, cookie []byte, reloadHint bool) ldap.Response {
// unimplemented
return nil
}
@@ -89,10 +89,20 @@ func (i *LDAP) CreateEducationClass(ctx context.Context, class libregraph.Educat
return nil, err
}
// Read back group from LDAP to get the generated UUID
e, err := i.getEducationClassByDN(ar.DN)
if err != nil {
return nil, err
var e *ldap.Entry
if i.useServerUUID {
// The directory assigns the ID and conn.Add cannot return it, so we must
// read the entry back to recover the generated UUID.
e, err = i.readBackAfterWrite(func() (*ldap.Entry, error) {
return i.getEducationClassByDN(ar.DN)
})
if err != nil {
return nil, err
}
} else {
// oCIS generated the ID and wrote it into the AddRequest, so synthesize the
// entry from data already in hand instead of reading it back.
e = ldap.NewEntry(ar.DN, attrsFromAddRequest(ar))
}
return i.createEducationClassModelFromLDAP(e), nil
}
@@ -142,7 +152,10 @@ func (i *LDAP) UpdateEducationClass(ctx context.Context, id string, class libreg
return nil, ErrReadOnly
}
g, err := i.getLDAPGroupByID(id, false)
// Request the full education-class attribute set (classification, externalID, …),
// not just [name, id], so the folded response entry carries everything the model
// builder reads — otherwise a displayName-only update would drop classification.
g, err := i.getEducationClassByID(id, false)
if err != nil {
return nil, err
}
@@ -174,12 +187,17 @@ func (i *LDAP) UpdateEducationClass(ctx context.Context, id string, class libreg
dn := g.DN
// The externalID lives in the RDN and is changed via ModifyDN, not the ModifyRequest.
// The model builder reads it from the externalID attribute, so we fold it on as an
// attribute replace below (deleteOldRDN=true updates the attribute server-side).
externalIDChanged := false
if eID := class.GetExternalId(); eID != "" {
if g.GetEqualFoldAttributeValue(i.educationConfig.classAttributeMap.externalID) != eID {
dn, err = i.updateClassExternalID(ctx, dn, eID)
if err != nil {
return nil, err
}
externalIDChanged = true
}
}
@@ -198,9 +216,14 @@ func (i *LDAP) UpdateEducationClass(ctx context.Context, id string, class libreg
}
}
g, err = i.getEducationClassByDN(dn)
if err != nil {
return nil, err
// Fold the applied changes onto the pre-read entry instead of reading it back.
// The externalID rename is modelled as an attribute replace so the returned model
// reflects the new externalID.
g = applyModifyToEntry(g, &mr)
if externalIDChanged {
extRename := ldap.ModifyRequest{DN: dn}
extRename.Replace(i.educationConfig.classAttributeMap.externalID, []string{class.GetExternalId()})
g = applyModifyToEntry(g, &extRename)
}
return i.createEducationClassModelFromLDAP(g), nil
@@ -50,7 +50,11 @@ func TestCreateEducationClass(t *testing.T) {
},
nil)
b, err := getMockedBackend(lm, eduConfig, &logger)
// useServerUUID=true keeps the read-back path (the directory assigns the ID),
// which is what this test asserts (Search called once, fixed entry returned).
c := eduConfig
c.UseServerUUID = true
b, err := getMockedBackend(lm, c, &logger)
assert.Nil(t, err)
assert.NotEqual(t, "", b.educationConfig.classObjectClass)
class := libregraph.NewEducationClass()
@@ -160,10 +160,20 @@ func (i *LDAP) CreateEducationSchool(ctx context.Context, school libregraph.Educ
return nil, err
}
// Read back school from LDAP to get the generated UUID
e, err := i.getSchoolByDN(ar.DN)
if err != nil {
return nil, err
var e *ldap.Entry
if i.useServerUUID {
// The directory assigns the ID and conn.Add cannot return it, so we must
// read the entry back to recover the generated UUID.
e, err = i.readBackAfterWrite(func() (*ldap.Entry, error) {
return i.getSchoolByDN(ar.DN)
})
if err != nil {
return nil, err
}
} else {
// oCIS generated the ID and wrote it into the AddRequest, so synthesize the
// entry from data already in hand instead of reading it back.
e = ldap.NewEntry(ar.DN, attrsFromAddRequest(ar))
}
return i.createSchoolModelFromLDAP(e), nil
}
@@ -240,7 +250,9 @@ func (i *LDAP) updateDisplayName(ctx context.Context, dn string, providedDisplay
// updateSchoolProperties updates the properties (other that displayName) of a school.
// It checks if a school number is already taken, before updating the school number
func (i *LDAP) updateSchoolProperties(ctx context.Context, dn string, currentSchool, updatedSchool libregraph.EducationSchool) error {
// updateSchoolProperties applies the ModifyRequest and returns it so the caller can
// fold the applied changes onto the pre-read entry (avoiding a read-after-write).
func (i *LDAP) updateSchoolProperties(ctx context.Context, dn string, currentSchool, updatedSchool libregraph.EducationSchool) (*ldap.ModifyRequest, error) {
logger := i.logger.SubloggerWithRequestID(ctx)
mr := ldap.NewModifyRequest(dn, nil)
@@ -248,7 +260,7 @@ func (i *LDAP) updateSchoolProperties(ctx context.Context, dn string, currentSch
if *updatedSchoolNumber != "" && currentSchool.GetSchoolNumber() != *updatedSchoolNumber {
_, err := i.getSchoolByNumber(*updatedSchoolNumber)
if err == nil {
return errSchoolNumberExists
return nil, errSchoolNumberExists
}
mr.Replace(i.educationConfig.schoolAttributeMap.schoolNumber, []string{*updatedSchoolNumber})
}
@@ -267,10 +279,10 @@ func (i *LDAP) updateSchoolProperties(ctx context.Context, dn string, currentSch
if err := i.conn.Modify(mr); err != nil {
logger.Debug().Err(err).Msg("error updating school number")
return err
return nil, err
}
return nil
return mr, nil
}
// UpdateEducationSchool updates the supplied school in the identity backend
@@ -287,6 +299,11 @@ func (i *LDAP) UpdateEducationSchool(ctx context.Context, numberOrID string, sch
}
currentSchool := i.createSchoolModelFromLDAP(e)
// Fold the applied changes onto the pre-read entry instead of reading it back.
// updateDisplayName mutates the RDN via ModifyDN; the model builder reads displayName
// from the attribute, so we model the rename as a displayName attribute replace.
// updateSchoolProperties returns the ModifyRequest it applied so we can fold it on.
fold := ldap.NewModifyRequest(e.DN, nil)
switch i.updateEducationSchoolOperation(school, *currentSchool) {
case tooManyValues:
return nil, fmt.Errorf("school name and school number cannot be updated in the same request")
@@ -297,17 +314,16 @@ func (i *LDAP) UpdateEducationSchool(ctx context.Context, numberOrID string, sch
if err := i.updateDisplayName(ctx, e.DN, school.GetDisplayName()); err != nil {
return nil, err
}
fold.Replace(i.educationConfig.schoolAttributeMap.displayName, []string{school.GetDisplayName()})
case schoolPropertiesUpdated:
if err := i.updateSchoolProperties(ctx, e.DN, *currentSchool, school); err != nil {
mr, err := i.updateSchoolProperties(ctx, e.DN, *currentSchool, school)
if err != nil {
return nil, err
}
fold.Changes = mr.Changes
}
// Read back school from LDAP
e, err = i.getSchoolByNumberOrID(i.getID(e))
if err != nil {
return nil, err
}
e = applyModifyToEntry(e, fold)
return i.createSchoolModelFromLDAP(e), nil
}
@@ -54,13 +54,6 @@ var schoolEntry1 = ldap.NewEntry("ou=Test School1",
"ocEducationSchoolNumber": {"0042"},
"owncloudUUID": {"hijk-defg"},
})
var schoolEntryWithTermination = ldap.NewEntry("ou=Test School",
map[string][]string{
"ou": {"Test School"},
"ocEducationSchoolNumber": {"0123"},
"owncloudUUID": {"abcd-defg"},
"ocEducationSchoolTerminationTimestamp": {"20420131120000Z"},
})
var (
filterSchoolSearchByIdExisting = "(&(objectClass=ocEducationSchool)(|(owncloudUUID=abcd-defg)(ocEducationSchoolNumber=abcd-defg)))"
@@ -177,7 +170,11 @@ func TestCreateEducationSchool(t *testing.T) {
Entries: []*ldap.Entry{schoolEntry},
},
nil)
b, err := getMockedBackend(lm, eduConfig, &logger)
// useServerUUID=true keeps the read-back path (the directory assigns the ID),
// which is what this test asserts (fixed entry returned with a known id).
c := eduConfig
c.UseServerUUID = true
b, err := getMockedBackend(lm, c, &logger)
assert.Nil(t, err)
assert.NotEqual(t, "", b.educationConfig.schoolObjectClass)
@@ -218,6 +215,7 @@ func TestUpdateEducationSchoolTerminationDate(t *testing.T) {
return false
}
lm.On("Modify", mock.MatchedBy(ldapSchoolTerminationRequestMatcher)).Return(nil)
// Single pre-read; the termination Replace is folded onto it (no read-back).
lm.On("Search", mock.Anything).
Return(
&ldap.SearchResult{
@@ -225,13 +223,6 @@ func TestUpdateEducationSchoolTerminationDate(t *testing.T) {
},
nil).
Once()
lm.On("Search", mock.Anything).
Return(
&ldap.SearchResult{
Entries: []*ldap.Entry{schoolEntryWithTermination},
},
nil).
Once()
b, err := getMockedBackend(lm, eduConfig, &logger)
assert.Nil(t, err)
@@ -240,7 +231,7 @@ func TestUpdateEducationSchoolTerminationDate(t *testing.T) {
terminationTime := time.Date(2042, time.January, 31, 12, 0, 0, 0, time.UTC)
school.SetTerminationDate(terminationTime)
resSchool, err := b.UpdateEducationSchool(context.Background(), "abcd-defg", *school)
lm.AssertNumberOfCalls(t, "Search", 2)
lm.AssertNumberOfCalls(t, "Search", 1)
assert.Nil(t, err)
assert.NotNil(t, resSchool)
assert.Equal(t, "Test School", resSchool.GetDisplayName())
@@ -44,10 +44,20 @@ func (i *LDAP) CreateEducationUser(ctx context.Context, user libregraph.Educatio
return nil, err
}
// Read back user from LDAP to get the generated UUID
e, err := i.getEducationUserByDN(ar.DN)
if err != nil {
return nil, err
var e *ldap.Entry
if i.useServerUUID {
// The directory assigns the ID and conn.Add cannot return it, so we must
// read the entry back to recover the generated UUID.
e, err = i.readBackAfterWrite(func() (*ldap.Entry, error) {
return i.getEducationUserByDN(ar.DN)
})
if err != nil {
return nil, err
}
} else {
// oCIS generated the ID and wrote it into the AddRequest, so synthesize the
// entry from data already in hand instead of reading it back.
e = ldap.NewEntry(ar.DN, attrsFromAddRequest(ar))
}
return i.createEducationUserModelFromLDAP(e), nil
}
@@ -170,11 +180,11 @@ func (i *LDAP) UpdateEducationUser(ctx context.Context, id string, user libregra
}
}
// Read back user from LDAP to get the generated UUID
e, err = i.getEducationUserByDN(e.DN)
if err != nil {
return nil, err
}
// Fold the applied changes onto the pre-read entry instead of reading it back.
// The ID is immutable on update (rejected above) and every field the model builder
// reads is either already on e or in the ModifyRequest just applied. The rename
// branch (changeUserName) is handled above and keeps its own read-back.
e = applyModifyToEntry(e, &mr)
returnUser := i.createEducationUserModelFromLDAP(e)
@@ -97,7 +97,11 @@ var sr3 *ldap.SearchRequest = &ldap.SearchRequest{
func TestCreateEducationUser(t *testing.T) {
lm := &mocks.Client{}
b, err := getMockedBackend(lm, eduConfig, &logger)
// useServerUUID=true keeps the read-back path (the directory assigns the ID),
// which is what this test asserts (Search called once, fixed entry returned).
c := eduConfig
c.UseServerUUID = true
b, err := getMockedBackend(lm, c, &logger)
assert.Nil(t, err)
//assert.NotEqual(t, "", b.educationConfig.schoolObjectClass)
lm.On("Add", mock.Anything).Return(nil)
+16 -6
View File
@@ -220,10 +220,20 @@ func (i *LDAP) CreateGroup(ctx context.Context, group libregraph.Group) (*libreg
}
}
// Read back group from LDAP to get the generated UUID
e, err := i.getGroupByDN(ar.DN)
if err != nil {
return nil, err
var e *ldap.Entry
if i.useServerUUID {
// The directory assigns the ID and conn.Add cannot return it, so we must
// read the entry back to recover the generated UUID.
e, err = i.readBackAfterWrite(func() (*ldap.Entry, error) {
return i.getGroupByDN(ar.DN)
})
if err != nil {
return nil, err
}
} else {
// oCIS generated the ID and wrote it into the AddRequest, so synthesize the
// entry from data already in hand instead of reading it back.
e = ldap.NewEntry(ar.DN, attrsFromAddRequest(ar))
}
return i.createGroupModelFromLDAP(e), nil
}
@@ -462,7 +472,7 @@ func (i *LDAP) groupToLDAPAttrValues(group libregraph.Group) (map[string][]strin
attrs["objectClass"] = append(attrs["objectClass"], i.groupAdditionalObjectClasses...)
if !i.useServerUUID {
attrs["owncloudUUID"] = []string{uuid.Must(uuid.NewV4()).String()}
attrs[i.groupAttributeMap.id] = []string{uuid.Must(uuid.NewV4()).String()}
attrs["objectClass"] = append(attrs["objectClass"], "owncloud")
}
@@ -490,7 +500,7 @@ func (i *LDAP) getLDAPGroupByNameOrID(nameOrID string, requestMembers bool) (*ld
if err == nil {
filter = fmt.Sprintf("(|(%s=%s)(%s=%s))", i.groupAttributeMap.name, ldap.EscapeFilter(nameOrID), i.groupAttributeMap.id, idString)
} else {
filter = fmt.Sprintf("(%s=%s)", i.userAttributeMap.userName, ldap.EscapeFilter(nameOrID))
filter = fmt.Sprintf("(%s=%s)", i.groupAttributeMap.name, ldap.EscapeFilter(nameOrID))
}
return i.getLDAPGroupByFilter(filter, requestMembers)
}
@@ -0,0 +1,73 @@
package identity
import (
"testing"
"github.com/go-ldap/ldap/v3"
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
"github.com/owncloud/ocis/v2/services/graph/pkg/identity/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
var instanceMapperConfig = config.LDAP{
UserBaseDN: "ou=people,dc=test",
UserObjectClass: "inetOrgPerson",
UserSearchScope: "sub",
UserDisplayNameAttribute: "displayname",
UserIDAttribute: "entryUUID",
UserEmailAttribute: "mail",
UserNameAttribute: "uid",
GroupBaseDN: "ou=groups,dc=test",
GroupObjectClass: "groupOfNames",
GroupSearchScope: "sub",
GroupNameAttribute: "cn",
GroupMemberAttribute: "member",
GroupIDAttribute: "entryUUID",
InstanceMapperEnabled: true,
InstanceMapperBaseDN: "ou=instances,dc=test",
InstanceMapperNameAttribute: "instanceName",
InstanceMapperIDAttribute: "instanceID",
}
func TestGetInstanceNameIsCached(t *testing.T) {
lm := &mocks.Client{}
b, err := getMockedBackend(lm, instanceMapperConfig, &logger)
assert.Nil(t, err)
instanceEntry := ldap.NewEntry("instanceID=instance-1,ou=instances,dc=test",
map[string][]string{
"instanceName": {"Instance One"},
})
lm.On("Search", mock.Anything).
Return(&ldap.SearchResult{Entries: []*ldap.Entry{instanceEntry}}, nil)
name1, err1 := b.getInstanceName("instance-1")
assert.Nil(t, err1)
assert.Equal(t, "Instance One", name1)
name2, err2 := b.getInstanceName("instance-1")
assert.Nil(t, err2)
assert.Equal(t, "Instance One", name2)
lm.AssertNumberOfCalls(t, "Search", 1)
}
func TestGetInstanceNameCachesNotFound(t *testing.T) {
lm := &mocks.Client{}
b, err := getMockedBackend(lm, instanceMapperConfig, &logger)
assert.Nil(t, err)
lm.On("Search", mock.Anything).
Return(&ldap.SearchResult{Entries: []*ldap.Entry{}}, nil)
_, err1 := b.getInstanceName("stale-instance")
assert.ErrorIs(t, err1, ErrNotFound)
_, err2 := b.getInstanceName("stale-instance")
assert.ErrorIs(t, err2, ErrNotFound)
lm.AssertNumberOfCalls(t, "Search", 1)
}
@@ -0,0 +1,217 @@
package identity
// Integration tests: full stack NewLDAPWithReconnect → NewLDAPBackend → libregraph/idm boltdb LDAP server.
// Uses the same server oCIS ships in production (services/idm). Regression baseline for
// GetUser, GetUsers, CreateUser, DeleteUser.
import (
"context"
"fmt"
"net"
"net/url"
"os"
"path/filepath"
"testing"
"github.com/CiscoM31/godata"
gldap "github.com/go-ldap/ldap/v3"
"github.com/libregraph/idm/pkg/ldappassword"
"github.com/libregraph/idm/pkg/ldapserver"
"github.com/libregraph/idm/pkg/ldbbolt"
"github.com/libregraph/idm/server/handler/boltdb"
libregraph "github.com/owncloud/libre-graph-api-go"
"github.com/owncloud/ocis/v2/ocis-pkg/log"
connldap "github.com/owncloud/reva/v2/pkg/utils/ldap"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
const (
idmBaseDN = "o=libregraph-idm"
idmAdminDN = "uid=admin,ou=sysusers,o=libregraph-idm"
idmAdminPW = "admin"
)
// idmConfig mirrors lconfig but with base DNs matching the libregraph/idm schema.
var idmConfig = lconfig
func init() {
idmConfig.UserBaseDN = "ou=users,o=libregraph-idm"
idmConfig.GroupBaseDN = "ou=groups,o=libregraph-idm"
idmConfig.LdapDisabledUsersGroupDN = "cn=DisabledUsersGroup,ou=groups,o=libregraph-idm"
idmConfig.WriteEnabled = true
idmConfig.UseServerUUID = false // boltdb does not auto-generate entryUUID; client must supply it
}
// idmEntry builds a gldap.Entry matching idmConfig attribute names.
func idmEntry(uid, uuid string) *gldap.Entry {
dn := fmt.Sprintf("uid=%s,%s", uid, idmConfig.UserBaseDN)
return gldap.NewEntry(dn, map[string][]string{
idmConfig.UserNameAttribute: {uid},
idmConfig.UserDisplayNameAttribute: {"Display " + uid},
idmConfig.UserEmailAttribute: {uid + "@example.com"},
idmConfig.UserIDAttribute: {uuid},
"sn": {uid},
"givenname": {uid},
idmConfig.UserEnabledAttribute: {"TRUE"},
idmConfig.UserTypeAttribute: {"Member"},
"objectClass": {"inetOrgPerson", "organizationalPerson", "person", "top", "ownCloudUser"},
})
}
// seedIDMDB seeds the boltdb with the OU structure, admin sysuser, and any additional entries.
func seedIDMDB(t *testing.T, dbfile string, entries ...*gldap.Entry) {
t.Helper()
bdb := &ldbbolt.LdbBolt{}
require.NoError(t, bdb.Configure(logrus.New(), idmBaseDN, dbfile, nil))
require.NoError(t, bdb.Initialize())
defer bdb.Close()
hashedPW, err := ldappassword.Hash(idmAdminPW, "{ARGON2}")
require.NoError(t, err)
// OU structure mirroring the real IDM base.ldif.tmpl
base := []*gldap.Entry{
gldap.NewEntry(idmBaseDN, map[string][]string{
"o": {"libregraph-idm"}, "objectClass": {"organization"},
}),
gldap.NewEntry("ou=users,o=libregraph-idm", map[string][]string{
"ou": {"users"}, "objectClass": {"organizationalUnit"},
}),
gldap.NewEntry("ou=sysusers,o=libregraph-idm", map[string][]string{
"ou": {"sysusers"}, "objectClass": {"organizationalUnit"},
}),
gldap.NewEntry("ou=groups,o=libregraph-idm", map[string][]string{
"ou": {"groups"}, "objectClass": {"organizationalUnit"},
}),
gldap.NewEntry(idmAdminDN, map[string][]string{
"uid": {"admin"}, "objectClass": {"account", "simpleSecurityObject"},
"userPassword": {hashedPW},
}),
}
for _, e := range base {
require.NoError(t, bdb.EntryPut(e), "seeding base entry %s", e.DN)
}
for _, e := range entries {
require.NoError(t, bdb.EntryPut(e), "seeding entry %s", e.DN)
}
}
// newIDMBackend starts the libregraph/idm boltdb LDAP server and returns a wired LDAP identity backend.
func newIDMBackend(t *testing.T, entries ...*gldap.Entry) *LDAP {
t.Helper()
dbfile := filepath.Join(t.TempDir(), "idm.db")
seedIDMDB(t, dbfile, entries...)
boltHandler, err := boltdb.NewBoltDBHandler(logrus.New(), dbfile, &boltdb.Options{
BaseDN: idmBaseDN,
AdminDN: idmAdminDN,
})
require.NoError(t, err)
srv := ldapserver.NewServer()
srv.EnforceLDAP = true // boltdb does not apply LDAP filters; the server must
ctx, cancel := context.WithCancel(context.Background())
h := boltHandler.WithContext(ctx)
srv.AddFunc("", h)
srv.BindFunc("", h)
srv.DeleteFunc("", h)
srv.ModifyFunc("", h)
srv.SearchFunc("", h)
ln, err := net.Listen("tcp", "127.0.0.1:0")
require.NoError(t, err)
quit := make(chan bool)
srv.QuitChannel(quit)
go func() { _ = srv.Serve(ln) }()
t.Cleanup(func() { cancel(); close(quit); ln.Close() })
level := os.Getenv("OCIS_LOG_LEVEL")
if level == "" {
level = "error"
}
lgr := log.NewLogger(log.Level(level))
conn := connldap.NewLDAPWithReconnect(connldap.Config{
URI: fmt.Sprintf("ldap://%s", ln.Addr().String()),
BindDN: idmAdminDN,
BindPassword: idmAdminPW,
RetryMaxCount: 1,
})
conn.SetLogger(&lgr.Logger)
backend, err := NewLDAPBackend(conn, idmConfig, &lgr, "")
require.NoError(t, err)
return backend
}
func odataReq(t *testing.T) *godata.GoDataRequest {
t.Helper()
req, err := godata.ParseRequest(context.Background(), "", url.Values{})
require.NoError(t, err)
return req
}
func TestIntegrationGetUser_HappyPath(t *testing.T) {
b := newIDMBackend(t,
idmEntry("alice", "aaaaaaaa-0000-0000-0000-000000000001"),
)
user, err := b.GetUser(context.Background(), "alice", odataReq(t))
require.NoError(t, err)
assert.Equal(t, "alice", user.GetOnPremisesSamAccountName())
assert.Equal(t, "Display alice", user.GetDisplayName())
assert.Equal(t, "alice@example.com", user.GetMail())
}
func TestIntegrationGetUsers_HappyPath(t *testing.T) {
b := newIDMBackend(t,
idmEntry("alice", "aaaaaaaa-0000-0000-0000-000000000001"),
idmEntry("bob", "bbbbbbbb-0000-0000-0000-000000000002"),
)
users, err := b.GetUsers(context.Background(), odataReq(t))
require.NoError(t, err)
require.Len(t, users, 2)
names := make(map[string]bool, 2)
for _, u := range users {
names[u.GetOnPremisesSamAccountName()] = true
}
assert.True(t, names["alice"])
assert.True(t, names["bob"])
}
func TestIntegrationCreateUser_HappyPath(t *testing.T) {
b := newIDMBackend(t) // empty — no pre-seeded users
newUser := libregraph.NewUser("Charlie", "charlie")
newUser.SetMail("charlie@example.com")
newUser.SetSurname("Charlie")
newUser.SetGivenName("Charlie")
newUser.SetAccountEnabled(true)
newUser.SetUserType("Member")
created, err := b.CreateUser(context.Background(), *newUser)
require.NoError(t, err)
assert.Equal(t, "charlie", created.GetOnPremisesSamAccountName())
assert.Equal(t, "Charlie", created.GetDisplayName())
assert.Equal(t, "charlie@example.com", created.GetMail())
}
func TestIntegrationDeleteUser_HappyPath(t *testing.T) {
entry := idmEntry("dave", "dddddddd-0000-0000-0000-000000000004")
b := newIDMBackend(t, entry)
// Confirm user exists first.
_, err := b.GetUser(context.Background(), "dave", odataReq(t))
require.NoError(t, err)
err = b.DeleteUser(context.Background(), "dave")
require.NoError(t, err)
// Confirm gone.
_, err = b.GetUser(context.Background(), "dave", odataReq(t))
require.Error(t, err)
}
+32 -312
View File
@@ -460,8 +460,12 @@ func TestUpdateUser(t *testing.T) {
DN: "uid=oldName",
Attributes: []*ldap.EntryAttribute{
{
Name: "displayname",
Values: []string{"oldmail@example.org"},
Name: lconfig.UserDisplayNameAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserNameAttribute,
Values: []string{"testUser"},
},
{
Name: "entryUUID",
@@ -482,54 +486,6 @@ func TestUpdateUser(t *testing.T) {
nil,
},
},
{
funcName: "Search",
args: []interface{}{
&ldap.SearchRequest{
BaseDN: "uid=oldName",
Scope: 0,
DerefAliases: 0,
SizeLimit: 1,
TimeLimit: 0,
TypesOnly: false,
Filter: "(objectClass=inetOrgPerson)",
Attributes: ldapUserAttributes,
Controls: []ldap.Control(nil),
},
},
returns: []interface{}{
&ldap.SearchResult{
Entries: []*ldap.Entry{
{
DN: "uid=oldName",
Attributes: []*ldap.EntryAttribute{
{
Name: lconfig.UserIDAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserEmailAttribute,
Values: []string{"testuser@example.org"},
},
{
Name: lconfig.UserDisplayNameAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserNameAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserEnabledAttribute,
Values: []string{""},
},
},
},
},
},
nil,
},
},
{
funcName: "Modify",
args: []interface{}{
@@ -590,7 +546,11 @@ func TestUpdateUser(t *testing.T) {
DN: "uid=oldName",
Attributes: []*ldap.EntryAttribute{
{
Name: "displayname",
Name: lconfig.UserDisplayNameAttribute,
Values: []string{"oldName"},
},
{
Name: lconfig.UserNameAttribute,
Values: []string{"testUser"},
},
{
@@ -612,54 +572,6 @@ func TestUpdateUser(t *testing.T) {
nil,
},
},
{
funcName: "Search",
args: []interface{}{
&ldap.SearchRequest{
BaseDN: "uid=oldName",
Scope: 0,
DerefAliases: 0,
SizeLimit: 1,
TimeLimit: 0,
TypesOnly: false,
Filter: "(objectClass=inetOrgPerson)",
Attributes: ldapUserAttributes,
Controls: []ldap.Control(nil),
},
},
returns: []interface{}{
&ldap.SearchResult{
Entries: []*ldap.Entry{
{
DN: "uid=oldName",
Attributes: []*ldap.EntryAttribute{
{
Name: lconfig.UserIDAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserEmailAttribute,
Values: []string{"testuser@example.org"},
},
{
Name: lconfig.UserDisplayNameAttribute,
Values: []string{"newName"},
},
{
Name: lconfig.UserNameAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserEnabledAttribute,
Values: []string{""},
},
},
},
},
},
nil,
},
},
{
funcName: "Modify",
args: []interface{}{
@@ -910,8 +822,12 @@ func TestUpdateUser(t *testing.T) {
DN: "uid=name",
Attributes: []*ldap.EntryAttribute{
{
Name: "displayname",
Values: []string{"testuser@example.org"},
Name: lconfig.UserDisplayNameAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserNameAttribute,
Values: []string{"testUser"},
},
{
Name: "entryUUID",
@@ -932,54 +848,6 @@ func TestUpdateUser(t *testing.T) {
nil,
},
},
{
funcName: "Search",
args: []interface{}{
&ldap.SearchRequest{
BaseDN: "uid=name",
Scope: 0,
DerefAliases: 0,
SizeLimit: 1,
TimeLimit: 0,
TypesOnly: false,
Filter: "(objectClass=inetOrgPerson)",
Attributes: ldapUserAttributes,
Controls: []ldap.Control(nil),
},
},
returns: []interface{}{
&ldap.SearchResult{
Entries: []*ldap.Entry{
{
DN: "uid=name",
Attributes: []*ldap.EntryAttribute{
{
Name: lconfig.UserIDAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserEmailAttribute,
Values: []string{"testuser@example.org"},
},
{
Name: lconfig.UserDisplayNameAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserNameAttribute,
Values: []string{"testUser"},
},
{
Name: lconfig.UserEnabledAttribute,
Values: []string{"FALSE"},
},
},
},
},
},
nil,
},
},
{
funcName: "Modify",
args: []interface{}{
@@ -1040,9 +908,13 @@ func TestUpdateUser(t *testing.T) {
{
DN: "uid=name",
Attributes: []*ldap.EntryAttribute{
{
Name: "uid",
Values: []string{"testUser"},
},
{
Name: "displayname",
Values: []string{"testuser@example.org"},
Values: []string{"testUser"},
},
{
Name: "entryUUID",
@@ -1114,58 +986,6 @@ func TestUpdateUser(t *testing.T) {
},
returns: []interface{}{nil},
},
{
funcName: "Modify",
args: []interface{}{
&ldap.ModifyRequest{
DN: "uid=name",
Changes: []ldap.Change(nil),
Controls: []ldap.Control(nil),
},
},
returns: []interface{}{nil},
},
{
funcName: "Search",
args: []interface{}{
ldap.NewSearchRequest(
"uid=name",
ldap.ScopeBaseObject,
ldap.NeverDerefAliases, 1, 0, false,
"(objectClass=inetOrgPerson)",
ldapUserAttributes,
[]ldap.Control(nil),
),
},
returns: []interface{}{
&ldap.SearchResult{
Entries: []*ldap.Entry{
{
DN: "uid=name",
Attributes: []*ldap.EntryAttribute{
{
Name: "uid",
Values: []string{"testUser"},
},
{
Name: "displayname",
Values: []string{"testUser"},
},
{
Name: "entryUUID",
Values: []string{"testUser"},
},
{
Name: "mail",
Values: []string{"testuser@example.org"},
},
},
},
},
},
nil,
},
},
},
},
{
@@ -1207,9 +1027,13 @@ func TestUpdateUser(t *testing.T) {
{
DN: "uid=name",
Attributes: []*ldap.EntryAttribute{
{
Name: "uid",
Values: []string{"testUser"},
},
{
Name: "displayname",
Values: []string{"testuser@example.org"},
Values: []string{"testUser"},
},
{
Name: "entryUUID",
@@ -1281,58 +1105,6 @@ func TestUpdateUser(t *testing.T) {
},
returns: []interface{}{nil},
},
{
funcName: "Modify",
args: []interface{}{
&ldap.ModifyRequest{
DN: "uid=name",
Changes: []ldap.Change(nil),
Controls: []ldap.Control(nil),
},
},
returns: []interface{}{nil},
},
{
funcName: "Search",
args: []interface{}{
ldap.NewSearchRequest(
"uid=name",
ldap.ScopeBaseObject,
ldap.NeverDerefAliases, 1, 0, false,
"(objectClass=inetOrgPerson)",
ldapUserAttributes,
[]ldap.Control(nil),
),
},
returns: []interface{}{
&ldap.SearchResult{
Entries: []*ldap.Entry{
{
DN: "uid=name",
Attributes: []*ldap.EntryAttribute{
{
Name: "uid",
Values: []string{"testUser"},
},
{
Name: "displayname",
Values: []string{"testUser"},
},
{
Name: "entryUUID",
Values: []string{"testUser"},
},
{
Name: "mail",
Values: []string{"testuser@example.org"},
},
},
},
},
},
nil,
},
},
},
},
{
@@ -1373,9 +1145,13 @@ func TestUpdateUser(t *testing.T) {
{
DN: "uid=name",
Attributes: []*ldap.EntryAttribute{
{
Name: "uid",
Values: []string{"testUser"},
},
{
Name: "displayname",
Values: []string{"testuser@example.org"},
Values: []string{"testUser"},
},
{
Name: "entryUUID",
@@ -1415,62 +1191,6 @@ func TestUpdateUser(t *testing.T) {
},
returns: []interface{}{nil},
},
{
funcName: "Modify",
args: []interface{}{
&ldap.ModifyRequest{
DN: "uid=name",
Changes: []ldap.Change(nil),
Controls: []ldap.Control(nil),
},
},
returns: []interface{}{nil},
},
{
funcName: "Search",
args: []interface{}{
ldap.NewSearchRequest(
"uid=name",
ldap.ScopeBaseObject,
ldap.NeverDerefAliases, 1, 0, false,
"(objectClass=inetOrgPerson)",
ldapUserAttributes,
[]ldap.Control(nil),
),
},
returns: []interface{}{
&ldap.SearchResult{
Entries: []*ldap.Entry{
{
DN: "uid=name",
Attributes: []*ldap.EntryAttribute{
{
Name: "uid",
Values: []string{"testUser"},
},
{
Name: "displayname",
Values: []string{"testUser"},
},
{
Name: "entryUUID",
Values: []string{"testUser"},
},
{
Name: "mail",
Values: []string{"testuser@example.org"},
},
{
Name: lconfig.UserTypeAttribute,
Values: []string{"Member"},
},
},
},
},
},
nil,
},
},
},
},
}
@@ -0,0 +1,125 @@
package identity
import (
"strings"
"github.com/go-ldap/ldap/v3"
)
// attrsFromAddRequest flattens the attributes of an *ldap.AddRequest into the
// map[string][]string shape that ldap.NewEntry expects. It is used to synthesize
// the response entry from data already in hand, avoiding a read-after-write when
// oCIS generated the entry's ID itself (useServerUUID=false).
func attrsFromAddRequest(ar *ldap.AddRequest) map[string][]string {
attrs := make(map[string][]string, len(ar.Attributes))
for _, a := range ar.Attributes {
vals := make([]string, len(a.Vals))
copy(vals, a.Vals)
attrs[a.Type] = vals
}
return attrs
}
// applyModifyToEntry returns a copy of base with the changes from mr folded on
// (Replace / Add / Delete). It never mutates base. Attribute names are matched
// case-insensitively, consistent with ldap.Entry's GetEqualFold* accessors, so
// folding never produces a duplicate attribute entry that differs only in case.
//
// It is used to synthesize the response entry after an update from the pre-read
// entry plus the ModifyRequest being persisted, avoiding a read-after-write.
func applyModifyToEntry(base *ldap.Entry, mr *ldap.ModifyRequest) *ldap.Entry {
if base == nil {
return nil
}
if mr == nil {
mr = &ldap.ModifyRequest{DN: base.DN}
}
// Deep-copy base into a name->values map so we never touch the original.
attrs := make(map[string][]string, len(base.Attributes))
// order preserves the original attribute order, with new attributes appended.
order := make([]string, 0, len(base.Attributes))
index := make(map[string]string, len(base.Attributes)) // fold-key -> stored name
for _, a := range base.Attributes {
vals := make([]string, len(a.Values))
copy(vals, a.Values)
attrs[a.Name] = vals
order = append(order, a.Name)
index[strings.ToLower(a.Name)] = a.Name
}
// name resolves the stored attribute name for attrType case-insensitively,
// registering a new attribute (preserving the request's casing) if none matches.
name := func(attrType string) string {
if n, ok := index[strings.ToLower(attrType)]; ok {
return n
}
index[strings.ToLower(attrType)] = attrType
order = append(order, attrType)
return attrType
}
for _, change := range mr.Changes {
attrType := change.Modification.Type
vals := change.Modification.Vals
switch change.Operation {
case ldap.ReplaceAttribute:
n := name(attrType)
cp := make([]string, len(vals))
copy(cp, vals)
attrs[n] = cp
case ldap.AddAttribute:
n := name(attrType)
attrs[n] = append(attrs[n], vals...)
case ldap.DeleteAttribute:
if n, ok := index[strings.ToLower(attrType)]; ok {
if len(vals) == 0 {
// whole-attribute delete
delete(attrs, n)
} else {
kept := removeValues(attrs[n], vals)
if len(kept) == 0 {
// the last value was removed; a real server drops the attribute
delete(attrs, n)
} else {
attrs[n] = kept
}
}
}
}
}
dn := base.DN
if mr.DN != "" {
dn = mr.DN
}
result := ldap.NewEntry(dn, nil)
result.Attributes = make([]*ldap.EntryAttribute, 0, len(order))
for _, n := range order {
v, ok := attrs[n]
if !ok {
// deleted attribute
continue
}
result.Attributes = append(result.Attributes, ldap.NewEntryAttribute(n, v))
}
return result
}
// removeValues returns have with every element of remove stripped out.
func removeValues(have, remove []string) []string {
if len(have) == 0 {
return have
}
drop := make(map[string]struct{}, len(remove))
for _, r := range remove {
drop[r] = struct{}{}
}
kept := make([]string, 0, len(have))
for _, v := range have {
if _, ok := drop[v]; ok {
continue
}
kept = append(kept, v)
}
return kept
}
@@ -0,0 +1,824 @@
package identity
import (
"context"
"strings"
"sync/atomic"
"testing"
"time"
"github.com/go-ldap/ldap/v3"
libregraph "github.com/owncloud/libre-graph-api-go"
"github.com/owncloud/ocis/v2/ocis-pkg/log"
"github.com/owncloud/ocis/v2/services/graph/pkg/identity/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
func TestAttrsFromAddRequest(t *testing.T) {
ar := ldap.NewAddRequest("uid=alice,ou=people,dc=test", nil)
ar.Attribute("uid", []string{"alice"})
ar.Attribute("displayname", []string{"Alice Example"})
ar.Attribute("mail", []string{"alice@example.org", "a@example.org"})
attrs := attrsFromAddRequest(ar)
assert.Equal(t, []string{"alice"}, attrs["uid"])
assert.Equal(t, []string{"Alice Example"}, attrs["displayname"])
assert.Equal(t, []string{"alice@example.org", "a@example.org"}, attrs["mail"])
// round-trips through ldap.NewEntry with case-insensitive lookup
e := ldap.NewEntry(ar.DN, attrs)
assert.Equal(t, ar.DN, e.DN)
assert.Equal(t, "alice", e.GetEqualFoldAttributeValue("UID"))
assert.Equal(t, "Alice Example", e.GetEqualFoldAttributeValue("displayName"))
assert.Equal(t, []string{"alice@example.org", "a@example.org"}, e.GetEqualFoldAttributeValues("mail"))
}
// TestAttrsFromAddRequestDoesNotAliasRequest guards against attrsFromAddRequest
// returning slices that alias ar.Attributes[].Vals: mutating the returned map must
// never change the AddRequest's own values, and vice versa.
func TestAttrsFromAddRequestDoesNotAliasRequest(t *testing.T) {
ar := ldap.NewAddRequest("uid=alice,ou=people,dc=test", nil)
ar.Attribute("mail", []string{"alice@example.org"})
attrs := attrsFromAddRequest(ar)
attrs["mail"][0] = "mutated@example.org"
assert.Equal(t, []string{"alice@example.org"}, ar.Attributes[0].Vals)
}
func TestApplyModifyToEntry(t *testing.T) {
base := ldap.NewEntry("uid=alice,ou=people,dc=test", map[string][]string{
"uid": {"alice"},
"displayname": {"Alice Example"},
"mail": {"alice@example.org"},
"member": {"cn=a", "cn=b"},
})
t.Run("Replace overwrites existing attribute", func(t *testing.T) {
mr := &ldap.ModifyRequest{DN: base.DN}
mr.Replace("displayname", []string{"Alice New"})
got := applyModifyToEntry(base, mr)
assert.Equal(t, "Alice New", got.GetEqualFoldAttributeValue("displayname"))
})
t.Run("Replace adds a not-yet-present attribute", func(t *testing.T) {
mr := &ldap.ModifyRequest{DN: base.DN}
mr.Replace("givenname", []string{"Alice"})
got := applyModifyToEntry(base, mr)
assert.Equal(t, "Alice", got.GetEqualFoldAttributeValue("givenname"))
})
t.Run("Add appends to existing attribute", func(t *testing.T) {
mr := &ldap.ModifyRequest{DN: base.DN}
mr.Add("member", []string{"cn=c"})
got := applyModifyToEntry(base, mr)
assert.Equal(t, []string{"cn=a", "cn=b", "cn=c"}, got.GetEqualFoldAttributeValues("member"))
})
t.Run("Delete whole attribute", func(t *testing.T) {
mr := &ldap.ModifyRequest{DN: base.DN}
mr.Delete("mail", []string{})
got := applyModifyToEntry(base, mr)
assert.Empty(t, got.GetEqualFoldAttributeValues("mail"))
})
t.Run("Delete specific value", func(t *testing.T) {
mr := &ldap.ModifyRequest{DN: base.DN}
mr.Delete("member", []string{"cn=a"})
got := applyModifyToEntry(base, mr)
assert.Equal(t, []string{"cn=b"}, got.GetEqualFoldAttributeValues("member"))
})
t.Run("Delete last remaining value drops the attribute", func(t *testing.T) {
single := ldap.NewEntry(base.DN, map[string][]string{
"member": {"cn=a"},
})
mr := &ldap.ModifyRequest{DN: single.DN}
mr.Delete("member", []string{"cn=a"})
got := applyModifyToEntry(single, mr)
assert.Empty(t, got.GetEqualFoldAttributeValues("member"))
for _, a := range got.Attributes {
assert.NotEqual(t, "member", strings.ToLower(a.Name), "attribute must be dropped, not left empty")
}
})
t.Run("nil ModifyRequest returns base unchanged", func(t *testing.T) {
got := applyModifyToEntry(base, nil)
assert.Equal(t, base.DN, got.DN)
assert.Equal(t, "Alice Example", got.GetEqualFoldAttributeValue("displayname"))
assert.Equal(t, []string{"cn=a", "cn=b"}, got.GetEqualFoldAttributeValues("member"))
})
t.Run("nil base returns nil", func(t *testing.T) {
mr := &ldap.ModifyRequest{DN: "uid=alice,ou=people,dc=test"}
mr.Replace("displayname", []string{"Alice New"})
got := applyModifyToEntry(nil, mr)
assert.Nil(t, got)
})
t.Run("case-insensitive match creates no duplicate", func(t *testing.T) {
mr := &ldap.ModifyRequest{DN: base.DN}
mr.Replace("DisplayName", []string{"Alice Caps"})
got := applyModifyToEntry(base, mr)
assert.Equal(t, "Alice Caps", got.GetEqualFoldAttributeValue("displayname"))
// exactly one attribute entry whose name folds to displayname
count := 0
for _, a := range got.Attributes {
if strings.EqualFold(a.Name, "displayname") {
count++
}
}
assert.Equal(t, 1, count)
})
t.Run("base is never mutated", func(t *testing.T) {
mr := &ldap.ModifyRequest{DN: base.DN}
mr.Replace("displayname", []string{"Mutated"})
mr.Add("member", []string{"cn=z"})
mr.Delete("mail", []string{})
_ = applyModifyToEntry(base, mr)
assert.Equal(t, "Alice Example", base.GetEqualFoldAttributeValue("displayname"))
assert.Equal(t, []string{"cn=a", "cn=b"}, base.GetEqualFoldAttributeValues("member"))
assert.Equal(t, "alice@example.org", base.GetEqualFoldAttributeValue("mail"))
})
t.Run("Replace populates ByteValues for raw accessors", func(t *testing.T) {
mr := &ldap.ModifyRequest{DN: base.DN}
mr.Replace("displayname", []string{"Raw Value"})
got := applyModifyToEntry(base, mr)
assert.Equal(t, []byte("Raw Value"), got.GetEqualFoldRawAttributeValue("displayname"))
})
}
// TestCreateUserReadBackRetriedOnStaleReplica asserts that with useServerUUID=true
// the server-assigned-UUID read-back is retried when it hits a lagging replica. A
// stale replica answers the base-scoped Search with a successful 0-entry result
// (surfaced as ErrNotFound above the connection-level retry layer, which only sees
// LDAP error codes), so getUserByDN is retried on ErrNotFound. Here the second read
// finds the entry: Search is called twice and CreateUser succeeds.
func TestCreateUserReadBackRetriedOnStaleReplica(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
user := libregraph.NewUser("DisplayName", "user")
user.SetMail("user@example")
user.SetAccountEnabled(true)
user.SetUserType("Member")
var written *ldap.AddRequest
var searchCalls int32
l := &mocks.Client{}
l.On("Add", mock.Anything).Run(func(args mock.Arguments) {
written = args.Get(0).(*ldap.AddRequest)
}).Return(nil)
l.On("Search", mock.MatchedBy(func(sr *ldap.SearchRequest) bool {
return sr.Scope == ldap.ScopeBaseObject
})).Return(func(sr *ldap.SearchRequest) *ldap.SearchResult {
if atomic.AddInt32(&searchCalls, 1) == 1 {
return &ldap.SearchResult{Entries: []*ldap.Entry{}} // stale replica: not yet visible
}
// Once visible, the entry carries the server-assigned UUID (with
// useServerUUID the id is not in the AddRequest — the directory generates it).
attrs := attrsFromAddRequest(written)
attrs["entryUUID"] = []string{"server-assigned-uuid"}
return &ldap.SearchResult{Entries: []*ldap.Entry{ldap.NewEntry(written.DN, attrs)}}
}, nil)
c := lconfig
c.UseServerUUID = true
b, err := NewLDAPBackend(l, c, &logger, "")
assert.Nil(t, err)
newUser, err := b.CreateUser(context.Background(), *user)
assert.NoError(t, err)
assert.NotNil(t, newUser)
assert.Equal(t, int32(2), atomic.LoadInt32(&searchCalls),
"read-back is retried once on the stale 0-entry result, then finds the entry")
}
// TestReadBackAfterWriteExhaustsRetriesReturnsNotFound asserts a read-back that
// stays stale for every attempt surfaces ErrNotFound after exactly RetryMaxCount+1
// reads rather than looping forever. With RetryMaxCount=2 that is 3 reads.
func TestReadBackAfterWriteExhaustsRetriesReturnsNotFound(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
user := libregraph.NewUser("DisplayName", "user")
user.SetMail("user@example")
user.SetAccountEnabled(true)
user.SetUserType("Member")
var searchCalls int32
l := &mocks.Client{}
l.On("Add", mock.Anything).Return(nil)
// Every read-back sees the stale replica: 0 entries, nil error.
l.On("Search", mock.MatchedBy(func(sr *ldap.SearchRequest) bool {
return sr.Scope == ldap.ScopeBaseObject
})).Return(func(sr *ldap.SearchRequest) *ldap.SearchResult {
atomic.AddInt32(&searchCalls, 1)
return &ldap.SearchResult{Entries: []*ldap.Entry{}}
}, nil)
c := lconfig
c.UseServerUUID = true
c.RetryMaxCount = 2 // 1 initial read + 2 retries = 3 reads
b, err := NewLDAPBackend(l, c, &logger, "")
assert.Nil(t, err)
newUser, err := b.CreateUser(context.Background(), *user)
assert.Error(t, err)
assert.Nil(t, newUser)
assert.Equal(t, int32(3), atomic.LoadInt32(&searchCalls),
"read-back is bounded at RetryMaxCount+1 attempts, not an unbounded loop")
}
// TestCreateUserSynthesizesWhenNotServerUUID asserts that with useServerUUID=false
// CreateUser builds the response model from the AddRequest instead of reading the
// entry back — i.e. no Search is issued after the Add.
func TestCreateUserSynthesizesWhenNotServerUUID(t *testing.T) {
displayName := "DisplayName"
mail := "user@example"
userName := "user"
surname := "surname"
givenName := "givenName"
userType := "Member"
l := &mocks.Client{}
// Add succeeds; Search must NOT be called (no read-back).
l.On("Add", mock.Anything).Return(nil)
logger := log.NewLogger(log.Level("debug"))
user := libregraph.NewUser(displayName, userName)
user.SetMail(mail)
user.SetSurname(surname)
user.SetGivenName(givenName)
user.SetAccountEnabled(true)
user.SetUserType(userType)
c := lconfig
c.UseServerUUID = false
b, err := NewLDAPBackend(l, c, &logger, "")
assert.Nil(t, err)
newUser, err := b.CreateUser(context.Background(), *user)
assert.Nil(t, err)
assert.Equal(t, displayName, newUser.GetDisplayName())
assert.Equal(t, mail, newUser.GetMail())
assert.Equal(t, userName, newUser.GetOnPremisesSamAccountName())
assert.Equal(t, givenName, newUser.GetGivenName())
assert.Equal(t, surname, newUser.GetSurname())
assert.True(t, newUser.GetAccountEnabled())
assert.Equal(t, userType, newUser.GetUserType())
// oCIS generated the id and wrote it into the Add; it must be present on the model.
assert.NotEmpty(t, newUser.GetId())
l.AssertNotCalled(t, "Search", mock.Anything)
}
// TestCreateUserSynthesizedModelEqualsReadBack is the regression guard: the model
// CreateUser returns from the synthesize path (useServerUUID=false) must equal the
// model the unchanged builder produces from the entry a read-back would have returned
// — i.e. the server's echo of exactly what oCIS wrote. Eliminating the read-back must
// not change the CreateUser response for any populated field.
func TestCreateUserSynthesizedModelEqualsReadBack(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
user := libregraph.NewUser("DisplayName", "user")
user.SetMail("user@example")
user.SetSurname("surname")
user.SetGivenName("givenName")
user.SetAccountEnabled(true)
user.SetUserType("Member")
// Capture the AddRequest so we can reproduce the entry a read-back would return.
var written *ldap.AddRequest
l := &mocks.Client{}
l.On("Add", mock.Anything).Run(func(args mock.Arguments) {
written = args.Get(0).(*ldap.AddRequest)
}).Return(nil)
c := lconfig
c.UseServerUUID = false
b, err := NewLDAPBackend(l, c, &logger, "")
assert.Nil(t, err)
synthUser, err := b.CreateUser(context.Background(), *user)
assert.Nil(t, err)
// Ground truth: what the old read-back path would have built. A base-scoped search
// on the DN returns exactly the attributes that were written, so the read-back entry
// is ldap.NewEntry over the captured AddRequest.
readBackEntry := ldap.NewEntry(written.DN, attrsFromAddRequest(written))
readBackModel := b.createUserModelFromLDAP(readBackEntry)
assert.Equal(t, readBackModel, synthUser)
}
// TestSynthesizedEntryPopulatesInstancesWithoutSearch is the regression guard for the
// attribute-sourced multi-instance fields. With instanceURLTemplate +
// crossInstanceReferenceTemplate configured and instanceMapperEnabled=false, building a
// user model from a synthesized entry (as the create/update fold paths do) must populate
// user.Instances / CrossInstanceReference AND must not issue a live Search — the codepath
// only searches when instanceMapperEnabled=true, which is mutually exclusive with the
// "no second LDAP call" guarantee (see the design spec's Testing section).
func TestSynthesizedEntryPopulatesInstancesWithoutSearch(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
c := lconfig
c.UserMemberAttribute = "ocMemberOfInstance"
c.InstanceURLTemplate = "https://{{.Instancename}}.example.org"
c.CrossInstanceReferenceTemplate = "{{.Username}}@{{.Instancename}}"
c.InstanceMapperEnabled = false
l := &mocks.Client{}
// A non-empty instanceID is required for the instance templates to be parsed.
b, err := NewLDAPBackend(l, c, &logger, "instanceA")
assert.Nil(t, err)
// Synthesized entry as attrsFromAddRequest + ldap.NewEntry would produce, carrying a
// member-of-instance value so the Instances loop runs.
entry := ldap.NewEntry("uid=user,ou=people,dc=test", map[string][]string{
"uid": {"user"},
"displayname": {"DisplayName"},
"mail": {"user@example"},
"entryUUID": {"abcd-defg"},
"ocMemberOfInstance": {"instanceA"},
})
model := b.createUserModelFromLDAP(entry)
assert.NotNil(t, model)
assert.NotEmpty(t, model.Instances)
assert.Equal(t, "https://instanceA.example.org", model.Instances[0].GetUrl())
assert.NotNil(t, model.CrossInstanceReference)
assert.Equal(t, "user@instanceA", model.GetCrossInstanceReference())
// instanceMapperEnabled=false → getInstance returns the value verbatim, no Search.
l.AssertNotCalled(t, "Search", mock.Anything)
}
// TestCreateGroupSynthesizesWhenNotServerUUID asserts CreateGroup builds its response
// from the AddRequest (no read-back) when oCIS generated the id itself.
func TestCreateGroupSynthesizesWhenNotServerUUID(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
// oCIS writes the generated group id under the configured GroupIDAttribute, so the
// synthesized entry must carry the id under that attribute for the model builder.
c := lconfig
c.UseServerUUID = false
c.GroupIDAttribute = "owncloudUUID"
var written *ldap.AddRequest
l := &mocks.Client{}
l.On("Add", mock.Anything).Run(func(args mock.Arguments) {
written = args.Get(0).(*ldap.AddRequest)
}).Return(nil)
b, err := NewLDAPBackend(l, c, &logger, "")
assert.Nil(t, err)
group := libregraph.NewGroup()
group.SetDisplayName("mygroup")
newGroup, err := b.CreateGroup(context.Background(), *group)
assert.Nil(t, err)
assert.Equal(t, "mygroup", newGroup.GetDisplayName())
assert.NotEmpty(t, newGroup.GetId())
l.AssertNotCalled(t, "Search", mock.Anything)
// parity with the read-back-derived model
readBackModel := b.createGroupModelFromLDAP(ldap.NewEntry(written.DN, attrsFromAddRequest(written)))
assert.Equal(t, readBackModel, newGroup)
}
// TestCreateEducationUserSynthesizesWhenNotServerUUID asserts CreateEducationUser
// synthesizes its response (no read-back) when oCIS generated the id itself.
func TestCreateEducationUserSynthesizesWhenNotServerUUID(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
c := eduConfig
c.UseServerUUID = false
var written *ldap.AddRequest
l := &mocks.Client{}
l.On("Add", mock.Anything).Run(func(args mock.Arguments) {
written = args.Get(0).(*ldap.AddRequest)
}).Return(nil)
b, err := getMockedBackend(l, c, &logger)
assert.Nil(t, err)
user := libregraph.NewEducationUser()
user.SetDisplayName("Test User")
user.SetOnPremisesSamAccountName("testuser")
user.SetMail("testuser@example.org")
user.SetPrimaryRole("student")
user.SetUserType("Member")
user.SetAccountEnabled(false)
user.SetExternalID("ext-ernal-id")
eduUser, err := b.CreateEducationUser(context.Background(), *user)
assert.Nil(t, err)
assert.Equal(t, "Test User", eduUser.GetDisplayName())
assert.Equal(t, "testuser", eduUser.GetOnPremisesSamAccountName())
assert.NotEmpty(t, eduUser.GetId())
l.AssertNotCalled(t, "Search", mock.Anything)
readBackModel := b.createEducationUserModelFromLDAP(ldap.NewEntry(written.DN, attrsFromAddRequest(written)))
assert.Equal(t, readBackModel, eduUser)
}
// TestCreateEducationClassSynthesizesWhenNotServerUUID asserts CreateEducationClass
// synthesizes its response (no read-back) when oCIS generated the id itself.
func TestCreateEducationClassSynthesizesWhenNotServerUUID(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
c := eduConfig
c.UseServerUUID = false
c.GroupIDAttribute = "owncloudUUID"
var written *ldap.AddRequest
l := &mocks.Client{}
l.On("Add", mock.Anything).Run(func(args mock.Arguments) {
written = args.Get(0).(*ldap.AddRequest)
}).Return(nil)
b, err := getMockedBackend(l, c, &logger)
assert.Nil(t, err)
class := libregraph.NewEducationClass()
class.SetExternalId("Math0123")
class.SetDisplayName("Math")
class.SetClassification("course")
resClass, err := b.CreateEducationClass(context.Background(), *class)
assert.Nil(t, err)
assert.Equal(t, "Math", resClass.GetDisplayName())
assert.Equal(t, "Math0123", resClass.GetExternalId())
assert.Equal(t, "course", resClass.GetClassification())
assert.NotEmpty(t, resClass.GetId())
l.AssertNotCalled(t, "Search", mock.Anything)
readBackModel := b.createEducationClassModelFromLDAP(ldap.NewEntry(written.DN, attrsFromAddRequest(written)))
assert.Equal(t, readBackModel, resClass)
}
// TestCreateEducationSchoolSynthesizesWhenNotServerUUID asserts CreateEducationSchool
// synthesizes its response (no read-back) when oCIS generated the id itself. The
// pre-create duplicate-number Search still fires; only the read-back is eliminated.
func TestCreateEducationSchoolSynthesizesWhenNotServerUUID(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
c := eduConfig
c.UseServerUUID = false
var written *ldap.AddRequest
l := &mocks.Client{}
l.On("Add", mock.Anything).Run(func(args mock.Arguments) {
written = args.Get(0).(*ldap.AddRequest)
}).Return(nil)
// The duplicate-schoolNumber lookup before Add is a subtree search that returns
// "not found" so create proceeds. No base-scoped read-back must follow the Add.
l.On("Search", mock.MatchedBy(func(sr *ldap.SearchRequest) bool {
return sr.Scope == ldap.ScopeWholeSubtree
})).Return(&ldap.SearchResult{Entries: []*ldap.Entry{}}, nil)
b, err := getMockedBackend(l, c, &logger)
assert.Nil(t, err)
school := libregraph.NewEducationSchool()
school.SetDisplayName("Test School")
school.SetSchoolNumber("0123")
resSchool, err := b.CreateEducationSchool(context.Background(), *school)
assert.Nil(t, err)
assert.Equal(t, "Test School", resSchool.GetDisplayName())
assert.Equal(t, "0123", resSchool.GetSchoolNumber())
assert.NotEmpty(t, resSchool.GetId())
// no base-scoped read-back on the created school DN
l.AssertNotCalled(t, "Search", mock.MatchedBy(func(sr *ldap.SearchRequest) bool {
return sr.Scope == ldap.ScopeBaseObject
}))
readBackModel := b.createSchoolModelFromLDAP(ldap.NewEntry(written.DN, attrsFromAddRequest(written)))
assert.Equal(t, readBackModel, resSchool)
}
// TestUpdateUserFoldsNoReadBack asserts a non-rename UpdateUser does not read the
// entry back: it pre-reads once, Modifies, and folds the ModifyRequest onto the
// pre-read entry to build the response.
func TestUpdateUserFoldsNoReadBack(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
preRead := ldap.NewEntry("uid=user,ou=people,dc=test", map[string][]string{
"uid": {"user"},
"displayname": {"Old Name"},
"mail": {"old@example.org"},
"entryUUID": {"abcd-defg"},
"userTypeAttribute": {"Member"},
})
l := &mocks.Client{}
// Pre-read (subtree search by name/id) returns the entry once.
l.On("Search", mock.MatchedBy(func(sr *ldap.SearchRequest) bool {
return sr.Scope == ldap.ScopeWholeSubtree
})).Return(&ldap.SearchResult{Entries: []*ldap.Entry{preRead}}, nil).Once()
l.On("Modify", mock.Anything).Return(nil)
b, err := getMockedBackend(l, lconfig, &logger)
assert.Nil(t, err)
id := "abcd-defg"
newMail := "new@example.org"
update := libregraph.UserUpdate{Mail: &newMail}
update.Id = &id
got, err := b.UpdateUser(context.Background(), "user", update)
assert.Nil(t, err)
assert.Equal(t, newMail, got.GetMail())
assert.Equal(t, "Old Name", got.GetDisplayName())
assert.Equal(t, "abcd-defg", got.GetId())
// No base-scoped read-back after the Modify.
l.AssertNotCalled(t, "Search", mock.MatchedBy(func(sr *ldap.SearchRequest) bool {
return sr.Scope == ldap.ScopeBaseObject
}))
}
// TestUpdateEducationUserFoldsNoReadBack asserts a non-rename UpdateEducationUser
// folds the ModifyRequest onto the pre-read entry rather than reading it back.
func TestUpdateEducationUserFoldsNoReadBack(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
preRead := ldap.NewEntry("uid=testuser,ou=people,dc=test", map[string][]string{
"uid": {"testuser"},
"displayname": {"Test User"},
"mail": {"old@example.org"},
"entryUUID": {"abcd-defg"},
"userClass": {"student"},
"userTypeAttribute": {"Member"},
})
l := &mocks.Client{}
// Pre-read by name/id (subtree) returns the entry; no base-scoped read-back after.
l.On("Search", mock.MatchedBy(func(sr *ldap.SearchRequest) bool {
return sr.Scope == ldap.ScopeWholeSubtree
})).Return(&ldap.SearchResult{Entries: []*ldap.Entry{preRead}}, nil).Once()
l.On("Modify", mock.Anything).Return(nil)
b, err := getMockedBackend(l, eduConfig, &logger)
assert.Nil(t, err)
newMail := "new@example.org"
user := libregraph.NewEducationUser()
user.SetMail(newMail)
got, err := b.UpdateEducationUser(context.Background(), "testuser", *user)
assert.Nil(t, err)
assert.Equal(t, newMail, got.GetMail())
assert.Equal(t, "Test User", got.GetDisplayName())
assert.Equal(t, "abcd-defg", got.GetId())
l.AssertNotCalled(t, "Search", mock.MatchedBy(func(sr *ldap.SearchRequest) bool {
return sr.Scope == ldap.ScopeBaseObject
}))
}
// TestUpdateEducationSchoolFoldsNoReadBack asserts UpdateEducationSchool folds the
// applied property changes onto the pre-read entry rather than reading it back.
func TestUpdateEducationSchoolFoldsNoReadBack(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
preRead := ldap.NewEntry("ou=Test School", map[string][]string{
"ou": {"Test School"},
"ocEducationSchoolNumber": {"0123"},
"owncloudUUID": {"abcd-defg"},
})
l := &mocks.Client{}
// Single pre-read; the termination Replace is folded on. No second Search.
l.On("Search", mock.Anything).Return(&ldap.SearchResult{Entries: []*ldap.Entry{preRead}}, nil).Once()
l.On("Modify", mock.Anything).Return(nil)
b, err := getMockedBackend(l, eduConfig, &logger)
assert.Nil(t, err)
school := libregraph.NewEducationSchool()
terminationTime := time.Date(2042, time.January, 31, 12, 0, 0, 0, time.UTC)
school.SetTerminationDate(terminationTime)
got, err := b.UpdateEducationSchool(context.Background(), "abcd-defg", *school)
assert.Nil(t, err)
assert.Equal(t, "Test School", got.GetDisplayName())
assert.Equal(t, "abcd-defg", got.GetId())
assert.Equal(t, "0123", got.GetSchoolNumber())
// the folded termination date is reflected in the response
assert.True(t, got.HasTerminationDate())
assert.True(t, terminationTime.Equal(got.GetTerminationDate()))
l.AssertNumberOfCalls(t, "Search", 1)
}
// TestUpdateEducationClassFoldPreservesClassificationAndExternalID guards the Site 9
// regression: folding must not drop classification/externalID from the response, even
// on an update that only changes displayName. It also asserts no read-back after Modify.
func TestUpdateEducationClassFoldPreservesClassificationAndExternalID(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
// Full education-class entry as getEducationClassByID would return it.
preRead := ldap.NewEntry("ocEducationExternalId=Math0123,ou=groups,dc=test", map[string][]string{
"cn": {"Math"},
"entryUUID": {"abcd-defg"},
"ocEducationExternalId": {"Math0123"},
"ocEducationClassType": {"course"},
})
l := &mocks.Client{}
l.On("Search", mock.Anything).Return(&ldap.SearchResult{Entries: []*ldap.Entry{preRead}}, nil).Once()
l.On("Modify", mock.Anything).Return(nil)
b, err := getMockedBackend(l, eduConfig, &logger)
assert.Nil(t, err)
newName := "Math-2"
class := libregraph.EducationClass{DisplayName: &newName}
got, err := b.UpdateEducationClass(context.Background(), "abcd-defg", class)
assert.Nil(t, err)
assert.Equal(t, "Math-2", got.GetDisplayName())
assert.Equal(t, "abcd-defg", got.GetId())
// classification and externalID must survive a displayName-only update
assert.Equal(t, "course", got.GetClassification())
assert.Equal(t, "Math0123", got.GetExternalId())
l.AssertNotCalled(t, "Search", mock.MatchedBy(func(sr *ldap.SearchRequest) bool {
return sr.Scope == ldap.ScopeBaseObject
}))
}
// TestCreateGroupSynthesizesWithNonDefaultIDAttribute guards the fix for the
// hardcoded "owncloudUUID" id write: the generated id must be stored under the
// configured GroupIDAttribute, otherwise the synthesized model has no id and
// createGroupModelFromLDAP returns nil (CreateGroup would return (nil, nil)).
func TestCreateGroupSynthesizesWithNonDefaultIDAttribute(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
c := lconfig
c.UseServerUUID = false
c.GroupIDAttribute = "entryUUID" // non-default: previously the id was written to owncloudUUID only
var written *ldap.AddRequest
l := &mocks.Client{}
l.On("Add", mock.Anything).Run(func(args mock.Arguments) {
written = args.Get(0).(*ldap.AddRequest)
}).Return(nil)
b, err := NewLDAPBackend(l, c, &logger, "")
assert.Nil(t, err)
group := libregraph.NewGroup()
group.SetDisplayName("mygroup")
newGroup, err := b.CreateGroup(context.Background(), *group)
assert.Nil(t, err)
assert.NotNil(t, newGroup)
assert.Equal(t, "mygroup", newGroup.GetDisplayName())
// the id was written under the configured attribute and survives synthesis
assert.NotEmpty(t, newGroup.GetId())
assert.NotEmpty(t, written.Attributes)
// the AddRequest carries the id under the configured attribute, not "owncloudUUID"
var idFromConfigured, idFromHardcoded string
for _, a := range written.Attributes {
switch a.Type {
case c.GroupIDAttribute:
if len(a.Vals) > 0 {
idFromConfigured = a.Vals[0]
}
case "owncloudUUID":
if len(a.Vals) > 0 {
idFromHardcoded = a.Vals[0]
}
}
}
assert.NotEmpty(t, idFromConfigured, "id must be written under the configured GroupIDAttribute")
assert.Empty(t, idFromHardcoded, "id must not be written under a hardcoded owncloudUUID")
assert.Equal(t, idFromConfigured, newGroup.GetId())
l.AssertNotCalled(t, "Search", mock.Anything)
}
// TestCreateEducationClassSynthesizesWithNonDefaultIDAttribute guards the same
// hardcoded-id fix on the education-class create path, which reuses
// groupToLDAPAttrValues.
func TestCreateEducationClassSynthesizesWithNonDefaultIDAttribute(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
c := eduConfig
c.UseServerUUID = false
c.GroupIDAttribute = "entryUUID" // non-default
l := &mocks.Client{}
l.On("Add", mock.Anything).Return(nil)
b, err := getMockedBackend(l, c, &logger)
assert.Nil(t, err)
class := libregraph.NewEducationClass()
class.SetExternalId("Math0123")
class.SetDisplayName("Math")
class.SetClassification("course")
resClass, err := b.CreateEducationClass(context.Background(), *class)
assert.Nil(t, err)
assert.NotNil(t, resClass)
assert.Equal(t, "Math", resClass.GetDisplayName())
// the id survives synthesis under the configured attribute
assert.NotEmpty(t, resClass.GetId())
l.AssertNotCalled(t, "Search", mock.Anything)
}
// TestGetGroupByNameUsesGroupNameAttribute guards the fix for the name-only lookup
// branch of getLDAPGroupByNameOrID, which previously filtered by the user name
// attribute (uid) instead of the group name attribute (cn), so a group could never
// be found by name. That else-branch is reached when filterEscapeUUID errors, which
// happens for a non-UUID name when the id attribute is an octet string. The lookup
// is exercised directly so the assertion isolates the filter, independent of model
// building.
func TestGetGroupByNameUsesGroupNameAttribute(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
c := lconfig
// Octet-string group IDs require server-assigned UUIDs; this also makes
// filterEscapeUUID error on a non-UUID name, reaching the name-only else branch.
c.UseServerUUID = true
c.GroupIDIsOctetString = true
var groupSearch *ldap.SearchRequest
l := &mocks.Client{}
l.On("Search", mock.Anything).Run(func(args mock.Arguments) {
groupSearch = args.Get(0).(*ldap.SearchRequest)
}).Return(&ldap.SearchResult{Entries: []*ldap.Entry{groupEntry}}, nil)
b, err := getMockedBackend(l, c, &logger)
assert.Nil(t, err)
_, err = b.getLDAPGroupByNameOrID("group", false)
assert.Nil(t, err)
assert.NotNil(t, groupSearch)
// the filter must use the group name attribute (cn), not the user name attribute (uid)
assert.Contains(t, groupSearch.Filter, "("+b.groupAttributeMap.name+"=group)")
assert.NotContains(t, groupSearch.Filter, b.userAttributeMap.userName+"=group")
}
// TestNewLDAPBackendRejectsOctetStringWithoutServerUUID guards the fail-fast check:
// octet-string ID attributes (server-assigned, e.g. AD objectGUID) are incompatible
// with UseServerUUID=false, where oCIS generates string UUIDs. The combination must
// be rejected at startup rather than silently producing corrupt IDs.
func TestNewLDAPBackendRejectsOctetStringWithoutServerUUID(t *testing.T) {
logger := log.NewLogger(log.Level("debug"))
l := &mocks.Client{}
t.Run("user octet-string without server UUID is rejected", func(t *testing.T) {
c := lconfig
c.UseServerUUID = false
c.UserIDIsOctetString = true
_, err := NewLDAPBackend(l, c, &logger, "")
assert.Error(t, err)
})
t.Run("group octet-string without server UUID is rejected", func(t *testing.T) {
c := lconfig
c.UseServerUUID = false
c.GroupIDIsOctetString = true
_, err := NewLDAPBackend(l, c, &logger, "")
assert.Error(t, err)
})
t.Run("octet-string with server UUID is allowed", func(t *testing.T) {
c := lconfig
c.UseServerUUID = true
c.UserIDIsOctetString = true
c.GroupIDIsOctetString = true
_, err := NewLDAPBackend(l, c, &logger, "")
assert.NoError(t, err)
})
t.Run("string IDs without server UUID is allowed", func(t *testing.T) {
c := lconfig
c.UseServerUUID = false
c.UserIDIsOctetString = false
c.GroupIDIsOctetString = false
_, err := NewLDAPBackend(l, c, &logger, "")
assert.NoError(t, err)
})
}
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-28 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Ivan Fustero, 2026\n"
"Language-Team: Catalan (https://app.transifex.com/owncloud-org/teams/6149/ca/)\n"
@@ -80,7 +80,7 @@ msgstr "Pot editar amb versions i mostrar invitacions"
#. UnifiedRole SpaceEditor, Role DisplayName (resolves directly)
#: pkg/unifiedrole/roles.go:232
msgid "Can edit with versions and trash bin"
msgstr ""
msgstr "Es pot editar amb versions i paperera"
#. Manager
#. UnifiedRole Manager, Role DisplayName (resolves directly)
@@ -120,7 +120,7 @@ msgid "Deny all access."
msgstr "Denega tot accés."
#. default description for new spaces
#: pkg/service/v0/spacetemplates.go:32
#: pkg/service/v0/spacetemplates.go:33
msgid "Here you can add a description for this Space."
msgstr "Aquí podeu afegir una descripció per a aquest espai."
@@ -175,6 +175,8 @@ msgstr "Visualitza, descarrega, carrega, edita i mostra totes les versions."
#: pkg/unifiedrole/roles.go:210
msgid "View, download, upload, edit, add, delete and restore from trash bin."
msgstr ""
"Visualitza, descarrega, carrega, edita, afegeix, elimina i restaura de la "
"paperera."
#. UnifiedRole EditorListGrants Editor, Role Description (resolves directly)
#: pkg/unifiedrole/roles.go:158
@@ -189,6 +191,8 @@ msgid ""
"View, download, upload, edit, add, delete, show all versions and restore "
"from trash bin."
msgstr ""
"Visualitza, descarrega, puja, edita, afegeix, suprimeix, mostra totes les "
"versions i restaura des de la paperera."
#. UnifiedRole Manager, Role Description (resolves directly)
#: pkg/unifiedrole/roles.go:242
@@ -196,6 +200,8 @@ msgid ""
"View, download, upload, edit, add, delete, show all versions, restore from "
"trash bin, empty the trash bin and manage members."
msgstr ""
"Visualitza, descarrega, puja, edita, afegeix, suprimeix, mostra totes les "
"versions, restaura des de la paperera, buida la paperera i gestiona membres."
#. UnifiedRole EditorListGrantsWithVersions, Role Description (resolves
#. directly)
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-05-07 03:20+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: David Walter, 2026\n"
"Language-Team: German (https://app.transifex.com/owncloud-org/teams/6149/de/)\n"
@@ -120,7 +120,7 @@ msgid "Deny all access."
msgstr "Jeder Zugriff ist verboten."
#. default description for new spaces
#: pkg/service/v0/spacetemplates.go:32
#: pkg/service/v0/spacetemplates.go:33
msgid "Here you can add a description for this Space."
msgstr "Hier können Sie eine Beschreibung für diesen Space einfügen."
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2026-04-28 03:18+0000\n"
"POT-Creation-Date: 2026-07-15 03:10+0000\n"
"PO-Revision-Date: 2026-01-02 10:10+0000\n"
"Last-Translator: Jesús Recio <jrecio@izertis.com>, 2026\n"
"Language-Team: Spanish (https://app.transifex.com/owncloud-org/teams/6149/es/)\n"
@@ -80,7 +80,7 @@ msgstr "Se puede editar con versiones y mostrar invitados"
#. UnifiedRole SpaceEditor, Role DisplayName (resolves directly)
#: pkg/unifiedrole/roles.go:232
msgid "Can edit with versions and trash bin"
msgstr ""
msgstr "Se puede editar con versiones y papelera"
#. Manager
#. UnifiedRole Manager, Role DisplayName (resolves directly)
@@ -120,7 +120,7 @@ msgid "Deny all access."
msgstr "Denegar todo el acceso."
#. default description for new spaces
#: pkg/service/v0/spacetemplates.go:32
#: pkg/service/v0/spacetemplates.go:33
msgid "Here you can add a description for this Space."
msgstr "Aquí puede añadir una descripción para este espacio."
@@ -173,6 +173,7 @@ msgstr "Ver, descargar, subir, editar, añadir y mostrar todas las versiones."
#: pkg/unifiedrole/roles.go:210
msgid "View, download, upload, edit, add, delete and restore from trash bin."
msgstr ""
"Ver, descargar, subir, editar, añadir, borrar y recuperar de la papelera."
#. UnifiedRole EditorListGrants Editor, Role Description (resolves directly)
#: pkg/unifiedrole/roles.go:158
@@ -186,6 +187,8 @@ msgid ""
"View, download, upload, edit, add, delete, show all versions and restore "
"from trash bin."
msgstr ""
"Ver, descargar subir, editar, añadir, borrar, mostrar todas las versiones y "
"recuperar de la papelera."
#. UnifiedRole Manager, Role Description (resolves directly)
#: pkg/unifiedrole/roles.go:242
@@ -193,6 +196,8 @@ msgid ""
"View, download, upload, edit, add, delete, show all versions, restore from "
"trash bin, empty the trash bin and manage members."
msgstr ""
"Ver, descargar, subir, editar, añadir, borrar, mostrar todas las versiones, "
"recuperar de la papelera, vaciar la papelera y gestionar miembros."
#. UnifiedRole EditorListGrantsWithVersions, Role Description (resolves
#. directly)
Loaded 100 of 2648 files, more files were not shown because too many files have changed in this diff. Show more