Compare commits

...
Author SHA1 Message Date
lars.jurgensen ddf18216be chore(OCISDEV-900): revert graphAPI markProcessing change 2026-08-24 15:18:48 +02:00
lars.jurgensen 04eefa1e6f chore(OCISDEV-900): bump reva version 2026-08-24 11:14:08 +02:00
lars.jurgensen bd374e47ff fix(OCISDEV-900): set upload_directory to StorageRoot/uploads in OCM revaconfig
Service-level upload_directory is used as-is by reva (no /uploads join).
Pass StorageRoot + "/uploads" explicitly so rootless-driver pattern is clear.
2026-08-19 17:19:54 +02:00
lars.jurgensen a5c539b9bb chore(OCISDEV-900): bump golang.org/x/mod to v0.40.0 (CVE-2026-56864/56865) 2026-08-19 16:58:16 +02:00
lars.jurgensen 98a353424c chore(OCISDEV-900): pin transitive deps to master versions after reva bump
Prevent unnecessary downgrades introduced by reva b1626ed21a.
Only intentional diff vs master: reva bump + ceph/go-ceph v0.41.0 (required by new reva).
2026-08-19 16:46:35 +02:00
lars.jurgensen 876a0ef418 refactor(OCISDEV-900): rebase onto master, bump reva to b1626ed21a
- Remove markprocessing opaque from TouchFile in personaldata.go
- Add upload_directory to OCM dataprovider and storageprovider revaconfig
- Add mount_id to storage-users dataprovider revaconfig
- Bump reva/v2 to b1626ed21a (feat: handle missing node id in tus)
2026-08-19 16:22:42 +02:00
Juan Pablo Villafañez be118f6bde fix: [OCISDEV-811] ignore write error after successful cache read (#12772)
* fix: [OCISDEV-811] ignore write error after successful cache read

* chore: add changelog entry
2026-08-19 09:29:35 +02:00
Matteo b97840e770 fix: [OCISDEV-1358] shift-click range selection in the files list (#12804)
* fix: [OCISDEV-1358] shift-click range selection in the files list

Shift-clicking a checkbox now triggers range selection, a plain
shift-click replaces the current selection instead of adding to it, and
the browser no longer highlights the text of the affected rows.

* fix: [OCISDEV-1358] keep the checkbox checked state in sync with the model

The browser toggles the native checked property on every click, while vue does
not re-patch an unchanged model-value, so the property stayed flipped whenever a
click did not change the selection, e.g. when a range selection keeps an already
selected resource selected. The tiles view worked around that by preventing the
default click action, which desyncs the property for good: chromium restores the
pre-click value after vue has already patched it, so it never follows the model
again.

Sync the native property from the model in OcCheckbox once the parent had its
chance to react to the change, and drop the workaround.
2026-08-18 13:04:08 +02:00
Pradip Subedi ed1bc5ec9f [tests-only][full-ci] test(apiGraphGroup): add acceptance test for configurable LDAP group object class (#12751)
* test(apiGraphGroup): add acceptance test for configurable LDAP group object class

* test(apiGraphGroup): make LDAP object class test portable across test environments

* test: use multilines for message assertion
2026-08-18 16:42:55 +05:45
Prajwol Amatya 4b4c630540 [tests-only][full-ci] test: restore totp for user in before scenario and rename the step name to ckeck acr value from jwt token (#12748)
* test: move deleteUserTotpCredentials to before scenario

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: refactor the step to check acr vaule

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

---------

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2026-08-18 14:36:40 +05:45
Martin 57e96f3438 fix: fix the introduction version of envvars (#12811) 2026-08-17 18:24:08 +00:00
dependabot[bot] b29dc89349 build(deps): bump the minor-and-patch group with 9 updates (#12805)
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` |


Updates `github.com/nats-io/nats-server/v2` from 2.14.4 to 2.14.5
- [Release notes](https://github.com/nats-io/nats-server/releases)
- [Changelog](https://github.com/nats-io/nats-server/blob/main/RELEASES.md)
- [Commits](https://github.com/nats-io/nats-server/compare/v2.14.4...v2.14.5)

Updates `github.com/nats-io/nats.go` from 1.52.0 to 1.53.1
- [Release notes](https://github.com/nats-io/nats.go/releases)
- [Commits](https://github.com/nats-io/nats.go/compare/v1.52.0...v1.53.1)

Updates `github.com/onsi/ginkgo/v2` from 2.32.0 to 2.32.1
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.32.0...v2.32.1)

Updates `github.com/sirupsen/logrus` from 1.9.4 to 1.10.0
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.4...v1.10.0)

Updates `golang.org/x/crypto` from 0.54.0 to 0.55.0
- [Commits](https://github.com/golang/crypto/compare/v0.54.0...v0.55.0)

Updates `golang.org/x/image` from 0.44.0 to 0.45.0
- [Commits](https://github.com/golang/image/compare/v0.44.0...v0.45.0)

Updates `golang.org/x/net` from 0.57.0 to 0.58.0
- [Commits](https://github.com/golang/net/compare/v0.57.0...v0.58.0)

Updates `golang.org/x/text` from 0.40.0 to 0.41.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.40.0...v0.41.0)

Updates `google.golang.org/protobuf` from 1.36.11 to 1.36.12

---
updated-dependencies:
- dependency-name: github.com/nats-io/nats-server/v2
  dependency-version: 2.14.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: github.com/nats-io/nats.go
  dependency-version: 1.53.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-version: 2.32.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: github.com/sirupsen/logrus
  dependency-version: 1.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: golang.org/x/crypto
  dependency-version: 0.55.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: golang.org/x/image
  dependency-version: 0.45.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: golang.org/x/net
  dependency-version: 0.58.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: golang.org/x/text
  dependency-version: 0.41.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-17 10:03:50 +02:00
Nalem7 1d319a4552 [tests-only][full-ci] add retry logic for file copy requests (#12781)
* test: add retry logic for file copy and move requests

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>

* test: add retry logic for file copy request only

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>

* test: add retry once for 500 status code only

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>

---------

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2026-08-17 10:46:51 +05:45
Nalem7 e75c48765c [tests-only][full-ci] test: add bug coverage tests for tag removal (#12655)
test: add coverage for idempotent tag removal

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2026-08-14 17:03:41 +05:45
Gaurav Soni ef41e736d1 fix: [OCISDEV-388] renaming a resource to its current name is a no-op (#12784)
A MOVE whose source and destination resolve to the same resource is now
answered with 204 No Content server side instead of a confusing 403 or
404, and instead of 409 Conflict on the id based dav route, so every
client behaves the same way. The no-op still requires the move
permission.

The server-side guard lives in reva (owncloud/reva#708 and the follow-up
owncloud/reva#713, which moves the guard above the recursion checks so it
is also reached when the request addresses the resource by its id).
Pulled in here by bumping reva to v2.0.0-20260813121157-d386075a0421.
vendor/ was regenerated with `go mod vendor`; no hand edits.

On the test side the @issue-1976 tags are dropped from the five MOVE
feature files and the corresponding entries are removed from both
expected-failures lists. Scenario Outlines that mix roles with and
without the move permission parameterize the expected status in an extra
http-status-code Examples column rather than being split into duplicate
scenarios. The gherlint newline_before_scenario rule is configured as
["error", 2, true], counting tag lines toward the total, so the eight
scenarios that lost their tag get back the blank line it occupied.

Drop the "viewer" row from the same-name Examples table in
moveByFileId.feature: "viewer" is not a valid space role for a
permissionsRole invitation, so the step errored with
Role 'viewer' not found, and the "Space Viewer" row already covers
the 403.
2026-08-14 10:50:35 +02:00
Lukas Hirt 2063b84b8f fix(deployment): downgrade drawio image to 0.4.1 in ocis_full example (#12795)
0.4.1 is the latest available version of the draw-io web-extensions image.

Signed-off-by: Lukas Hirt <info@hirt.cz>
2026-08-14 08:50:13 +02:00
Lukas Hirt a3601009ac fix(deployments): support Collabora Online 26.x in ocis_full example (#12794)
* fix(deployments): support Collabora Online 26.x in ocis_full example

collabora/code 26.x dropped the shell (no /bin/bash, no /bin/sh) and the
coolconfig helper the ocis_full example relied on to start the container
and generate its WOPI proof key, so the deployment failed to start and,
once patched to start, would reject every document open with a 500 since
the collaboration service enforces WOPI proof-key verification by default.

Drop the custom bash entrypoint (the image's default entrypoint already
honors extra_params/username/password via --use-env-vars), replace the
bash-based healthcheck with the built-in "coolwsd --probe", and add a
one-shot init container that generates and persists the WOPI proof key
on the host before Collabora starts.

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

* fix(deployments): self-heal a bad WOPI proof key in ocis_full example

The collabora-proof-key-init container only checked "does /keys/proof_key
exist" before skipping generation. If the collabora service's single-file
bind mount of that path ever won the race against the init container (e.g.
on the very first `docker compose up`, or after an interrupted run), Docker
silently created a directory there instead of a file, which then persisted
across restarts and made coolwsd fail to load the proof key with an
EVPPKey::loadKey DECODER error, breaking WOPI CheckFileInfo for good.

Validate any existing proof_key with `openssl rsa -check` and remove it
before regenerating if it's missing, not a regular file, or invalid, so a
bad state (directory, truncated write, corrupt key) heals itself on the
next start instead of requiring a manual `rm -rf` of the generated config.

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

---------

Signed-off-by: Lukas Hirt <info@hirt.cz>
2026-08-14 08:42:35 +02:00
Nalem7 86105b86af [tests-only][full-ci] test: add retry once for space creation wherever required (#12785)
test: add retry once for space creation

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2026-08-14 12:11:34 +05:45
Pradip Subedi 6dc967e583 [tests-only][full-ci] test: enable secure viewer role before upload in moveReceivedShare scenarios (#12786)
test: enable secure viewer role before upload in moveReceivedShare scenarios
2026-08-14 09:18:37 +05:45
Pradip Subedi af7d39d1b6 [tests-only][full-ci] test: Add acceptance test for empty CallToAction notification translation fix (#12616)
* test: add tests email after changing default language

* test: fix other feature files cleanup

* test: restore unrelated files

* test: add missing unshare strings to test translation fixture

* test: add missing space in email body

* test: assert full translated unshare email and sync userlog fixture

* test: remove unused negative email content step
2026-08-14 09:15:56 +05:45
Lukas Hirt e21e19470b feat(app-store): update app store repository to use ownCloud Marketplace (#12793)
Signed-off-by: Lukas Hirt <info@hirt.cz>
2026-08-13 21:46:59 +02:00
owncloud-translations-bot[bot] 74ae9bf88d chore: update translations from transifex (#12771)
Co-authored-by: owncloud-translations-bot[bot] <274778013+owncloud-translations-bot[bot]@users.noreply.github.com>
2026-08-13 13:54:04 +02:00
Michal Klos d9bae04aee feat: [OCISDEV-1115] harden nats communication (#12777)
* feat: [OCISDEV-1115] harden nats communication

* feat: bump reva for tls-enabled stores
2026-08-13 09:56:24 +00:00
Pradip Subedi 5a2c1cc351 [tests-only] test: add vault public link scenarios (#12735)
test: add vault public link rejection scenarios
2026-08-13 14:53:57 +05:45
Nalem7 4684d3d4ee [tests-only][full-ci] test: add test for space manager removing members (#12776)
test: add test for space manager removing members

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2026-08-13 11:42:30 +05:45
Prajwol Amatya c53e2f773e [tests-only][full-ci] test: fix flaky e2e test for tag search (#12780)
test: login user after creating resources via API

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2026-08-13 11:13:38 +05:45
donmor 3b5bad6ade fix(web): use light logo in light mode (in dark blue background) (#12782) 2026-08-12 19:43:08 +02:00
Alexander Salimonov 81527e98e4 fix: pass mount id to the s3ng storage driver (#12756)
* fix: pass mount id to the s3ng storage driver

Uploads to a s3ng backed storage-users service never left the processing
state, leaving the file unreadable and unmodifiable. This affects every
client equally: WebDAV, the desktop sync client and the web UI.

Decomposedfs discards any event whose storage id does not match its
configured mount id. Only the ocis driver was ever given a mount_id, so
under s3ng the comparison ran against an empty string and every
PostprocessingFinished event was dropped.

Regression since 8.1.0, where the mount-id event filter was introduced
for vault storage.

* fix: adding mount_id in OcisNoEvents and S3NGNoEvents
2026-08-12 10:55:08 +02:00
donmor 36d5089424 Generate web timestamp by env/git log; make it buildable without .git (#12758)
* fix(web): generate web timestamp by env SOURCE_DATE_EPOCH or git log (#12757)

* fix(web): suppress error when make in non-git directory (e.g. source tarballs)

* chore: add changelog for pull 12758

* fix(web): fix env description in changelog; remove cwd from execSync

* fix(web): fix format (prettier check)
2026-08-12 09:03:26 +02:00
Prajwol Amatya f6628b6264 [tests-only][full-ci] test: fix flaky e2e test in e2e-part-3 (#12778)
* test: slow down test run

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: scope temp upload path per Playwright worker

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

---------

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2026-08-12 12:30:12 +05:45
Juan Pablo Villafañez 597104629a fix: use specific gookit config instance instance of using global (#12769)
* fix: use specific gookit config instance instance of using global

Using the global instance was causing a panic when the service was
restarted. That panic won't happen now.

* chore: add changelog entry
2026-08-11 17:48:46 +02:00
Michal Klos 6d3e10c120 fix: [OCISDEV-660] harden GetUserDrive (#12742) 2026-08-11 08:27:14 +00:00
Matteo 8ea724c8a4 chore: remove Vue warnings in web (#12767)
- ResourceTile: drop leading eslint comment (fragment root) and add
  role=presentation so fallthrough attrs and drag listeners inherit and
  the element ref resolves to the card; fixes drag-and-drop crash on tiles
- markRaw components passed as extension/folder-view data to avoid
  reactive-component warnings
- web-app-external: wrap iframe/form in a single root element
- AppWrapper: type currentContent as string
2026-08-10 14:53:47 +02:00
Michal Klos 90148451c8 chore: bump go and web packages (#12765)
* chore: bump go packages

* chore: bump web packages
2026-08-10 11:43:14 +02:00
owncloud-translations-bot[bot] 101e9d6404 chore: update translations from transifex (#12755)
Co-authored-by: owncloud-translations-bot[bot] <274778013+owncloud-translations-bot[bot]@users.noreply.github.com>
2026-08-10 09:03:28 +02:00
Gaurav Soni 07f2a8bba9 fix(web): [OCISDEV-996] truncate long resource names instead of overlapping the next column (#12754)
fix(web): [OCISDEV-996] truncate long resource names instead of overlapping next column

Add `min-width: 0` to `.oc-resource` so the inline-flex item can shrink
below its content width. Without it the automatic min-content floor kept
the element at full name width, painting the name over the adjacent
column's value. The existing `oc-text-truncate` rule on the name span can
now take effect and truncate with an ellipsis at the column boundary.

Most visible in the Spaces overview, where a long space name overlapped
the "Manager" column, but it affected every resource table using the name
column, including the files list and search results.
2026-08-07 16:22:30 +02:00
kobergj 1d70560428 feat(storage-users): add recalculate-treesize command (#12746)
feat(storage-users): [OCISDEV-1203] add recalculate-treesize command

The treesize of a directory is maintained as a running counter that is updated
on every change, so a failed or incomplete update leaves the counter wrong and
the reported quota usage of a space drifts from the data on disk. Removing a node
without propagating the size change leaves its size counted against the quota
with no way to reclaim it.

Add a command that walks a space bottom up, recalculates the treesize of every
directory from the actual size of its children and corrects the stored values:

    ocis storage-users spaces recalculate-treesize --space-id <id>

As with the other maintenance commands --dry-run defaults to true, so the
command reports what it would change until explicitly told to write.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-08-07 15:16:12 +02:00
Matteo 3da140042c fix(web): remove focus from file name in app top bar (#12752)
The open file name in the top bar was tabbable via keyboard even
though it is not clickable, which was confusing during keyboard
navigation.
2026-08-07 12:48:50 +00:00
Gaurav Soni f975f00120 fix(web): [OCISDEV-1168] open files whose name contains a hash or question mark (#12740)
Cmd+Clicking or middle-clicking a file with a `#` or `?` in its name opened the
space root instead of the file, and the top bar showed the space name rather than
the file name. The file's path is carried in a route parameter which the router
percent-encodes when it builds the URL, but the editor route was resolved twice
and resolving twice does not encode twice: the second pass rebuilt the URL from
the still-decoded parameter with the encoding step skipped. The browser then read
everything from the `#` onward as a fragment, discarding the query string along
with the `fileId` needed to identify the file. Left clicks were unaffected because
they never leave the app.

Editor routes are now handed to links unresolved, so the file name is encoded
exactly once and survives both a new tab and an in-app navigation. Hash and
question mark remain valid characters in file names.
2026-08-07 12:41:34 +02:00
Matteo e1ee0d01ef chore(web): update dep js-yml to 4.3.1 (#12747) 2026-08-07 11:17:29 +02:00
owncloud-translations-bot[bot] d498d9b42d chore: update translations from transifex (#12743)
Co-authored-by: owncloud-translations-bot[bot] <274778013+owncloud-translations-bot[bot]@users.noreply.github.com>
2026-08-07 09:28:00 +02:00
isha 40d257726a [test-only][k8s]test(ci): run test on kubernetes deployment (#12654)
* test(ci): run test on k8s deployment

* chore: update authapp in config

* chore: update storageusers in config

* chore: update version and envs

* chore: normalize service name
2026-08-07 11:31:05 +05:45
Prajwol Amatya 42cb013e8f [tests-only] test: search resources in vault (#12685)
* test: search resources in vault

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: add test to search using content and tags

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: add tika service for vault tests

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

---------

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2026-08-07 09:11:49 +05:45
kobergj 003e8cddb8 fix(storage-users): add --orphaned upload session filter (#12739)
Bump reva to pick up the fix for upload sessions whose node metadata can no
longer be read. Such sessions can never finish postprocessing, stay in
processing state indefinitely and keep consuming the quota of their space.
Cleaning them previously removed the uploaded bytes without releasing the quota.

Wire up the new Orphaned session filter so operators can list the affected
sessions and remove them with --clean:

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

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-08-06 15:00:09 +02:00
owncloud-translations-bot[bot] 8011fcb7e6 chore: update translations from transifex (#12736)
Co-authored-by: owncloud-translations-bot[bot] <274778013+owncloud-translations-bot[bot]@users.noreply.github.com>
2026-08-06 10:21:04 +00:00
Michal Klos c1457168c3 feat: [OCISDEV-1032] ldap config and retry policy (#12724)
* feat: [OCISDEV-1032] ldap config and retry policy (#12672)

* feat: ldap config and retry policy

Co-authored-by: Roman Perekhod <2403905@gmail.com>
# Conflicts:
#	go.mod
#	go.sum
#	services/graph/pkg/config/config.go
#	services/graph/pkg/service/v0/service.go
#	vendor/modules.txt

# Conflicts:
#	services/graph/pkg/service/v0/service.go

* test: e2e ldap

# Conflicts:
#	.github/workflows/acceptance-tests.yml

# Conflicts:
#	.github/workflows/acceptance-tests.yml

* test: e2e ldap distributed

# Conflicts:
#	.github/workflows/acceptance-tests.yml

* fix: post rebases build error
2026-08-06 12:15:36 +02:00
Nalem7 78313a52fe [tests-only] add for spaceEditorWithoutVersionsWithoutTrashbin role (#12681)
test: add for spaceEditorWithoutVersionsWithoutTrashbin role

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2026-08-06 11:49:34 +05:45
Matteo 092be75ca0 Fix/ocisdev 1165/resource with same name gets prefix on share (#12730)
* feat: bump reva

Bumps reva to 441d6e77b33d, pulling in the vault/non-vault share
mountpoint collision fix, decomposedfs DisableVersioning aspect
handling, ChunkHandler.Assemble/scan fields, and LDAP retry policy
config. Also picks up the transitive nats-server, grpc, go-sqlite3
and antithesis-sdk-go bumps from reva's go.mod.

* docs: add changelog for vault share mountpoint collision fix

Documents the reva fix (owncloud/reva#691) that stops resources shared
under the same name from vault and non-vault mountpoints from getting
a spurious (1) suffix.
2026-08-06 07:19:09 +02:00
Lukas Hirt 1a43d7ddc0 feat(web): [OCISDEV-840] apply Kiteworks branding to theme (#12464)
Signed-off-by: Lukas Hirt <info@hirt.cz>
2026-08-06 07:16:44 +02:00
Matteo f1dbac418b fix(web): use centralized vault detection for nav labels (#12729)
The Files app nav labels checked window.location.pathname directly,
which missed hash-based vault routes and the post-login redirect
target, so labels didn't always reflect vault state.
2026-08-05 20:37:40 +02:00
dependabot[bot] 19c1cd2fa2 build(deps): bump the minor-and-patch group across 1 directory with 3 updates (#12728)
Bumps the minor-and-patch group with 3 updates in the / directory: [github.com/gabriel-vasile/mimetype](https://github.com/gabriel-vasile/mimetype), [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) and [github.com/rogpeppe/go-internal](https://github.com/rogpeppe/go-internal).


Updates `github.com/gabriel-vasile/mimetype` from 1.4.13 to 1.4.15
- [Release notes](https://github.com/gabriel-vasile/mimetype/releases)
- [Commits](https://github.com/gabriel-vasile/mimetype/compare/v1.4.13...v1.4.15)

Updates `github.com/open-policy-agent/opa` from 1.18.2 to 1.19.0
- [Release notes](https://github.com/open-policy-agent/opa/releases)
- [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-policy-agent/opa/compare/v1.18.2...v1.19.0)

Updates `github.com/rogpeppe/go-internal` from 1.15.0 to 1.16.0
- [Release notes](https://github.com/rogpeppe/go-internal/releases)
- [Commits](https://github.com/rogpeppe/go-internal/compare/v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: github.com/gabriel-vasile/mimetype
  dependency-version: 1.4.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: github.com/open-policy-agent/opa
  dependency-version: 1.19.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: github.com/rogpeppe/go-internal
  dependency-version: 1.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-05 20:31:43 +02:00
Lukas Hirt fc34bd9824 feat(ldap): [OCISDEV-1031] add opt-in LDAP connection pool (#12689)
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>

fix(ldap): [OCISDEV-1031] set real pool_size/pool_checkout_timeout defaults

Only PoolEnabled: false was set in the four defaultconfig.go files;
PoolSize/PoolCheckoutTimeout were left as Go zero values (0/0s),
relying on reva's NewLDAPPool substituting 5/30s when <= 0. That
reads as "zero connections" to an operator in the generated yaml
config rather than "default 5". Set the real defaults (5, 30s)
so documented defaults match what's emitted.

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

chore(deps): [OCISDEV-1031] bump reva to pick up LDAP TLS fixes

Bumps the vendored reva dependency to owncloud/reva@8ee2020, picking
up owncloud/reva#672 (restore MinVersion: tls.VersionTLS12 on LDAP
TLS connections) and owncloud/reva#674 (restore pinned-CA-only trust
and PEM validation for the CA-cert path), both flagged during review
of this PR.

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

docs: point changelog fragment at forward-port PR #12689
2026-08-05 17:57:48 +02:00
Matteo 1745797d2b fix(web): use correct color variable for group icon in share list (#12722)
The group icon in the share collaborator autocomplete list referenced a
removed CSS variable, making it invisible. Switch to the current default
text color variable.
2026-08-05 16:20:13 +02:00
Ward Pieters 4390b44b02 fix(oidc): respect (no) proxy env vars in OIDC HTTP client (#12703)
fix(oidc): respect HTTP(S)_PROXY and NO_PROXY env vars in OIDC HTTP client
2026-08-05 14:55:13 +02:00
Martin 0acfcb4040 fix: correct introduction version of new envvar (#12720) 2026-08-05 10:20:08 +00:00
Martin 3a98e41689 docs: Update README.md (#12717)
The readme contained a mistyped link -- fixed.
2026-08-05 09:27:23 +02:00
owncloud-translations-bot[bot] 3b7d0006a7 chore: update translations from transifex (#12718)
Co-authored-by: owncloud-translations-bot[bot] <274778013+owncloud-translations-bot[bot]@users.noreply.github.com>
2026-08-05 09:01:50 +02:00
Pradip Subedi 58a0bd9dea [tests-only][full-ci] test(cli): add blobstore get and check CLI tests (#12505)
* test(cli): add blobstore check and get CLI test scenarios

* ci: add get blob step

* test(cli): add valid blob size, --path, by-ID, and malformed path blobstore tests

* test: include round-trip verifications

* test: swap check assertions from exact-match to substring-contains
2026-08-05 12:08:59 +05:45
Nalem7 afa8790227 [tests-only] add graph API tests for password change re-authentication (#12664)
test: add graph API tests for password change re-authentication

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2026-08-05 11:46:39 +05:45
Gaurav Soni 2ea716aea4 [OCISDEV-492] Space image not uploaded if larger than 7MB (#12701)
fix(graph): [OCISDEV-492] reject space images too large to be rendered

Setting a space image larger than the thumbnails service accepts appeared
to succeed but never changed the space image. Uploading the file and
assigning it as the space image are two separate requests, and both
completed successfully, so clients reported success. Only a later preview
request, which the assigning client never observes, was rejected because
the image exceeded THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE. As space images
are rendered exclusively as thumbnails, the image was not merely degraded,
it was invisible with no error anywhere in the UI.

The graph service now stats the file when a space image is assigned and
rejects the request with 413 Request Entity Too Large instead of storing a
reference which cannot be displayed. The previous space image is left
untouched. The limit is read from the new GRAPH_MAX_IMAGE_FILE_SIZE
setting, which defaults to the value of
THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE so that a single setting keeps both
services in agreement. A limit of zero disables the check. Space
descriptions (readme) are not affected.
2026-08-04 14:29:11 +02:00
Matteo 4ba02000fa fix: bump reva to allow space managers to remove others' shares (#12705)
* fix: bump reva to allow space managers to remove others' shares

Space managers with the RemoveGrant permission on a resource could not
remove user shares created by other users; the share manager only allowed
the share's creator to remove it. This bumps reva to the commit that fixes
Unshare to also honor the RemoveGrant permission.

* fix(l10n): route gotext.Locale calls through func fields to satisfy go vet

Bumping reva pulled in reva's go 1.26 requirement, and go 1.26's stricter
printf vet analyzer now sees through the OcisLocale interface to flag
gotext.Locale.Get as a printf-wrapper, breaking go test across 5 packages.
Forwarding through func fields hides that static trail from vet.
2026-08-04 13:42:08 +02:00
ishaandMatteo 0e591928c8 chore: update brace expansion package (#12714)
* build(deps): bump pnpm dependencies

* chore(deps): update fast-uri to 3.1.5

---------

Co-authored-by: Matteo <matteo.sonnenholzner@kiteworks.com>
2026-08-04 15:38:36 +05:45
owncloud-translations-bot[bot] 09299e4ab0 chore: update translations from transifex (#12712)
Co-authored-by: owncloud-translations-bot[bot] <274778013+owncloud-translations-bot[bot]@users.noreply.github.com>
2026-08-04 07:41:26 +00:00
Roman PerekhodandClaude Opus 4.8 604a680a03 feat: [ocisdev-1033] forward port (#12709)
* 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

* chore: tests

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 17:51:59 +03:00
owncloud-translations-bot[bot] 6d1d0590e2 chore: update translations from transifex (#12614)
Co-authored-by: owncloud-translations-bot[bot] <274778013+owncloud-translations-bot[bot]@users.noreply.github.com>
2026-08-03 09:39:59 +02:00
1027 changed files with 71466 additions and 67748 deletions

No files matched your search

+98 -1
View File
@@ -315,6 +315,41 @@ 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: "8.4"
extensions: curl, xml, mbstring, zip, ldap, gd
tools: composer
- name: Install libvips runtime
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper
- 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]
@@ -695,8 +730,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: [detect-changes, local-api-tests, cli-tests, core-api-tests, litmus, cs3api, wopi-builtin, wopi-cs3, e2e-tests]
needs: [detect-changes, 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:
+271
View File
@@ -0,0 +1,271 @@
name: Acceptance Tests K8S
on:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 1 * * *"
env:
PHP_VERSION: "8.4"
K3D_VERSION: "v5.8.3"
HELM_VERSION: "v3.18.4"
TEST_SERVER_URL: https://ocis-server
STORAGE_DRIVER: ocis
OCIS_WRAPPER_URL: http://localhost:5200
K8S: true
jobs:
api-tests:
name: ${{ matrix.suite }}-k8s
runs-on: ubuntu-26.04
if: >-
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.title || '', 'k8s'))
strategy:
fail-fast: false
matrix:
include:
- suite: apiContract
- suite: apiLocks
- suite: apiSettings
# - suite: apiNotification
- suite: apiCors
- suite: apiGraphUser
- suite: apiGraph
- suite: apiGraphGroup
# - suite: apiSpaces
- suite: apiSpacesShares
- suite: apiSpacesDavOperation
- suite: apiDownloads
- suite: apiAsyncUpload
- suite: apiDepthInfinity
- suite: apiArchiver
- suite: apiActivities
- suite: apiSearch1
- suite: apiSearch2
# - suite: apiSearchContent
- suite: apiSharingNgShares
- suite: apiReshare
- suite: apiSharingNgPermissions
- suite: apiSharingNgAdditionalShareRole
- suite: apiSharingNgDriveInvitation
# - suite: apiSharingNgItemInvitation
- suite: apiSharingNgDriveLinkShare
- suite: apiSharingNgItemLinkShare
- suite: apiSharingNgLinkShareManagement
- suite: apiAuthApp
# - suite: apiAntivirus
- suite: apiOcm
# - suite: apiCollaboration
# - suite: "coreApiAuth,coreApiCapabilities,coreApiFavorites,coreApiMain,coreApiVersions"
- suite: "coreApiShareManagementBasicToShares,coreApiShareManagementToShares"
- suite: "coreApiSharees"
- suite: "coreApiSharePublicLink2"
- suite: "coreApiShareOperationsToShares1,coreApiShareOperationsToShares2,coreApiSharePublicLink1,coreApiShareCreateSpecialToShares1,coreApiShareCreateSpecialToShares2,coreApiShareUpdateToShares"
- suite: "coreApiTrashbin,coreApiTrashbinRestore,coreApiWebdavEtagPropagation1,coreApiWebdavEtagPropagation2"
- suite: "coreApiWebdavDelete,coreApiWebdavOperations,coreApiWebdavMove2"
- suite: "coreApiWebdavProperties"
# - suite: "coreApiWebdavMove1,coreApiWebdavPreviews,coreApiWebdavUpload,coreApiWebdavUploadTUS"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup PHP ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
with:
php-version: ${{ env.PHP_VERSION }}
extensions: curl, xml, mbstring, zip, ldap, gd
tools: composer
- name: Download k3d
run: |
curl -L \
-o k3d \
https://github.com/k3d-io/k3d/releases/download/${{ env.K3D_VERSION }}/k3d-linux-amd64
echo "dbaa79a76ace7f4ca230a1ff41dc7d8a5036a8ad0309e9c54f9bf3836dbe853e k3d" | sha256sum --check
chmod +x k3d
sudo mv k3d /usr/local/bin/
k3d version
- name: Install Helm
run: |
curl -fsSL -o helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz https://get.helm.sh/helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz
tar -zxvf helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz
sudo mv linux-amd64/helm /usr/local/bin/helm
helm version --short
- name: Prepare hosts
run: |
echo "127.0.0.1 ocis-server clamav email collabora onlyoffice fakeoffice tika federation-ocis-server" \
| sudo tee -a /etc/hosts
- name: Spin up K3d Cluster
run: make -C tests/config/k8s create-cluster
- name: Prepare Helm Charts & Deploy oCIS
env:
ENABLE_ANTIVIRUS: ${{ matrix.suite == 'apiAntivirus' }}
ENABLE_EMAIL: ${{ matrix.suite == 'apiNotification' || matrix.suite == 'apiSettings' || matrix.suite == 'apiOcm' }}
ENABLE_TIKA: ${{ matrix.suite == 'apiSearchContent' }}
ENABLE_WOPI: ${{ matrix.suite == 'apiCollaboration' }}
ENABLE_OCM: ${{ matrix.suite == 'apiOcm' }}
ENABLE_AUTH_APP: ${{ matrix.suite == 'apiAuthApp' }}
run: |
cd tests/config/k8s
make prepare-charts
kubectl get pods -n ocis-server -Aw &
make deploy-ocis
if [[ "${{ matrix.suite }}" == "apiOcm" ]]; then
OCM=true make prepare-charts
OCM=true make deploy-ocis
fi
- name: Deploy Suite-Specific External Backends
run: |
if [[ "${{ matrix.suite }}" == "apiNotification" || \
"${{ matrix.suite }}" == "apiSettings" || \
"${{ matrix.suite }}" == "apiOcm" ]]; then
docker run -d \
-p 1025:1025 \
-p 8025:8025 \
--name mailpit \
axllent/mailpit:v1.22.3
bash tests/config/k8s/expose-external-svc.sh email:1025
fi
if [[ "${{ matrix.suite }}" == "apiAntivirus" ]]; then
docker run -d \
-p 3310:3310 \
--name clamav \
owncloudci/clamavd
bash tests/config/k8s/expose-external-svc.sh clamav:3310
fi
if [[ "${{ matrix.suite }}" == "apiSearchContent" ]]; then
docker run -d \
-p 9998:9998 \
--name tika \
apache/tika:3.2.2.0-full
bash tests/config/k8s/expose-external-svc.sh tika:9998
fi
- name: Wait for oCIS to be ready
env:
FILE_URL: ${{ env.TEST_SERVER_URL }}/remote.php/dav/files/admin/hello1.txt
run: |
kubectl wait \
--namespace ocis-server \
--for=condition=Available \
deployment \
--all \
--timeout=10m
kubectl wait \
--namespace ocis-server \
--for=condition=Ready \
pod \
--all \
--timeout=10m
kubectl get pods -n ocis-server
echo "Creating test file in oCIS..."
request() {
local method=$1
shift
curl -ks -o /dev/null -w "%{http_code}" \
-X "$method" \
-u admin:admin \
"$@" \
"$FILE_URL"
}
retry_http() {
local expected=$1
shift
for i in {1..30}; do
status=$("$@")
if [ "$status" = "$expected" ]; then
echo "Succeeded (HTTP $status)"
return 0
fi
echo "Attempt $i failed (HTTP $status), retrying in 10s..."
sleep 10
done
echo "Failed after 30 attempts"
return 1
}
put_file() {
request PUT \
-H "Content-Type: text/plain" \
--data "Hello from GitHub Actions!"
}
delete_file() {
request DELETE
}
echo "Creating test file..."
retry_http 201 put_file || exit 1
echo "Deleting test file..."
retry_http 204 delete_file || exit 1
- name: Expose debug ports
run: bash tests/config/k8s/expose-debug-svc.sh
- name: Build ociswrapper
run: make -C tests/ociswrapper/
- name: Start ociswrapper
run: |
tests/ociswrapper/bin/ociswrapper serve \
--url ${{ env.TEST_SERVER_URL }} \
--admin-username admin \
--admin-password admin \
--skip-ocis-run \
-n ocis-server &
- name: Prepare expected failures
if: startsWith( matrix.suite, 'core' )
env:
EXPECTED_FAILURES_FILE: tests/acceptance/expected-failures-API-on-OCIS-storage.md
WITH_REMOTE_PHP: "false"
run: |
if [[ "$WITH_REMOTE_PHP" != "true" ]]; then
cat tests/acceptance/expected-failures-without-remotephp.md >> \
"$EXPECTED_FAILURES_FILE"
fi
- name: Run API ${{ matrix.suite }} tests
if: startsWith( matrix.suite, 'api' )
env:
TEST_SERVER_URL: ${{ env.TEST_SERVER_URL }}
TEST_SERVER_FED_URL: https://federation-ocis-server
STORAGE_DRIVER: ${{ env.STORAGE_DRIVER }}
BEHAT_SUITES: ${{ matrix.suite }}
BEHAT_FILTER_TAGS: "~@skip&&~@skipOnGraph&&~@skipOnOcis-OCIS-Storage"
EXPECTED_FAILURES_FILE: tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md
OCIS_WRAPPER_URL: ${{ env.OCIS_WRAPPER_URL }}
COLLABORATION_SERVICE_URL: http://ocis-server:9304
K8S: ${{ env.K8S }}
run: make test-acceptance-api
- name: Run Core ${{ matrix.suite }} tests
if: startsWith( matrix.suite, 'core' )
env:
TEST_SERVER_URL: ${{ env.TEST_SERVER_URL }}
OCIS_REVA_DATA_ROOT: ""
STORAGE_DRIVER: ocis
BEHAT_FILTER_TAGS: "~@skip&&~@skipOnGraph&&~@skipOnOcis-OCIS-Storage"
BEHAT_SUITES: ${{ matrix.suite }}
ACCEPTANCE_TEST_TYPE: core-api
EXPECTED_FAILURES_FILE: tests/acceptance/expected-failures-API-on-OCIS-storage.md
UPLOAD_DELETE_WAIT_TIME: "0"
OCIS_WRAPPER_URL: ${{ env.OCIS_WRAPPER_URL }}
WITH_REMOTE_PHP: "false"
K8S: ${{ env.K8S }}
run: make test-acceptance-api
+3
View File
@@ -60,6 +60,9 @@ go.work
go.work.sum
.env
.envrc
# generated secrets for deployment examples (e.g. Collabora WOPI proof key)
deployments/examples/*/config/collabora/
CLAUDE.md
.claude/
GEMINI.md
+1 -1
View File
@@ -102,7 +102,7 @@ Before starting to set up an instance, we **highly** recommend reading the [Prer
### Use the Official Documentation
See the [Install Infinite Scale on a Server](https://doc.owncloud.com/ocis/next/depl-examples/ubuntu-compose/ubuntu-compose-prod.html) for a production ready deployment starting with a Raspberry Pi, a single server or VM.
See the [Install Infinite Scale on a Server](https://doc.owncloud.com/ocis/next/admin/depl-examples/ubuntu-compose/ubuntu-compose-prod.html) for a production ready deployment starting with a Raspberry Pi, a single server or VM.
### Use the ocis Repo as Source
@@ -0,0 +1,10 @@
Bugfix: Support Collabora Online 26.x in the ocis_full deployment example
collabora/code 26.x ships without a shell and without the `coolconfig` helper the
ocis_full example relied on to start the container and generate its WOPI proof
key, so the example failed to start and, once running, would reject every
document open with a 500. The example now uses the image's default entrypoint
and a one-shot init container that generates and persists the WOPI proof key
before Collabora starts.
https://github.com/owncloud/ocis/pull/12794
@@ -0,0 +1,8 @@
Bugfix: Fix invisible group icon in share collaborator list
The icon shown next to group entries in the share collaborator autocomplete
list used a color variable that no longer resolved to a valid value, making
the icon effectively invisible against the background. The icon now uses the
correct default text color variable so it renders properly again.
https://github.com/owncloud/ocis/pull/12722
@@ -0,0 +1,10 @@
Bugfix: Ignore write error after successful read
In the settings service, we're caching data in the NATSjs store. When reading
service information, that information is written in the cache. Previously,
failing to write that information in the cache caused an error, despite
correct information being retrieved from the service successfully. Now, if the
information isn't written in the cache, we log the failure, but return the
read information without error.
https://github.com/owncloud/ocis/pull/12772
@@ -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,12 @@
Bugfix: Restarting the proxy service on error was causing panics
Starting oCIS with the `ocis server` command causes oCIS to monitor the
services being started. When a service fails to start, this monitor tries
to restart the services. For the cause of the proxy service, restarting it
was a panic.
Now, the proxy service can be restarted as expected, without that panic.
Note that the service might still fail to start if the actual cause isn't
fixed, such as the service's port being taken by a different application.
https://github.com/owncloud/ocis/pull/12769
@@ -0,0 +1,10 @@
Bugfix: Remove keyboard focus from open file name in top bar
When opening a file such as a text or markdown document, the file name shown
in the top bar could be reached via keyboard tabbing even though it was not
clickable and triggered no action. This made keyboard navigation confusing.
The file name is no longer part of the tab order, since it is a purely
informational, non-interactive element.
https://github.com/owncloud/ocis/pull/12752
@@ -0,0 +1,15 @@
Bugfix: Renaming a resource to its current name is a silent no-op
Renaming a file or folder to the name it already has failed with a
confusing `403 Forbidden` or `404 Not Found`, and `409 Conflict` when the
request addressed the resource by its id. Every client had to work around
it on its own. A `MOVE` whose source and destination resolve to the same
resource is now detected server side and answered with `204 No Content`
without touching the resource, so the behaviour is consistent for all
clients and for both dav routes. The no-op still requires the move
permission: a user who may not rename the resource keeps getting
`403 Forbidden`.
https://github.com/owncloud/ocis/pull/12784
https://github.com/owncloud/reva/pull/708
https://github.com/owncloud/reva/pull/713
@@ -0,0 +1,14 @@
Bugfix: Truncate long resource names instead of overlapping the next column
In resource tables, a name that was too long for its column was not truncated.
Instead it kept its full width and was painted over the value of the adjacent
column, making both unreadable. This was most visible in the Spaces overview,
where a long space name overlapped the "Manager" column, but it affected every
resource table using the name column, including the files list and search
results, as well as the parent folder path shown below a search result.
The name is now truncated with an ellipsis at the column boundary, and the
rename button stays inside the name column. The full name remains available via
the title tooltip on hover.
https://github.com/owncloud/ocis/pull/12754
@@ -0,0 +1,20 @@
Bugfix: Fix uploads stuck in processing with the s3ng storage driver
Uploads to a `s3ng` backed storage-users service never left the processing
state, so the file stayed unreadable and unmodifiable forever. Every client was
affected equally, because the defect sits below the protocol layer: WebDAV, the
desktop sync client and the Web UI alike.
Decomposedfs ignores any event whose storage id does not match its configured
mount id. The `s3ng` driver never received a `mount_id`, so that comparison ran
against an empty string and every `PostprocessingFinished` event was discarded.
The `s3ng` driver now passes `mount_id` the same way the `ocis` driver already
does.
The same key is also added to `OcisNoEvents` and `S3NGNoEvents`. Those build the
storage provider rather than the data provider and configure no events, so today
the value is unused there. Setting it keeps both constructions of the same
storage consistent about their own identity, rather than leaving one of them to
report an empty mount id to any future reader of that option.
https://github.com/owncloud/ocis/pull/12756
@@ -0,0 +1,9 @@
Bugfix: Fix shift-click range selection in the files list
We have fixed an issue where shift-click did not select resources between
the anchor and the clicked one, and ignored ctrl/cmd. It now selects the
full range, replacing the current selection unless ctrl/cmd is held, and no
longer highlights the text of the affected rows. Checkboxes now also keep their
checked state in sync with the selection when a click does not change it.
https://github.com/owncloud/ocis/pull/12804
@@ -0,0 +1,11 @@
Bugfix: Allow space managers to remove shares created by other users
Space managers with permission to manage a resource's shares were unable to
remove shares that other users had created on that resource. Attempting to
remove such a share failed with a generic server error instead of succeeding.
Space managers can now remove any share on a resource within their space,
regardless of who created it, as long as they hold the required permission
on that resource.
https://github.com/owncloud/ocis/pull/12705
@@ -0,0 +1,14 @@
Bugfix: Vault navigation labels not updating on switch
The Files app navigation labels for the personal space and spaces list
sometimes kept showing the regular names instead of the vault-specific
ones after switching into the vault, and vice versa. This happened
because the vault detection only looked at the plain URL path and
missed cases such as hash-based routes or the redirect right after
logging in.
The vault detection has been centralized and now also recognizes
hash-based vault routes and the post-login redirect target, so the
navigation labels correctly reflect whether the user is in the vault.
https://github.com/owncloud/ocis/pull/12729
+1
View File
@@ -8,3 +8,4 @@ https://github.com/owncloud/ocis/pull/12137
https://github.com/owncloud/ocis/pull/12302
https://github.com/owncloud/ocis/pull/12439
https://github.com/owncloud/ocis/pull/12266
https://github.com/owncloud/ocis/pull/12730
@@ -0,0 +1,10 @@
Change: Respect proxy environment variables for OIDC requests
The proxy and webfinger services now route OIDC requests through the
`HTTP_PROXY` and `HTTPS_PROXY` settings from the environment. Deployments that
should not send the OIDC issuer host through the proxy, or whose proxy cannot
reach that host, must list the issuer hostname in `NO_PROXY`, otherwise
authentication can fail when oCIS's own external hostname is reached through
the proxy.
https://github.com/owncloud/ocis/pull/12703
@@ -0,0 +1,10 @@
Enhancement: Restrict personal drive information to the owner and admins
The `/graph/v1.0/users/{userID}/drive`, `/graph/v1.0/drives/{driveID}` and
`/graph/v1.0/drives` endpoints now drop personal spaces the caller does not own
unless the caller holds account management permission, leaving project and other
shared space types unaffected. The single-drive and per-user lookups return the
same `404` as a missing drive, so the response does not depend on the target
user's existence.
https://github.com/owncloud/ocis/pull/12742
@@ -0,0 +1,6 @@
Enhancement: Apply Kiteworks branding to the web theme
The default oCIS theme now uses the Kiteworks OSPO name, slogan and logos
across all regular and vault mode themes.
https://github.com/owncloud/ocis/pull/12464
@@ -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/12689
@@ -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,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,21 @@
Enhancement: Add a command to recalculate the treesize of a space
The reported quota usage of a space can drift from the data actually stored on
disk. The treesize of a directory is maintained as a running counter that is
updated on every change, so a failed or incomplete update leaves the counter
wrong. Removing a node without propagating the size change, for example, leaves
its size counted against the quota forever, with no way to reclaim it.
The new command walks a space bottom up, recalculates the treesize of every
directory from the actual size of its children and corrects the stored values:
```
ocis storage-users spaces recalculate-treesize --space-id <id>
ocis storage-users spaces recalculate-treesize --space-id <id> --dry-run=false
```
Omit `--space-id` to process all spaces. As with the other maintenance commands,
`--dry-run` defaults to true, so the command reports what it would change until
it is explicitly told to write.
https://github.com/owncloud/ocis/pull/12746
@@ -0,0 +1,5 @@
Enhancement: Update app store repository
We've updated the default app store repository to use the new ownCloud Marketplace instead of the awesome-ocis repository. The default Content-Security-Policy configuration was also updated to allow connections to the new marketplace domain.
https://github.com/owncloud/ocis/pull/12793
@@ -0,0 +1,17 @@
Bugfix: Open files whose name contains a hash or question mark
Cmd+Clicking or middle-clicking a file with a `#` or `?` in its name opened the
space root instead of the file, and the top bar showed the space name rather than
the file name. The file's path is carried in a route parameter which the router
percent-encodes when it builds the URL, but the editor route was resolved twice
and resolving twice does not encode twice: the second pass rebuilt the URL from
the still-decoded parameter with the encoding step skipped. The browser then read
everything from the `#` onward as a fragment, discarding the query string along
with the `fileId` needed to identify the file. Left clicks were unaffected because
they never leave the app.
Editor routes are now handed to links unresolved, so the file name is encoded
exactly once and survives both a new tab and an in-app navigation. Hash and
question mark remain valid characters in file names.
https://github.com/owncloud/ocis/pull/12740
@@ -0,0 +1,20 @@
Bugfix: Reject space images which are too large to be rendered
Setting a space image larger than the thumbnails service accepts appeared to
succeed but never changed the space image. Uploading the file and assigning it
as the space image are two separate requests, and both completed successfully,
so clients reported success. Only a later preview request, which the assigning
client never observes, was rejected because the image exceeded
`THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE`. As space images are rendered
exclusively as thumbnails, the image was not merely degraded, it was invisible
with no error anywhere in the UI.
The graph service now checks the file size when a space image is assigned and
rejects the request with `413 Request Entity Too Large` instead of storing a
reference which cannot be displayed. The previous space image is left
untouched. The limit is read from the new `GRAPH_MAX_IMAGE_FILE_SIZE` setting,
which defaults to `50MB` and must be less than or equal to
`THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE`. Space descriptions (`readme`) are not
affected.
https://github.com/owncloud/ocis/pull/12701
@@ -0,0 +1,12 @@
Bugfix: Do not collide vault and non-vault share mountpoints
Received shares mounted from the Vault storage and received shares mounted
from regular drives were treated as one flat namespace when computing a
unique mountpoint name. Sharing a resource with the same name once from a
regular drive and once from the Vault caused the second one to get a
spurious ` (1)` suffix, even though the two shares are rendered in
completely separate, segregated lists and never actually collide.
Mountpoint name collisions are now only checked against other shares within
the same vault/non-vault group.
https://github.com/owncloud/ocis/pull/12730
@@ -0,0 +1,5 @@
fix(web): Use light logo in light mode (with dark blue topbar)
The light theme actually have a dark blue topbar and login screen, where the dark logo is applied and can hardly be seen. This patch changes it to logo.svg (the light logo).
https://github.com/owncloud/ocis/pull/12782
@@ -0,0 +1,5 @@
Bugfix: Generate web timestamp by env/git log; make it buildable without .git
Change compilationTimeStamp to distTimeStamp, set its value from env SOURCE_DATE_EPOCH, or timestamp of last git commit, or fallback to current time. Also fixes a problem that raises an error during make ci-node-generate due to running git clean -xfd in a non-repository directory (usually an extracted source tarball), showing a message instead.
https://github.com/owncloud/ocis/pull/12758
+4 -1
View File
@@ -212,7 +212,7 @@ TIKA_DOCKER_TAG=latest-full
COLLABORA=:collabora.yml
# The recommended (and tested) version to pull. If no version is used, it pulls "latest"
# release notes: https://www.collaboraonline.com/release-notes/
COLLABORA_DOCKER_TAG=25.04.9.3.1
COLLABORA_DOCKER_TAG=26.04.3.1.1
# Domain of Collabora, where you can find the frontend.
# Defaults to "collabora.owncloud.test"
COLLABORA_DOMAIN=
@@ -229,6 +229,9 @@ COLLABORA_SSL_ENABLE=false
# If you're on an internet-facing server, enable SSL verification for Collabora Online.
# Please comment out the following line:
COLLABORA_SSL_VERIFICATION=false
# Path to persist the Collabora Online WOPI proof key across container restarts (auto-generated on first start).
# Leaving it default stores it in ./config/collabora relative to this compose project.
# COLLABORA_CONFIG_DIR=/your/local/collabora/config
## Supplemental Configurations ##
+26 -3
View File
@@ -48,10 +48,33 @@ services:
driver: ${LOG_DRIVER:-local}
restart: always
# Since collabora/code 26.x, the image ships without a shell (no /bin/bash, no /bin/sh) and
# without the "coolconfig" helper that used to generate the WOPI proof key on startup.
# This one-shot container generates and persists that key on the host before "collabora" starts.
collabora-proof-key-init:
image: alpine/openssl:latest
user: root
entrypoint: ["/bin/sh", "-c"]
command:
- |
if [ -e /keys/proof_key ] && ! openssl rsa -in /keys/proof_key -check -noout >/dev/null 2>&1; then
echo "/keys/proof_key is missing, not a regular file, or invalid; regenerating" >&2
rm -rf /keys/proof_key
fi
if [ ! -f /keys/proof_key ]; then
openssl genrsa -out /keys/proof_key 2048
chmod 644 /keys/proof_key
fi
volumes:
- ${COLLABORA_CONFIG_DIR:-./config/collabora}:/keys
collabora:
image: collabora/code:${COLLABORA_DOCKER_TAG}
networks:
ocis-net:
depends_on:
collabora-proof-key-init:
condition: service_completed_successfully
environment:
DONT_GEN_SSL_CERT: "YES"
extra_params: |
@@ -62,6 +85,8 @@ services:
--o:net.frame_ancestors=${OCIS_DOMAIN:-ocis.owncloud.test}
username: ${COLLABORA_ADMIN_USER:-admin}
password: ${COLLABORA_ADMIN_PASSWORD:-admin}
volumes:
- ${COLLABORA_CONFIG_DIR:-./config/collabora}/proof_key:/etc/coolwsd/proof_key:ro
cap_add:
- MKNOD
labels:
@@ -74,7 +99,5 @@ services:
logging:
driver: ${LOG_DRIVER:-local}
restart: always
entrypoint: ['/bin/bash', '-c']
command: ['coolconfig generate-proof-key && /start-collabora-online.sh']
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/9980 && echo -e 'GET /hosting/discovery HTTP/1.1\r\nHost: localhost:9980\r\n\r\n' >&3 && head -n 1 <&3 | grep '200 OK'"]
test: ["CMD", "/usr/bin/coolwsd", "--probe"]
@@ -7,6 +7,7 @@ directives:
- 'https://${COMPANION_DOMAIN|companion.owncloud.test}/'
- 'wss://${COMPANION_DOMAIN|companion.owncloud.test}/'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
# In contrary to bash and docker the default is given after the | character
- 'https://${KEYCLOAK_DOMAIN|keycloak.owncloud.test}/'
# Photo-addon: OpenStreetMap tile requests
@@ -32,6 +33,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
# In contrary to bash and docker the default is given after the | character
- 'https://${ONLYOFFICE_DOMAIN|onlyoffice.owncloud.test}/'
- 'https://${COLLABORA_DOMAIN|collabora.owncloud.test}/'
@@ -6,7 +6,7 @@ services:
condition: service_completed_successfully
drawio-init:
image: owncloud/web-extensions:draw-io-0.4.4
image: owncloud/web-extensions:draw-io-0.4.1
user: root
volumes:
- ocis-apps:/apps
@@ -5,6 +5,7 @@ directives:
- '''self'''
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
# In contrary to bash and docker the default is given after the | character
- 'https://${KEYCLOAK_DOMAIN|keycloak.owncloud.test}/'
default-src:
@@ -23,6 +24,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
manifest-src:
- '''self'''
media-src:
@@ -5,6 +5,7 @@ directives:
- '''self'''
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
- 'https://${KEYCLOAK_DOMAIN|keycloak.owncloud.test}/'
default-src:
- '''none'''
@@ -24,6 +25,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
manifest-src:
- '''self'''
media-src:
@@ -5,6 +5,7 @@ directives:
- '''self'''
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
# In contrary to bash and docker the default is given after the | character
- 'https://${KEYCLOAK_DOMAIN|keycloak.owncloud.test}/'
default-src:
@@ -23,6 +24,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
manifest-src:
- '''self'''
media-src:
@@ -5,6 +5,7 @@ directives:
- '''self'''
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
default-src:
- '''none'''
font-src:
@@ -23,6 +24,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
manifest-src:
- '''self'''
media-src:
@@ -5,6 +5,7 @@ directives:
- '''self'''
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
default-src:
- '''none'''
font-src:
@@ -25,6 +26,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
# In contrary to bash and docker the default is given after the | character
- 'https://${COLLABORA_DOMAIN|collabora.ocm.next.owncloud.test}/'
manifest-src:
@@ -5,6 +5,7 @@ directives:
- '''self'''
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
default-src:
- '''none'''
font-src:
@@ -25,6 +26,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
# In contrary to bash and docker the default is given after the | character
- 'https://${ONLYOFFICE_DOMAIN|onlyoffice.owncloud.test}/'
manifest-src:
+48 -49
View File
@@ -1,6 +1,6 @@
module github.com/owncloud/ocis/v2
go 1.25.11
go 1.26
require (
dario.cat/mergo v1.0.2
@@ -13,13 +13,14 @@ require (
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/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.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.3.1
github.com/go-chi/httprate v0.16.0
@@ -44,7 +45,7 @@ require (
github.com/gookit/config/v2 v2.2.9
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0
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.1
@@ -57,25 +58,25 @@ require (
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.14.3
github.com/nats-io/nats.go v1.52.0
github.com/nats-io/nats-server/v2 v2.14.5
github.com/nats-io/nats.go v1.53.1
github.com/olekukonko/tablewriter v1.1.4
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.32.0
github.com/onsi/ginkgo/v2 v2.32.1
github.com/onsi/gomega v1.42.1
github.com/open-policy-agent/opa v1.18.2
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.20260216101009-eeac018af245
github.com/owncloud/reva/v2 v2.0.0-20260722181911-d084587fefc7
github.com/owncloud/reva/v2 v2.0.0-20260821144357-79bb0520701d
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.15.0
github.com/rogpeppe/go-internal v1.16.0
github.com/rs/cors v1.11.1
github.com/rs/zerolog v1.35.1
github.com/shamaton/msgpack/v2 v2.4.1
github.com/sirupsen/logrus v1.9.4
github.com/sirupsen/logrus v1.10.0
github.com/spf13/afero v1.15.0
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.11.1
@@ -88,25 +89,25 @@ require (
github.com/xhit/go-simple-mail/v2 v2.16.0
go-micro.dev/v4 v4.11.0
go.etcd.io/bbolt v1.5.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0
go.opentelemetry.io/contrib/zpages v0.69.0
go.opentelemetry.io/otel v1.44.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.44.0
go.opentelemetry.io/otel/sdk v1.44.0
go.opentelemetry.io/otel/trace v1.44.0
golang.org/x/crypto v0.54.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.44.0
golang.org/x/net v0.57.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.22.0
golang.org/x/term v0.45.0
golang.org/x/text v0.40.0
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa
google.golang.org/grpc v1.82.1
google.golang.org/protobuf v1.36.11
golang.org/x/text v0.41.0
google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d
google.golang.org/grpc v1.83.0
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
@@ -127,7 +128,7 @@ require (
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.7.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
@@ -154,8 +155,7 @@ require (
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.40.0 // indirect
github.com/ceph/go-ceph v0.41.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cevaris/ordered_map v0.0.0-20190319150403-3adeae072e73 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
@@ -182,19 +182,19 @@ require (
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.19.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // 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.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.9.0 // indirect
github.com/go-git/go-git/v5 v5.19.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
@@ -215,7 +215,6 @@ require (
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 v1.0.0 // indirect
@@ -240,7 +239,7 @@ require (
github.com/json-iterator/go v1.1.13-0.20220915233716-71ac16282d12 // indirect
github.com/juliangruber/go-intersect v1.1.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.18.6 // indirect
github.com/klauspost/compress v1.19.2 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/klauspost/crc32 v1.3.0 // indirect
github.com/kovidgoyal/go-parallel v1.1.1 // indirect
@@ -260,7 +259,7 @@ require (
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.23 // indirect
github.com/mattn/go-sqlite3 v1.14.47 // 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
@@ -295,8 +294,8 @@ require (
github.com/pquerna/cachecontrol v0.2.0 // indirect
github.com/prometheus/alertmanager v0.33.1 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.5 // indirect
github.com/prometheus/procfs v0.20.1 // 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/rs/xid v1.6.0 // indirect
@@ -308,7 +307,7 @@ require (
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/sethvargo/go-password v0.4.0 // indirect
github.com/skeema/knownhosts v1.3.1 // indirect
github.com/spacewander/go-suffix-tree v0.0.0-20191010040751-0865e368c784 // indirect
github.com/spf13/pflag v1.0.10 // indirect
@@ -321,7 +320,7 @@ require (
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.10 // indirect
github.com/vektah/gqlparser/v2 v2.5.34 // 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
@@ -329,24 +328,24 @@ require (
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/yashtewari/glob-intersection v0.2.0 // indirect
github.com/zeebo/xxh3 v1.1.0 // indirect
go.etcd.io/etcd/api/v3 v3.6.13 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.6.13 // indirect
go.etcd.io/etcd/client/v3 v3.6.13 // indirect
go.etcd.io/etcd/api/v3 v3.7.1 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.7.1 // indirect
go.etcd.io/etcd/client/v3 v3.7.1 // 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.44.0 // indirect
go.opentelemetry.io/otel/metric v1.44.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.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.uber.org/zap v1.27.1 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/mod v0.37.0 // 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.47.0 // 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-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d // 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
+100 -100
View File
@@ -90,8 +90,8 @@ github.com/amoghe/go-crypt v0.0.0-20220222110647-20eada5f5964 h1:I9YN9WMo3SUh7p/
github.com/amoghe/go-crypt v0.0.0-20220222110647-20eada5f5964/go.mod h1:eFiR01PwTcpbzXtdMces7zxg6utvFM5puiWHpWB8D/k=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0=
github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI=
github.com/antithesishq/antithesis-sdk-go v0.7.2-default-no-op h1:p2zFsAzvhIpFya8AIOHIbWf7NGvO34QpLGclyf7nXj8=
github.com/antithesishq/antithesis-sdk-go v0.7.2-default-no-op/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
@@ -162,15 +162,13 @@ github.com/bombsimon/logrusr/v3 v3.1.0 h1:zORbLM943D+hDMGgyjMhSAz/iDz86ZV72qaak/
github.com/bombsimon/logrusr/v3 v3.1.0/go.mod h1:PksPPgSFEL2I52pla2glgCyyd2OqOHAnFF5E+g8Ixco=
github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw=
github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c=
github.com/bytecodealliance/wasmtime-go/v44 v44.0.0 h1:WRZXnLPIer/TWs5aYPaMlmVcOlzmR6Ur6wjLRIQOhTQ=
github.com/bytecodealliance/wasmtime-go/v44 v44.0.0/go.mod h1:GP93piU+39CoFVCQ5xfHrPOUtL0APlMnkbblJ2d3YY0=
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/ceph/go-ceph v0.40.0 h1:Wz9WOX6i73Hz74mpwhTO9S6IyX3eFPv88VUc7FRMPRk=
github.com/ceph/go-ceph v0.40.0/go.mod h1:1oFtT/x/4y+teLsNiogdd/Kj81Gmrw6JM5w1bWnZoc4=
github.com/ceph/go-ceph v0.41.0 h1:uATh5+zR1KWOQCoBYj4uEfuAPsSccajOGXWW8u8UTgA=
github.com/ceph/go-ceph v0.41.0/go.mod h1:8tvljRxQ65aEtRt7aCxzuPpN7tiwPHCPPSuAqQ5teCY=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
@@ -220,8 +218,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1/go.mod h1:ZXNYxsqcloTdSy/rNShjY
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE=
github.com/desertbit/timer v1.0.1 h1:yRpYNn5Vaaj6QXecdLMPMJsW81JLiI1eokUft5nBmeo=
github.com/desertbit/timer v1.0.1/go.mod h1:htRrYeY5V/t4iu1xCJ5XsQvp4xve8QulXXctAzxqcwE=
github.com/dgraph-io/badger/v4 v4.9.2 h1:Wb5qw8gElqwV1a8msHTeQKova9b1V10heFKMIiPd80E=
github.com/dgraph-io/badger/v4 v4.9.2/go.mod h1:nJjaJTUOSsQEBhsq209FmwCvMJzEA3e74RjZw6V2pQI=
github.com/dgraph-io/badger/v4 v4.9.4 h1:bcw+waCpzRZ2nmcSPbnPvDVhiEsn98TKmvnAhK7r7LM=
github.com/dgraph-io/badger/v4 v4.9.4/go.mod h1:nJjaJTUOSsQEBhsq209FmwCvMJzEA3e74RjZw6V2pQI=
github.com/dgraph-io/ristretto v0.2.0 h1:XAfl+7cmoUDWW/2Lx8TGZQjjxIQ2Ley9DSf52dru4WE=
github.com/dgraph-io/ristretto v0.2.0/go.mod h1:8uBHCU/PBV4Ag0CJrP47b9Ofby5dqWNh4FicAdoqFNU=
github.com/dgraph-io/ristretto/v2 v2.2.0 h1:bkY3XzJcXoMuELV8F+vS8kzNgicwQFAaGINAEJdWGOM=
@@ -258,8 +256,8 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF
github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w=
github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc=
github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/foxcpp/go-mockdns v1.2.0 h1:omK3OrHRD1IWJz1FuFBCFquhXslXoF17OvBS6JPzZF0=
@@ -268,8 +266,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho=
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM=
github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
github.com/gabriel-vasile/mimetype v1.4.15 h1:05iP/CYtZ/w455R/KZM6rZ5ieAdh99UPtd+d3YzLmaI=
github.com/gabriel-vasile/mimetype v1.4.15/go.mod h1:azpTcoLcDZRNgFou5j+APrqQx9HqVPWa6ijYQIIVswQ=
github.com/gdexlab/go-render v1.0.1 h1:rxqB3vo5s4n1kF0ySmoNeSPRYkEsyHgln4jFIQY7v0U=
github.com/gdexlab/go-render v1.0.1/go.mod h1:wRi5nW2qfjiGj4mPukH4UV0IknS1cHD4VgFTmJX5JzM=
github.com/ggwhite/go-masker v1.1.0 h1:kN/KIvktu2U+hd3KWrSlLj7xBGD1iBfc9/xdbVgFbRc=
@@ -300,8 +298,8 @@ github.com/go-git/go-billy/v5 v5.9.0 h1:jItGXszUDRtR/AlferWPTMN4j38BQ88XnXKbilmm
github.com/go-git/go-billy/v5 v5.9.0/go.mod h1:jCnQMLj9eUgGU7+ludSTYoZL/GGmii14RxKFj7ROgHw=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.19.1 h1:nX27AnaU43/K5bKktKwgBmR9lawoYVe1Ckg0rgzzN00=
github.com/go-git/go-git/v5 v5.19.1/go.mod h1:Pb1v0c7/g8aGQJwx9Us09W85yGoyvSwuhEGMH7zjDKQ=
github.com/go-git/go-git/v5 v5.19.2 h1:wkfn7vOlUBu8ivAWKBWisTiwJK4jYHzTF8Ndv1LyGqY=
github.com/go-git/go-git/v5 v5.19.2/go.mod h1:QqCBE1EFN5ddFmrliLQ3/ntRCUjZU3EJuwuB/jWEHjk=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -327,8 +325,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8=
github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-micro/plugins/v4/client/grpc v1.2.1 h1:7xAwZRCO6mdUtBHsYIQs1/eCTdhCrnjF70GB+AVd6L0=
@@ -395,10 +393,9 @@ github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw=
github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0=
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid/v5 v5.4.0 h1:EfbpCTjqMuGyq5ZJwxqzn3Cbr2d0rUZU7v5ycAk/e/0=
github.com/gofrs/uuid/v5 v5.4.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gofrs/uuid/v5 v5.5.0 h1:FkPv6jYQRbZtH3bD8yC7106u+CedTCLF8+t7CLHSZNo=
github.com/gofrs/uuid/v5 v5.5.0/go.mod h1:bbAA98EoIlxyRHIVg6ektCSsZ5n8mSbwgEhvhMYlZgg=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
@@ -502,8 +499,8 @@ github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E=
github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY=
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-plugin v1.8.0 h1:ie8S6RRY8RvB2usYZv+AAZ/wBvx2AU5p5QeP5j/FORs=
@@ -576,8 +573,8 @@ github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao=
github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
github.com/klauspost/compress v1.19.2 h1:hMRETovs/pu/dVWN7zIT1PGG8t509MwT6bO7XSi26R8=
github.com/klauspost/compress v1.19.2/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
@@ -652,8 +649,8 @@ github.com/mattn/go-isatty v0.0.21 h1:xYae+lCNBP7QuW4PUnNG61ffM4hVIfm+zUzDuSzYLG
github.com/mattn/go-isatty v0.0.21/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4=
github.com/mattn/go-runewidth v0.0.23 h1:7ykA0T0jkPpzSvMS5i9uoNn2Xy3R383f9HDx3RybWcw=
github.com/mattn/go-runewidth v0.0.23/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
github.com/mattn/go-sqlite3 v1.14.47 h1:jOBI62gS7nKeZv+as1oGEy0+1qISgXwH/QBlR6KbfIo=
github.com/mattn/go-sqlite3 v1.14.47/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w=
github.com/mattn/go-sqlite3 v1.14.49 h1:B8jBHC3xhxZgxztrgruTuLucebnULQnx4W7cF7SAE9w=
github.com/mattn/go-sqlite3 v1.14.49/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/maxymania/go-system v0.0.0-20170110133659-647cc364bf0b h1:Q53idHrTuQDDHyXaxZ6pUl0I9uyD6Z6uKFK3ocX6LzI=
github.com/maxymania/go-system v0.0.0-20170110133659-647cc364bf0b/go.mod h1:KirJrATYGbTyUwVR26xIkaipRqRcMRXBf8N5dacvGus=
@@ -699,10 +696,10 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nats-io/jwt/v2 v2.8.2 h1:XXRgB60MSTnqsRwejQurVDs/hcv2dkt+86GjI+I/bMc=
github.com/nats-io/jwt/v2 v2.8.2/go.mod h1:Ag/56sq9OblL4JgdYufDd16Egb17Kr/8WwwuO/forVc=
github.com/nats-io/nats-server/v2 v2.14.3 h1:+xjydPt7rkit67G+04TN0mcO2n+8nveZE7tK/PPV53A=
github.com/nats-io/nats-server/v2 v2.14.3/go.mod h1:5IlCtBzfwyzQzPMjmoJ9W2/LKmnJRtNyuOs/OT+NHDY=
github.com/nats-io/nats.go v1.52.0 h1:n3avV4VBsCgsdwh71TppsTwtv+QdPs7ntSKM8qJLGsc=
github.com/nats-io/nats.go v1.52.0/go.mod h1:26HypzazeOkyO3/mqd1zZd53STJN0EjCYF9Uy2ZOBno=
github.com/nats-io/nats-server/v2 v2.14.5 h1:M6yeo/Xb7khi97RSEVELof3DForDqmYza3P4tHCPFWw=
github.com/nats-io/nats-server/v2 v2.14.5/go.mod h1:1D3iocrisKvWaD1B/imqarTqmaGrWMqALMLbEDo3v7Q=
github.com/nats-io/nats.go v1.53.1 h1:Otsq3uLc/kLdjmkNHkXH0jBqwUquwdKFoe3fq6/3/Xo=
github.com/nats-io/nats.go v1.53.1/go.mod h1:26HypzazeOkyO3/mqd1zZd53STJN0EjCYF9Uy2ZOBno=
github.com/nats-io/nkeys v0.4.16 h1:rd5oAuLOb8mnAycB0xleuEBNS1pVVnN0fv/FF34Eypg=
github.com/nats-io/nkeys v0.4.16/go.mod h1:llLgWoI0o4z/Q57q2R1kHfmocyhGV6VG/U18Glg1Afs=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
@@ -724,14 +721,14 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.32.0 h1:Hw7s2pVrQo/8Yz5N77qdnpHaoc+c6cC9WIV1Jce+J6E=
github.com/onsi/ginkgo/v2 v2.32.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44=
github.com/onsi/ginkgo/v2 v2.32.1 h1:6tlvcDm/3sE8lGJbZ4+d4mO3RLy24/tQWOFzVSQNIfw=
github.com/onsi/ginkgo/v2 v2.32.1/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.42.1 h1:iN1rCUX+44NZ1Dc97MPoeFYbFR0vh8zxoxMFwKdyZ6I=
github.com/onsi/gomega v1.42.1/go.mod h1:REff/hsDsodHoKlWsP2mAPhu1+5/6hVYNf9rIEBpeSg=
github.com/open-policy-agent/opa v1.18.2 h1:VBiLJpioTuk7XTW1JoQi4ILo+FVxD2/8uD8iP9/OcxY=
github.com/open-policy-agent/opa v1.18.2/go.mod h1:9GY+hER4ZEXtxPlMjftVbqJJY9xLtCD3Q0oufRCfAKo=
github.com/open-policy-agent/opa v1.19.0 h1:+j2OCsjMezZEML2T1lI9giJdGJS/PL1XFKgkHPGIhpo=
github.com/open-policy-agent/opa v1.19.0/go.mod h1:pb6Y6klyf7X7X8uXNDflruA9dQC2gMqWROXI5w/kvv0=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
@@ -739,8 +736,8 @@ github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HD
github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI=
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245 h1:JRidLTAKhnvyLMRtVtSF4lhBa0NSAOs6fof+d6JnKII=
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245/go.mod h1:z61VMGAJRtR1nbgXWiNoCkxUXP1B3Je9rMuJbnGd+Og=
github.com/owncloud/reva/v2 v2.0.0-20260722181911-d084587fefc7 h1:VGWhUAYu3TYCmkvk5PNG2+rEH7VFR2uxny/ZQXaE71g=
github.com/owncloud/reva/v2 v2.0.0-20260722181911-d084587fefc7/go.mod h1:m2fGRZDsnNSBszbnwysuq7uhlitQ90+weX4FFQRdkak=
github.com/owncloud/reva/v2 v2.0.0-20260821144357-79bb0520701d h1:aXW5V1zEJnBZTciBDug02m1eEMkA/mHKer1PiBSoHOk=
github.com/owncloud/reva/v2 v2.0.0-20260821144357-79bb0520701d/go.mod h1:DGoRFcaZdpikfpo14QD9gPHUDw6oodKdFOrVLSa1raA=
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw=
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0=
github.com/pablodz/inotifywaitgo v0.0.12 h1:DVJJTFMDlSAdO46yisPF2vzozs/r+4k6ih8MVghq78M=
@@ -780,8 +777,8 @@ github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_golang v1.24.1 h1:JnJkREXzWxUdCuPFpIWZiPispT9xVV59uiuyR2bPlnU=
github.com/prometheus/client_golang v1.24.1/go.mod h1:F+oSRECHg4sse5ucfYpYDeIv/hu68Zo0uoHKetWnzcE=
github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -796,8 +793,8 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4=
github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw=
github.com/prometheus/common v0.70.1 h1:1HvjP4D5oL3t8RsPlwxA9onvvStjtIHYE5XuuwOi/PY=
github.com/prometheus/common v0.70.1/go.mod h1:VdFUQDMZK3VLkurFUVhia6uys/0suUp86TJz5qbJRhc=
github.com/prometheus/procfs v0.0.0-20170703101242-e645f4e5aaa8/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
@@ -805,8 +802,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc=
github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo=
github.com/prometheus/procfs v0.21.1 h1:GljZCt+zSTS+NZq88cyQ1LjZ+RCHp3uVuabBWA5+OJI=
github.com/prometheus/procfs v0.21.1/go.mod h1:aB55Cww9pdSJVHk0hUf0inxWyyjPogFIjmHKYgMKmtY=
github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI=
github.com/prometheus/statsd_exporter v0.22.8 h1:Qo2D9ZzaQG+id9i5NYNGmbf1aa/KxKbB9aKfMS+Yib0=
github.com/prometheus/statsd_exporter v0.22.8/go.mod h1:/DzwbTEaFTE0Ojz5PqcSk6+PFHOPWGxdXVr6yC8eFOM=
@@ -815,8 +812,8 @@ github.com/r3labs/sse/v2 v2.10.0/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktE
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 h1:bsUq1dX0N8AOIL7EB/X911+m4EHsnWEHeJ0c+3TTBrg=
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.15.0 h1:D0RCU5rMAp+SpgkiNdrjfJ+LX4J1M32V2NeCY7EJ6hc=
github.com/rogpeppe/go-internal v1.15.0/go.mod h1:DrUVZyrJU+txYW5/1kwtXQSMFio52ZOxX7yM1VHvnxs=
github.com/rogpeppe/go-internal v1.16.0 h1:O9DK+vNMDVGLr2BeZqmpLeMjiMNkuXfcqntWbZV6S5g=
github.com/rogpeppe/go-internal v1.16.0/go.mod h1:DrUVZyrJU+txYW5/1kwtXQSMFio52ZOxX7yM1VHvnxs=
github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA=
github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
@@ -839,8 +836,8 @@ github.com/sercand/kuberesolver/v5 v5.1.1 h1:CYH+d67G0sGBj7q5wLK61yzqJJ8gLLC8aep
github.com/sercand/kuberesolver/v5 v5.1.1/go.mod h1:Fs1KbKhVRnB2aDWN12NjKCB+RgYMWZJ294T3BtmVCpQ=
github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
github.com/sethvargo/go-password v0.3.1 h1:WqrLTjo7X6AcVYfC6R7GtSyuUQR9hGyAj/f1PYQZCJU=
github.com/sethvargo/go-password v0.3.1/go.mod h1:rXofC1zT54N7R8K/h1WDUdkf9BOx5OptoxrMBcrXzvs=
github.com/sethvargo/go-password v0.4.0 h1:eSidVKQw5C7CmTDAtH3RipBTSjdU1ZRxQaynD2GWLVU=
github.com/sethvargo/go-password v0.4.0/go.mod h1:PO3nYHwUpcHPR0F9woy7a4abZPvzRuqJr0GaeIYTm3k=
github.com/shamaton/msgpack/v2 v2.4.1 h1:JtJ141QoQ3NqgPDsjq2v9VXlaON8SiQOwEaoNLEK/MQ=
github.com/shamaton/msgpack/v2 v2.4.1/go.mod h1:6khjYnkx73f7VQU7wjcFS9DFjs+59naVWJv1TB7qdOI=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
@@ -849,8 +846,8 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
github.com/sirupsen/logrus v1.10.0 h1:T8MxJJXVZkfcC5zSRMRAg2F8+lxjmUCGGWPzFxO+Msc=
github.com/sirupsen/logrus v1.10.0/go.mod h1:FXZFonkDAnFozmO+5hGAFvB0Yg9/j2SIhA/QuIkP180=
github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8=
github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY=
github.com/spacewander/go-suffix-tree v0.0.0-20191010040751-0865e368c784 h1:0jjO3HdJfOn6gYHD/ZNZh0LLMxEAqkYX7xoDPQReEgs=
@@ -887,6 +884,8 @@ github.com/tchap/go-patricia/v2 v2.3.3 h1:xfNEsODumaEcCcY3gI0hYPZ/PcpVv5ju6RMAhg
github.com/tchap/go-patricia/v2 v2.3.3/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k=
github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE=
github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU=
github.com/tetratelabs/wazero v1.12.0 h1:DuWcpNu/FzgEXgGBDp8J1Spc+CWOvvtvVyjKlaZopYU=
github.com/tetratelabs/wazero v1.12.0/go.mod h1:LvKtzl2RqO4gyF27BiXU+nKAjcV8f38U+kP/q2vgxh0=
github.com/thanhpk/randstr v1.0.6 h1:psAOktJFD4vV9NEVb3qkhRSMvYh4ORRaj1+w/hn4B+o=
github.com/thanhpk/randstr v1.0.6/go.mod h1:M/H2P1eNLZzlDwAzpkkkUvoyNNMbzRGhESZuEQk3r0U=
github.com/thejerf/suture/v4 v4.0.6 h1:QsuCEsCqb03xF9tPAsWAj8QOAJBgQI1c0VqJNaingg8=
@@ -915,8 +914,8 @@ github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU=
github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4=
github.com/valyala/fastjson v1.6.10 h1:/yjJg8jaVQdYR3arGxPE2X5z89xrlhS0eGXdv+ADTh4=
github.com/valyala/fastjson v1.6.10/go.mod h1:e6FubmQouUNP73jtMLmcbxS6ydWIpOfhz34TSfO3JaE=
github.com/vektah/gqlparser/v2 v2.5.34 h1:MEea5P0qhdcqfBL45ghKE+qr9laidVHTMHjav5h7ckk=
github.com/vektah/gqlparser/v2 v2.5.34/go.mod h1:mFdHLGCio7OGX1fby9ZjTW6FN+qxgmbnBcRIeeScE5s=
github.com/vektah/gqlparser/v2 v2.5.36 h1:CN9mKVHgMkc+XftdOWIhb4HEL8wKSYkFAqhf8booa7s=
github.com/vektah/gqlparser/v2 v2.5.36/go.mod h1:cAJ9qwVgPaUkWv6Gn8vn0mqOE0Ui5Pn56wNy5396XWo=
github.com/wk8/go-ordered-map v1.0.0 h1:BV7z+2PaK8LTSd/mWgY12HyMAo5CEgkHqbkVq2thqr8=
github.com/wk8/go-ordered-map v1.0.0/go.mod h1:9ZIbRunKbuvfPKyBP1SIKLcXNlv74YCOZ3t3VTS6gRk=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
@@ -950,12 +949,12 @@ github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s=
go.etcd.io/bbolt v1.5.0 h1:S7GAl7Fxv12yohbwFfIbQCGDWbQbtDGPET4P/bD4lxU=
go.etcd.io/bbolt v1.5.0/go.mod h1:mkltfYE5aUHQxUct9N9V+Kp7aSjFqjgrhcXIS70Lrdk=
go.etcd.io/etcd/api/v3 v3.6.13 h1:AvHPZv15LYEe7tZDyFglv7xnbiuF6GMZpZqKpIzXTt0=
go.etcd.io/etcd/api/v3 v3.6.13/go.mod h1:X9+3gaKwzjlOxzo6TZ2u3b7HcHBcAL+Ph7EBPjI/VWk=
go.etcd.io/etcd/client/pkg/v3 v3.6.13 h1:7QeMOisYByx8dBA7/CKcwCaPWfjb5C0xpmrIov/8WyY=
go.etcd.io/etcd/client/pkg/v3 v3.6.13/go.mod h1:Dn2zUBOCu/6xYcd6iAjB7LgoY16OTQjDZfWHLwvuQj4=
go.etcd.io/etcd/client/v3 v3.6.13 h1:0E+9ZYGpMsi9KlOJVoCdONh9PUDawKDTy5mSNY8wOEI=
go.etcd.io/etcd/client/v3 v3.6.13/go.mod h1:rtVI3vwobljb8xlTGcp1Yhz7hBIuBWULXwB848kqJGw=
go.etcd.io/etcd/api/v3 v3.7.1 h1:KJG0/DcWGfe3Y1otDf/fsBf0TSSgpxZ5RO/L8SFt73E=
go.etcd.io/etcd/api/v3 v3.7.1/go.mod h1:8bXIpCMeV7E3/XL0Ix123ATn3dB+0V7d9zklHbB0m78=
go.etcd.io/etcd/client/pkg/v3 v3.7.1 h1:rKYsj3pRkR0eK3yjT3XOgrhqfmIfj9pzNgxjh7mfFv4=
go.etcd.io/etcd/client/pkg/v3 v3.7.1/go.mod h1:cnzZGIUzSfjEwLC6UBVsSXlEK1eepS/JUD7wE6PLRT0=
go.etcd.io/etcd/client/v3 v3.7.1 h1:0PEMMC0KuZmVIN+RAbdqfkZ45pYTgKVtmBEbRCvZFUg=
go.etcd.io/etcd/client/v3 v3.7.1/go.mod h1:ffNqALa8tRCYhYo1F9oR489y23K39Gz+BSR3ApAGYq0=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@@ -966,30 +965,30 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0 h1:2yEATaop1/a1I4psnSLgWVPLWwCzkqWakgJy7xTDVy0=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0/go.mod h1:D7J12YRapIekYyPWgGPlA/23pRmpSEZC5xJC/TTLI9U=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI=
go.opentelemetry.io/contrib/zpages v0.69.0 h1:YQC1PumJq6lUGQNrLW14ID9a0dXSBcbC/aC6VRSIARU=
go.opentelemetry.io/contrib/zpages v0.69.0/go.mod h1:FGvUcMGN5atRzUIgUsqOi+MiMvlQsfbuYATBHPP4cGs=
go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU=
go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0 h1:oECp5f+hN7nkwjU/8BxQ/q23bGPb8FIrD839owX222E=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0/go.mod h1:DqEFwLumhzMBDQv9PcWbyoDxHI/4lAk6CM4nJBH39sc=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 h1:LMuyCAyfalSjDyjdC65nK6N0zoTT63+E/u95X0JovZI=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04=
go.opentelemetry.io/contrib/zpages v0.70.0 h1:uBcclHekIrCRLO4KZfXiebDcWB52QQXaHGgvhUJ1K5I=
go.opentelemetry.io/contrib/zpages v0.70.0/go.mod h1:Nz9A1+68HVoJrk+cg92zJbcbHFAa+Jbl1uINwAlcK94=
go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU=
go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 h1:4YsVu3B8+3qtWYYrsUYgn0OG78pN0rnNPRGX4SbokQI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0/go.mod h1:+wnlSn0mD1ADVMe3v9Z/WIaiz6q6gL2J/ejaAmdmv80=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 h1:qazEJlUOQzhCpzQpFETGby7EdqjI1wsd0W+6Gg1SCTU=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0/go.mod h1:fOD2Yefuxixkx3ahVNf0O/PERb6r4OlbxfATVnYvzCo=
go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc=
go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo=
go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58=
go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0=
go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI=
go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA=
go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk=
go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE=
go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g=
go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0 h1:QRefszxJmfPdjXUUm3j6iDzY03mTPXMjqErFqQ67vUg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0/go.mod h1:Tiz03lTBVBrm7eWZBOidzEaYaJa8tjwGUGv6d8mlTyk=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0 h1:fG5MCxGz8+2VtrN/WgqSpJFctVz24gpxj8CxkKmc8Ww=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0/go.mod h1:BmAYTn+3ysbRe+IU2msxmf5Rx3g6DHvex+tWI3LdhYI=
go.opentelemetry.io/otel/metric v1.45.0 h1:7Eg1uH7CJ5cXv9is6tnBe1FI6rj1nwUdbFypRm3br/M=
go.opentelemetry.io/otel/metric v1.45.0/go.mod h1:HAPbm1nd3p1PmFH7v2dR+6BjXxw+Lq4a2+pndMAm08s=
go.opentelemetry.io/otel/sdk v1.45.0 h1:4VVSMgQ83dUgW2aoX5f6JgLvHwIvzcuLnF9lUdCSpCw=
go.opentelemetry.io/otel/sdk v1.45.0/go.mod h1:Sr40LgXV7DsKMMJMKOhUWOgMWTfAaqvm2kF0g7ilwuA=
go.opentelemetry.io/otel/sdk/metric v1.45.0 h1:oVFszMfyj1Am6s24Vtc7wBb8BKLcwepJjNEYILuiE3o=
go.opentelemetry.io/otel/sdk/metric v1.45.0/go.mod h1:vUWUxDZvu1WVRj8JA8S0AdhsPrZoDpA2DdZauIh4mDA=
go.opentelemetry.io/otel/trace v1.45.0 h1:l/mP6Uv7oNO7/TblbhpbgMidxhq1uO/rPsikOyVhxag=
go.opentelemetry.io/otel/trace v1.45.0/go.mod h1:qoJJA2xNMnxRrdISU/kLtfUH2wNeQbiv+jhs/CxI8bc=
go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk=
go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
@@ -998,12 +997,13 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -1015,8 +1015,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M=
golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1031,8 +1031,8 @@ golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJk
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.44.0 h1:+tDekMZED9+LrtB3G5xzRggpVh9CARjZqROla3R3R+I=
golang.org/x/image v0.44.0/go.mod h1:V8K3KE9KKKE+pLpQDOeN18w9oacNSvy1tDOirTu4xtY=
golang.org/x/image v0.45.0 h1:FMb1nTbH5H9vF55SriQHgFw5GnNL9Jg6L25BwXKzhB0=
golang.org/x/image v0.45.0/go.mod h1:n62x/7RqlwXDvGsSU4u6IUTUf6KghUZ9Bt7cG/T9Fx4=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -1054,8 +1054,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ=
golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0=
golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs=
golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1099,8 +1099,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To=
golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -1210,8 +1210,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1264,8 +1264,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210112230658-8b4aab62c064/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q=
golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA=
golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI=
golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -1326,10 +1326,10 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 h1:XzmzkmB14QhVhgnawEVsOn6OFsnpyxNPRY9QV01dNB0=
google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:L43LFes82YgSonw6iTXTxXUX1OlULt4AQtkik4ULL/I=
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:Kjn0N0tCrDgiAFW+lGO4JZ3ck44CehvJQMAwj9QF0G8=
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d h1:FarXi840EJWSHYTN3ERkADbPWjl307+FGrA22KAVjjc=
google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d/go.mod h1:K/+WGbmBY7aNW1HDw1fJnKYo10i0DkAX6pows00dLig=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d h1:IL4hdHzcUv2l/gcg98/Rj3FbtE6axwqslOW8SW0C+S0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -1343,8 +1343,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE=
google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA=
google.golang.org/grpc v1.83.0 h1:JeNZEKJFbQxArAMl+hiytHauacDNqJUllNfmIMmpqnQ=
google.golang.org/grpc v1.83.0/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ=
google.golang.org/grpc/examples v0.0.0-20211102180624-670c133e568e h1:m7aQHHqd0q89mRwhwS9Bx2rjyl/hsFAeta+uGrHsQaU=
google.golang.org/grpc/examples v0.0.0-20211102180624-670c133e568e/go.mod h1:gID3PKrg7pWKntu9Ss6zTLJ0ttC0X9IHgREOCZwbCVU=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
@@ -1361,8 +1361,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y=
gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI=
+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
@@ -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
+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"`
@@ -83,6 +87,10 @@ type LDAPProvider struct {
UserGuestAttribute string `yaml:"user_guest_attribute" env:"OCIS_LDAP_USER_GUEST_ATTRIBUTE" desc:"LDAP attribute that marks a user as a guest of an instance." introductionVersion:"7.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"
ocisldap "github.com/owncloud/ocis/v2/ocis-pkg/ldap"
@@ -52,9 +53,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.
+1 -1
View File
@@ -34,7 +34,7 @@ type Config struct {
EnableFederatedSharingIncoming bool `yaml:"enable_federated_sharing_incoming" env:"OCIS_ENABLE_OCM;FRONTEND_ENABLE_FEDERATED_SHARING_INCOMING" desc:"Changing this value is NOT supported. Enables support for incoming federated sharing for clients. The backend behaviour is not changed." introductionVersion:"pre5.0"`
EnableFederatedSharingOutgoing bool `yaml:"enable_federated_sharing_outgoing" env:"OCIS_ENABLE_OCM;FRONTEND_ENABLE_FEDERATED_SHARING_OUTGOING" desc:"Changing this value is NOT supported. Enables support for outgoing federated sharing for clients. The backend behaviour is not changed." introductionVersion:"pre5.0"`
EnableUserSharing bool `yaml:"enable_user_sharing" env:"OCIS_ENABLE_USER_SHARING" desc:"Enables direct sharing with users and groups. When disabled, creating new user or group shares is rejected and searching for users to share with is disabled. Public link sharing is not affected." introductionVersion:"%%NEXT_PRODUCTION_VERSION%%"`
EnablePublicSharing bool `yaml:"enable_public_sharing" env:"OCIS_ENABLE_PUBLIC_SHARING" desc:"Enables public link sharing. When disabled, creating new public links is rejected. Direct sharing with users and groups is not affected." introductionVersion:"%%NEXT_PRODUCTION_VERSION%%"`
EnablePublicSharing bool `yaml:"enable_public_sharing" env:"OCIS_ENABLE_PUBLIC_SHARING" desc:"Enables public link sharing. When disabled, creating new public links is rejected. Direct sharing with users and groups is not affected." introductionVersion:"8.2.0"`
SearchMinLength int `yaml:"search_min_length" env:"FRONTEND_SEARCH_MIN_LENGTH" desc:"Minimum number of characters to enter before a client should start a search for Share receivers. This setting can be used to customize the user experience if e.g too many results are displayed." introductionVersion:"pre5.0"`
UserSearchDisplayedAttributes []string `yaml:"user_search_displayed_attributes" env:"OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES;FRONTEND_USER_SEARCH_DISPLAYED_ATTRIBUTES" desc:"A list of user attributes to display in the user search results." introductionVersion:"7.3.0"`
Edition string `yaml:"edition" env:"OCIS_EDITION;FRONTEND_EDITION" desc:"Edition of oCIS. Used for branding purposes." introductionVersion:"pre5.0"`
+5 -2
View File
@@ -93,6 +93,9 @@ type Cache struct {
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"`
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"`
}
+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,
},
},
"authregistry": map[string]interface{}{
+10
View File
@@ -59,6 +59,16 @@ is based on the [OData Specification](https://docs.oasis-open.org/odata/odata/v4
See the [Libre Graph API](https://owncloud.dev/libre-graph-api/#/users/ListUsers) for examples
on the filters supported when querying users.
## Space Image File Size
A space can have an image, set by assigning a file in the space's `.space` folder via `PATCH /graph/v1beta1/drives/{drive-id}`. Space images are rendered exclusively as thumbnails and there is no raw download fallback, which means an image that the `thumbnails` service refuses to process cannot be displayed at all.
The graph service therefore rejects an assignment with `413/Request Entity Too Large` if the referenced file exceeds `GRAPH_MAX_IMAGE_FILE_SIZE`, defaulting to `50MB`. Without this check, assigning a too large image would succeed but the image would silently never appear. A previously set space image is left unchanged when an assignment is rejected. Set the value to `0` to not limit the file size.
This limit is independent of `THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE` of the `thumbnails` service, which is the upper bound for any image that can be rendered at all. A deployment can set a stricter limit for space images than for thumbnails in general, but `GRAPH_MAX_IMAGE_FILE_SIZE` must be less than or equal to `THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE`. Both default to `50MB`. If the graph limit is set higher, images between the two values are accepted as a space image but cannot be rendered.
Only the file size is enforced. The independent dimension limits of the `thumbnails` service, `THUMBNAILS_MAX_INPUT_WIDTH` and `THUMBNAILS_MAX_INPUT_HEIGHT`, are not checked here, because image dimensions cannot be determined without downloading and decoding the image. A small image with very large dimensions can therefore still be accepted and still fail to render.
## Caching
The `graph` service can use a configured store via `GRAPH_CACHE_STORE`. Possible stores are:
+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"`
}
+19 -11
View File
@@ -63,16 +63,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"`
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.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"`
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.2.0"`
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"`
@@ -182,7 +189,8 @@ type ServiceAccount struct {
}
type Validation struct {
MaxTagLength int `yaml:"max_tag_length" env:"OCIS_MAX_TAG_LENGTH" desc:"Define the maximum tag length. Defaults to 100 if not set. Set to 0 to not limit the tag length. Changes only impact the validation of new tags." introductionVersion:"7.2.0"`
MaxTagLength int `yaml:"max_tag_length" env:"OCIS_MAX_TAG_LENGTH" desc:"Define the maximum tag length. Defaults to 100 if not set. Set to 0 to not limit the tag length. Changes only impact the validation of new tags." introductionVersion:"7.2.0"`
MaxImageFileSize string `yaml:"max_image_file_size" env:"GRAPH_MAX_IMAGE_FILE_SIZE" desc:"The maximum file size of an image which can be set as a space image. Must be less than or equal to 'THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE' of the thumbnails service, otherwise images between the two values are accepted but cannot be rendered. Usable common abbreviations: [KB, KiB, MB, MiB, GB, GiB, TB, TiB, PB, PiB, EB, EiB], example: 2GB. Set to 0 to not limit the file size." introductionVersion:"8.3.0"`
}
// MultiInstanceConfig holds configuration for multi-instance-ocis
@@ -88,10 +88,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: "",
@@ -135,7 +139,8 @@ func DefaultConfig() *config.Config {
AvailableRoles: nil, // will be populated with defaults in EnsureDefaults
},
Validation: config.Validation{
MaxTagLength: 100,
MaxTagLength: 100,
MaxImageFileSize: "50MB",
},
}
}
+81 -9
View File
@@ -12,6 +12,7 @@ import (
"time"
"github.com/CiscoM31/godata"
backoff "github.com/cenkalti/backoff/v5"
"github.com/go-ldap/ldap/v3"
"github.com/google/uuid"
"github.com/libregraph/idm/pkg/ldapdn"
@@ -54,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
@@ -149,6 +155,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,
@@ -195,6 +210,9 @@ func NewLDAPBackend(lc ldap.Client, config config.LDAP, logger *log.Logger, inst
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,
@@ -266,10 +284,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
}
@@ -439,11 +468,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)
@@ -523,6 +553,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")
}
@@ -533,7 +570,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=*)"
}
@@ -593,6 +663,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
@@ -1159,6 +1230,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)
@@ -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,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)
})
}
+88 -2
View File
@@ -8,6 +8,7 @@ import (
"net/http"
"net/url"
"path"
"slices"
"sort"
"strconv"
"strings"
@@ -58,8 +59,34 @@ var (
// ErrForbiddenCharacter is thrown when the spacename contains an invalid character
ErrForbiddenCharacter = fmt.Errorf("spacenames must not contain %v", _invalidSpaceNameCharacters)
errSpaceImageTooLarge = errors.New("space image is too large")
)
func (g Graph) checkSpaceImageFileSize(ctx context.Context, gatewayClient gateway.GatewayAPIClient, fileID string) error {
if g.maxImageFileSize == 0 {
return nil
}
resourceID, err := storagespace.ParseID(fileID)
if err != nil {
return errorcode.New(errorcode.InvalidRequest, fmt.Sprintf("invalid space image id: %v", err))
}
statResponse, err := gatewayClient.Stat(ctx, &storageprovider.StatRequest{
Ref: &storageprovider.Reference{ResourceId: &resourceID},
})
if err := errorcode.FromStat(statResponse, err); err != nil {
return err
}
if size := statResponse.GetInfo().GetSize(); size > g.maxImageFileSize {
return fmt.Errorf("%w: %d bytes exceeds the maximum of %d bytes", errSpaceImageTooLarge, size, g.maxImageFileSize)
}
return nil
}
// GetDrives serves as a factory method that returns the appropriate
// http.Handler function based on the specified API version.
func (g Graph) GetDrives(version APIVersion) http.HandlerFunc {
@@ -234,6 +261,12 @@ func (g Graph) getDrives(r *http.Request, unrestricted bool, apiVersion APIVersi
return nil, errorcode.New(errorcode.GeneralException, err.Error())
}
// An unrestricted listing includes other users' personal spaces; drop the
// ones the caller may not see (project/shared spaces are unaffected).
if unrestricted {
spaces = g.filterForeignPersonalSpaces(ctx, spaces)
}
spaces, err = sortSpaces(odataReq, spaces)
if err != nil {
logger.Debug().Err(err).Msg("could not get drives: error sorting the spaces list according to query")
@@ -243,6 +276,37 @@ func (g Graph) getDrives(r *http.Request, unrestricted bool, apiVersion APIVersi
return spaces, nil
}
// filterForeignPersonalSpaces drops personal spaces the caller does not own,
// unless the caller holds full account management permission (OCISDEV-660).
func (g Graph) filterForeignPersonalSpaces(ctx context.Context, spaces []*libregraph.Drive) []*libregraph.Drive {
user, ok := revactx.ContextGetUser(ctx)
if !ok {
// No caller identity: drop every personal space rather than leak it.
return slices.DeleteFunc(slices.Clone(spaces), func(d *libregraph.Drive) bool {
return d.GetDriveType() == _spaceTypePersonal
})
}
callerID := user.GetId().GetOpaqueId()
isForeignPersonal := func(d *libregraph.Drive) bool {
if d.GetDriveType() != _spaceTypePersonal {
return false
}
owner := d.GetOwner()
ownerUser := owner.GetUser()
return ownerUser.GetId() != callerID
}
if !slices.ContainsFunc(spaces, isForeignPersonal) {
return spaces
}
if g.contextUserHasFullAccountPerms(ctx) {
return spaces
}
return slices.DeleteFunc(slices.Clone(spaces), isForeignPersonal)
}
// GetSingleDrive V1 does a lookup of a single space by spaceId
func (g Graph) GetSingleDrive(w http.ResponseWriter, r *http.Request) {
g.getSingleDrive(w, r, APIVersion_1)
@@ -305,6 +369,9 @@ func (g Graph) getSingleDrive(w http.ResponseWriter, r *http.Request, apiVersion
errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, err.Error())
return
}
// Runs unrestricted, so decomposedfs skips per-node checks; drop a foreign
// personal space here so it renders the same 404 as a missing drive below.
spaces = g.filterForeignPersonalSpaces(ctx, spaces)
switch num := len(spaces); {
case num == 0:
log.Debug().Msg("could not get drive: no drive returned from storage")
@@ -560,9 +627,28 @@ func (g Graph) updateDrive(w http.ResponseWriter, r *http.Request, apiVersion AP
}
for _, special := range drive.Special {
if special.Id != nil {
updateSpaceRequest.StorageSpace.Opaque = utils.AppendPlainToOpaque(updateSpaceRequest.StorageSpace.Opaque, *special.SpecialFolder.Name, *special.Id)
if special.Id == nil {
continue
}
// A space image which exceeds the thumbnailer's maximum input file size
// can be stored but never rendered, and the web UI has no raw-download
// fallback, so it would silently stay invisible. Reject it here instead.
if special.SpecialFolder.GetName() == SpaceImageSpecialFolderName {
if err := g.checkSpaceImageFileSize(r.Context(), gatewayClient, *special.Id); err != nil {
logger.Debug().Err(err).Str("fileID", *special.Id).Msg("could not update drive: space image rejected")
if errors.Is(err, errSpaceImageTooLarge) {
// errorcode.InvalidRequest renders as 400 by default, but the
// specific problem here is the size of the payload.
errorcode.InvalidRequest.Render(w, r, http.StatusRequestEntityTooLarge, err.Error())
return
}
errorcode.RenderError(w, r, err)
return
}
}
updateSpaceRequest.StorageSpace.Opaque = utils.AppendPlainToOpaque(updateSpaceRequest.StorageSpace.Opaque, *special.SpecialFolder.Name, *special.Id)
}
if _, ok := drive.GetNameOk(); ok {
+1
View File
@@ -68,6 +68,7 @@ type Graph struct {
keycloakClient keycloak.Client
historyClient ehsvc.EventHistoryService
traceProvider trace.TracerProvider
maxImageFileSize uint64
}
// ServeHTTP implements the Service interface.
+311
View File
@@ -92,6 +92,16 @@ var _ = Describe("Graph", func() {
It("returns a service", func() {
Expect(svc).ToNot(BeNil())
})
It("fails when the maximum image file size is not parseable", func() {
cfg.Validation.MaxImageFileSize = "notasize"
_, err := service.NewService(
service.Config(cfg),
service.WithGatewaySelector(gatewaySelector),
)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("max_image_file_size"))
})
})
Describe("Drives", func() {
@@ -1203,6 +1213,307 @@ var _ = Describe("Graph", func() {
return req.StorageSpace.Id.OpaqueId == "spaceid" && req.StorageSpace.Quota.QuotaMaxBytes == uint64(1000)
}))
})
Describe("setting the space image", func() {
var (
imageFileID = "spaceid$spaceid!imageid"
spaceImageUpdate = func() []byte {
drive := libregraph.NewDrive("thename")
drive.SetSpecial([]libregraph.DriveItem{{
Id: &imageFileID,
SpecialFolder: &libregraph.SpecialFolder{Name: libregraph.PtrString("image")},
}})
driveJson, err := json.Marshal(drive)
Expect(err).ToNot(HaveOccurred())
return driveJson
}
patchDrive = func(body []byte) {
r := httptest.NewRequest(http.MethodPatch, "/graph/v1.0/drives/{driveID}/", bytes.NewBuffer(body))
rctx := chi.NewRouteContext()
rctx.URLParams.Add("driveID", "spaceid")
r = r.WithContext(context.WithValue(revactx.ContextSetUser(ctx, currentUser), chi.RouteCtxKey, rctx))
svc.UpdateDrive(rr, r)
}
onStatReturnSize = func(size uint64) {
gatewayClient.On("Stat", mock.Anything, mock.Anything).Return(&provider.StatResponse{
Status: status.NewOK(ctx),
Info: &provider.ResourceInfo{Size: size},
}, nil)
}
onUpdateStorageSpaceOK = func() {
gatewayClient.On("UpdateStorageSpace", mock.Anything, mock.Anything).Return(func(_ context.Context, req *provider.UpdateStorageSpaceRequest, _ ...grpc.CallOption) *provider.UpdateStorageSpaceResponse {
return &provider.UpdateStorageSpaceResponse{
Status: status.NewOK(ctx),
StorageSpace: req.StorageSpace,
}
}, nil)
gatewayClient.On("GetPath", mock.Anything, mock.Anything).Return(&provider.GetPathResponse{
Status: status.NewOK(ctx),
Path: "/.space/image.png",
}, nil)
}
expectStoredSpecial = func(name, fileID string) {
gatewayClient.AssertCalled(GinkgoT(), "UpdateStorageSpace", mock.Anything, mock.MatchedBy(func(req *provider.UpdateStorageSpaceRequest) bool {
return utils.ReadPlainFromOpaque(req.StorageSpace.Opaque, name) == fileID
}))
}
)
setMaxImageFileSize := func(size string) {
cfg.Validation.MaxImageFileSize = size
var err error
svc, err = service.NewService(
service.Config(cfg),
service.WithGatewaySelector(gatewaySelector),
service.EventsPublisher(&eventsPublisher),
service.PermissionService(&permissionService),
)
Expect(err).ToNot(HaveOccurred())
}
BeforeEach(func() {
setMaxImageFileSize("1KB")
})
It("rejects an image larger than the configured maximum and stores nothing", func() {
onUpdateStorageSpaceOK()
onStatReturnSize(2048)
patchDrive(spaceImageUpdate())
Expect(rr.Code).To(Equal(http.StatusRequestEntityTooLarge))
gatewayClient.AssertNotCalled(GinkgoT(), "UpdateStorageSpace", mock.Anything, mock.Anything)
})
It("accepts an image of exactly the configured maximum", func() {
onUpdateStorageSpaceOK()
onStatReturnSize(1000) // 1KB, as bytesize uses decimal units
patchDrive(spaceImageUpdate())
Expect(rr.Code).To(Equal(http.StatusOK))
expectStoredSpecial("image", imageFileID)
})
It("accepts any size when the maximum is set to zero", func() {
setMaxImageFileSize("0")
onUpdateStorageSpaceOK()
onStatReturnSize(100 * 1024 * 1024)
patchDrive(spaceImageUpdate())
Expect(rr.Code).To(Equal(http.StatusOK))
expectStoredSpecial("image", imageFileID)
})
It("does not store the image when the size could not be determined", func() {
onUpdateStorageSpaceOK()
gatewayClient.On("Stat", mock.Anything, mock.Anything).Return(&provider.StatResponse{
Status: status.NewInternal(ctx, "stat failed"),
}, nil)
patchDrive(spaceImageUpdate())
Expect(rr.Code).ToNot(Equal(http.StatusOK))
Expect(rr.Code).ToNot(Equal(http.StatusRequestEntityTooLarge))
gatewayClient.AssertNotCalled(GinkgoT(), "UpdateStorageSpace", mock.Anything, mock.Anything)
})
It("does not restrict the size of the space readme", func() {
onUpdateStorageSpaceOK()
onStatReturnSize(100 * 1024 * 1024)
readmeFileID := "spaceid$spaceid!readmeid"
drive := libregraph.NewDrive("thename")
drive.SetSpecial([]libregraph.DriveItem{{
Id: &readmeFileID,
SpecialFolder: &libregraph.SpecialFolder{Name: libregraph.PtrString("readme")},
}})
driveJson, err := json.Marshal(drive)
Expect(err).ToNot(HaveOccurred())
patchDrive(driveJson)
Expect(rr.Code).To(Equal(http.StatusOK))
expectStoredSpecial("readme", readmeFileID)
})
})
})
Describe("Foreign personal drive access (OCISDEV-660)", func() {
var (
callerCtx = func(opaqueID string) context.Context {
return revactx.ContextSetUser(context.Background(), &userprovider.User{
Id: &userprovider.UserId{Type: userprovider.UserType_USER_TYPE_PRIMARY, OpaqueId: opaqueID},
})
}
personalSpace = func(owner string) *provider.StorageSpace {
return &provider.StorageSpace{
Id: &provider.StorageSpaceId{OpaqueId: "targetspace"},
SpaceType: "personal",
Owner: &userprovider.User{Id: &userprovider.UserId{OpaqueId: owner}},
Root: &provider.ResourceId{
StorageId: "pro-1",
SpaceId: "targetspace",
OpaqueId: "targetspace",
},
Name: "targetuser",
}
}
projectSpace = func(owner string) *provider.StorageSpace {
return &provider.StorageSpace{
Id: &provider.StorageSpaceId{OpaqueId: "projectspace"},
SpaceType: "project",
Owner: &userprovider.User{Id: &userprovider.UserId{OpaqueId: owner}},
Root: &provider.ResourceId{
StorageId: "pro-1",
SpaceId: "projectspace",
OpaqueId: "projectspace",
},
Name: "aproject",
}
}
mockAccountPerms = func(constraint v0.Permission_Constraint) {
permissionService.On("GetPermissionByID", mock.Anything, mock.Anything).Return(&settingssvc.GetPermissionByIDResponse{
Permission: &v0.Permission{Constraint: constraint},
}, nil)
}
mockSpaceFormatting = func() {
gatewayClient.On("GetQuota", mock.Anything, mock.Anything).Return(&provider.GetQuotaResponse{
Status: status.NewUnimplemented(ctx, fmt.Errorf("not supported"), "not supported"),
}, nil)
gatewayClient.On("InitiateFileDownload", mock.Anything, mock.Anything).Return(&gateway.InitiateFileDownloadResponse{
Status: status.NewNotFound(ctx, "not found"),
}, nil)
}
)
Describe("GetSingleDrive", func() {
singleDriveReq := func(userCtx context.Context) *http.Request {
r := httptest.NewRequest(http.MethodGet, "/graph/v1.0/drives/{driveID}/", nil)
rctx := chi.NewRouteContext()
rctx.URLParams.Add("driveID", "targetspace")
return r.WithContext(context.WithValue(userCtx, chi.RouteCtxKey, rctx))
}
It("returns 404 when a non-admin looks up another user's personal drive", func() {
mockSpaceFormatting()
mockAccountPerms(v0.Permission_CONSTRAINT_OWN)
gatewayClient.On("ListStorageSpaces", mock.Anything, mock.Anything).Return(&provider.ListStorageSpacesResponse{
Status: status.NewOK(ctx),
StorageSpaces: []*provider.StorageSpace{personalSpace("targetuser")},
}, nil)
svc.GetSingleDrive(rr, singleDriveReq(callerCtx("otheruser")))
Expect(rr.Code).To(Equal(http.StatusNotFound))
})
It("returns the personal drive to a full-account admin", func() {
mockSpaceFormatting()
mockAccountPerms(v0.Permission_CONSTRAINT_ALL)
gatewayClient.On("ListStorageSpaces", mock.Anything, mock.Anything).Return(&provider.ListStorageSpacesResponse{
Status: status.NewOK(ctx),
StorageSpaces: []*provider.StorageSpace{personalSpace("targetuser")},
}, nil)
svc.GetSingleDrive(rr, singleDriveReq(callerCtx("admin")))
Expect(rr.Code).To(Equal(http.StatusOK))
})
It("returns the owner's own personal drive", func() {
mockSpaceFormatting()
mockAccountPerms(v0.Permission_CONSTRAINT_OWN)
gatewayClient.On("ListStorageSpaces", mock.Anything, mock.Anything).Return(&provider.ListStorageSpacesResponse{
Status: status.NewOK(ctx),
StorageSpaces: []*provider.StorageSpace{personalSpace("targetuser")},
}, nil)
svc.GetSingleDrive(rr, singleDriveReq(callerCtx("targetuser")))
Expect(rr.Code).To(Equal(http.StatusOK))
})
It("returns another user's project drive to a non-admin (unaffected)", func() {
mockSpaceFormatting()
mockAccountPerms(v0.Permission_CONSTRAINT_OWN)
gatewayClient.On("ListStorageSpaces", mock.Anything, mock.Anything).Return(&provider.ListStorageSpacesResponse{
Status: status.NewOK(ctx),
StorageSpaces: []*provider.StorageSpace{projectSpace("targetuser")},
}, nil)
r := httptest.NewRequest(http.MethodGet, "/graph/v1.0/drives/{driveID}/", nil)
rctx := chi.NewRouteContext()
rctx.URLParams.Add("driveID", "projectspace")
r = r.WithContext(context.WithValue(callerCtx("otheruser"), chi.RouteCtxKey, rctx))
svc.GetSingleDrive(rr, r)
Expect(rr.Code).To(Equal(http.StatusOK))
})
})
Describe("GetAllDrivesV1 (unrestricted listing)", func() {
listedDriveIDs := func() []string {
var lr struct {
Value []map[string]interface{} `json:"value"`
}
body, _ := io.ReadAll(rr.Body)
Expect(json.Unmarshal(body, &lr)).To(Succeed())
ids := make([]string, 0, len(lr.Value))
for _, d := range lr.Value {
ids = append(ids, d["id"].(string))
}
return ids
}
It("hides other users' personal drives from a non-admin", func() {
mockSpaceFormatting()
mockAccountPerms(v0.Permission_CONSTRAINT_OWN)
gatewayClient.On("ListStorageSpaces", mock.Anything, mock.Anything).Return(&provider.ListStorageSpacesResponse{
Status: status.NewOK(ctx),
StorageSpaces: []*provider.StorageSpace{personalSpace("targetuser"), projectSpace("targetuser")},
}, nil)
r := httptest.NewRequest(http.MethodGet, "/graph/v1.0/drives", nil).WithContext(callerCtx("otheruser"))
svc.GetAllDrivesV1(rr, r)
Expect(rr.Code).To(Equal(http.StatusOK))
Expect(listedDriveIDs()).To(ConsistOf("pro-1$projectspace"))
})
It("shows all personal drives to a full-account admin", func() {
mockSpaceFormatting()
mockAccountPerms(v0.Permission_CONSTRAINT_ALL)
gatewayClient.On("ListStorageSpaces", mock.Anything, mock.Anything).Return(&provider.ListStorageSpacesResponse{
Status: status.NewOK(ctx),
StorageSpaces: []*provider.StorageSpace{personalSpace("targetuser"), projectSpace("targetuser")},
}, nil)
r := httptest.NewRequest(http.MethodGet, "/graph/v1.0/drives", nil).WithContext(callerCtx("admin"))
svc.GetAllDrivesV1(rr, r)
Expect(rr.Code).To(Equal(http.StatusOK))
Expect(listedDriveIDs()).To(ConsistOf("pro-1$targetspace", "pro-1$projectspace"))
})
It("keeps the caller's own personal drive", func() {
mockSpaceFormatting()
mockAccountPerms(v0.Permission_CONSTRAINT_OWN)
gatewayClient.On("ListStorageSpaces", mock.Anything, mock.Anything).Return(&provider.ListStorageSpacesResponse{
Status: status.NewOK(ctx),
StorageSpaces: []*provider.StorageSpace{personalSpace("targetuser")},
}, nil)
r := httptest.NewRequest(http.MethodGet, "/graph/v1.0/drives", nil).WithContext(callerCtx("targetuser"))
svc.GetAllDrivesV1(rr, r)
Expect(rr.Code).To(Equal(http.StatusOK))
Expect(listedDriveIDs()).To(ConsistOf("pro-1$targetspace"))
})
})
})
Describe("Delete a drive", func() {
+28 -43
View File
@@ -2,12 +2,9 @@ package svc
import (
"context"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"net/http"
"os"
"strconv"
"time"
@@ -18,6 +15,7 @@ import (
microstore "go-micro.dev/v4/store"
"github.com/owncloud/reva/v2/pkg/autoprop"
"github.com/owncloud/reva/v2/pkg/bytesize"
"github.com/owncloud/reva/v2/pkg/events"
"github.com/owncloud/reva/v2/pkg/rgrpc/todo/pool"
"github.com/owncloud/reva/v2/pkg/store"
@@ -31,7 +29,6 @@ import (
"github.com/owncloud/ocis/v2/ocis-pkg/service/grpc"
settingssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0"
"github.com/owncloud/ocis/v2/services/graph/pkg/identity"
"github.com/owncloud/ocis/v2/services/graph/pkg/identity/ldap"
graphmw "github.com/owncloud/ocis/v2/services/graph/pkg/middleware"
)
@@ -117,6 +114,7 @@ type Service interface { //nolint:interfacebloat
GetSharedByMe(w http.ResponseWriter, r *http.Request)
ListSharedWithMe(w http.ResponseWriter, r *http.Request)
GetUserDrive(w http.ResponseWriter, r *http.Request)
GetRootDriveChildren(w http.ResponseWriter, r *http.Request)
GetDriveItem(w http.ResponseWriter, r *http.Request)
GetDriveItemChildren(w http.ResponseWriter, r *http.Request)
@@ -168,6 +166,14 @@ func NewService(opts ...Option) (Graph, error) { //nolint:maintidx
valueService: options.ValueService,
}
if raw := options.Config.Validation.MaxImageFileSize; raw != "" {
maxImageFileSize, err := bytesize.Parse(raw)
if err != nil {
return svc, fmt.Errorf("could not parse validation.max_image_file_size %q: %w", raw, err)
}
svc.maxImageFileSize = maxImageFileSize.Bytes()
}
if err := setIdentityBackends(options, &svc); err != nil {
return svc, err
}
@@ -194,6 +200,7 @@ func NewService(opts ...Option) (Graph, error) { //nolint:maintidx
microstore.Table(options.Config.Cache.Table),
store.DisablePersistence(options.Config.Cache.DisablePersistence),
store.Authentication(options.Config.Cache.AuthUsername, options.Config.Cache.AuthPassword),
store.TLS(options.Config.Cache.EnableTLS, options.Config.Cache.TLSInsecure, options.Config.Cache.TLSRootCACertificate),
}
m := roles.NewManager(
roles.StoreOptions(storeOptions),
@@ -451,53 +458,31 @@ func setIdentityBackends(options Options, svc *Graph) error {
GatewaySelector: gatewaySelector,
}
case "ldap":
var err error
var tlsConf *tls.Config
if options.Config.Identity.LDAP.Insecure {
// When insecure is set to true then we don't need a certificate.
options.Config.Identity.LDAP.CACert = ""
tlsConf = &tls.Config{
MinVersion: tls.VersionTLS12,
//nolint:gosec // We need the ability to run with "insecure" (dev/testing)
InsecureSkipVerify: options.Config.Identity.LDAP.Insecure,
}
}
if options.Config.Identity.LDAP.CACert != "" {
if err := ocisldap.WaitForCA(options.Logger,
options.Config.Identity.LDAP.Insecure,
options.Config.Identity.LDAP.CACert); err != nil {
options.Logger.Fatal().Err(err).Msg("The configured LDAP CA cert does not exist")
}
if tlsConf == nil {
tlsConf = &tls.Config{
MinVersion: tls.VersionTLS12,
}
}
certs := x509.NewCertPool()
pemData, err := os.ReadFile(options.Config.Identity.LDAP.CACert)
if err != nil {
options.Logger.Error().Err(err).Msg("Error initializing LDAP Backend")
return err
}
if !certs.AppendCertsFromPEM(pemData) {
options.Logger.Error().Msg("Error initializing LDAP Backend. Adding CA cert failed")
return err
}
tlsConf.RootCAs = certs
}
conn := ldap.NewLDAPWithReconnect(&options.Logger,
ldap.Config{
URI: options.Config.Identity.LDAP.URI,
BindDN: options.Config.Identity.LDAP.BindDN,
BindPassword: options.Config.Identity.LDAP.BindPassword,
TLSConfig: tlsConf,
},
)
conn, err := utils.GetLDAPClientFromConfig(&utils.LDAPConn{
URI: options.Config.Identity.LDAP.URI,
Insecure: options.Config.Identity.LDAP.Insecure,
CACert: options.Config.Identity.LDAP.CACert,
BindDN: options.Config.Identity.LDAP.BindDN,
BindPassword: options.Config.Identity.LDAP.BindPassword,
RetryMaxCount: options.Config.Identity.LDAP.RetryMaxCount,
RetryBaseDelay: options.Config.Identity.LDAP.RetryBaseDelay,
RetryMaxDelay: options.Config.Identity.LDAP.RetryMaxDelay,
PoolEnabled: options.Config.Identity.LDAP.PoolEnabled,
PoolSize: options.Config.Identity.LDAP.PoolSize,
PoolCheckoutTimeout: options.Config.Identity.LDAP.PoolCheckoutTimeout,
})
if err != nil {
options.Logger.Error().Err(err).Msg("Error initializing LDAP Backend")
return err
}
var iid, masterID string
if options.Config.MultiInstance.Enabled {
iid = options.Config.MultiInstance.InstanceID
+16 -7
View File
@@ -131,14 +131,23 @@ func (g Graph) GetUserDrive(w http.ResponseWriter, r *http.Request) {
return
}
if userID == "" {
u, ok := revactx.ContextGetUser(r.Context())
if !ok {
logger.Debug().Msg("could not get user: user not in context")
errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, "user not in context")
return
}
u, ok := revactx.ContextGetUser(r.Context())
if !ok {
logger.Debug().Msg("could not get user: user not in context")
errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, "user not in context")
return
}
switch {
case userID == "":
// /me/drive — self access
userID = u.GetId().GetOpaqueId()
case userID != u.GetId().GetOpaqueId() && !g.contextUserHasFullAccountPerms(r.Context()):
// Only the owner or a full-account admin may read another user's drive;
// return the same 404 as a missing drive so UUIDs can't be probed.
logger.Debug().Str("userID", userID).Msg("could not get drive: access to another user's drive is not permitted")
errorcode.ItemNotFound.Render(w, r, http.StatusNotFound, "no drive returned from storage")
return
}
logger.Debug().Str("userID", userID).Msg("calling list storage spaces with user and personal filter")
@@ -937,6 +937,88 @@ var _ = Describe("Users", func() {
})
})
Describe("GetUserDrive", func() {
// grantPerms sets the permission constraint returned for every
// GetPermissionByID call. CONSTRAINT_ALL makes
// contextUserHasFullAccountPerms return true (admin); CONSTRAINT_OWN
// makes it return false (non-admin).
grantPerms := func(c settingsmsg.Permission_Constraint) {
permissionService.On("GetPermissionByID", mock.Anything, mock.Anything).Return(&settings.GetPermissionByIDResponse{
Permission: &settingsmsg.Permission{Constraint: c},
}, nil)
}
// expectPersonalSpace mocks a successful personal-drive listing owned by ownerID.
expectPersonalSpace := func(ownerID string) {
gatewayClient.On("GetQuota", mock.Anything, mock.Anything, mock.Anything).Return(&provider.GetQuotaResponse{
Status: status.NewOK(ctx),
TotalBytes: 10,
}, nil)
gatewayClient.On("ListStorageSpaces", mock.Anything, mock.Anything, mock.Anything).Return(&provider.ListStorageSpacesResponse{
Status: status.NewOK(ctx),
StorageSpaces: []*provider.StorageSpace{
{
Id: &provider.StorageSpaceId{OpaqueId: "personal"},
Owner: &userv1beta1.User{Id: &userv1beta1.UserId{OpaqueId: ownerID}},
Root: &provider.ResourceId{SpaceId: "personal", OpaqueId: "personal"},
SpaceType: "personal",
},
},
}, nil)
}
doRequest := func(userID string) {
r := httptest.NewRequest(http.MethodGet, "/graph/v1.0/users/"+userID+"/drive", nil)
rctx := chi.NewRouteContext()
rctx.URLParams.Add("userID", userID)
r = r.WithContext(context.WithValue(revactx.ContextSetUser(ctx, currentUser), chi.RouteCtxKey, rctx))
svc.GetUserDrive(rr, r)
}
It("returns the caller's own drive (self, non-admin)", func() {
grantPerms(settingsmsg.Permission_CONSTRAINT_OWN)
expectPersonalSpace("user")
doRequest("user")
Expect(rr.Code).To(Equal(http.StatusOK))
data, err := io.ReadAll(rr.Body)
Expect(err).ToNot(HaveOccurred())
drive := &libregraph.Drive{}
Expect(json.Unmarshal(data, drive)).To(Succeed())
Expect(drive.GetId()).To(Equal("personal"))
})
It("returns the personal drive for the /me path (empty userID)", func() {
grantPerms(settingsmsg.Permission_CONSTRAINT_OWN)
expectPersonalSpace("user")
doRequest("")
Expect(rr.Code).To(Equal(http.StatusOK))
})
It("allows a full-account admin to read another user's drive", func() {
grantPerms(settingsmsg.Permission_CONSTRAINT_ALL)
expectPersonalSpace("other")
doRequest("other")
Expect(rr.Code).To(Equal(http.StatusOK))
})
It("denies a non-admin reading another user's drive (IDOR), without listing spaces", func() {
grantPerms(settingsmsg.Permission_CONSTRAINT_OWN)
doRequest("other")
Expect(rr.Code).To(Equal(http.StatusNotFound))
data, err := io.ReadAll(rr.Body)
Expect(err).ToNot(HaveOccurred())
Expect(string(data)).To(ContainSubstring("no drive returned from storage"))
gatewayClient.AssertNotCalled(GinkgoT(), "ListStorageSpaces", mock.Anything, mock.Anything, mock.Anything)
})
})
Describe("PostUser", func() {
var (
user *libregraph.User
+8
View File
@@ -2,6 +2,7 @@ package config
import (
"context"
"time"
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
)
@@ -65,6 +66,9 @@ type LDAPDriver struct {
Insecure bool `yaml:"insecure" env:"OCIS_LDAP_INSECURE;GROUPS_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;GROUPS_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;GROUPS_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;GROUPS_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;GROUPS_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;GROUPS_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;GROUPS_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;GROUPS_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;GROUPS_LDAP_USER_SCOPE" desc:"LDAP search scope to use when looking up users. Supported scopes are 'base', 'one' and 'sub'." introductionVersion:"pre5.0"`
@@ -80,6 +84,10 @@ type LDAPDriver struct {
UserGuestAttribute string `yaml:"user_guest_attribute" env:"OCIS_LDAP_USER_GUEST_ATTRIBUTE" desc:"LDAP attribute that marks a user as a guest of an instance." introductionVersion:"7.0"`
UserSchema LDAPUserSchema `yaml:"user_schema"`
GroupSchema LDAPGroupSchema `yaml:"group_schema"`
PoolEnabled bool `yaml:"pool_enabled" env:"OCIS_LDAP_POOL_ENABLED;GROUPS_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;GROUPS_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;GROUPS_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"
ocisldap "github.com/owncloud/ocis/v2/ocis-pkg/ldap"
@@ -52,7 +53,11 @@ func DefaultConfig() *config.Config {
UserObjectClass: "inetOrgPerson",
GroupObjectClass: "groupOfNames",
BindDN: "uid=reva,ou=sysusers,o=libregraph-idm",
RetryMaxCount: 1,
IDP: "https://localhost:9200",
PoolEnabled: false,
PoolSize: 5,
PoolCheckoutTimeout: 30 * time.Second,
UserSchema: config.LDAPUserSchema{
ID: "ownclouduuid",
Mail: "mail",
+6
View File
@@ -68,6 +68,9 @@ func ldapConfigFromString(cfg config.LDAPDriver) 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_scope": cfg.UserScope,
@@ -78,6 +81,9 @@ func ldapConfigFromString(cfg config.LDAPDriver) map[string]interface{} {
"user_objectclass": cfg.UserObjectClass,
"group_objectclass": cfg.GroupObjectClass,
"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,
@@ -134,6 +134,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),
)
svc := service.NewEventsNotifier(traceProvider, evts, channel, logger, gatewaySelector, valueService,
+5 -2
View File
@@ -76,6 +76,9 @@ type Store struct {
Database string `yaml:"database" env:"NOTIFICATIONS_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"7.1.0"`
Table string `yaml:"table" env:"NOTIFICATIONS_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"7.1.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_PERSISTENT_STORE_TTL;NOTIFICATIONS_STORE_TTL" desc:"Time to live for notifications in the store. Defaults to '336h' (2 weeks). See the Environment Variable Types description for more details." introductionVersion:"7.1.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;NOTIFICATIONS_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"7.1.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;NOTIFICATIONS_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"7.1.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;NOTIFICATIONS_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"7.1.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;NOTIFICATIONS_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"7.1.0"`
EnableTLS bool `yaml:"enable_tls" env:"OCIS_PERSISTENT_STORE_ENABLE_TLS;NOTIFICATIONS_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;NOTIFICATIONS_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;NOTIFICATIONS_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"`
}
+6 -3
View File
@@ -3,6 +3,7 @@ package revaconfig
import (
"math"
"net/url"
"path/filepath"
"github.com/owncloud/ocis/v2/ocis-pkg/log"
"github.com/owncloud/ocis/v2/services/ocm/pkg/config"
@@ -91,8 +92,9 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter
"service_account_secret": cfg.ServiceAccount.Secret,
},
"dataprovider": map[string]interface{}{
"prefix": "data",
"driver": "ocmreceived",
"prefix": "data",
"driver": "ocmreceived",
"upload_directory": filepath.Join(cfg.OCMStorageProvider.StorageRoot, "uploads"),
"drivers": map[string]interface{}{
"ocmreceived": map[string]interface{}{
"insecure": cfg.OCMStorageProvider.Insecure,
@@ -181,7 +183,8 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter
},
},
"storageprovider": map[string]interface{}{
"driver": "ocmreceived",
"driver": "ocmreceived",
"upload_directory": filepath.Join(cfg.OCMStorageProvider.StorageRoot, "uploads"),
"drivers": map[string]interface{}{
"ocmreceived": map[string]interface{}{
"insecure": cfg.OCMStorageProvider.Insecure,
+5 -2
View File
@@ -35,6 +35,9 @@ type SigningKeys struct {
Store string `yaml:"store" env:"OCIS_CACHE_STORE;OCS_PRESIGNEDURL_SIGNING_KEYS_STORE" desc:"The type of the signing key store. Supported values are: 'redis-sentinel' and 'nats-js-kv'. See the text description for details." introductionVersion:"5.0"`
Nodes []string `yaml:"addresses" env:"OCIS_CACHE_STORE_NODES;OCS_PRESIGNEDURL_SIGNING_KEYS_STORE_NODES" desc:"A list of nodes to access the configured store. 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:"5.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;OCS_PRESIGNEDURL_SIGNING_KEYS_STORE_TTL" desc:"Default time to live for signing keys. See the Environment Variable Types description for more details." introductionVersion:"5.0"`
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;OCS_PRESIGNEDURL_SIGNING_KEYS_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_CACHE_AUTH_PASSWORD;OCS_PRESIGNEDURL_SIGNING_KEYS_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_CACHE_AUTH_USERNAME;OCS_PRESIGNEDURL_SIGNING_KEYS_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_CACHE_AUTH_PASSWORD;OCS_PRESIGNEDURL_SIGNING_KEYS_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_CACHE_ENABLE_TLS;OCS_PRESIGNEDURL_SIGNING_KEYS_STORE_ENABLE_TLS" desc:"Activate TLS for the connection to the signing key 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;OCS_PRESIGNEDURL_SIGNING_KEYS_STORE_TLS_INSECURE" desc:"Disable TLS certificate verification for the signing key 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;OCS_PRESIGNEDURL_SIGNING_KEYS_STORE_TLS_ROOT_CA_CERTIFICATE" desc:"Path to the PEM-encoded root CA certificate for the signing key store TLS connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
}
+1
View File
@@ -43,6 +43,7 @@ func Server(opts ...Option) (http.Service, error) {
microstore.Database("proxy"),
microstore.Table("signing-keys"),
store.Authentication(options.Config.SigningKeys.AuthUsername, options.Config.SigningKeys.AuthPassword),
store.TLS(options.Config.SigningKeys.EnableTLS, options.Config.SigningKeys.TLSInsecure, options.Config.SigningKeys.TLSRootCACertificate),
)
handle := svc.NewService(
@@ -65,6 +65,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),
)
svc, err := service.NewPostprocessingService(ctx, bus, logger, st, traceProvider, cfg.Postprocessing)
+5 -2
View File
@@ -62,6 +62,9 @@ type Store struct {
Database string `yaml:"database" env:"POSTPROCESSING_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
Table string `yaml:"table" env:"POSTPROCESSING_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_PERSISTENT_STORE_TTL;POSTPROCESSING_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;POSTPROCESSING_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;POSTPROCESSING_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;POSTPROCESSING_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;POSTPROCESSING_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;POSTPROCESSING_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;POSTPROCESSING_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;POSTPROCESSING_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"`
}
+4
View File
@@ -77,6 +77,7 @@ func Server(cfg *config.Config) *cli.Command {
microstore.Table(cfg.OIDC.UserinfoCache.Table),
store.DisablePersistence(cfg.OIDC.UserinfoCache.DisablePersistence),
store.Authentication(cfg.OIDC.UserinfoCache.AuthUsername, cfg.OIDC.UserinfoCache.AuthPassword),
store.TLS(cfg.OIDC.UserinfoCache.EnableTLS, cfg.OIDC.UserinfoCache.TLSInsecure, cfg.OIDC.UserinfoCache.TLSRootCACertificate),
)
signingKeyStore := store.Create(
@@ -86,6 +87,7 @@ func Server(cfg *config.Config) *cli.Command {
microstore.Database("proxy"),
microstore.Table("signing-keys"),
store.Authentication(cfg.PreSignedURL.SigningKeys.AuthUsername, cfg.PreSignedURL.SigningKeys.AuthPassword),
store.TLS(cfg.PreSignedURL.SigningKeys.EnableTLS, cfg.PreSignedURL.SigningKeys.TLSInsecure, cfg.PreSignedURL.SigningKeys.TLSRootCACertificate),
)
cfg.GrpcClient, err = grpc.NewClient(
@@ -98,6 +100,7 @@ func Server(cfg *config.Config) *cli.Command {
oidcHTTPClient := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: cfg.OIDC.Insecure, //nolint:gosec
@@ -269,6 +272,7 @@ func loadMiddlewares(logger log.Logger, cfg *config.Config,
oidcHTTPClient := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: cfg.OIDC.Insecure, //nolint:gosec
+10 -4
View File
@@ -144,8 +144,11 @@ type Cache struct {
Table string `yaml:"table" env:"PROXY_OIDC_USERINFO_CACHE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;PROXY_OIDC_USERINFO_CACHE_TTL" desc:"Default time to live for user info in the user info cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;PROXY_OIDC_USERINFO_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"pre5.0"`
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;PROXY_OIDC_USERINFO_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;PROXY_OIDC_USERINFO_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;PROXY_OIDC_USERINFO_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;PROXY_OIDC_USERINFO_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;PROXY_OIDC_USERINFO_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;PROXY_OIDC_USERINFO_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;PROXY_OIDC_USERINFO_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"`
}
// RoleAssignment contains the configuration for how to assign roles to users during login
@@ -199,8 +202,11 @@ type SigningKeys struct {
Nodes []string `yaml:"addresses" env:"OCIS_CACHE_STORE_NODES;PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE_NODES" desc:"A list of nodes to access the configured store. 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:"5.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE_TTL" desc:"Default time to live for signing keys. See the Environment Variable Types description for more details." introductionVersion:"5.0"`
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE_DISABLE_PERSISTENCE" desc:"Disables persistence of the store. Only applies when store type 'nats-js-kv' is configured. Defaults to true." introductionVersion:"5.0"`
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;PROXY_PRESIGNEDURL_SIGNING_KEYS_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_CACHE_AUTH_PASSWORD;PROXY_PRESIGNEDURL_SIGNING_KEYS_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_CACHE_AUTH_USERNAME;PROXY_PRESIGNEDURL_SIGNING_KEYS_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_CACHE_AUTH_PASSWORD;PROXY_PRESIGNEDURL_SIGNING_KEYS_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_CACHE_ENABLE_TLS;PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE_ENABLE_TLS" desc:"Activate TLS for the connection to the signing key 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;PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE_TLS_INSECURE" desc:"Disable TLS certificate verification for the signing key 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;PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE_TLS_ROOT_CA_CERTIFICATE" desc:"Path to the PEM-encoded root CA certificate for the signing key store TLS connection. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.3.0"`
}
// ClaimsSelectorConf is the config for the claims-selector
+2
View File
@@ -5,6 +5,7 @@ directives:
- '''self'''
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
default-src:
- '''none'''
font-src:
@@ -21,6 +22,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
manifest-src:
- '''self'''
media-src:
+9 -6
View File
@@ -13,27 +13,30 @@ import (
// LoadCSPConfig loads CSP header configuration from a yaml file.
func LoadCSPConfig(proxyCfg *config.Config) (*config.CSP, error) {
serviceName := proxyCfg.Service.Name
yamlContent, err := loadCSPYaml(proxyCfg)
if err != nil {
return nil, err
}
return loadCSPConfig(yamlContent)
return loadCSPConfig(serviceName, yamlContent)
}
// LoadCSPConfig loads CSP header configuration from a yaml file.
func loadCSPConfig(yamlContent []byte) (*config.CSP, error) {
func loadCSPConfig(svcName string, yamlContent []byte) (*config.CSP, error) {
// The LoadCSPConfig (public) is expected to be called once, so
// creating a new gookit config instance each time here is fine.
// substitute env vars and load to struct
gofig.WithOptions(gofig.ParseEnv)
gofig.AddDriver(yaml.Driver)
cfg := gofig.NewWithOptions(svcName, gofig.ParseEnv)
cfg.AddDriver(yaml.Driver)
err := gofig.LoadSources("yaml", yamlContent)
err := cfg.LoadSources("yaml", yamlContent)
if err != nil {
return nil, err
}
// read yaml
cspConfig := config.CSP{}
err = gofig.BindStruct("", &cspConfig)
err = cfg.BindStruct("", &cspConfig)
if err != nil {
return nil, err
}
@@ -20,7 +20,7 @@ directives:
- 'https://${COLLABORA_DOMAIN|collabora.owncloud.test}/'
`
config, err := loadCSPConfig([]byte(yaml))
config, err := loadCSPConfig("proxy", []byte(yaml))
if err != nil {
t.Error(err)
}
+5 -2
View File
@@ -63,6 +63,9 @@ type Cache struct {
DirectoryTable string `yaml:"directories_table" env:"SETTINGS_DIRECTORY_CACHE_TABLE" desc:"The database table the store should use for the directory cache." introductionVersion:"pre5.0"`
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;SETTINGS_CACHE_TTL" desc:"Default time to live for entries in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;SETTINGS_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;SETTINGS_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;SETTINGS_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;SETTINGS_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;SETTINGS_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;SETTINGS_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;SETTINGS_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;SETTINGS_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"`
}
@@ -113,7 +113,8 @@ func (c *CachedMDC) ReadDir(ctx context.Context, id string) ([]string, error) {
c.logger.Error().Err(err).Msg("ReadDir: failed to update dirs cache")
}
return s, err
// return valid data regardless of cache write failure
return s, nil
}
// MakeDirIfNotExist invalidates the cache
@@ -140,6 +141,7 @@ func (c *CachedMDC) Init(ctx context.Context, id string) error {
microstore.Table(c.cfg.Metadata.Cache.DirectoryTable),
store.DisablePersistence(c.cfg.Metadata.Cache.DisablePersistence),
store.Authentication(c.cfg.Metadata.Cache.AuthUsername, c.cfg.Metadata.Cache.AuthPassword),
store.TLS(c.cfg.Metadata.Cache.EnableTLS, c.cfg.Metadata.Cache.TLSInsecure, c.cfg.Metadata.Cache.TLSRootCACertificate),
)
c.filesCache = store.Create(
store.Store(c.cfg.Metadata.Cache.Store),
@@ -149,6 +151,7 @@ func (c *CachedMDC) Init(ctx context.Context, id string) error {
microstore.Table(c.cfg.Metadata.Cache.FileTable),
store.DisablePersistence(c.cfg.Metadata.Cache.DisablePersistence),
store.Authentication(c.cfg.Metadata.Cache.AuthUsername, c.cfg.Metadata.Cache.AuthPassword),
store.TLS(c.cfg.Metadata.Cache.EnableTLS, c.cfg.Metadata.Cache.TLSInsecure, c.cfg.Metadata.Cache.TLSRootCACertificate),
)
return c.next.Init(ctx, id)
}
+1 -1
View File
@@ -29,7 +29,7 @@ type Config struct {
PublicShareMustHavePassword bool `yaml:"public_sharing_share_must_have_password" env:"OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD;SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD" desc:"Set this to true if you want to enforce passwords on all public shares." introductionVersion:"5.0"`
EnableExpiredSharesCleanup bool `yaml:"enable_expired_shares_cleanup"`
EnableUserSharing bool `yaml:"enable_user_sharing" env:"OCIS_ENABLE_USER_SHARING" desc:"Enables direct sharing with users and groups. When disabled, creating new user or group shares is rejected. Public link sharing is not affected." introductionVersion:"%%NEXT_PRODUCTION_VERSION%%"`
EnablePublicSharing bool `yaml:"enable_public_sharing" env:"OCIS_ENABLE_PUBLIC_SHARING" desc:"Enables public link sharing. When disabled, creating new public links is rejected. Direct sharing with users and groups is not affected." introductionVersion:"%%NEXT_PRODUCTION_VERSION%%"`
EnablePublicSharing bool `yaml:"enable_public_sharing" env:"OCIS_ENABLE_PUBLIC_SHARING" desc:"Enables public link sharing. When disabled, creating new public links is rejected. Direct sharing with users and groups is not affected." introductionVersion:"8.2.0"`
PasswordPolicy PasswordPolicy `yaml:"password_policy"`
Context context.Context `yaml:"-"`
@@ -68,6 +68,9 @@ type Store struct {
Nodes []string `yaml:"nodes" env:"OCIS_PERSISTENT_STORE_NODES;STORAGE_PUBLICLINK_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:"8.0.0"`
Database string `yaml:"database" env:"STORAGE_PUBLICLINK_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"8.0.0"`
Table string `yaml:"table" env:"STORAGE_PUBLICLINK_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"8.0.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;STORAGE_PUBLICLINK_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.0.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;STORAGE_PUBLICLINK_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.0.0"`
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;STORAGE_PUBLICLINK_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.0.0"`
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;STORAGE_PUBLICLINK_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"8.0.0"`
EnableTLS bool `yaml:"enable_tls" env:"OCIS_PERSISTENT_STORE_ENABLE_TLS;STORAGE_PUBLICLINK_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;STORAGE_PUBLICLINK_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;STORAGE_PUBLICLINK_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"`
}
Loaded 100 of 1027 files, more files were not shown because too many files have changed in this diff. Show more