Compare commits
76
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3a49c8b88 | ||
|
|
c53da6ba96 | ||
|
|
be8d253b82 | ||
|
|
aed04c983f | ||
|
|
78f138e9a8 | ||
|
|
df0903a508 | ||
|
|
e4d674a30d | ||
|
|
8bbf4ababe | ||
|
|
906189462c | ||
|
|
046895a831 | ||
|
|
4b501e93a4 | ||
|
|
5fbee63f09 | ||
|
|
d69decdafe | ||
|
|
428e696eb0 | ||
|
|
8cef413f02 | ||
|
|
f209f65eae | ||
|
|
09812e009e | ||
|
|
d127954df4 | ||
|
|
86fbfa5d8c | ||
|
|
8be428c605 | ||
|
|
0bf6a110f6 | ||
|
|
7f11f7984a | ||
|
|
62b91981ed | ||
|
|
e208b3018a | ||
|
|
55d72475d7 | ||
|
|
ff7a1d2efa | ||
|
|
edbecf0aa5 | ||
|
|
a3d72569fb | ||
|
|
7931533a67 | ||
|
|
ab50b9efd1 | ||
|
|
14e577d452 | ||
|
|
98059708a0 | ||
|
|
4ca58526fc | ||
|
|
0c361e4162 | ||
|
|
a571b372ae | ||
|
|
b6ffa07a34 | ||
|
|
8e9e547e9d | ||
|
|
0bbadc4a05 | ||
|
|
72aa49b9f6 | ||
|
|
52ddba3fac | ||
|
|
cd7ef50481 | ||
|
|
a8e8d0b841 | ||
|
|
670aa26975 | ||
|
|
444afd2094 | ||
|
|
4302eec3ab | ||
|
|
f6fae22811 | ||
|
|
4aa746d52a | ||
|
|
517a177057 | ||
|
|
eac3ad38d2 | ||
|
|
888870920b | ||
|
|
87997ba49e | ||
|
|
5c3c7278dc | ||
|
|
18a6e18507 | ||
|
|
484f333c61 | ||
|
|
9d4236f5b6 | ||
|
|
d73ea1318c | ||
|
|
968ec9dec5 | ||
|
|
62a93bc9c4 | ||
|
|
e89ea96470 | ||
|
|
65f0b18254 | ||
|
|
1317eea31c | ||
|
|
6ff7dc2741 | ||
|
|
73c327bdf0 | ||
|
|
56a64b98ee | ||
|
|
a34c6c42a8 | ||
|
|
67b7b6bad5 | ||
|
|
bc2a74c895 | ||
|
|
6400151d12 | ||
|
|
33d9be3832 | ||
|
|
1587bf09cf | ||
|
|
7cc39df306 | ||
|
|
2240fb52bc | ||
|
|
93cb0912ce | ||
|
|
7a195eaf46 | ||
|
|
97b0094ed3 | ||
|
|
17826d8ca9 |
No files matched your search
+2
-2
@@ -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
@@ -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 {
|
||||
|
||||
@@ -50,5 +50,6 @@ protogen/buf.sha1.lock
|
||||
|
||||
# misc
|
||||
go.work
|
||||
go.work.sum
|
||||
.env
|
||||
.envrc
|
||||
+7848
-21
File diff suppressed because it is too large.
Load diff
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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)
|
||||
=======================================
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+4
-5
@@ -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
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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
|
||||
|
||||
Executable
+89
@@ -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" >}}
|
||||
|
||||
@@ -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
|
||||
)
|
||||
@@ -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=
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
Reference in new issue
Block a user