Compare commits

..
Author SHA1 Message Date
Michael Barz d3a49c8b88 web changelog [skip ci] 2023-05-08 17:55:52 +02:00
Michael Barz c53da6ba96 reva changelog 2023-05-08 17:36:44 +02:00
Michael Barz be8d253b82 update reva, replace go-micro redis store plugin 2023-05-08 17:31:31 +02:00
Michael Barz aed04c983f bump version, prepare changelog 2023-05-08 17:28:42 +02:00
Michael Barz 78f138e9a8 Merge pull request #6233 from rhafer/issue/6219
Allow selected updates even when GRAPH_LDAP_SERVER_WRITE_ENABLED=false
2023-05-08 17:22:33 +02:00
Michael Barz df0903a508 Automated changelog update [skip ci] 2023-05-08 15:14:18 +00:00
Michael Barz e4d674a30d Merge pull request #6220 from 2403905/issue-5031
fix Graph delete request leaks existence of space #5031
2023-05-08 17:13:47 +02:00
Roman Perekhod 8bbf4ababe bump the reva version 2023-05-08 16:29:35 +02:00
Ralf Haferkamp 906189462c graph: Always allow updates to "local" groups when LDAP
When GRAPH_LDAP_SERVER_WRITE_ENABLED=false still allow updates of groups
if a distinct GRAPH_LDAP_GROUP_CREATE_BASE_DN is configured.

Partial-Fix: #6219
2023-05-08 16:17:25 +02:00
Ralf Haferkamp 046895a831 graph: Allow disabling users via groupmember ship on "read-only" server
When GRAPH_LDAP_SERVER_WRITE_ENABLED is set to false we still allow updates
of the accountEnabled property when OCIS_LDAP_DISABLE_USER_MECHANISM is set
to "group"

Partial-Fix: #6219
2023-05-08 16:17:25 +02:00
Ralf Haferkamp 4b501e93a4 graph/users: Avoid to leak LDAP error messages to the client 2023-05-08 16:17:25 +02:00
Roman Perekhod 5fbee63f09 fix tests 2023-05-08 16:13:52 +02:00
Roman Perekhod d69decdafe fix Graph delete request leaks existence of space #5031 2023-05-08 16:13:52 +02:00
Michael Barz 428e696eb0 Automated changelog update [skip ci] 2023-05-08 13:14:56 +00:00
Michael Barz 8cef413f02 Update fix-web-config.md 2023-05-08 15:14:17 +02:00
Martin f209f65eae Merge pull request #6229 from owncloud/deprecate_some_web_ui_ennvars 2023-05-08 13:43:16 +02:00
Michael Barz 09812e009e Merge pull request #6248 from owncloud/edition
make edition configurable
2023-05-08 12:01:30 +02:00
Phil Davis d127954df4 Merge pull request #6247 from owncloud/remove-skiponldap-tag
[tests-only][full-ci]Remove skipOnLDAP tag
2023-05-08 13:49:11 +05:45
Michael Barz 86fbfa5d8c make edition configurable 2023-05-08 09:46:41 +02:00
Prarup Gurung 8be428c605 Merge pull request #6207 from owncloud/remove-auto-share-accept
[full-ci] [tests-only] Removed step and implementation of setting share auto accept
2023-05-08 10:08:16 +05:45
amrita 0bf6a110f6 Remove skipOnLDAP tag 2023-05-08 09:33:53 +05:45
Prarup Gurung 7f11f7984a Fixed line numbers in expected failure 2023-05-08 09:05:10 +05:45
Prarup Gurung 62b91981ed Refactored dav_version to new 2023-05-08 09:03:08 +05:45
Prarup Gurung e208b3018a Removed step and implementation of setting share auto accept 2023-05-08 09:01:54 +05:45
Michael Barz 55d72475d7 Automated changelog update [skip ci] 2023-05-05 13:16:20 +00:00
Michael Barz ff7a1d2efa Merge pull request #6234 from owncloud/bump-web-7.0.0-rc.36
[full-ci] chore: bump web to v7.0.0-rc.36
2023-05-05 15:15:50 +02:00
Martin edbecf0aa5 Merge pull request #6244 from owncloud/upload_expiration_warning
[docs-only] Add note that uploads could be canceled when setting is too low
2023-05-05 14:26:53 +02:00
Sagar Gurung a3d72569fb Added GDPR export when user is added to a group (#6237) 2023-05-05 14:15:04 +02:00
Martin 7931533a67 Merge pull request #6243 from owncloud/fix_envvar_separation
[docs-only] An envvar in the storage-users service needs separation by semicolon
2023-05-05 13:37:33 +02:00
mmattel ab50b9efd1 [docs-only] Add note that uploads could be canceled when setting is too low 2023-05-05 12:57:46 +02:00
mmattel 14e577d452 [docs-only] An envvar in the storage-users service needs separation by semicolon 2023-05-05 12:38:39 +02:00
Phil Davis 98059708a0 Merge pull request #6241 from owncloud/enh/remove-duplication-in-feature-file
[tests-only][full-ci] Remove duplication of steps and scenario name within a feature file
2023-05-05 16:18:03 +05:45
Swikriti Tripathi 4ca58526fc Remove dutlication of steps and scenarion name within a feature file 2023-05-05 15:36:50 +05:45
Benedikt Kulmann 0c361e4162 chore: update web commit id for test runner in CI 2023-05-05 10:54:08 +02:00
Phil Davis a571b372ae Merge pull request #6236 from owncloud/tests/enable-skipped-test
[tests-only]Unskip the test related to expiration date
2023-05-05 13:32:51 +05:45
Phil Davis b6ffa07a34 Merge pull request #6235 from owncloud/tests/add-propfind-tests-for-folder-size
[tests-only][full-ci]Add test to propfind the size of a folder
2023-05-05 13:30:13 +05:45
Swikriti Tripathi 8e9e547e9d Unskip the test related to expiration date 2023-05-05 13:03:58 +05:45
Swikriti Tripathi 0bbadc4a05 Add test to propfind the size of a folder 2023-05-05 10:03:39 +05:45
Benedikt Kulmann 72aa49b9f6 chore: bump web to v7.0.0-rc.36 2023-05-04 23:13:21 +02:00
Michael Barz 52ddba3fac Automated changelog update [skip ci] 2023-05-04 16:20:36 +00:00
Michael Barz cd7ef50481 Merge pull request #6232 from owncloud/bump-reva-756a84314af0
bump reva to 756a84314af0
2023-05-04 18:19:55 +02:00
Jörn Friedrich Dreyer a8e8d0b841 bump reva to 756a84314af0
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-04 17:16:56 +02:00
Edith Parzefall 670aa26975 Apply suggestions from code review
spelling fixes
2023-05-04 16:50:06 +02:00
Phil Davis 444afd2094 Merge pull request #6167 from owncloud/enh/refactor-feature-file-part2
[tests-only][full-ci]Refactor feature files to add correct description
2023-05-04 20:30:41 +05:45
mmattel 4302eec3ab deprecate some web envvars 2023-05-04 15:48:10 +02:00
Michael Barz f6fae22811 Automated changelog update [skip ci] 2023-05-04 13:37:26 +00:00
Michael Barz 4aa746d52a Merge pull request #6227 from owncloud/fix-web-config
Fix config name for the web logout url
2023-05-04 15:36:42 +02:00
Amrita 517a177057 [tests-only] [full-ci] Refactor scenario related to checking json response (#6034)
* Separate positive and negative testing in different scenario

* Remove duplicate scenario

* Refactor json step graamer

* Remove unnecessary steps

* Add step to check space disable state
2023-05-04 14:55:11 +02:00
Michael Barz eac3ad38d2 Fix config name for the web logout url 2023-05-04 14:14:44 +02:00
Swikriti Tripathi 888870920b update line numbers
Signed-off-by: Swikriti Tripathi <swikriti808@gmail.com>
2023-05-04 17:15:28 +05:45
Swikriti Tripathi 87997ba49e update expected to fail file 2023-05-04 16:34:28 +05:45
Phil Davis 5c3c7278dc Merge pull request #6225 from owncloud/remove-remain-tag
[tests-only][full-ci]Remove core tags
2023-05-04 16:16:55 +05:45
Swikriti Tripathi 18a6e18507 Refactor feature files to add correct description 2023-05-04 15:20:56 +05:45
amrita 484f333c61 Remove unneccessary tag 2023-05-04 14:39:50 +05:45
Phil Davis 9d4236f5b6 Merge pull request #6165 from owncloud/remove-unneccessary-tag
[tests-only][full-ci]Remove unnecessary tags
2023-05-04 13:50:20 +05:45
Christian Richter d73ea1318c Merge pull request #6223 from owncloud/fix_envvar_decr
[docs-only] Fix IDP envvar description
2023-05-04 09:44:54 +02:00
Martin 968ec9dec5 Merge pull request #6224 from owncloud/xattrs_warning_in_readme
[docs-only] Add readme.md note to not use xattrs anymore
2023-05-04 09:42:59 +02:00
Martin 62a93bc9c4 Apply suggestions from code review 2023-05-04 09:06:46 +02:00
mmattel e89ea96470 [docs-only] Add readme.md note to not use xattrs anymore 2023-05-04 08:58:56 +02:00
amrita 65f0b18254 Remove files-version-app tag 2023-05-04 12:42:14 +05:45
amrita 1317eea31c Remove files-trashbin-app tag 2023-05-04 12:42:14 +05:45
amrita 6ff7dc2741 Remove brute-force-tag 2023-05-04 12:42:14 +05:45
amrita 73c327bdf0 Remove file sharing app 2023-05-04 12:42:14 +05:45
amrita 56a64b98ee Remove tag skipOnOcV10 2023-05-04 12:42:14 +05:45
amrita a34c6c42a8 Remove tag skipOnOcis notToImplementOnOCIS oImplementOnOCIS comments-app-required federation-app-required notifications-app-required systemtags-app-required local_storage 2023-05-04 12:42:14 +05:45
mmattel 67b7b6bad5 [docs-only] Fix IDP envvar description 2023-05-04 08:39:32 +02:00
Christian Richter bc2a74c895 Merge pull request #6221 from owncloud/fix_missing_index.md_file
[docs-only] Fix missing _index.md for the frontend service
2023-05-04 08:17:25 +02:00
Phil Davis 6400151d12 Merge pull request #6162 from owncloud/enh/refactor-feature-file
[tests-only]Refactor feature files to add correct description
2023-05-04 09:28:27 +05:45
ownClouders 33d9be3832 [tx] updated from transifex 2023-05-04 00:25:45 +00:00
Michael Barz 1587bf09cf Automated changelog update [skip ci] 2023-05-03 22:09:07 +00:00
Michael Barz 7cc39df306 Merge pull request #6222 from owncloud/release-3.0.0-rc.2
[full-ci] Bump version, prepare changelog
2023-05-04 00:08:31 +02:00
Michael Barz 2240fb52bc Automated changelog update [skip ci] 2023-05-03 20:33:31 +00:00
mmattel 93cb0912ce [docs-only] Fix missing _index.md for the frontend service 2023-05-03 17:10:18 +02:00
Swikriti Tripathi 7a195eaf46 Address reviews 2023-05-03 10:36:31 +05:45
Swikriti Tripathi 97b0094ed3 update expected to fail file 2023-05-03 10:36:31 +05:45
Swikriti Tripathi 17826d8ca9 Refactor feature files to add correct description 2023-05-03 10:36:30 +05:45
294 changed files with 9657 additions and 2364 deletions

No files matched your search

+2 -2
View File
@@ -1,3 +1,3 @@
# The test runner source for UI tests
WEB_COMMITID=cb15d9035ec81560444caa7ba14f41ba840d64ff
WEB_BRANCH=master
WEB_COMMITID=548ff614ae49c8e19651da5560bb3b04c710e19d
WEB_BRANCH=stable-7.0
+1 -1
View File
@@ -962,7 +962,7 @@ def wopiValidatorTests(ctx, storage, accounts_hash_difficulty = 4):
def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", accounts_hash_difficulty = 4):
early_fail = config["apiTests"]["earlyFail"] if "earlyFail" in config["apiTests"] else False
filterTags = "~@skipOnGraph&&~@toImplementOnOCIS&&~comments-app-required&&~@federation-app-required&&~@notifications-app-required&&~systemtags-app-required&&~@local_storage&&~@skipOnOcis-%s-Storage&&~@caldav&&~@carddav" % ("OC" if storage == "owncloud" else "OCIS")
filterTags = "~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS")
expectedFailuresFile = "%s/tests/acceptance/expected-failures-API-on-%s-storage.md" % (dirs["base"], storage.upper())
return {
+1
View File
@@ -50,5 +50,6 @@ protogen/buf.sha1.lock
# misc
go.work
go.work.sum
.env
.envrc
+7848 -21
View File
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,8 @@
Bugfix: Allow selected updates on graph users
We are now allowing a couple of update request to complete even if GRAPH_LDAP_SERVER_WRITE_ENABLED=false:
* When using a group to disable users (OCIS_LDAP_DISABLE_USER_MECHANISM=group) updates to the accountEnabled property of a user will be allowed
* When a distinct base dn for new groups is configured ( GRAPH_LDAP_GROUP_CREATE_BASE_DN is set to a different value than GRAPH_LDAP_GROUP_BASE_DN), allow the creation/update of local groups.
https://github.com/owncloud/ocis/pull/6233
@@ -1,4 +1,11 @@
Enhancement: Update Reva to version 2.13.1
Enhancement: Update Reva to version 2.13.2
Changelog for reva 2.13.2 (2023-05-08)
=======================================
* Bugfix [cs3org/reva#3845](https://github.com/cs3org/reva/pull/3845): Fix propagation
* Bugfix [cs3org/reva#3856](https://github.com/cs3org/reva/pull/3856): Fix response code
* Bugfix [cs3org/reva#3857](https://github.com/cs3org/reva/pull/3857): Fix trashbin purge
Changelog for reva 2.13.1 (2023-05-03)
=======================================
@@ -0,0 +1,6 @@
Bugfix: Hide the existence of space when deleting/updating
The "code": "notAllowed" changed to "code": "itemNotFound"
https://github.com/owncloud/ocis/issues/5031
https://github.com/owncloud/ocis/pull/6220
@@ -0,0 +1,5 @@
Bugfix: Fix Logout Url config name
We fixed the yaml and json name of the logout url option.
https://github.com/owncloud/ocis/pull/6227
File renamed without changes.
@@ -1,8 +1,8 @@
Enhancement: Update web to v7.0.0-rc.35
Enhancement: Update web to v7.0.0-rc.36
Tags: web
We updated ownCloud Web to v7.0.0-rc.35. Please refer to the changelog (linked) for details on the web release.
We updated ownCloud Web to v7.0.0-rc.36. Please refer to the changelog (linked) for details on the web release.
* Bugfix [owncloud/web#6423](https://github.com/owncloud/web/issues/6423): Archiver in protected public links
* Bugfix [owncloud/web#6731](https://github.com/owncloud/web/issues/6731): Layout with long breadcrumb
@@ -137,7 +137,6 @@ We updated ownCloud Web to v7.0.0-rc.35. Please refer to the changelog (linked)
* Enhancement [owncloud/web#8820](https://github.com/owncloud/web/pull/8820): Adjust missing reshare permissions message
* Enhancement [owncloud/web#8822](https://github.com/owncloud/web/pull/8822): Fix quicklink icon alignment
* Enhancement [owncloud/web#8826](https://github.com/owncloud/web/pull/8826): Admin settings groups members panel
* Enhancement [owncloud/web#8866](https://github.com/owncloud/web/pull/8866): Add expiration date hint to public links
* Enhancement [owncloud/web#8868](https://github.com/owncloud/web/pull/8868): Respect user read-only configuration by the server
* Enhancement [owncloud/web#8876](https://github.com/owncloud/web/pull/8876): Update roles and permissions names, labels, texts and icons
* Enhancement [owncloud/web#8882](https://github.com/owncloud/web/pull/8882): Layout of Share role and expiration date dropdown
@@ -145,5 +144,5 @@ We updated ownCloud Web to v7.0.0-rc.35. Please refer to the changelog (linked)
* Enhancement [owncloud/web#8898](https://github.com/owncloud/web/pull/8898): Rename "Quicklink" to "link"
* Enhancement [owncloud/web#8911](https://github.com/owncloud/web/pull/8911): Add notification setting to account page
https://github.com/owncloud/ocis/pull/6190
https://github.com/owncloud/web/releases/tag/v7.0.0-rc.35
https://github.com/owncloud/ocis/pull/6234
https://github.com/owncloud/web/releases/tag/v7.0.0-rc.36
@@ -31,7 +31,7 @@
env:
INSECURE: "false"
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
OCIS_DOCKER_TAG: 3.0.0-rc.2
OCIS_DOCKER_TAG: 3.0.0-rc.3
OCIS_DOMAIN: ocis.ocis-keycloak.released.owncloud.works
KEYCLOAK_DOMAIN: keycloak.ocis-keycloak.released.owncloud.works
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
@@ -31,7 +31,7 @@
env:
INSECURE: "false"
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
OCIS_DOCKER_TAG: 3.0.0-rc.2
OCIS_DOCKER_TAG: 3.0.0-rc.3
OCIS_DOMAIN: ocis.ocis-ldap.released.owncloud.works
LDAP_MANAGER_DOMAIN: ldap.ocis-ldap.released.owncloud.works
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
@@ -31,7 +31,7 @@
env:
INSECURE: "false"
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
OCIS_DOCKER_TAG: 3.0.0-rc.2
OCIS_DOCKER_TAG: 3.0.0-rc.3
OCIS_DOMAIN: ocis.ocis-traefik.released.owncloud.works
DEMO_USERS: "true"
INBUCKET_DOMAIN: mail.ocis-traefik.released.owncloud.works
@@ -31,7 +31,7 @@
env:
INSECURE: "false"
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
OCIS_DOCKER_TAG: 3.0.0-rc.2
OCIS_DOCKER_TAG: 3.0.0-rc.3
OCIS_DOMAIN: ocis.ocis-wopi.released.owncloud.works
WOPISERVER_DOMAIN: wopiserver.ocis-wopi.released.owncloud.works
COLLABORA_DOMAIN: collabora.ocis-wopi.released.owncloud.works
+89
View File
@@ -0,0 +1,89 @@
---
title: Frontend
date: 2023-05-03T16:23:46.388689927+02:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/services/frontend
geekdocFilePath: README.md
geekdocCollapseSection: true
---
<!-- Do not edit this file, it is autogenerated. Edit the service README.md instead -->
## Abstract
The frontend service translates various owncloud related HTTP APIs to CS3 requests.
## Table of Contents
* [Endpoints Overview](#endpoints-overview)
* [appprovider](#appprovider)
* [archiver](#archiver)
* [datagateway](#datagateway)
* [ocs](#ocs)
* [Sharing](#sharing)
* [Scalability](#scalability)
* [Define Read-Only Attributes](#define-read-only-attributes)
* [Caching](#caching)
* [Example Yaml Config](#example-yaml-config)
## Endpoints Overview
Currently, the frontend service handles requests for three functionalities, which are `appprovider`, `archiver`, `datagateway` and `ocs`.
### appprovider
The appprovider endpoint, by default `/app`, forwards HTTP requests to the CS3 [App Registry API](https://cs3org.github.io/cs3apis/#cs3.app.registry.v1beta1.RegistryAPI)
### archiver
The archiver endpoint, by default `/archiver`, implements zip and tar download for collections of files. It will internally use the CS3 API to initiate downloads and then stream the individual files as part of a compressed file.
### datagateway
The datagateway endpoint, by default `/data`, forwards file up- and download requests to the correct CS3 data provider. OCIS starts a dataprovider as part of the storage-* services. The routing happens based on the JWT that was created by a storage provider in response to an `InitiateFileDownload` or `InitiateFileUpload` request.
### ocs
The ocs endpoint, by default `/ocs`, implements the ownCloud 10 Open Collaboration Services API by translating it into CS3 API requests. It can handle users, groups, capabilities and also implements the files sharing functionality on top of CS3. The `/ocs/v[12].php/cloud/user/signing-key` is currently handled by the dedicated [ocs](https://github.com/owncloud/ocis/tree/master/services/ocs) service.
### Sharing
Aggregating share information is one of the most time consuming operations in OCIS. The service fetches a list of either received or created shares and has to stat every resource individually. While stats are fast, the default behavior scales linearly with the number of shares.
To save network trips the sharing implementation can cache the stat requests with an in memory cache or in Redis. It will shorten the response time by the network round-trip overhead at the cost of the API only eventually being updated.
Setting `FRONTEND_OCS_RESOURCE_INFO_CACHE_TTL=60` would cache the stat info for 60 seconds. Increasing this value makes sense for large deployments with thousands of active users that keep the cache up to date. Low frequency usage scenarios should not expect a noticeable improvement.
## Scalability
While the frontend service does not persist any data, it does cache information about files and filesystem (`Stat()`) responses and user information. Therefore, multiple instances of this service can be spawned in a bigger deployment like when using container orchestration with Kubernetes, when configuring `FRONTEND_OCS_RESOURCE_INFO_CACHE_STORE` and the related config options.
## Define Read-Only Attributes
A lot of user management is made via the standardized libregraph API. Depending on how the system is configured, there might be some user attributes that an ocis instance admin can't change because of properties coming from an external LDAP server, or similar. This can be the case when the ocis admin is not the LDAP admin. To ease life for admins, there are hints as capabilites telling the frontend which attributes are read-only to enable a different optical representation like being grayed out. To configure these hints, use the environment variable `FRONTEND_READONLY_USER_ATTRIBUTES`, which takes a comma separated list of attributes, see the envvar for supported values.
You can find more details regarding available attributes at the [libre-graph-api openapi-spec](https://github.com/owncloud/libre-graph-api/blob/main/api/openapi-spec/v1.0.yaml) and on [owncloud.dev](https://owncloud.dev/libre-graph-api/).
## Caching
The `frontend` service can use a configured store via `FRONTEND_OCS_RESOURCE_INFO_CACHE_STORE`. Possible stores are:
- `memory`: Basic in-memory store and the default.
- `ocmem`: Advanced in-memory store allowing max size.
- `redis`: Stores data in a configured Redis cluster.
- `redis-sentinel`: Stores data in a configured Redis Sentinel cluster.
- `etcd`: Stores data in a configured etcd cluster.
- `nats-js`: Stores data using key-value-store feature of [nats jetstream](https://docs.nats.io/nats-concepts/jetstream/key-value-store)
- `noop`: Stores nothing. Useful for testing. Not recommended in production environments.
1. Note that in-memory stores are by nature not reboot-persistent.
2. Though usually not necessary, a database name and a database table can be configured for event stores if the event store supports this. Generally not applicable for stores of type `in-memory`. These settings are blank by default which means that the standard settings of the configured store apply.
3. The frontend service can be scaled if not using `in-memory` stores and the stores are configured identically over all instances.
4. When using `redis-sentinel`, the Redis master to use is configured via `FRONTEND_OCS_RESOURCE_INFO_CACHE_STORE_NODES` in the form of `<sentinel-host>:<sentinel-port>/<redis-master>` like `10.10.0.200:26379/mymaster`.
## Example Yaml Config
{{< include file="services/_includes/frontend-config-example.yaml" language="yaml" >}}
{{< include file="services/_includes/frontend_configvars.md" >}}
+5 -2
View File
@@ -13,7 +13,7 @@ require (
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.4.0
github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965
github.com/cs3org/reva/v2 v2.13.1
github.com/cs3org/reva/v2 v2.13.2
github.com/disintegration/imaging v1.6.2
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
github.com/egirna/icap-client v0.1.1
@@ -320,4 +320,7 @@ require (
sigs.k8s.io/yaml v1.3.0 // indirect
)
replace github.com/cs3org/go-cs3apis => github.com/c0rby/go-cs3apis v0.0.0-20230110100311-5b424f1baa35
replace (
github.com/cs3org/go-cs3apis => github.com/c0rby/go-cs3apis v0.0.0-20230110100311-5b424f1baa35
github.com/go-micro/plugins/v4/store/redis => github.com/dragonchaser/go-micro-plugins/v4/store/redis v0.0.0-20230508144354-06738dcca00f
)
+4 -4
View File
@@ -627,8 +627,8 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo
github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4=
github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc=
github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
github.com/cs3org/reva/v2 v2.13.1 h1:siUG/fJ4ds7RRswGtjEOLNu6u6Y+n4l9CF8ubFAUi+8=
github.com/cs3org/reva/v2 v2.13.1/go.mod h1:VxBmpOvIKlgKLPOsHun+fABopzX+3ZELPAp3N5bQMsM=
github.com/cs3org/reva/v2 v2.13.2 h1:M8UcHUMyYx8tbPyf68JgjxVpbMtqC5a6//BaBa5pEMY=
github.com/cs3org/reva/v2 v2.13.2/go.mod h1:ZhUAORNpfKdMXO9LWcQta+DM77ArnqNnEB+b/Zgdmmk=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
@@ -661,6 +661,8 @@ github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyG
github.com/dnsimple/dnsimple-go v0.63.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg=
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dragonchaser/go-micro-plugins/v4/store/redis v0.0.0-20230508144354-06738dcca00f h1:5siFx2qvzmMSIWJvN2JhdJmU0tlqIFzgcfOnJm8sGTg=
github.com/dragonchaser/go-micro-plugins/v4/store/redis v0.0.0-20230508144354-06738dcca00f/go.mod h1:MbCG0YiyPqETTtm7uHFmxQNCaW1o9hBoYtFwhbVjLUg=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e h1:rcHHSQqzCgvlwP0I/fQ8rQMn/MpHE5gWSLdtpxtP6KQ=
@@ -792,8 +794,6 @@ github.com/go-micro/plugins/v4/server/http v1.2.1 h1:Cia924J90rgFT/4qWWvyLvN+XqE
github.com/go-micro/plugins/v4/server/http v1.2.1/go.mod h1:YuAjaSPxcn3LI8j2FUsqx0Rxunrj4YwDV41Ax76rLl0=
github.com/go-micro/plugins/v4/store/nats-js v1.1.0 h1:6Fe1/eLtg8kRyaGvMILp4olYtTDGwYNBXyb1sYfAWGk=
github.com/go-micro/plugins/v4/store/nats-js v1.1.0/go.mod h1:jJf7Gm39OafZlT3s3UE2/9NIYj6OlI2fmZ4czSA3gvo=
github.com/go-micro/plugins/v4/store/redis v1.2.1-0.20230405210006-efd9191305c5 h1:W5HQDVr+6u9yQpnFZxMBRQd2rQCjOw/17Yb3dp6SQhE=
github.com/go-micro/plugins/v4/store/redis v1.2.1-0.20230405210006-efd9191305c5/go.mod h1:MbCG0YiyPqETTtm7uHFmxQNCaW1o9hBoYtFwhbVjLUg=
github.com/go-micro/plugins/v4/transport/grpc v1.1.0 h1:mXfDYfFQLnVDzjGY3o84oe4prfux9h8txsnA19dKsj8=
github.com/go-micro/plugins/v4/wrapper/breaker/gobreaker v1.2.0 h1:EQj4l7fuOSz8ueUYhFlpZPp9+tN4JeONL32ARRKXW/U=
github.com/go-micro/plugins/v4/wrapper/breaker/gobreaker v1.2.0/go.mod h1:JR9Ox/iJIrcXm8nCWdAEBsyG7Q7lyMLzsTZPfXrqvwo=
+1 -1
View File
@@ -16,7 +16,7 @@ var (
// LatestTag is the latest released version plus the dev meta version.
// Will be overwritten by the release pipeline
// Needs a manual change for every tagged release
LatestTag = "3.0.0-rc.2+dev"
LatestTag = "3.0.0-rc.3+dev"
// Date indicates the build date.
// This has been removed, it looks like you can only replace static strings with recent go versions
+1
View File
@@ -37,6 +37,7 @@ type Config struct {
EnableFederatedSharingIncoming bool `yaml:"enable_federated_sharing_incoming" env:"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."`
EnableFederatedSharingOutgoing bool `yaml:"enable_federated_sharing_outgoing" env:"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."`
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."`
Edition string `yaml:"edition" env:"OCIS_EDITION;FRONTEND_EDITION"`
PublicURL string `yaml:"public_url" env:"OCIS_URL;FRONTEND_PUBLIC_URL" desc:"The public facing URL of the oCIS frontend."`
@@ -87,6 +87,7 @@ func DefaultConfig() *config.Config {
DefaultUploadProtocol: "tus",
EnableResharing: true,
SearchMinLength: 3,
Edition: "Community",
Checksums: config.Checksums{
SupportedTypes: []string{"sha1", "md5", "adler32"},
PreferredUploadType: "sha1",
+1 -1
View File
@@ -191,7 +191,7 @@ func FrontendConfigFromStruct(cfg *config.Config) (map[string]interface{}, error
"needsDbUpgrade": false,
"version": version.Legacy,
"versionstring": version.LegacyString,
"edition": "Community",
"edition": cfg.Edition,
"productname": "Infinite Scale",
"product": "Infinite Scale",
"productversion": version.GetString(),
+111 -31
View File
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"math"
"strconv"
"strings"
@@ -85,6 +86,10 @@ type userAttributeMap struct {
type ldapAttributeValues map[string][]string
type ldapResultToErrMap map[uint16]errorcode.Error
const ldapGenericErr = math.MaxUint16
// ParseDisableMechanismType checks that the configuration option for how to disable users is correct.
func ParseDisableMechanismType(disableMechanism string) (DisableUserMechanismType, error) {
disableMechanism = strings.ToLower(disableMechanism)
@@ -188,14 +193,15 @@ func (i *LDAP) CreateUser(ctx context.Context, user libregraph.User) (*libregrap
}
if err := i.conn.Add(ar); err != nil {
var lerr *ldap.Error
logger.Debug().Err(err).Msg("error adding user")
if errors.As(err, &lerr) {
if lerr.ResultCode == ldap.LDAPResultEntryAlreadyExists {
err = errorcode.New(errorcode.NameAlreadyExists, lerr.Error())
}
msg := "failed to add user"
logger.Error().Err(err).Msg(msg)
errMap := ldapResultToErrMap{
ldap.LDAPResultEntryAlreadyExists: errorcode.New(errorcode.NameAlreadyExists, "a user with that name already exists"),
ldap.LDAPResultUnwillingToPerform: errorcode.New(errorcode.NotAllowed, msg),
ldap.LDAPResultInsufficientAccessRights: errorcode.New(errorcode.NotAllowed, msg),
ldapGenericErr: errorcode.New(errorcode.GeneralException, msg),
}
return nil, err
return nil, i.mapLDAPError(err, errMap)
}
if i.usePwModifyExOp && user.PasswordProfile != nil && user.PasswordProfile.Password != nil {
@@ -226,7 +232,15 @@ func (i *LDAP) DeleteUser(ctx context.Context, nameOrID string) error {
}
dr := ldap.DelRequest{DN: e.DN}
if err = i.conn.Del(&dr); err != nil {
return err
msg := "error deleting user"
logger.Error().Err(err).Msg(msg)
errMap := ldapResultToErrMap{
ldap.LDAPResultNoSuchObject: errorcode.New(errorcode.ItemNotFound, "user not found"),
ldap.LDAPResultUnwillingToPerform: errorcode.New(errorcode.NotAllowed, msg),
ldap.LDAPResultInsufficientAccessRights: errorcode.New(errorcode.NotAllowed, msg),
ldapGenericErr: errorcode.New(errorcode.GeneralException, msg),
}
return i.mapLDAPError(err, errMap)
}
if !i.refintEnabled {
@@ -253,7 +267,12 @@ func (i *LDAP) UpdateUser(ctx context.Context, nameOrID string, user libregraph.
logger := i.logger.SubloggerWithRequestID(ctx)
logger.Debug().Str("backend", "ldap").Msg("UpdateUser")
if !i.writeEnabled {
return nil, ErrReadOnly
// still allow eanble/disable User when using DisableMechanismGroup
if i.disableUserMechanism == DisableMechanismGroup && isUserEnabledUpdate(user) {
logger.Error().Str("backend", "ldap").Msg("Allowing accountEnabled Update on read-only backend")
} else {
return nil, ErrReadOnly
}
}
e, err := i.getLDAPUserByNameOrID(nameOrID)
if err != nil {
@@ -303,7 +322,15 @@ func (i *LDAP) UpdateUser(ctx context.Context, nameOrID string, user libregraph.
if user.PasswordProfile != nil && user.PasswordProfile.GetPassword() != "" {
if i.usePwModifyExOp {
if err := i.updateUserPassowrd(ctx, e.DN, user.PasswordProfile.GetPassword()); err != nil {
return nil, err
msg := "error updating user password"
logger.Error().Err(err).Msg(msg)
errMap := ldapResultToErrMap{
ldap.LDAPResultNoSuchObject: errorcode.New(errorcode.ItemNotFound, "user not found"),
ldap.LDAPResultUnwillingToPerform: errorcode.New(errorcode.NotAllowed, msg),
ldap.LDAPResultInsufficientAccessRights: errorcode.New(errorcode.NotAllowed, msg),
ldapGenericErr: errorcode.New(errorcode.GeneralException, msg),
}
return nil, i.mapLDAPError(err, errMap)
}
} else {
// password are hashed server side there is no need to check if the new password
@@ -331,7 +358,15 @@ func (i *LDAP) UpdateUser(ctx context.Context, nameOrID string, user libregraph.
if updateNeeded {
if err := i.conn.Modify(&mr); err != nil {
return nil, err
msg := "error updating user"
logger.Error().Err(err).Msg(msg)
errMap := ldapResultToErrMap{
ldap.LDAPResultNoSuchObject: errorcode.New(errorcode.ItemNotFound, "user not found"),
ldap.LDAPResultUnwillingToPerform: errorcode.New(errorcode.NotAllowed, msg),
ldap.LDAPResultInsufficientAccessRights: errorcode.New(errorcode.NotAllowed, msg),
ldapGenericErr: errorcode.New(errorcode.GeneralException, msg),
}
return nil, i.mapLDAPError(err, errMap)
}
}
@@ -395,7 +430,7 @@ func (i *LDAP) getEntryByDN(dn string, attrs []string, filter string) (*ldap.Ent
res, err := i.conn.Search(searchRequest)
if err != nil {
i.logger.Error().Err(err).Str("backend", "ldap").Str("dn", dn).Msg("Search ldap by DN failed")
return nil, errorcode.New(errorcode.ItemNotFound, err.Error())
return nil, errorcode.New(errorcode.ItemNotFound, "user lookup failed")
}
if len(res.Entries) == 0 {
return nil, ErrNotFound
@@ -428,7 +463,7 @@ func (i *LDAP) searchLDAPEntryByFilter(basedn string, attrs []string, filter str
res, err := i.conn.Search(searchRequest)
if err != nil {
i.logger.Error().Err(err).Str("backend", "ldap").Str("dn", basedn).Str("filter", filter).Msg("Search user by filter failed")
return nil, errorcode.New(errorcode.ItemNotFound, err.Error())
return nil, errorcode.New(errorcode.ItemNotFound, "user search failed")
}
if len(res.Entries) == 0 {
return nil, ErrNotFound
@@ -580,7 +615,13 @@ func (i *LDAP) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*lib
Msg("GetUsers")
res, err := i.conn.Search(searchRequest)
if err != nil {
return nil, errorcode.New(errorcode.ItemNotFound, err.Error())
msg := "error listing users"
logger.Error().Err(err).Msg(msg)
errMap := ldapResultToErrMap{
ldap.LDAPResultInsufficientAccessRights: errorcode.New(errorcode.AccessDenied, msg),
ldapGenericErr: errorcode.New(errorcode.GeneralException, msg),
}
return nil, i.mapLDAPError(err, errMap)
}
users := make([]*libregraph.User, 0, len(res.Entries))
@@ -626,14 +667,16 @@ func (i *LDAP) changeUserName(ctx context.Context, dn, originalUserName, newUser
mrdn := ldap.NewModifyDNRequest(dn, newDNString, true, "")
if err := i.conn.ModifyDN(mrdn); err != nil {
var lerr *ldap.Error
logger.Debug().Str("originalDN", dn).Str("newDN", newDNString).Err(err).Msg("Failed to modify DN")
if errors.As(err, &lerr) {
if lerr.ResultCode == ldap.LDAPResultEntryAlreadyExists {
err = errorcode.New(errorcode.NameAlreadyExists, lerr.Error())
}
msg := "error renaming user"
logger.Error().Err(err).Msg(msg)
errMap := ldapResultToErrMap{
ldap.LDAPResultEntryAlreadyExists: errorcode.New(errorcode.NameAlreadyExists, "a user with that name already exists"),
ldap.LDAPResultNoSuchObject: errorcode.New(errorcode.ItemNotFound, msg),
ldap.LDAPResultUnwillingToPerform: errorcode.New(errorcode.NotAllowed, msg),
ldap.LDAPResultInsufficientAccessRights: errorcode.New(errorcode.NotAllowed, msg),
ldapGenericErr: errorcode.New(errorcode.GeneralException, msg),
}
return nil, err
return nil, i.mapLDAPError(err, errMap)
}
parsed, err := ldap.ParseDN(dn)
@@ -678,17 +721,17 @@ func (i *LDAP) renameMemberInGroup(ctx context.Context, group *ldap.Entry, oldMe
mr.Delete(i.groupAttributeMap.member, []string{oldMember})
mr.Add(i.groupAttributeMap.member, []string{newMember})
if err := i.conn.Modify(mr); err != nil {
logger.Warn().Err(err).
Str("oldMember", oldMember).
Str("newMember", newMember).
Str("groupDN", group.DN).
Msg("Error renaming group members.")
var lerr *ldap.Error
if errors.As(err, &lerr) {
if lerr.ResultCode == ldap.LDAPResultNoSuchObject {
logger.Warn().Str("group", group.DN).Msg("Group no longer exists")
return nil
} else if lerr.ResultCode == ldap.LDAPResultNoSuchAttribute {
logger.Warn().
Str("oldMember", oldMember).
Str("newMember", newMember).
Str("groupDN", group.DN).
Msg("member attribute not found, this probably means that the server has refint enabled, please configure the OCIS to respect that.")
// NoSuchObject means that the group no longer exists. Some other client might have deleted it. There is
// not much we can do
// NoSuchAttribute means that the old value is no longer present. We can't do much here either
if lerr.ResultCode == ldap.LDAPResultNoSuchObject || lerr.ResultCode == ldap.LDAPResultNoSuchAttribute {
return nil
}
}
@@ -929,9 +972,17 @@ func (i *LDAP) removeEntryByDNAndAttributeFromEntry(entry *ldap.Entry, dn string
if err != nil {
i.logger.Error().Err(err).Str("entry", entry.DN).Str("attribute", attribute).Str("target value", dn).
Msg("Failed to remove dn attribute from entry")
msg := "failed to update object"
errMap := ldapResultToErrMap{
ldap.LDAPResultNoSuchObject: errorcode.New(errorcode.ItemNotFound, "object does not exists"),
ldap.LDAPResultUnwillingToPerform: errorcode.New(errorcode.NotAllowed, msg),
ldap.LDAPResultInsufficientAccessRights: errorcode.New(errorcode.NotAllowed, msg),
ldapGenericErr: errorcode.New(errorcode.GeneralException, msg),
}
return i.mapLDAPError(err, errMap)
}
return err
return nil
}
// expandLDAPAttributeEntries reads an attribute from an ldap entry and expands to users
@@ -1133,3 +1184,32 @@ func (i *LDAP) updateAccountEnabledState(logger log.Logger, accountEnabled bool,
return updateNeeded, err
}
func (i *LDAP) mapLDAPError(err error, errmap ldapResultToErrMap) errorcode.Error {
var lerr *ldap.Error
if errors.As(err, &lerr) {
if res, ok := errmap[lerr.ResultCode]; ok {
return res
}
}
if res, ok := errmap[ldapGenericErr]; ok {
return res
}
return errorcode.New(errorcode.GeneralException, err.Error())
}
func isUserEnabledUpdate(user libregraph.User) bool {
switch {
case user.Id != nil, user.DisplayName != nil,
user.Drive != nil, user.Mail != nil, user.OnPremisesSamAccountName != nil,
user.PasswordProfile != nil, user.Surname != nil, user.GivenName != nil,
user.UserType != nil:
return false
case len(user.AppRoleAssignments) != 0,
len(user.MemberOf) != 0,
len(user.Identities) != 0,
len(user.Drives) != 0:
return false
}
return user.AccountEnabled != nil
}
+5 -9
View File
@@ -177,7 +177,7 @@ func (i *LDAP) GetGroupMembers(ctx context.Context, groupID string, req *godata.
func (i *LDAP) CreateGroup(ctx context.Context, group libregraph.Group) (*libregraph.Group, error) {
logger := i.logger.SubloggerWithRequestID(ctx)
logger.Debug().Str("backend", "ldap").Msg("create group")
if !i.writeEnabled {
if !i.writeEnabled && i.groupCreateBaseDN == i.groupBaseDN {
return nil, errorcode.New(errorcode.NotAllowed, "server is configured read-only")
}
ar, err := i.groupToAddRequest(group)
@@ -201,7 +201,7 @@ func (i *LDAP) CreateGroup(ctx context.Context, group libregraph.Group) (*libreg
func (i *LDAP) DeleteGroup(ctx context.Context, id string) error {
logger := i.logger.SubloggerWithRequestID(ctx)
logger.Debug().Str("backend", "ldap").Msg("DeleteGroup")
if !i.writeEnabled {
if !i.writeEnabled && i.groupCreateBaseDN == i.groupBaseDN {
return errorcode.New(errorcode.NotAllowed, "server is configured read-only")
}
@@ -225,7 +225,7 @@ func (i *LDAP) DeleteGroup(ctx context.Context, id string) error {
func (i *LDAP) UpdateGroupName(ctx context.Context, groupID string, groupName string) error {
logger := i.logger.SubloggerWithRequestID(ctx)
logger.Debug().Str("backend", "ldap").Msg("AddMembersToGroup")
if !i.writeEnabled {
if !i.writeEnabled && i.groupCreateBaseDN == i.groupBaseDN {
return errorcode.New(errorcode.NotAllowed, "server is configured read-only")
}
@@ -271,7 +271,7 @@ func (i *LDAP) UpdateGroupName(ctx context.Context, groupID string, groupName st
func (i *LDAP) AddMembersToGroup(ctx context.Context, groupID string, memberIDs []string) error {
logger := i.logger.SubloggerWithRequestID(ctx)
logger.Debug().Str("backend", "ldap").Msg("AddMembersToGroup")
if !i.writeEnabled {
if !i.writeEnabled && i.groupCreateBaseDN == i.groupBaseDN {
return errorcode.New(errorcode.NotAllowed, "server is configured read-only")
}
ge, err := i.getLDAPGroupByNameOrID(groupID, true)
@@ -365,7 +365,7 @@ func (i *LDAP) AddMembersToGroup(ctx context.Context, groupID string, memberIDs
func (i *LDAP) RemoveMemberFromGroup(ctx context.Context, groupID string, memberID string) error {
logger := i.logger.SubloggerWithRequestID(ctx)
logger.Debug().Str("backend", "ldap").Msg("RemoveMemberFromGroup")
if !i.writeEnabled {
if !i.writeEnabled && i.groupCreateBaseDN == i.groupBaseDN {
return errorcode.New(errorcode.NotAllowed, "server is configured read-only")
}
@@ -562,10 +562,6 @@ func (i *LDAP) createGroupModelFromLDAP(e *ldap.Entry) *libregraph.Group {
}
func (i *LDAP) isLDAPGroupReadOnly(e *ldap.Entry) bool {
if !i.writeEnabled {
return true
}
groupDN, err := ldap.ParseDN(e.DN)
if err != nil {
i.logger.Warn().Err(err).Str("dn", e.DN).Msg("Failed to parse DN")
Loaded 100 of 294 files, more files were not shown because too many files have changed in this diff. Show more