Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df64cb9cba | ||
|
|
65d46844ba | ||
|
|
d65f3fc215 | ||
|
|
1256793012 | ||
|
|
cdcabdb527 | ||
|
|
2f70a6856f | ||
|
|
eb06e23a09 | ||
|
|
604cb5a069 | ||
|
|
6361b52b7f | ||
|
|
5e7ce5c7de | ||
|
|
63b0cdda0e | ||
|
|
31ccffa99c | ||
|
|
5f1dbeca53 | ||
|
|
5eb6366a6c | ||
|
|
53fa0f0691 | ||
|
|
c3a6f52502 | ||
|
|
2ed2f8697b | ||
|
|
7c87568713 | ||
|
|
b265241288 | ||
|
|
7b284878f5 | ||
|
|
c20900419e | ||
|
|
bfda167e31 | ||
|
|
77560da057 | ||
|
|
ad9ccdc93b | ||
|
|
5bf887a570 | ||
|
|
fa077e7eeb | ||
|
|
382d95a3eb | ||
|
|
aa9aa9b454 | ||
|
|
37222116c0 | ||
|
|
b49335fce6 | ||
|
|
380273bb84 | ||
|
|
5112d837a8 | ||
|
|
aefe0131a3 | ||
|
|
cf54f4b2e1 | ||
|
|
6ccdb91454 | ||
|
|
f6441e4c9a |
No files matched your search
@@ -1,3 +1,6 @@
|
||||
# SPDX-FileCopyrightText: ownCloud GmbH - A Kiteworks Company and ownCloud contributors
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Managed by owncloud/admin — edit codeowners/ownership.yml, not this file.
|
||||
# Generated by scripts/sync-codeowners.py. Last matching pattern wins.
|
||||
* @owncloud/ocis-maintainers
|
||||
@@ -217,6 +217,7 @@ jobs:
|
||||
- apiOcm
|
||||
# collaboration (needs WOPI)
|
||||
- apiCollaboration
|
||||
- apiVault
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
|
||||
@@ -109,9 +109,11 @@ jobs:
|
||||
path: |
|
||||
.
|
||||
!.git
|
||||
!web
|
||||
retention-days: 1
|
||||
|
||||
docker-build:
|
||||
if: false
|
||||
name: docker-build (${{ matrix.arch }}, ${{ matrix.repo }})
|
||||
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
|
||||
needs: [determine-release-type, generate-code, security-scan-trivy]
|
||||
@@ -125,8 +127,8 @@ jobs:
|
||||
with:
|
||||
name: generated-code
|
||||
path: .
|
||||
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
|
||||
- uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
|
||||
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
||||
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
@@ -152,7 +154,7 @@ jobs:
|
||||
printf "tags<<EOF\n%s\nEOF\n" \
|
||||
"${REPO}:${VERSION}-linux-${ARCH}" >> $GITHUB_OUTPUT
|
||||
- id: build
|
||||
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
|
||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
|
||||
with:
|
||||
context: ocis
|
||||
file: ocis/docker/Dockerfile.linux.${{ matrix.arch }}
|
||||
@@ -165,7 +167,7 @@ jobs:
|
||||
VERSION=${{ needs.determine-release-type.outputs.version }}
|
||||
tags: ${{ steps.tags.outputs.tags }}
|
||||
- id: trivy
|
||||
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
||||
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
image-ref: ${{ steps.tags.outputs.tags }}
|
||||
@@ -196,7 +198,7 @@ jobs:
|
||||
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
||||
- uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
|
||||
id: trivy
|
||||
continue-on-error: true
|
||||
with:
|
||||
@@ -217,6 +219,7 @@ jobs:
|
||||
exit 1
|
||||
|
||||
docker-manifest:
|
||||
if: false
|
||||
name: docker-manifest (${{ matrix.repo }})
|
||||
runs-on: ubuntu-latest
|
||||
needs: [determine-release-type, docker-build, docker-scan]
|
||||
@@ -224,7 +227,7 @@ jobs:
|
||||
matrix:
|
||||
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
|
||||
steps:
|
||||
- uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
|
||||
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
@@ -242,6 +245,7 @@ jobs:
|
||||
"${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-arm64"
|
||||
|
||||
docker-readme:
|
||||
if: false
|
||||
name: docker-readme (${{ matrix.repo }})
|
||||
runs-on: ubuntu-latest
|
||||
needs: [determine-release-type, docker-manifest]
|
||||
@@ -289,7 +293,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
||||
- uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
|
||||
with:
|
||||
scan-type: fs
|
||||
format: table
|
||||
@@ -313,6 +317,10 @@ jobs:
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: npm install --silent -g yarn npx "pnpm@$PNPM_VERSION" --force
|
||||
# web is excluded from the generated-code artifact (see generate-code) to
|
||||
# avoid OOM on upload, so its node_modules — which provides the
|
||||
# license-checker-rseidelsohn binary — must be reinstalled here.
|
||||
- run: cd web && pnpm install
|
||||
- run: make ci-node-check-licenses && make ci-node-save-licenses
|
||||
- run: make ci-go-check-licenses && make ci-go-save-licenses
|
||||
- run: tar -czf third-party-licenses.tar.gz -C third-party-licenses .
|
||||
@@ -347,7 +355,7 @@ jobs:
|
||||
|
||||
create-github-release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [determine-release-type, build-binaries, license-check, generate-changelog, security-scan-trivy, docker-readme]
|
||||
needs: [determine-release-type, build-binaries, license-check, generate-changelog, security-scan-trivy]
|
||||
steps:
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
@@ -378,10 +386,6 @@ jobs:
|
||||
needs:
|
||||
- determine-release-type
|
||||
- generate-code
|
||||
- docker-build
|
||||
- docker-scan
|
||||
- docker-manifest
|
||||
- docker-readme
|
||||
- build-binaries
|
||||
- security-scan-trivy
|
||||
- license-check
|
||||
@@ -405,7 +409,7 @@ jobs:
|
||||
python3 scripts/audit-release.py \
|
||||
--version "${{ needs.determine-release-type.outputs.version }}" \
|
||||
--dir release-assets/ \
|
||||
--github-release --docker
|
||||
--github-release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Bugfix: Apply the role allowlist on permission updates
|
||||
|
||||
The `PATCH` permission and space-root permission handlers now consult the
|
||||
administrator role allowlist when validating a request, consistent with the
|
||||
invite handler.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12540
|
||||
@@ -0,0 +1,15 @@
|
||||
Bugfix: Restore hover feedback in high-contrast and dark themes
|
||||
|
||||
The Light and Dark High-Contrast themes set the background-highlight color
|
||||
token equal to the default page background, making hover backgrounds
|
||||
indistinguishable from the resting background wherever background-highlight
|
||||
was used for interactive feedback, such as the global search results
|
||||
dropdown. The non-high-contrast Dark theme had the same collision.
|
||||
|
||||
background-highlight now matches background-hover in the affected theme
|
||||
definitions, and the search results dropdown and create-shortcut context
|
||||
menu now use the background-hover color directly for their hover and active
|
||||
states, since background-highlight is otherwise used for static surfaces
|
||||
like cards, modals and form fields rather than interaction feedback.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12613
|
||||
@@ -1,11 +0,0 @@
|
||||
Bugfix: Keep the web session on transient network errors during context init
|
||||
|
||||
We've fixed a bug in the web frontend where a temporary connectivity failure (e.g. a
|
||||
fast page reload cancelling in-flight requests, or a short offline period) while
|
||||
re-establishing the authenticated context on page load was treated like an expired or
|
||||
invalid token. This forced a full logout and redirected the user to the "trouble
|
||||
connecting to the login service" page. Network/connectivity errors now preserve the
|
||||
existing session, while genuine authentication rejections (e.g. a 401) still trigger
|
||||
the regular logout flow as before.
|
||||
|
||||
https://github.com/owncloud/web/issues/12980
|
||||
@@ -0,0 +1,11 @@
|
||||
Bugfix: Fix missing labels and low-contrast elements across the web UI
|
||||
|
||||
Several icon-only buttons (search, hide-share, create-user, gallery
|
||||
navigation) were missing labels, and loading spinners and progress bars did
|
||||
not expose a name describing what they represent. The global search and
|
||||
create shortcut dropdowns now use correct roles and states. Tooltips no longer
|
||||
get caught mid-fade with a low-contrast color when the reduced-motion system
|
||||
setting is enabled, and low-contrast colors were fixed in the select combobox
|
||||
search input and in markdown editor links and inline code.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12526
|
||||
@@ -0,0 +1,7 @@
|
||||
Enhancement: Clean up the deployment examples
|
||||
|
||||
Removed the legacy deployment example oc10_ocis_parallel and its
|
||||
documentation references.
|
||||
Removed coverage.out
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12521
|
||||
@@ -0,0 +1,7 @@
|
||||
Enhancement: Add configurable software license and help page links
|
||||
|
||||
Themes can now set `common.urls.softwareLicense` and `common.urls.helpPage` to
|
||||
surface deployment-specific legal/help links in the web UI. When set, links
|
||||
appear in a new "Help" menu in the topbar and on the account page.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12528
|
||||
@@ -0,0 +1,10 @@
|
||||
Enhancement: Add option to disable public link sharing
|
||||
|
||||
Added an `OCIS_ENABLE_PUBLIC_SHARING` config option, read by the frontend
|
||||
and sharing services. It defaults to `true`. When set to `false`,
|
||||
creating new public links is rejected and the
|
||||
`files_sharing.public.enabled` capability reports `false` so clients
|
||||
hide the corresponding UI. Direct sharing with users and groups is not
|
||||
affected.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12542
|
||||
@@ -0,0 +1,11 @@
|
||||
Enhancement: Add option to disable direct (user/group) sharing
|
||||
|
||||
Added an `OCIS_ENABLE_USER_SHARING` config option, read by the frontend,
|
||||
graph, sharing and ocm services. It defaults to `true`. When set to
|
||||
`false`, creating new user, group or federated shares is rejected, the
|
||||
legacy `sharees` search endpoint returns no results, and the
|
||||
`files_sharing.user.enabled` and `files_sharing.user_enumeration.enabled`
|
||||
capabilities report `false` so clients hide the corresponding UI. Public
|
||||
link sharing and space membership are not affected.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12542
|
||||
@@ -0,0 +1,5 @@
|
||||
Security: Restrict group member data to authorized users
|
||||
|
||||
The groups API could return group membership details to callers who should not have had access to it. Access to group member data is now properly restricted based on the caller's permissions.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12573
|
||||
@@ -0,0 +1,8 @@
|
||||
Security: Harden origin validation for embed mode delegated authentication
|
||||
|
||||
Hardened origin validation for the delegated authentication feature in Web's
|
||||
embed mode. Deployments using `WEB_OPTION_EMBED_DELEGATE_AUTHENTICATION` should
|
||||
ensure `WEB_OPTION_EMBED_DELEGATE_AUTHENTICATION_ORIGIN` is explicitly
|
||||
configured.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12572
|
||||
+7
-2
@@ -11,11 +11,16 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-simplexml": "*",
|
||||
"bamarni/composer-bin-plugin": "^1.8"
|
||||
"bamarni/composer-bin-plugin": "^1.8",
|
||||
"playwright-php/playwright": "^1.2"
|
||||
},
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": false
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"khanamiryan/qrcode-detector-decoder": "^2.0",
|
||||
"spomky-labs/otphp": "^11.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
-26734
File diff suppressed because it is too large.
Load diff
@@ -1,69 +0,0 @@
|
||||
# If you're on a internet facing server please comment out following line.
|
||||
# It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates.
|
||||
INSECURE=true
|
||||
|
||||
# The demo users should not be created on a production instance
|
||||
# because their passwords are public
|
||||
DEMO_USERS=false
|
||||
|
||||
### Traefik settings ###
|
||||
TRAEFIK_LOG_LEVEL=
|
||||
# Serve Traefik dashboard. Defaults to "false".
|
||||
TRAEFIK_DASHBOARD=
|
||||
# Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test"
|
||||
TRAEFIK_DOMAIN=
|
||||
# Basic authentication for the dashboard. Defaults to user "admin" and password "admin"
|
||||
TRAEFIK_BASIC_AUTH_USERS=
|
||||
# Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server
|
||||
TRAEFIK_ACME_MAIL=
|
||||
|
||||
### shared oCIS / oC10 settings ###
|
||||
# Domain of oCIS / oC10, where you can find the frontend. Defaults to "cloud.owncloud.test"
|
||||
CLOUD_DOMAIN=
|
||||
|
||||
### oCIS settings ###
|
||||
# oCIS version. Defaults to "latest"
|
||||
OCIS_DOCKER_TAG=
|
||||
# JWT secret which is used for the storage provider. Must be changed in order to have a secure oCIS. Defaults to "Pive-Fumkiu4"
|
||||
OCIS_JWT_SECRET=
|
||||
# JWT secret which is used for uploads to create transfer tokens. Must be changed in order to have a secure oCIS. Defaults to "replace-me-with-a-transfer-secret"
|
||||
STORAGE_TRANSFER_SECRET=
|
||||
# Machine auth api key secret. Must be changed in order to have a secure oCIS. Defaults to "change-me-please"
|
||||
OCIS_MACHINE_AUTH_API_KEY=
|
||||
|
||||
### oCIS settings ###
|
||||
# oC10 version. Defaults to "latest"
|
||||
OC10_DOCKER_TAG=
|
||||
# client secret which the openidconnect app uses to authenticate to Keycloak. Defaults to "oc10-oidc-secret"
|
||||
OC10_OIDC_CLIENT_SECRET=
|
||||
# app which will be shown when opening the ownCloud 10 UI. Defaults to "files" but also could be set to "web"
|
||||
OWNCLOUD_DEFAULT_APP=
|
||||
# if set to "false" (default) links will be opened in the classic UI, if set to "true" ownCloud Web is used
|
||||
OWNCLOUD_WEB_REWRITE_LINKS=
|
||||
|
||||
### LDAP settings ###
|
||||
# password for the LDAP admin user "cn=admin,dc=owncloud,dc=com", defaults to "admin"
|
||||
LDAP_ADMIN_PASSWORD=
|
||||
# Domain of the LDAP management frontend. Defaults to "ldap.owncloud.test"
|
||||
LDAP_MANAGER_DOMAIN=
|
||||
|
||||
### Keycloak ###
|
||||
# Domain of Keycloak, where you can find the management and authentication frontend. Defaults to "keycloak.owncloud.test"
|
||||
KEYCLOAK_DOMAIN=
|
||||
# Realm which to be used with oCIS. Defaults to "oCIS"
|
||||
KEYCLOAK_REALM=
|
||||
# Admin user login name. Defaults to "admin"
|
||||
KEYCLOAK_ADMIN_USER=
|
||||
# Admin user login password. Defaults to "admin"
|
||||
KEYCLOAK_ADMIN_PASSWORD=
|
||||
|
||||
|
||||
# If you want to use debugging and tracing with this stack,
|
||||
# you need uncomment following line. Please see documentation at
|
||||
# https://owncloud.dev/ocis/deployment/monitoring-tracing/
|
||||
#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||
|
||||
# If you want to use the testsuite with this stack,
|
||||
# you need uncomment following line. Please see documentation at
|
||||
# https://owncloud.dev/ocis/development/testing/
|
||||
#COMPOSE_FILE=docker-compose.yml:testing/docker-compose-additions.yml
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
document this deployment example in docs/ocis/deployment/oc10_ocis_parallel.md
|
||||
---
|
||||
|
||||
Please refer to [our documentation](https://owncloud.dev/ocis/deployment/oc10_ocis_parallel/)
|
||||
for instructions on how to deploy this scenario.
|
||||
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"clientId": "e4rAsNUSIUs0lF4nbv9FmCeUkTlV9GdgTLDH1b5uie7syb90SzEVrbN7HIpmWJeD",
|
||||
"name": "ownCloud Android app",
|
||||
"surrogateAuthRequired": false,
|
||||
"enabled": true,
|
||||
"alwaysDisplayInConsole": false,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"secret" : "dInFYGV33xKzhbRmpqQltYNdfLdJIfJ9L5ISoKhNoT9qZftpdWSP71VrpGR9pmoD",
|
||||
"redirectUris": [
|
||||
"oc://android.owncloud.com"
|
||||
],
|
||||
"webOrigins": [],
|
||||
"notBefore": 0,
|
||||
"bearerOnly": false,
|
||||
"consentRequired": false,
|
||||
"standardFlowEnabled": true,
|
||||
"implicitFlowEnabled": false,
|
||||
"directAccessGrantsEnabled": true,
|
||||
"serviceAccountsEnabled": false,
|
||||
"publicClient": false,
|
||||
"frontchannelLogout": false,
|
||||
"protocol": "openid-connect",
|
||||
"attributes": {
|
||||
"saml.assertion.signature": "false",
|
||||
"saml.force.post.binding": "false",
|
||||
"saml.multivalued.roles": "false",
|
||||
"saml.encrypt": "false",
|
||||
"backchannel.logout.revoke.offline.tokens": "false",
|
||||
"saml.server.signature": "false",
|
||||
"saml.server.signature.keyinfo.ext": "false",
|
||||
"exclude.session.state.from.auth.response": "false",
|
||||
"backchannel.logout.session.required": "true",
|
||||
"client_credentials.use_refresh_token": "false",
|
||||
"saml_force_name_id_format": "false",
|
||||
"saml.client.signature": "false",
|
||||
"tls.client.certificate.bound.access.tokens": "false",
|
||||
"saml.authnstatement": "false",
|
||||
"display.on.consent.screen": "false",
|
||||
"saml.onetimeuse.condition": "false"
|
||||
},
|
||||
"authenticationFlowBindingOverrides": {},
|
||||
"fullScopeAllowed": true,
|
||||
"nodeReRegistrationTimeout": -1,
|
||||
"defaultClientScopes": [
|
||||
"web-origins",
|
||||
"role_list",
|
||||
"profile",
|
||||
"roles",
|
||||
"owncloud",
|
||||
"email"
|
||||
],
|
||||
"optionalClientScopes": [
|
||||
"address",
|
||||
"phone",
|
||||
"offline_access",
|
||||
"microprofile-jwt"
|
||||
],
|
||||
"access": {
|
||||
"view": true,
|
||||
"configure": true,
|
||||
"manage": true
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
"clientId": "xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69",
|
||||
"name": "ownCloud desktop client",
|
||||
"surrogateAuthRequired": false,
|
||||
"enabled": true,
|
||||
"alwaysDisplayInConsole": false,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"secret" : "UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh",
|
||||
"redirectUris": [
|
||||
"http://127.0.0.1:*",
|
||||
"http://localhost:*"
|
||||
],
|
||||
"webOrigins": [],
|
||||
"notBefore": 0,
|
||||
"bearerOnly": false,
|
||||
"consentRequired": false,
|
||||
"standardFlowEnabled": true,
|
||||
"implicitFlowEnabled": false,
|
||||
"directAccessGrantsEnabled": true,
|
||||
"serviceAccountsEnabled": false,
|
||||
"publicClient": false,
|
||||
"frontchannelLogout": false,
|
||||
"protocol": "openid-connect",
|
||||
"attributes": {
|
||||
"saml.assertion.signature": "false",
|
||||
"saml.force.post.binding": "false",
|
||||
"saml.multivalued.roles": "false",
|
||||
"saml.encrypt": "false",
|
||||
"backchannel.logout.revoke.offline.tokens": "false",
|
||||
"saml.server.signature": "false",
|
||||
"saml.server.signature.keyinfo.ext": "false",
|
||||
"exclude.session.state.from.auth.response": "false",
|
||||
"backchannel.logout.session.required": "true",
|
||||
"client_credentials.use_refresh_token": "false",
|
||||
"saml_force_name_id_format": "false",
|
||||
"saml.client.signature": "false",
|
||||
"tls.client.certificate.bound.access.tokens": "false",
|
||||
"saml.authnstatement": "false",
|
||||
"display.on.consent.screen": "false",
|
||||
"saml.onetimeuse.condition": "false"
|
||||
},
|
||||
"authenticationFlowBindingOverrides": {},
|
||||
"fullScopeAllowed": true,
|
||||
"nodeReRegistrationTimeout": -1,
|
||||
"defaultClientScopes": [
|
||||
"web-origins",
|
||||
"role_list",
|
||||
"profile",
|
||||
"roles",
|
||||
"owncloud",
|
||||
"email"
|
||||
],
|
||||
"optionalClientScopes": [
|
||||
"address",
|
||||
"phone",
|
||||
"offline_access",
|
||||
"microprofile-jwt"
|
||||
],
|
||||
"access": {
|
||||
"view": true,
|
||||
"configure": true,
|
||||
"manage": true
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"clientId": "mxd5OQDk6es5LzOzRvidJNfXLUZS2oN3oUFeXPP8LpPrhx3UroJFduGEYIBOxkY1",
|
||||
"name": "ownCloud iOS app",
|
||||
"surrogateAuthRequired": false,
|
||||
"enabled": true,
|
||||
"alwaysDisplayInConsole": false,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"secret" : "KFeFWWEZO9TkisIQzR3fo7hfiMXlOpaqP8CFuTbSHzV1TUuGECglPxpiVKJfOXIx",
|
||||
"redirectUris": [
|
||||
"oc://ios.owncloud.com"
|
||||
],
|
||||
"webOrigins": [],
|
||||
"notBefore": 0,
|
||||
"bearerOnly": false,
|
||||
"consentRequired": false,
|
||||
"standardFlowEnabled": true,
|
||||
"implicitFlowEnabled": false,
|
||||
"directAccessGrantsEnabled": true,
|
||||
"serviceAccountsEnabled": false,
|
||||
"publicClient": false,
|
||||
"frontchannelLogout": false,
|
||||
"protocol": "openid-connect",
|
||||
"attributes": {
|
||||
"saml.assertion.signature": "false",
|
||||
"saml.force.post.binding": "false",
|
||||
"saml.multivalued.roles": "false",
|
||||
"saml.encrypt": "false",
|
||||
"backchannel.logout.revoke.offline.tokens": "false",
|
||||
"saml.server.signature": "false",
|
||||
"saml.server.signature.keyinfo.ext": "false",
|
||||
"exclude.session.state.from.auth.response": "false",
|
||||
"backchannel.logout.session.required": "true",
|
||||
"client_credentials.use_refresh_token": "false",
|
||||
"saml_force_name_id_format": "false",
|
||||
"saml.client.signature": "false",
|
||||
"tls.client.certificate.bound.access.tokens": "false",
|
||||
"saml.authnstatement": "false",
|
||||
"display.on.consent.screen": "false",
|
||||
"saml.onetimeuse.condition": "false"
|
||||
},
|
||||
"authenticationFlowBindingOverrides": {},
|
||||
"fullScopeAllowed": true,
|
||||
"nodeReRegistrationTimeout": -1,
|
||||
"defaultClientScopes": [
|
||||
"web-origins",
|
||||
"role_list",
|
||||
"profile",
|
||||
"roles",
|
||||
"owncloud",
|
||||
"email"
|
||||
],
|
||||
"optionalClientScopes": [
|
||||
"address",
|
||||
"phone",
|
||||
"offline_access",
|
||||
"microprofile-jwt"
|
||||
],
|
||||
"access": {
|
||||
"view": true,
|
||||
"configure": true,
|
||||
"manage": true
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"clientId": "oc10-web",
|
||||
"rootUrl": "https://cloud.owncloud.test",
|
||||
"adminUrl": "https://cloud.owncloud.test",
|
||||
"surrogateAuthRequired": false,
|
||||
"enabled": true,
|
||||
"alwaysDisplayInConsole": false,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"redirectUris": [
|
||||
"https://cloud.owncloud.test/*"
|
||||
],
|
||||
"webOrigins": [
|
||||
"https://cloud.owncloud.test"
|
||||
],
|
||||
"notBefore": 0,
|
||||
"bearerOnly": false,
|
||||
"consentRequired": false,
|
||||
"standardFlowEnabled": true,
|
||||
"implicitFlowEnabled": false,
|
||||
"directAccessGrantsEnabled": true,
|
||||
"serviceAccountsEnabled": false,
|
||||
"publicClient": true,
|
||||
"frontchannelLogout": false,
|
||||
"protocol": "openid-connect",
|
||||
"attributes": {
|
||||
"saml.assertion.signature": "false",
|
||||
"id.token.as.detached.signature": "false",
|
||||
"saml.force.post.binding": "false",
|
||||
"saml.multivalued.roles": "false",
|
||||
"saml.encrypt": "false",
|
||||
"oauth2.device.authorization.grant.enabled": "false",
|
||||
"backchannel.logout.revoke.offline.tokens": "false",
|
||||
"saml.server.signature": "false",
|
||||
"saml.server.signature.keyinfo.ext": "false",
|
||||
"use.refresh.tokens": "true",
|
||||
"exclude.session.state.from.auth.response": "false",
|
||||
"oidc.ciba.grant.enabled": "false",
|
||||
"saml.artifact.binding": "false",
|
||||
"backchannel.logout.session.required": "true",
|
||||
"client_credentials.use_refresh_token": "false",
|
||||
"saml_force_name_id_format": "false",
|
||||
"saml.client.signature": "false",
|
||||
"tls.client.certificate.bound.access.tokens": "false",
|
||||
"saml.authnstatement": "false",
|
||||
"display.on.consent.screen": "false",
|
||||
"saml.onetimeuse.condition": "false"
|
||||
},
|
||||
"authenticationFlowBindingOverrides": {},
|
||||
"fullScopeAllowed": true,
|
||||
"nodeReRegistrationTimeout": -1,
|
||||
"defaultClientScopes": [
|
||||
"web-origins",
|
||||
"profile",
|
||||
"roles",
|
||||
"owncloud",
|
||||
"email"
|
||||
],
|
||||
"optionalClientScopes": [
|
||||
"address",
|
||||
"phone",
|
||||
"offline_access",
|
||||
"microprofile-jwt"
|
||||
],
|
||||
"access": {
|
||||
"view": true,
|
||||
"configure": true,
|
||||
"manage": true
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"clientId": "oc10",
|
||||
"rootUrl": "https://cloud.owncloud.test",
|
||||
"adminUrl": "https://cloud.owncloud.test",
|
||||
"surrogateAuthRequired": false,
|
||||
"enabled": true,
|
||||
"alwaysDisplayInConsole": false,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"redirectUris": [
|
||||
"https://cloud.owncloud.test/*"
|
||||
],
|
||||
"webOrigins": [
|
||||
"https://cloud.owncloud.test"
|
||||
],
|
||||
"notBefore": 0,
|
||||
"bearerOnly": false,
|
||||
"consentRequired": false,
|
||||
"standardFlowEnabled": true,
|
||||
"implicitFlowEnabled": false,
|
||||
"directAccessGrantsEnabled": true,
|
||||
"serviceAccountsEnabled": false,
|
||||
"publicClient": false,
|
||||
"frontchannelLogout": false,
|
||||
"protocol": "openid-connect",
|
||||
"attributes": {
|
||||
"id.token.as.detached.signature": "false",
|
||||
"saml.assertion.signature": "false",
|
||||
"saml.force.post.binding": "false",
|
||||
"saml.multivalued.roles": "false",
|
||||
"saml.encrypt": "false",
|
||||
"oauth2.device.authorization.grant.enabled": "false",
|
||||
"backchannel.logout.revoke.offline.tokens": "false",
|
||||
"saml.server.signature": "false",
|
||||
"saml.server.signature.keyinfo.ext": "false",
|
||||
"use.refresh.tokens": "true",
|
||||
"exclude.session.state.from.auth.response": "false",
|
||||
"oidc.ciba.grant.enabled": "false",
|
||||
"saml.artifact.binding": "false",
|
||||
"backchannel.logout.session.required": "true",
|
||||
"client_credentials.use_refresh_token": "false",
|
||||
"saml_force_name_id_format": "false",
|
||||
"saml.client.signature": "false",
|
||||
"tls.client.certificate.bound.access.tokens": "false",
|
||||
"saml.authnstatement": "false",
|
||||
"display.on.consent.screen": "false",
|
||||
"saml.onetimeuse.condition": "false"
|
||||
},
|
||||
"authenticationFlowBindingOverrides": {},
|
||||
"fullScopeAllowed": true,
|
||||
"nodeReRegistrationTimeout": -1,
|
||||
"defaultClientScopes": [
|
||||
"web-origins",
|
||||
"profile",
|
||||
"roles",
|
||||
"owncloud",
|
||||
"email"
|
||||
],
|
||||
"optionalClientScopes": [
|
||||
"address",
|
||||
"phone",
|
||||
"offline_access",
|
||||
"microprofile-jwt"
|
||||
],
|
||||
"access": {
|
||||
"view": true,
|
||||
"configure": true,
|
||||
"manage": true
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
{
|
||||
"clientId": "ocis-web",
|
||||
"rootUrl": "https://cloud.owncloud.test",
|
||||
"adminUrl": "https://cloud.owncloud.test",
|
||||
"baseUrl": "",
|
||||
"surrogateAuthRequired": false,
|
||||
"enabled": true,
|
||||
"alwaysDisplayInConsole": false,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"redirectUris": [
|
||||
"https://cloud.owncloud.test/*"
|
||||
],
|
||||
"webOrigins": [
|
||||
"https://cloud.owncloud.test"
|
||||
],
|
||||
"notBefore": 0,
|
||||
"bearerOnly": false,
|
||||
"consentRequired": false,
|
||||
"standardFlowEnabled": true,
|
||||
"implicitFlowEnabled": false,
|
||||
"directAccessGrantsEnabled": true,
|
||||
"serviceAccountsEnabled": false,
|
||||
"publicClient": true,
|
||||
"frontchannelLogout": false,
|
||||
"protocol": "openid-connect",
|
||||
"attributes": {
|
||||
"saml.assertion.signature": "false",
|
||||
"saml.force.post.binding": "false",
|
||||
"saml.multivalued.roles": "false",
|
||||
"saml.encrypt": "false",
|
||||
"backchannel.logout.revoke.offline.tokens": "false",
|
||||
"saml.server.signature": "false",
|
||||
"saml.server.signature.keyinfo.ext": "false",
|
||||
"exclude.session.state.from.auth.response": "false",
|
||||
"backchannel.logout.session.required": "true",
|
||||
"client_credentials.use_refresh_token": "false",
|
||||
"saml_force_name_id_format": "false",
|
||||
"saml.client.signature": "false",
|
||||
"tls.client.certificate.bound.access.tokens": "false",
|
||||
"saml.authnstatement": "false",
|
||||
"display.on.consent.screen": "false",
|
||||
"saml.onetimeuse.condition": "false"
|
||||
},
|
||||
"authenticationFlowBindingOverrides": {},
|
||||
"fullScopeAllowed": true,
|
||||
"nodeReRegistrationTimeout": -1,
|
||||
"defaultClientScopes": [
|
||||
"web-origins",
|
||||
"profile",
|
||||
"roles",
|
||||
"owncloud",
|
||||
"email"
|
||||
],
|
||||
"optionalClientScopes": [
|
||||
"address",
|
||||
"phone",
|
||||
"offline_access",
|
||||
"microprofile-jwt"
|
||||
],
|
||||
"access": {
|
||||
"view": true,
|
||||
"configure": true,
|
||||
"manage": true
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
printenv
|
||||
# replace owncloud domain in keycloak realm import
|
||||
cp /opt/jboss/keycloak/owncloud-realm.dist.json /opt/jboss/keycloak/owncloud-realm.json
|
||||
sed -i "s/cloud.owncloud.test/${CLOUD_DOMAIN}/g" /opt/jboss/keycloak/owncloud-realm.json
|
||||
sed -i "s/oc10-oidc-secret/${OC10_OIDC_CLIENT_SECRET}/g" /opt/jboss/keycloak/owncloud-realm.json
|
||||
sed -i "s/ldap-bind-credential/${LDAP_ADMIN_PASSWORD}/g" /opt/jboss/keycloak/owncloud-realm.json
|
||||
|
||||
|
||||
|
||||
# run original docker-entrypoint
|
||||
/opt/jboss/tools/docker-entrypoint.sh
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,32 +0,0 @@
|
||||
# This LDIF files describes the ownCloud schema
|
||||
dn: cn=owncloud,cn=schema,cn=config
|
||||
objectClass: olcSchemaConfig
|
||||
cn: owncloud
|
||||
olcObjectIdentifier: ownCloudOid 1.3.6.1.4.1.39430
|
||||
olcAttributeTypes: ( ownCloudOid:1.1.2 NAME 'ownCloudUUID'
|
||||
DESC 'A non-reassignable and persistent account ID)'
|
||||
EQUALITY uuidMatch
|
||||
SUBSTR caseIgnoreSubstringsMatch
|
||||
SYNTAX 1.3.6.1.1.16.1 SINGLE-VALUE )
|
||||
olcAttributeTypes: ( ownCloudOid:1.1.3 NAME 'oCExternalIdentity'
|
||||
DESC 'A triple separated by "$" representing the objectIdentity resource type of the Graph API ( signInType $ issuer $ issuerAssignedId )'
|
||||
EQUALITY caseIgnoreMatch
|
||||
SUBSTR caseIgnoreSubstringsMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
|
||||
olcAttributeTypes: ( ownCloudOid:1.1.4 NAME 'ownCloudUserEnabled'
|
||||
DESC 'A boolean value indicating if ownCloudUser is enabled'
|
||||
EQUALITY booleanMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE)
|
||||
olcAttributeTypes: ( ownCloudOid:1.1.5 NAME 'ownCloudUserType'
|
||||
DESC 'User type (e.g. Member or Guest)'
|
||||
EQUALITY caseIgnoreMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
|
||||
olcObjectClasses: ( ownCloudOid:1.2.1 NAME 'ownCloud'
|
||||
DESC 'ownCloud LDAP Schema'
|
||||
AUXILIARY
|
||||
MAY ( ownCloudUUID ) )
|
||||
olcObjectClasses: ( ownCloudOid:1.2.2 NAME 'ownCloudUser'
|
||||
DESC 'ownCloud User LDAP Schema'
|
||||
SUP ownCloud
|
||||
AUXILIARY
|
||||
MAY ( ocExternalIdentity $ ownCloudUserEnabled $ ownCloudUserType ) )
|
||||
@@ -1,109 +0,0 @@
|
||||
dn: ou=users,dc=owncloud,dc=com
|
||||
objectClass: organizationalUnit
|
||||
ou: users
|
||||
|
||||
# Start dn with uid (user identifier / login), not cn (Firstname + Surname)
|
||||
dn: uid=einstein,ou=users,dc=owncloud,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
objectClass: ownCloud
|
||||
objectClass: person
|
||||
objectClass: posixAccount
|
||||
objectClass: top
|
||||
uid: einstein
|
||||
givenName: Albert
|
||||
sn: Einstein
|
||||
cn: einstein
|
||||
displayName: Albert Einstein
|
||||
description: A German-born theoretical physicist who developed the theory of relativity, one of the two pillars of modern physics (alongside quantum mechanics).
|
||||
mail: einstein@example.org
|
||||
uidNumber: 20000
|
||||
gidNumber: 30000
|
||||
homeDirectory: /home/einstein
|
||||
ownCloudUUID:: NGM1MTBhZGEtYzg2Yi00ODE1LTg4MjAtNDJjZGY4MmMzZDUx
|
||||
userPassword:: e1NTSEF9TXJEcXpFNGdKbXZxbVRVTGhvWEZ1VzJBbkV3NWFLK3J3WTIvbHc9PQ==
|
||||
ownCloudSelector: ocis
|
||||
|
||||
dn: uid=marie,ou=users,dc=owncloud,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
objectClass: ownCloud
|
||||
objectClass: person
|
||||
objectClass: posixAccount
|
||||
objectClass: top
|
||||
uid: marie
|
||||
givenName: Marie
|
||||
sn: Curie
|
||||
cn: marie
|
||||
displayName: Marie Skłodowska Curie
|
||||
description: A Polish and naturalized-French physicist and chemist who conducted pioneering research on radioactivity.
|
||||
mail: marie@example.org
|
||||
uidNumber: 20001
|
||||
gidNumber: 30000
|
||||
homeDirectory: /home/marie
|
||||
ownCloudUUID:: ZjdmYmY4YzgtMTM5Yi00Mzc2LWIzMDctY2YwYThjMmQwZDlj
|
||||
userPassword:: e1NTSEF9UmFvQWs3TU9jRHBIUWY3bXN3MGhHNnVraFZQWnRIRlhOSUNNZEE9PQ==
|
||||
ownCloudSelector: oc10
|
||||
|
||||
dn: uid=richard,ou=users,dc=owncloud,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
objectClass: ownCloud
|
||||
objectClass: person
|
||||
objectClass: posixAccount
|
||||
objectClass: top
|
||||
uid: richard
|
||||
givenName: Richard
|
||||
sn: Feynman
|
||||
cn: richard
|
||||
displayName: Richard Phillips Feynman
|
||||
description: An American theoretical physicist, known for his work in the path integral formulation of quantum mechanics, the theory of quantum electrodynamics, the physics of the superfluidity of supercooled liquid helium, as well as his work in particle physics for which he proposed the parton model.
|
||||
mail: richard@example.org
|
||||
uidNumber: 20002
|
||||
gidNumber: 30000
|
||||
homeDirectory: /home/richard
|
||||
ownCloudUUID:: OTMyYjQ1NDAtOGQxNi00ODFlLThlZjQtNTg4ZTRiNmIxNTFj
|
||||
userPassword:: e1NTSEF9Z05LZTRreHdmOGRUREY5eHlhSmpySTZ3MGxSVUM1d1RGcWROTVE9PQ==
|
||||
ownCloudSelector: ocis
|
||||
|
||||
dn: uid=moss,ou=users,dc=owncloud,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
objectClass: ownCloud
|
||||
objectClass: person
|
||||
objectClass: posixAccount
|
||||
objectClass: top
|
||||
uid: moss
|
||||
givenName: Maurice
|
||||
sn: Moss
|
||||
cn: moss
|
||||
displayName: Maurice Moss
|
||||
description: A worker in the IT Department of Reynholm Industries. Of all the working staff in the IT Department, he is the most hard-working, the most experienced, and the most capable of doing his job well. He puts a lot of effort into his work, however he does not get the credit he deserves.
|
||||
mail: moss@example.org
|
||||
uidNumber: 20003
|
||||
gidNumber: 30000
|
||||
homeDirectory: /home/moss
|
||||
ownCloudUUID:: MDU4YmZmOTUtNjcwOC00ZmU1LTkxZTQtOWVhM2QzNzc1ODhi
|
||||
userPassword:: e1NTSEF9N0hEdTRoMkFDVExFWWt4U0RtSDZVQjhmUlpKRExDZDc=
|
||||
ownCloudSelector: ocis
|
||||
|
||||
dn: uid=admin,ou=users,dc=owncloud,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
objectClass: ownCloud
|
||||
objectClass: person
|
||||
objectClass: posixAccount
|
||||
objectClass: top
|
||||
uid: admin
|
||||
givenName: Admin
|
||||
sn: Admin
|
||||
cn: admin
|
||||
displayName: Admin
|
||||
description: An admin for this oCIS instance.
|
||||
mail: admin@example.org
|
||||
uidNumber: 20004
|
||||
gidNumber: 30000
|
||||
homeDirectory: /home/admin
|
||||
ownCloudUUID:: ZGRjMjAwNGMtMDk3Ny0xMWViLTlkM2YtYTc5Mzg4OGNkMGY4
|
||||
userPassword:: e1NTSEF9UWhmaFB3dERydTUydURoWFFObDRMbzVIckI3TkI5Nmo=
|
||||
ownCloudSelector: oc10
|
||||
@@ -1,81 +0,0 @@
|
||||
dn: ou=groups,dc=owncloud,dc=com
|
||||
objectClass: organizationalUnit
|
||||
ou: groups
|
||||
|
||||
dn: cn=users,ou=groups,dc=owncloud,dc=com
|
||||
objectClass: groupOfNames
|
||||
objectClass: ownCloud
|
||||
objectClass: top
|
||||
cn: users
|
||||
description: Users
|
||||
ownCloudUUID:: NTA5YTlkY2QtYmIzNy00ZjRmLWEwMWEtMTlkY2EyN2Q5Y2Zh
|
||||
member: uid=einstein,ou=users,dc=owncloud,dc=com
|
||||
member: uid=marie,ou=users,dc=owncloud,dc=com
|
||||
member: uid=richard,ou=users,dc=owncloud,dc=com
|
||||
member: uid=moss,ou=users,dc=owncloud,dc=com
|
||||
member: uid=admin,ou=users,dc=owncloud,dc=com
|
||||
|
||||
dn: cn=sailing-lovers,ou=groups,dc=owncloud,dc=com
|
||||
objectClass: groupOfNames
|
||||
objectClass: ownCloud
|
||||
objectClass: top
|
||||
cn: sailing-lovers
|
||||
description: Sailing lovers
|
||||
ownCloudUUID:: NjA0MGFhMTctOWM2NC00ZmVmLTliZDAtNzcyMzRkNzFiYWQw
|
||||
member: uid=einstein,ou=users,dc=owncloud,dc=com
|
||||
|
||||
dn: cn=violin-haters,ou=groups,dc=owncloud,dc=com
|
||||
objectClass: groupOfNames
|
||||
objectClass: ownCloud
|
||||
objectClass: top
|
||||
cn: violin-haters
|
||||
description: Violin haters
|
||||
ownCloudUUID:: ZGQ1OGU1ZWMtODQyZS00OThiLTg4MDAtNjFmMmVjNmY5MTFm
|
||||
member: uid=einstein,ou=users,dc=owncloud,dc=com
|
||||
|
||||
dn: cn=radium-lovers,ou=groups,dc=owncloud,dc=com
|
||||
objectClass: groupOfNames
|
||||
objectClass: ownCloud
|
||||
objectClass: top
|
||||
cn: radium-lovers
|
||||
description: Radium lovers
|
||||
ownCloudUUID:: N2I4N2ZkNDktMjg2ZS00YTVmLWJhZmQtYzUzNWQ1ZGQ5OTdh
|
||||
member: uid=marie,ou=users,dc=owncloud,dc=com
|
||||
|
||||
dn: cn=polonium-lovers,ou=groups,dc=owncloud,dc=com
|
||||
objectClass: groupOfNames
|
||||
objectClass: ownCloud
|
||||
objectClass: top
|
||||
cn: polonium-lovers
|
||||
description: Polonium lovers
|
||||
ownCloudUUID:: Y2VkYzIxYWEtNDA3Mi00NjE0LTg2NzYtZmE5MTY1ZjU5OGZm
|
||||
member: uid=marie,ou=users,dc=owncloud,dc=com
|
||||
|
||||
dn: cn=quantum-lovers,ou=groups,dc=owncloud,dc=com
|
||||
objectClass: groupOfNames
|
||||
objectClass: ownCloud
|
||||
objectClass: top
|
||||
cn: quantum-lovers
|
||||
description: Quantum lovers
|
||||
ownCloudUUID:: YTE3MjYxMDgtMDFmOC00YzMwLTg4ZGYtMmIxYTlkMWNiYTFh
|
||||
member: uid=richard,ou=users,dc=owncloud,dc=com
|
||||
|
||||
dn: cn=philosophy-haters,ou=groups,dc=owncloud,dc=com
|
||||
objectClass: groupOfNames
|
||||
objectClass: ownCloud
|
||||
objectClass: top
|
||||
cn: philosophy-haters
|
||||
description: Philosophy haters
|
||||
ownCloudUUID:: MTY3Y2JlZTItMDUxOC00NTVhLWJmYjItMDMxZmUwNjIxZTVk
|
||||
member: uid=richard,ou=users,dc=owncloud,dc=com
|
||||
|
||||
dn: cn=physics-lovers,ou=groups,dc=owncloud,dc=com
|
||||
objectClass: groupOfNames
|
||||
objectClass: ownCloud
|
||||
objectClass: top
|
||||
cn: physics-lovers
|
||||
description: Physics lovers
|
||||
ownCloudUUID:: MjYyOTgyYzEtMjM2Mi00YWZhLWJmZGYtOGNiZmVmNjRhMDZl
|
||||
member: uid=einstein,ou=users,dc=owncloud,dc=com
|
||||
member: uid=marie,ou=users,dc=owncloud,dc=com
|
||||
member: uid=richard,ou=users,dc=owncloud,dc=com
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "Writing custom config files..."
|
||||
|
||||
# openidconnect
|
||||
gomplate \
|
||||
-f /etc/templates/oidc.config.php \
|
||||
-o ${OWNCLOUD_VOLUME_CONFIG}/oidc.config.php
|
||||
|
||||
# we need at least version 2.1.0 of the openidconnect app
|
||||
occ market:upgrade --major openidconnect
|
||||
occ app:enable openidconnect
|
||||
|
||||
# user LDAP
|
||||
gomplate \
|
||||
-f /etc/templates/ldap-config.tmpl.json \
|
||||
-o ${OWNCLOUD_VOLUME_CONFIG}/ldap-config.json
|
||||
|
||||
CONFIG=$(cat ${OWNCLOUD_VOLUME_CONFIG}/ldap-config.json)
|
||||
occ config:import <<< $CONFIG
|
||||
|
||||
occ ldap:test-config "s01"
|
||||
occ app:enable user_ldap
|
||||
/bin/bash -c 'occ user:sync "OCA\User_LDAP\User_Proxy" -r -m remove'
|
||||
|
||||
cp /tmp/ldap-sync-cron /etc/cron.d
|
||||
chown root:root /etc/cron.d/ldap-sync-cron
|
||||
|
||||
# ownCloud Web
|
||||
gomplate \
|
||||
-f /etc/templates/web.config.php \
|
||||
-o ${OWNCLOUD_VOLUME_CONFIG}/web.config.php
|
||||
|
||||
gomplate \
|
||||
-f /etc/templates/web-config.tmpl.json \
|
||||
-o ${OWNCLOUD_VOLUME_CONFIG}/config.json
|
||||
|
||||
occ market:upgrade --major web
|
||||
occ app:enable web
|
||||
|
||||
true
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# enable testing app
|
||||
echo "Cloning and enabling testing app..."
|
||||
git clone --depth 1 https://github.com/owncloud/testing.git /var/www/owncloud/apps/testing
|
||||
occ app:enable testing
|
||||
|
||||
true
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"apps": {
|
||||
"user_ldap": {
|
||||
"s01has_memberof_filter_support": "0",
|
||||
"s01home_folder_naming_rule": "",
|
||||
"s01last_jpegPhoto_lookup": "0",
|
||||
"s01ldap_agent_password": "{{ .Env.STORAGE_LDAP_BIND_PASSWORD | base64.Encode }}",
|
||||
"s01ldap_attributes_for_group_search": "",
|
||||
"s01ldap_attributes_for_user_search": "{{ .Env.LDAP_USERATTRIBUTEFILTERS }}",
|
||||
"s01ldap_backup_host": "",
|
||||
"s01ldap_backup_port": "",
|
||||
"s01ldap_base_groups": "{{ .Env.LDAP_BASE_DN }}",
|
||||
"s01ldap_base_users": "{{ .Env.LDAP_BASE_DN }}",
|
||||
"s01ldap_base": "{{ .Env.LDAP_BASE_DN }}",
|
||||
"s01ldap_cache_ttl": "60",
|
||||
"s01ldap_configuration_active": "1",
|
||||
"s01ldap_display_name": "{{ .Env.LDAP_USER_SCHEMA_DISPLAYNAME }}",
|
||||
"s01ldap_dn": "{{ .Env.STORAGE_LDAP_BIND_DN }}",
|
||||
"s01ldap_dynamic_group_member_url": "",
|
||||
"s01ldap_email_attr": "{{ .Env.LDAP_USER_SCHEMA_MAIL }}",
|
||||
"s01ldap_experienced_admin": "1",
|
||||
"s01ldap_expert_username_attr": "{{ .Env.LDAP_USER_SCHEMA_NAME_ATTR }}",
|
||||
"s01ldap_expert_uuid_group_attr": "",
|
||||
"s01ldap_expert_uuid_user_attr": "{{ .Env.LDAP_USER_SCHEMA_UID }}",
|
||||
"s01ldap_group_display_name": "{{ .Env.LDAP_GROUP_SCHEMA_DISPLAYNAME }}",
|
||||
"s01ldap_group_filter_mode": "0",
|
||||
"s01ldap_group_filter": "{{ .Env.LDAP_GROUP_FILTER }}",
|
||||
"s01ldap_group_member_assoc_attribute": "{{ .Env.LDAP_GROUP_MEMBER_ASSOC_ATTR }}",
|
||||
"s01ldap_groupfilter_groups": "",
|
||||
"s01ldap_groupfilter_objectclass": "",
|
||||
"s01ldap_host": "{{ .Env.LDAP_HOST }}",
|
||||
"s01ldap_login_filter_mode": "0",
|
||||
"s01ldap_login_filter": "{{ .Env.LDAP_LOGINFILTER }}",
|
||||
"s01ldap_loginfilter_attributes": "",
|
||||
"s01ldap_loginfilter_email": "1",
|
||||
"s01ldap_loginfilter_username": "1",
|
||||
"s01ldap_nested_groups": "0",
|
||||
"s01ldap_override_main_server": "",
|
||||
"s01ldap_paging_size": "100",
|
||||
"s01ldap_port": "{{ .Env.LDAP_PORT }}",
|
||||
"s01ldap_quota_attr": "",
|
||||
"s01ldap_quota_def": "",
|
||||
"s01ldap_tls": "0",
|
||||
"s01ldap_turn_off_cert_check": "0",
|
||||
"s01ldap_user_display_name_2": "",
|
||||
"s01ldap_user_filter_mode": "0",
|
||||
"s01ldap_userfilter_groups": "",
|
||||
"s01ldap_userfilter_objectclass": "",
|
||||
"s01ldap_userlist_filter": "{{ .Env.LDAP_USER_FILTER }}",
|
||||
"s01use_memberof_to_detect_membership": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
*/1 * * * * www-data /bin/bash -c 'occ user:sync "OCA\User_LDAP\User_Proxy" -r -m remove'
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
# reference: https://doc.owncloud.com/server/admin_manual/configuration/user/oidc/
|
||||
|
||||
function getOIDCConfigFromEnv() {
|
||||
$config = [
|
||||
'openid-connect' => [
|
||||
'provider-url' => getenv('IDP_OIDC_ISSUER'),
|
||||
'client-id' => 'oc10',
|
||||
'client-secret' => getenv('IDP_OIDC_CLIENT_SECRET'),
|
||||
'loginButtonName' => 'OpenId Connect',
|
||||
'search-attribute' => 'preferred_username',
|
||||
'mode' => 'userid',
|
||||
'autoRedirectOnLoginPage' => true,
|
||||
'insecure' => true,
|
||||
'post_logout_redirect_uri' => 'https://' . getenv('CLOUD_DOMAIN'),
|
||||
],
|
||||
];
|
||||
return $config;
|
||||
}
|
||||
|
||||
$CONFIG = getOIDCConfigFromEnv();
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"server": "https://{{ .Env.CLOUD_DOMAIN }}",
|
||||
"theme": "owncloud",
|
||||
"openIdConnect": {
|
||||
"metadata_url": "{{ .Env.IDP_OIDC_ISSUER }}/.well-known/openid-configuration",
|
||||
"authority": "{{ .Env.IDP_OIDC_ISSUER }}",
|
||||
"client_id": "oc10-web",
|
||||
"response_type": "code",
|
||||
"scope": "openid profile email"
|
||||
},
|
||||
"apps": ["files", "media-viewer", "search"],
|
||||
"applications": [
|
||||
{
|
||||
"icon": "switch_ui",
|
||||
"target": "_self",
|
||||
"title": {
|
||||
"en": "Classic Design",
|
||||
"de": "Dateien",
|
||||
"fr": "Fichiers",
|
||||
"zh_CN": "文件"
|
||||
},
|
||||
"url": "https://{{ .Env.CLOUD_DOMAIN }}/index.php/apps/files"
|
||||
},
|
||||
{
|
||||
"icon": "application",
|
||||
"menu": "user",
|
||||
"target": "_self",
|
||||
"title": {
|
||||
"de": "Einstellungen",
|
||||
"en": "Settings"
|
||||
},
|
||||
"url": "https://{{ .Env.CLOUD_DOMAIN }}/index.php/settings/personal"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
# reference: https://owncloud.dev/clients/web/deployments/oc10-app/
|
||||
|
||||
function getWebConfigFromEnv() {
|
||||
$config = [
|
||||
'web.baseUrl' => 'https://' . getenv('CLOUD_DOMAIN') . '/index.php/apps/web',
|
||||
'web.rewriteLinks' => getenv('OWNCLOUD_WEB_REWRITE_LINKS') == 'true',
|
||||
|
||||
];
|
||||
return $config;
|
||||
}
|
||||
|
||||
$CONFIG = getWebConfigFromEnv();
|
||||
@@ -1,5 +0,0 @@
|
||||
password
|
||||
12345678
|
||||
123
|
||||
ownCloud
|
||||
ownCloud-1
|
||||
@@ -1,61 +0,0 @@
|
||||
---
|
||||
policy_selector:
|
||||
claims:
|
||||
default_policy: oc10
|
||||
unauthenticated_policy: oc10
|
||||
policies:
|
||||
- name: ocis
|
||||
routes:
|
||||
- endpoint: /
|
||||
backend: http://localhost:9100
|
||||
- endpoint: /.well-known/
|
||||
backend: http://localhost:9130
|
||||
- endpoint: /konnect/
|
||||
backend: http://localhost:9130
|
||||
- endpoint: /signin/
|
||||
backend: http://localhost:9130
|
||||
- endpoint: /archiver
|
||||
backend: http://localhost:9140
|
||||
- type: regex
|
||||
endpoint: /ocs/v[12].php/cloud/user/signing-key
|
||||
backend: http://localhost:9110
|
||||
- endpoint: /ocs/
|
||||
backend: http://localhost:9140
|
||||
- type: query
|
||||
endpoint: /remote.php/?preview=1
|
||||
backend: http://localhost:9115
|
||||
- method: REPORT
|
||||
endpoint: /remote.php/dav/
|
||||
backend: http://localhost:9115
|
||||
- type: query
|
||||
endpoint: /dav/?preview=1
|
||||
backend: http://localhost:9115
|
||||
- type: query
|
||||
endpoint: /webdav/?preview=1
|
||||
backend: http://localhost:9115
|
||||
- endpoint: /remote.php/
|
||||
service: com.owncloud.web.ocdav
|
||||
- endpoint: /dav/
|
||||
service: com.owncloud.web.ocdav
|
||||
- endpoint: /webdav/
|
||||
service: com.owncloud.web.ocdav
|
||||
- endpoint: /status.php
|
||||
service: com.owncloud.web.ocdav
|
||||
- endpoint: /index.php/
|
||||
service: com.owncloud.web.ocdav
|
||||
- endpoint: /apps/
|
||||
service: com.owncloud.web.ocdav
|
||||
- endpoint: /data
|
||||
backend: http://localhost:9140
|
||||
- endpoint: /app/
|
||||
backend: http://localhost:9140
|
||||
- endpoint: /graph/
|
||||
backend: http://localhost:9120
|
||||
- endpoint: /api/v0/settings
|
||||
backend: http://localhost:9190
|
||||
- name: oc10
|
||||
routes:
|
||||
- endpoint: "/"
|
||||
backend: http://oc10:8080
|
||||
- endpoint: "/data"
|
||||
backend: http://localhost:9140
|
||||
@@ -1,345 +0,0 @@
|
||||
---
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:v2.9.1
|
||||
networks:
|
||||
ocis-net:
|
||||
aliases:
|
||||
- ${CLOUD_DOMAIN:-cloud.owncloud.test}
|
||||
- ${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}
|
||||
command:
|
||||
- "--log.level=${TRAEFIK_LOG_LEVEL:-ERROR}"
|
||||
# letsencrypt configuration
|
||||
- "--certificatesResolvers.http.acme.email=${TRAEFIK_ACME_MAIL:-example@example.org}"
|
||||
- "--certificatesResolvers.http.acme.storage=/certs/acme.json"
|
||||
- "--certificatesResolvers.http.acme.httpChallenge.entryPoint=http"
|
||||
# enable dashboard
|
||||
- "--api.dashboard=true"
|
||||
# define entrypoints
|
||||
- "--entryPoints.http.address=:80"
|
||||
- "--entryPoints.http.http.redirections.entryPoint.to=https"
|
||||
- "--entryPoints.http.http.redirections.entryPoint.scheme=https"
|
||||
- "--entryPoints.https.address=:443"
|
||||
# docker provider (get configuration from container labels)
|
||||
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
|
||||
- "--providers.docker.exposedByDefault=false"
|
||||
# access log
|
||||
- "--accessLog=true"
|
||||
- "--accessLog.format=json"
|
||||
- "--accessLog.fields.headers.names.X-Request-Id=keep"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
- "certs:/certs"
|
||||
labels:
|
||||
- "traefik.enable=${TRAEFIK_DASHBOARD:-false}"
|
||||
- "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_BASIC_AUTH_USERS:-admin:$$apr1$$4vqie50r$$YQAmQdtmz5n9rEALhxJ4l.}" # defaults to admin:admin
|
||||
- "traefik.http.routers.traefik.entrypoints=https"
|
||||
- "traefik.http.routers.traefik.rule=Host(`${TRAEFIK_DOMAIN:-traefik.owncloud.test}`)"
|
||||
- "traefik.http.routers.traefik.middlewares=traefik-auth"
|
||||
- "traefik.http.routers.traefik.tls.certresolver=http"
|
||||
- "traefik.http.routers.traefik.service=api@internal"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
ocis-init-volumes:
|
||||
image: busybox
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
# prepare the oCIS config volume for oCIS
|
||||
command: ["-c", "chown -R 33:33 /etc/ocis /var/lib/ocis"]
|
||||
volumes:
|
||||
- ocis-config:/etc/ocis
|
||||
- ocis-data:/var/lib/ocis
|
||||
|
||||
ocis:
|
||||
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
|
||||
networks:
|
||||
ocis-net:
|
||||
user: "33:33" # equals the user "www-data" for oC10
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
# run ocis init to initialize a configuration file with random secrets
|
||||
# it will fail on subsequent runs, because the config file already exists
|
||||
# therefore we ignore the error and then start the ocis server
|
||||
command: ["-c", "ocis init || true; exec ocis server"]
|
||||
#entrypoint:
|
||||
# - /bin/sh
|
||||
# - /entrypoint-override.sh
|
||||
environment:
|
||||
# Keycloak IDP specific configuration
|
||||
OCIS_OIDC_ISSUER: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-owncloud}
|
||||
PROXY_OIDC_REWRITE_WELLKNOWN: "true"
|
||||
WEB_OIDC_CLIENT_ID: ocis-web
|
||||
WEB_OIDC_SCOPE: openid profile email owncloud
|
||||
# external ldap is supposed to be read-only
|
||||
GRAPH_IDENTITY_BACKEND: ldap
|
||||
GRAPH_LDAP_SERVER_WRITE_ENABLED: "false"
|
||||
# LDAP bind
|
||||
OCIS_LDAP_URI: "ldaps://openldap"
|
||||
OCIS_LDAP_INSECURE: "true"
|
||||
OCIS_LDAP_BIND_DN: "cn=admin,dc=owncloud,dc=com"
|
||||
OCIS_LDAP_BIND_PASSWORD: ${LDAP_ADMIN_PASSWORD:-admin}
|
||||
# LDAP user settings
|
||||
PROXY_USER_OIDC_CLAIM: ocis.user.uuid # claim was added in Keycloak
|
||||
PROXY_USER_CS3_CLAIM: userid # equals LDAP_USER_SCHEMA_ID
|
||||
OCIS_LDAP_GROUP_BASE_DN: "ou=groups,dc=owncloud,dc=com"
|
||||
OCIS_LDAP_GROUP_SCHEMA_ID: "ownclouduuid"
|
||||
OCIS_LDAP_GROUP_FILTER: "(objectclass=owncloud)"
|
||||
OCIS_LDAP_USER_BASE_DN: "ou=users,dc=owncloud,dc=com"
|
||||
OCIS_LDAP_USER_SCHEMA_ID: "ownclouduuid"
|
||||
OCIS_LDAP_USER_FILTER: "(objectclass=owncloud)"
|
||||
# ownCloudSQL storage driver
|
||||
STORAGE_USERS_DRIVER: "owncloudsql"
|
||||
STORAGE_USERS_OWNCLOUDSQL_DATADIR: "/mnt/data/files"
|
||||
STORAGE_USERS_OWNCLOUDSQL_SHARE_FOLDER: "/Shares"
|
||||
STORAGE_USERS_OWNCLOUDSQL_LAYOUT: "{{.Username}}"
|
||||
STORAGE_USERS_OWNCLOUDSQL_DB_USERNAME: "owncloud"
|
||||
STORAGE_USERS_OWNCLOUDSQL_DB_PASSWORD: "owncloud"
|
||||
STORAGE_USERS_OWNCLOUDSQL_DB_HOST: "oc10-db"
|
||||
STORAGE_USERS_OWNCLOUDSQL_DB_PORT: 3306
|
||||
STORAGE_USERS_OWNCLOUDSQL_DB_NAME: "owncloud"
|
||||
# ownCloudSQL sharing driver
|
||||
SHARING_USER_DRIVER: "owncloudsql"
|
||||
SHARING_USER_OWNCLOUDSQL_DB_USERNAME: "owncloud"
|
||||
SHARING_USER_OWNCLOUDSQL_DB_PASSWORD: "owncloud"
|
||||
SHARING_USER_OWNCLOUDSQL_DB_HOST: "oc10-db"
|
||||
SHARING_USER_OWNCLOUDSQL_DB_PORT: 3306
|
||||
SHARING_USER_OWNCLOUDSQL_DB_NAME: "owncloud"
|
||||
# ownCloud storage readonly
|
||||
OCIS_STORAGE_READ_ONLY: "false" # TODO: conflict with OWNCLOUDSQL -> https://github.com/owncloud/ocis/issues/2303
|
||||
# General oCIS config
|
||||
# OCIS_RUN_SERVICES specifies to start all fullstack services except idm and idp. These are replaced by external services
|
||||
OCIS_RUN_SERVICES: app-registry,app-provider,auth-basic,auth-machine,frontend,gateway,graph,groups,nats,notifications,ocdav,ocs,proxy,search,settings,sharing,storage-system,storage-publiclink,storage-shares,storage-users,store,thumbnails,users,web,webdav
|
||||
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-info}
|
||||
OCIS_LOG_COLOR: "${OCIS_LOG_COLOR:-false}"
|
||||
OCIS_URL: https://${CLOUD_DOMAIN:-cloud.owncloud.test}
|
||||
PROXY_TLS: "false" # do not use SSL between Traefik and oCIS
|
||||
# INSECURE: needed if oCIS / Traefik is using self generated certificates
|
||||
OCIS_INSECURE: "${INSECURE:-false}"
|
||||
# basic auth (not recommended, but needed for e.g., WebDav clients that do not support OpenID Connect)
|
||||
PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-false}"
|
||||
# password policies
|
||||
OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST: "banned-password-list.txt"
|
||||
volumes:
|
||||
- ./config/ocis/banned-password-list.txt:/etc/ocis/banned-password-list.txt
|
||||
- ./config/ocis/proxy.yaml:/etc/ocis/proxy.yaml
|
||||
- ocis-config:/etc/ocis
|
||||
- ocis-data:/var/lib/ocis
|
||||
# shared volume with oC10
|
||||
- oc10-data:/mnt/data
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.ocis.entrypoints=https"
|
||||
- "traefik.http.routers.ocis.rule=Host(`${CLOUD_DOMAIN:-cloud.owncloud.test}`)"
|
||||
- "traefik.http.routers.ocis.tls.certresolver=http"
|
||||
- "traefik.http.routers.ocis.service=ocis"
|
||||
- "traefik.http.services.ocis.loadbalancer.server.port=9200"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
oc10:
|
||||
image: owncloud/server:${OC10_DOCKER_TAG:-latest}
|
||||
networks:
|
||||
ocis-net:
|
||||
environment:
|
||||
# make ownCloud Web the default frontend
|
||||
OWNCLOUD_DEFAULT_APP: ${OWNCLOUD_DEFAULT_APP:-files} # can be switched to "web"
|
||||
OWNCLOUD_WEB_REWRITE_LINKS: ${OWNCLOUD_WEB_REWRITE_LINKS:-false}
|
||||
# script / config variables
|
||||
IDP_OIDC_ISSUER: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-owncloud}
|
||||
IDP_OIDC_CLIENT_SECRET: ${OC10_OIDC_CLIENT_SECRET:-oc10-oidc-secret}
|
||||
CLOUD_DOMAIN: ${CLOUD_DOMAIN:-cloud.owncloud.test}
|
||||
# LDAP bind configuration
|
||||
LDAP_HOST: "openldap"
|
||||
LDAP_PORT: 389
|
||||
STORAGE_LDAP_BIND_DN: "cn=admin,dc=owncloud,dc=com"
|
||||
STORAGE_LDAP_BIND_PASSWORD: ${LDAP_ADMIN_PASSWORD:-admin}
|
||||
# LDAP user configuration
|
||||
LDAP_BASE_DN: "dc=owncloud,dc=com"
|
||||
LDAP_USER_SCHEMA_DISPLAYNAME: "displayname"
|
||||
LDAP_LOGINFILTER: "(&(objectclass=owncloud)(|(uid=%uid)(mail=%uid)))"
|
||||
LDAP_GROUP_SCHEMA_DISPLAYNAME: "cn"
|
||||
LDAP_USER_SCHEMA_NAME_ATTR: "uid"
|
||||
LDAP_GROUP_FILTER: "(&(objectclass=groupOfNames)(objectclass=owncloud))"
|
||||
LDAP_USER_SCHEMA_UID: "ownclouduuid"
|
||||
LDAP_USERATTRIBUTEFILTERS: "" #"ownclouduuid;cn;uid;mail"
|
||||
LDAP_USER_SCHEMA_MAIL: "mail"
|
||||
LDAP_USER_FILTER: "(&(objectclass=owncloud))"
|
||||
LDAP_GROUP_MEMBER_ASSOC_ATTR: "uniqueMember"
|
||||
# ownCloud config
|
||||
OWNCLOUD_DB_TYPE: mysql
|
||||
OWNCLOUD_DB_NAME: owncloud
|
||||
OWNCLOUD_DB_USERNAME: owncloud
|
||||
OWNCLOUD_DB_PASSWORD: owncloud
|
||||
OWNCLOUD_DB_HOST: oc10-db
|
||||
OWNCLOUD_ADMIN_USERNAME: admin
|
||||
OWNCLOUD_ADMIN_PASSWORD: admin
|
||||
OWNCLOUD_MYSQL_UTF8MB4: "true"
|
||||
OWNCLOUD_REDIS_ENABLED: "true"
|
||||
OWNCLOUD_REDIS_HOST: redis
|
||||
OWNCLOUD_TRUSTED_PROXIES: ${CLOUD_DOMAIN:-cloud.owncloud.test}
|
||||
OWNCLOUD_OVERWRITE_PROTOCOL: https
|
||||
OWNCLOUD_OVERWRITE_HOST: ${CLOUD_DOMAIN:-cloud.owncloud.test}
|
||||
OWNCLOUD_APPS_ENABLE: "openidconnect,oauth2,user_ldap,graphapi"
|
||||
OWNCLOUD_LOG_LEVEL: 0
|
||||
OWNCLOUD_LOG_FILE: /dev/stdout
|
||||
volumes:
|
||||
# oidc, ldap and web config
|
||||
- ./config/oc10/oidc.config.php:/etc/templates/oidc.config.php
|
||||
- ./config/oc10/ldap-config.tmpl.json:/etc/templates/ldap-config.tmpl.json
|
||||
- ./config/oc10/ldap-sync-cron:/tmp/ldap-sync-cron
|
||||
- ./config/oc10/web.config.php:/etc/templates/web.config.php
|
||||
- ./config/oc10/web-config.tmpl.json:/etc/templates/web-config.tmpl.json
|
||||
# config load script
|
||||
- ./config/oc10/10-custom-config.sh:/etc/pre_server.d/10-custom-config.sh
|
||||
# data persistence
|
||||
- oc10-data:/mnt/data
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
keycloak:
|
||||
# Keycloak WildFly distribution, Quarkus is not ready yet for automatic setup https://github.com/keycloak/keycloak/issues/10216
|
||||
image: quay.io/keycloak/keycloak:legacy
|
||||
networks:
|
||||
ocis-net:
|
||||
entrypoint: ["/bin/sh", "/opt/jboss/tools/docker-entrypoint-override.sh"]
|
||||
volumes:
|
||||
- ./config/keycloak/docker-entrypoint-override.sh:/opt/jboss/tools/docker-entrypoint-override.sh
|
||||
- ./config/keycloak/owncloud-realm.dist.json:/opt/jboss/keycloak/owncloud-realm.dist.json
|
||||
environment:
|
||||
CLOUD_DOMAIN: ${CLOUD_DOMAIN:-cloud.owncloud.test}
|
||||
OC10_OIDC_CLIENT_SECRET: ${OC10_OIDC_CLIENT_SECRET:-oc10-oidc-secret}
|
||||
LDAP_ADMIN_PASSWORD: ${LDAP_ADMIN_PASSWORD:-admin}
|
||||
DB_VENDOR: POSTGRES
|
||||
DB_ADDR: keycloak-db
|
||||
DB_DATABASE: keycloak
|
||||
DB_USER: keycloak
|
||||
DB_SCHEMA: public
|
||||
DB_PASSWORD: keycloak
|
||||
KEYCLOAK_USER: ${KEYCLOAK_ADMIN_USER:-admin}
|
||||
KEYCLOAK_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin}
|
||||
PROXY_ADDRESS_FORWARDING: "true"
|
||||
KEYCLOAK_IMPORT: /opt/jboss/keycloak/owncloud-realm.json
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.keycloak.entrypoints=https"
|
||||
- "traefik.http.routers.keycloak.rule=Host(`${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}`)"
|
||||
- "traefik.http.routers.keycloak.tls.certresolver=http"
|
||||
- "traefik.http.routers.keycloak.service=keycloak"
|
||||
- "traefik.http.services.keycloak.loadbalancer.server.port=8080"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
openldap:
|
||||
image: osixia/openldap:latest
|
||||
networks:
|
||||
ocis-net:
|
||||
command: --copy-service --loglevel debug
|
||||
environment:
|
||||
LDAP_TLS_VERIFY_CLIENT: never
|
||||
LDAP_DOMAIN: owncloud.com
|
||||
LDAP_ORGANISATION: ownCloud
|
||||
LDAP_ADMIN_PASSWORD: ${LDAP_ADMIN_PASSWORD:-admin}
|
||||
LDAP_RFC2307BIS_SCHEMA: "true"
|
||||
LDAP_REMOVE_CONFIG_AFTER_SETUP: "false"
|
||||
volumes:
|
||||
- ./config/ldap/ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
ldap-manager:
|
||||
image: osixia/phpldapadmin:0.9.0
|
||||
networks:
|
||||
ocis-net:
|
||||
environment:
|
||||
PHPLDAPADMIN_LDAP_HOSTS: openldap
|
||||
PHPLDAPADMIN_HTTPS: "false"
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.ldap-manager.entrypoints=https"
|
||||
- "traefik.http.routers.ldap-manager.rule=Host(`${LDAP_MANAGER_DOMAIN:-ldap.owncloud.test}`)"
|
||||
- "traefik.http.routers.ldap-manager.tls.certresolver=http"
|
||||
- "traefik.http.routers.ldap-manager.service=ldap-manager"
|
||||
- "traefik.http.services.ldap-manager.loadbalancer.server.port=80"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
keycloak-db:
|
||||
image: postgres:alpine
|
||||
networks:
|
||||
ocis-net:
|
||||
volumes:
|
||||
- keycloak-postgres-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_DB: keycloak
|
||||
POSTGRES_USER: keycloak
|
||||
POSTGRES_PASSWORD: keycloak
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
oc10-db:
|
||||
image: mariadb:10.6
|
||||
networks:
|
||||
ocis-net:
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=owncloud
|
||||
- MYSQL_USER=owncloud
|
||||
- MYSQL_PASSWORD=owncloud
|
||||
- MYSQL_DATABASE=owncloud
|
||||
command:
|
||||
[
|
||||
"--max-allowed-packet=128M",
|
||||
"--innodb-log-file-size=64M",
|
||||
"--innodb-read-only-compressed=OFF",
|
||||
]
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=owncloud"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
volumes:
|
||||
- oc10-mysql-data:/var/lib/mysql
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
networks:
|
||||
ocis-net:
|
||||
image: redis:6
|
||||
command: ["--databases", "1"]
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
volumes:
|
||||
- oc10-redis-data:/data
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
certs:
|
||||
ocis-config:
|
||||
ocis-data:
|
||||
keycloak-postgres-data:
|
||||
oc10-mysql-data:
|
||||
oc10-redis-data:
|
||||
oc10-data:
|
||||
oc10-tmp:
|
||||
|
||||
networks:
|
||||
ocis-net:
|
||||
@@ -1,13 +0,0 @@
|
||||
#! /bin/bash
|
||||
docker-compose exec keycloak \
|
||||
sh -c "cd /opt/jboss/keycloak && \
|
||||
timeout 60 bin/standalone.sh \
|
||||
-Djboss.httin/standalone.sh \
|
||||
-Djboss.socket.binding.port-offset=100 \
|
||||
-Dkeycloak.migration.action=export \
|
||||
-Dkeycloak.migration.provider=singleFile \
|
||||
-Dkeycloak.migration.realmName=owncloud \
|
||||
-Dkeycloak.migration.file=owncloud-realm.json"
|
||||
|
||||
docker-compose exec keycloak \
|
||||
cp /opt/jboss/keycloak/owncloud-realm.json /opt/jboss/keycloak/owncloud-realm.dist.json
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
---
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
ocis:
|
||||
environment:
|
||||
# tracing
|
||||
OCIS_TRACING_ENABLED: "true"
|
||||
OCIS_TRACING_TYPE: "otlp"
|
||||
OCIS_TRACING_ENDPOINT: jaeger:4317
|
||||
# metrics
|
||||
# if oCIS runs as a single process, all <debug>/metrics endpoints
|
||||
# will expose the same metrics, so it's sufficient to query one endpoint
|
||||
PROXY_DEBUG_ADDR: 0.0.0.0:9205
|
||||
|
||||
networks:
|
||||
ocis-net:
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
ocis:
|
||||
environment:
|
||||
LDAP_GROUP_BASE_DN: "ou=TestGroups,dc=owncloud,dc=com"
|
||||
LDAP_USER_BASE_DN: "ou=TestUsers,dc=owncloud,dc=com"
|
||||
PROXY_ENABLE_BASIC_AUTH: "true"
|
||||
|
||||
oc10:
|
||||
ports:
|
||||
- 8080:8080
|
||||
volumes:
|
||||
- ./config/oc10/11-testing-app.sh:/etc/pre_server.d/11-testing-app.sh
|
||||
|
||||
openldap:
|
||||
ports:
|
||||
- 636:636
|
||||
+192
-169
@@ -5260,6 +5260,19 @@ GRAPH_LDAP_SERVER_WRITE_ENABLED:
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE:
|
||||
name: OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE;GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE
|
||||
defaultValue: "true"
|
||||
type: bool
|
||||
description: 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
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
GRAPH_LDAP_URI:
|
||||
name: OCIS_LDAP_URI;GRAPH_LDAP_URI
|
||||
defaultValue: ldaps://localhost:9235
|
||||
@@ -5423,7 +5436,7 @@ GRAPH_RECEIVED_SHARES_STAT_TIMEOUT:
|
||||
be statted within this time is still listed as a degraded item instead of being
|
||||
dropped. Defaults to '10s'. See the Environment Variable Types description for
|
||||
more details.
|
||||
introductionVersion: NEXT
|
||||
introductionVersion: 8.2.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
@@ -7991,28 +8004,28 @@ OCIS_ASYNC_UPLOADS:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CACHE_AUTH_PASSWORD:
|
||||
name: OCIS_CACHE_AUTH_PASSWORD;STORAGE_USERS_ID_CACHE_AUTH_PASSWORD
|
||||
name: OCIS_CACHE_AUTH_PASSWORD;STORAGE_SYSTEM_CACHE_AUTH_PASSWORD
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The password to authenticate with the cache store. Only applies when
|
||||
store type 'nats-js-kv' is configured.
|
||||
description: Password for the configured store. Only applies when store type 'nats-js-kv'
|
||||
is configured.
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CACHE_AUTH_USERNAME:
|
||||
name: OCIS_CACHE_AUTH_USERNAME;STORAGE_USERS_ID_CACHE_AUTH_USERNAME
|
||||
name: OCIS_CACHE_AUTH_USERNAME;STORAGE_SYSTEM_CACHE_AUTH_USERNAME
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The username to authenticate with the cache store. Only applies when
|
||||
store type 'nats-js-kv' is configured.
|
||||
description: Username for the configured store. Only applies when store type 'nats-js-kv'
|
||||
is configured.
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CACHE_DATABASE:
|
||||
name: OCIS_CACHE_DATABASE
|
||||
defaultValue: ids-storage-users
|
||||
defaultValue: storage-system
|
||||
type: string
|
||||
description: The database name the configured store should use.
|
||||
introductionVersion: pre5.0
|
||||
@@ -8020,7 +8033,7 @@ OCIS_CACHE_DATABASE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CACHE_DISABLE_PERSISTENCE:
|
||||
name: OCIS_CACHE_DISABLE_PERSISTENCE;STORAGE_USERS_ID_CACHE_DISABLE_PERSISTENCE
|
||||
name: OCIS_CACHE_DISABLE_PERSISTENCE;STORAGE_SYSTEM_CACHE_DISABLE_PERSISTENCE
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Disables persistence of the cache. Only applies when store type 'nats-js-kv'
|
||||
@@ -8030,7 +8043,7 @@ OCIS_CACHE_DISABLE_PERSISTENCE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CACHE_STORE:
|
||||
name: OCIS_CACHE_STORE;STORAGE_USERS_ID_CACHE_STORE
|
||||
name: OCIS_CACHE_STORE;STORAGE_SYSTEM_CACHE_STORE
|
||||
defaultValue: memory
|
||||
type: string
|
||||
description: 'The type of the cache store. Supported values are: ''memory'', ''redis-sentinel'',
|
||||
@@ -8040,7 +8053,7 @@ OCIS_CACHE_STORE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CACHE_STORE_NODES:
|
||||
name: OCIS_CACHE_STORE_NODES;STORAGE_USERS_ID_CACHE_STORE_NODES
|
||||
name: OCIS_CACHE_STORE_NODES;STORAGE_SYSTEM_CACHE_STORE_NODES
|
||||
defaultValue: '[127.0.0.1:9233]'
|
||||
type: '[]string'
|
||||
description: A list of nodes to access the configured store. This has no effect
|
||||
@@ -8052,13 +8065,12 @@ OCIS_CACHE_STORE_NODES:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CACHE_TTL:
|
||||
name: OCIS_CACHE_TTL;STORAGE_USERS_ID_CACHE_TTL
|
||||
name: OCIS_CACHE_TTL;STORAGE_SYSTEM_CACHE_TTL
|
||||
defaultValue: 24m0s
|
||||
type: Duration
|
||||
description: Default time to live for user info in the user info cache. Only applied
|
||||
when access tokens have no expiration. Defaults to 300s which is derived from
|
||||
the underlaying package though not explicitly set as default. See the Environment
|
||||
Variable Types description for more details.
|
||||
when access tokens has no expiration. See the Environment Variable Types description
|
||||
for more details.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
@@ -8101,47 +8113,46 @@ OCIS_CLAIM_MANAGED_SPACES_REGEXP:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CORS_ALLOW_CREDENTIALS:
|
||||
name: OCIS_CORS_ALLOW_CREDENTIALS;STORAGE_USERS_CORS_ALLOW_CREDENTIALS
|
||||
defaultValue: "false"
|
||||
name: OCIS_CORS_ALLOW_CREDENTIALS;SSE_CORS_ALLOW_CREDENTIALS
|
||||
defaultValue: "true"
|
||||
type: bool
|
||||
description: 'Allow credentials for CORS.See following chapter for more details:
|
||||
*Access-Control-Allow-Credentials* at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials.'
|
||||
introductionVersion: pre5.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CORS_ALLOW_HEADERS:
|
||||
name: OCIS_CORS_ALLOW_HEADERS;STORAGE_USERS_CORS_ALLOW_HEADERS
|
||||
defaultValue: '[Authorization Origin X-Requested-With X-Request-Id X-HTTP-Method-Override
|
||||
Content-Type Upload-Length Upload-Offset Tus-Resumable Upload-Metadata Upload-Defer-Length
|
||||
Upload-Concat Upload-Incomplete Upload-Draft-Interop-Version]'
|
||||
name: OCIS_CORS_ALLOW_HEADERS;SSE_CORS_ALLOW_HEADERS
|
||||
defaultValue: '[Authorization Origin Content-Type Accept X-Requested-With X-Request-Id
|
||||
Ocs-Apirequest]'
|
||||
type: '[]string'
|
||||
description: 'A list of allowed CORS headers. See following chapter for more details:
|
||||
*Access-Control-Request-Headers* at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Headers.
|
||||
See the Environment Variable Types description for more details.'
|
||||
introductionVersion: pre5.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CORS_ALLOW_METHODS:
|
||||
name: OCIS_CORS_ALLOW_METHODS;STORAGE_USERS_CORS_ALLOW_METHODS
|
||||
defaultValue: '[POST HEAD PATCH OPTIONS GET DELETE]'
|
||||
name: OCIS_CORS_ALLOW_METHODS;SSE_CORS_ALLOW_METHODS
|
||||
defaultValue: '[GET]'
|
||||
type: '[]string'
|
||||
description: 'A list of allowed CORS methods. See following chapter for more details:
|
||||
*Access-Control-Request-Method* at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Method.
|
||||
See the Environment Variable Types description for more details.'
|
||||
introductionVersion: pre5.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_CORS_ALLOW_ORIGINS:
|
||||
name: OCIS_CORS_ALLOW_ORIGINS;STORAGE_USERS_CORS_ALLOW_ORIGINS
|
||||
defaultValue: '[https://localhost:9200]'
|
||||
name: OCIS_CORS_ALLOW_ORIGINS;SSE_CORS_ALLOW_ORIGINS
|
||||
defaultValue: '[*]'
|
||||
type: '[]string'
|
||||
description: 'A list of allowed CORS origins. See following chapter for more details:
|
||||
*Access-Control-Allow-Origin* at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin.
|
||||
See the Environment Variable Types description for more details.'
|
||||
introductionVersion: pre5.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
@@ -8249,27 +8260,27 @@ OCIS_EMAIL_TEMPLATE_PATH:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_ENABLE_OCM:
|
||||
name: OCIS_ENABLE_OCM;GRAPH_INCLUDE_OCM_SHAREES
|
||||
name: OCIS_ENABLE_OCM
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Include OCM sharees when listing users.
|
||||
description: Include OCM sharees when listing sharees.
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_ENABLE_VAULT_MODE:
|
||||
name: OCIS_ENABLE_VAULT_MODE;GRAPH_ENABLE_VAULT_MODE
|
||||
name: OCIS_ENABLE_VAULT_MODE;FRONTEND_ENABLE_VAULT_MODE
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Enable vault mode in addition to the regular graph service. This only
|
||||
applies when the additional storage-users-vault service is running, which is a
|
||||
special configured storage-users service.
|
||||
description: Enable vault mode. When enabled, the capabilities endpoint will report
|
||||
vault as enabled and the capabilities?vault=true endpoint will return capabilities
|
||||
with public sharing and federation disabled.
|
||||
introductionVersion: 8.1.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_EVENTS_AUTH_PASSWORD:
|
||||
name: OCIS_EVENTS_AUTH_PASSWORD;STORAGE_USERS_EVENTS_AUTH_PASSWORD
|
||||
name: OCIS_EVENTS_AUTH_PASSWORD;SSE_EVENTS_AUTH_PASSWORD
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The password to authenticate with the events broker. The events broker
|
||||
@@ -8279,7 +8290,7 @@ OCIS_EVENTS_AUTH_PASSWORD:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_EVENTS_AUTH_USERNAME:
|
||||
name: OCIS_EVENTS_AUTH_USERNAME;STORAGE_USERS_EVENTS_AUTH_USERNAME
|
||||
name: OCIS_EVENTS_AUTH_USERNAME;SSE_EVENTS_AUTH_USERNAME
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The username to authenticate with the events broker. The events broker
|
||||
@@ -8289,43 +8300,43 @@ OCIS_EVENTS_AUTH_USERNAME:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_EVENTS_CLUSTER:
|
||||
name: OCIS_EVENTS_CLUSTER;STORAGE_USERS_EVENTS_CLUSTER
|
||||
name: OCIS_EVENTS_CLUSTER;SSE_EVENTS_CLUSTER
|
||||
defaultValue: ocis-cluster
|
||||
type: string
|
||||
description: The clusterID of the event system. The event system is the message
|
||||
queuing service. It is used as message broker for the microservice architecture.
|
||||
Mandatory when using NATS as event system.
|
||||
introductionVersion: pre5.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_EVENTS_ENABLE_TLS:
|
||||
name: OCIS_EVENTS_ENABLE_TLS;STORAGE_USERS_EVENTS_ENABLE_TLS
|
||||
name: OCIS_EVENTS_ENABLE_TLS;SSE_EVENTS_ENABLE_TLS
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Enable TLS for the connection to the events broker. The events broker
|
||||
is the ocis service which receives and delivers events between the services.
|
||||
introductionVersion: pre5.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_EVENTS_ENDPOINT:
|
||||
name: OCIS_EVENTS_ENDPOINT;STORAGE_USERS_EVENTS_ENDPOINT
|
||||
name: OCIS_EVENTS_ENDPOINT;SSE_EVENTS_ENDPOINT
|
||||
defaultValue: 127.0.0.1:9233
|
||||
type: string
|
||||
description: The address of the event system. The event system is the message queuing
|
||||
service. It is used as message broker for the microservice architecture.
|
||||
introductionVersion: pre5.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_EVENTS_TLS_ROOT_CA_CERTIFICATE:
|
||||
name: OCIS_EVENTS_TLS_ROOT_CA_CERTIFICATE;STORAGE_USERS_EVENTS_TLS_ROOT_CA_CERTIFICATE
|
||||
name: OCIS_EVENTS_TLS_ROOT_CA_CERTIFICATE;SSE_EVENTS_TLS_ROOT_CA_CERTIFICATE
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The root CA certificate used to validate the server's TLS certificate.
|
||||
If provided STORAGE_USERS_EVENTS_TLS_INSECURE will be seen as false.
|
||||
introductionVersion: pre5.0
|
||||
If provided SSE_EVENTS_TLS_INSECURE will be seen as false.
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
@@ -8362,7 +8373,7 @@ OCIS_GRPC_CLIENT_TLS_MODE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_GRPC_PROTOCOL:
|
||||
name: OCIS_GRPC_PROTOCOL;STORAGE_USERS_GRPC_PROTOCOL
|
||||
name: OCIS_GRPC_PROTOCOL;USERS_GRPC_PROTOCOL
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The transport protocol of the GPRC service.
|
||||
@@ -8402,16 +8413,16 @@ OCIS_HTTP_TLS_KEY:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_INSECURE:
|
||||
name: OCIS_INSECURE;STORAGE_USERS_EVENTS_TLS_INSECURE
|
||||
name: OCIS_INSECURE;SSE_EVENTS_TLS_INSECURE
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Whether to verify the server TLS certificates.
|
||||
introductionVersion: pre5.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_JWT_SECRET:
|
||||
name: OCIS_JWT_SECRET;STORAGE_USERS_JWT_SECRET
|
||||
name: OCIS_JWT_SECRET;USERS_JWT_SECRET
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The secret to mint and validate jwt tokens.
|
||||
@@ -8475,8 +8486,8 @@ OCIS_KEYCLOAK_USER_REALM:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_BIND_DN:
|
||||
name: OCIS_LDAP_BIND_DN;GRAPH_LDAP_BIND_DN
|
||||
defaultValue: uid=libregraph,ou=sysusers,o=libregraph-idm
|
||||
name: OCIS_LDAP_BIND_DN;USERS_LDAP_BIND_DN
|
||||
defaultValue: uid=reva,ou=sysusers,o=libregraph-idm
|
||||
type: string
|
||||
description: LDAP DN to use for simple bind authentication with the target LDAP
|
||||
server.
|
||||
@@ -8485,7 +8496,7 @@ OCIS_LDAP_BIND_DN:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_BIND_PASSWORD:
|
||||
name: OCIS_LDAP_BIND_PASSWORD;GRAPH_LDAP_BIND_PASSWORD
|
||||
name: OCIS_LDAP_BIND_PASSWORD;USERS_LDAP_BIND_PASSWORD
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: Password to use for authenticating the 'bind_dn'.
|
||||
@@ -8494,7 +8505,7 @@ OCIS_LDAP_BIND_PASSWORD:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_CACERT:
|
||||
name: OCIS_LDAP_CACERT;GRAPH_LDAP_CACERT
|
||||
name: OCIS_LDAP_CACERT;USERS_LDAP_CACERT
|
||||
defaultValue: /var/lib/ocis/idm/ldap.crt
|
||||
type: string
|
||||
description: Path/File name for the root CA certificate (in PEM format) used to
|
||||
@@ -8515,20 +8526,20 @@ OCIS_LDAP_CROSS_INSTANCE_REFERENCE_TEMPLATE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_DISABLE_USER_MECHANISM:
|
||||
name: OCIS_LDAP_DISABLE_USER_MECHANISM;GRAPH_DISABLE_USER_MECHANISM
|
||||
name: OCIS_LDAP_DISABLE_USER_MECHANISM;USERS_LDAP_DISABLE_USER_MECHANISM
|
||||
defaultValue: attribute
|
||||
type: string
|
||||
description: An option to control the behavior for disabling users. Supported options
|
||||
description: An option to control the behavior for disabling users. Valid options
|
||||
are 'none', 'attribute' and 'group'. If set to 'group', disabling a user via API
|
||||
will add the user to the configured group for disabled users, if set to 'attribute'
|
||||
this will be done in the ldap user entry, if set to 'none' the disable request
|
||||
is not processed. Default is 'attribute'.
|
||||
is not processed.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_DISABLED_USERS_GROUP_DN:
|
||||
name: OCIS_LDAP_DISABLED_USERS_GROUP_DN;GRAPH_DISABLED_USERS_GROUP_DN
|
||||
name: OCIS_LDAP_DISABLED_USERS_GROUP_DN;USERS_LDAP_DISABLED_USERS_GROUP_DN
|
||||
defaultValue: cn=DisabledUsersGroup,ou=groups,o=libregraph-idm
|
||||
type: string
|
||||
description: The distinguished name of the group to which added users will be classified
|
||||
@@ -8558,7 +8569,7 @@ OCIS_LDAP_GROUP_AFFILIATION_ATTRIBUTE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_BASE_DN:
|
||||
name: OCIS_LDAP_GROUP_BASE_DN;GRAPH_LDAP_GROUP_BASE_DN
|
||||
name: OCIS_LDAP_GROUP_BASE_DN;USERS_LDAP_GROUP_BASE_DN
|
||||
defaultValue: ou=groups,o=libregraph-idm
|
||||
type: string
|
||||
description: Search base DN for looking up LDAP groups.
|
||||
@@ -8567,7 +8578,7 @@ OCIS_LDAP_GROUP_BASE_DN:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_FILTER:
|
||||
name: OCIS_LDAP_GROUP_FILTER;GRAPH_LDAP_GROUP_FILTER
|
||||
name: OCIS_LDAP_GROUP_FILTER;USERS_LDAP_GROUP_FILTER
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: LDAP filter to add to the default filters for group searches.
|
||||
@@ -8576,17 +8587,17 @@ OCIS_LDAP_GROUP_FILTER:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_OBJECTCLASS:
|
||||
name: OCIS_LDAP_GROUP_OBJECTCLASS;GRAPH_LDAP_GROUP_OBJECTCLASS
|
||||
name: OCIS_LDAP_GROUP_OBJECTCLASS;USERS_LDAP_GROUP_OBJECTCLASS
|
||||
defaultValue: groupOfNames
|
||||
type: string
|
||||
description: The object class to use for groups in the default group search filter
|
||||
('groupOfNames').
|
||||
like 'groupOfNames'.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_SCHEMA_DISPLAYNAME:
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_DISPLAYNAME;GROUPS_LDAP_GROUP_SCHEMA_DISPLAYNAME
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_DISPLAYNAME;USERS_LDAP_GROUP_SCHEMA_DISPLAYNAME
|
||||
defaultValue: cn
|
||||
type: string
|
||||
description: LDAP Attribute to use for the displayname of groups (often the same
|
||||
@@ -8596,7 +8607,7 @@ OCIS_LDAP_GROUP_SCHEMA_DISPLAYNAME:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_SCHEMA_GROUPNAME:
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_GROUPNAME;GRAPH_LDAP_GROUP_NAME_ATTRIBUTE
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_GROUPNAME;USERS_LDAP_GROUP_SCHEMA_GROUPNAME
|
||||
defaultValue: cn
|
||||
type: string
|
||||
description: LDAP Attribute to use for the name of groups.
|
||||
@@ -8605,28 +8616,28 @@ OCIS_LDAP_GROUP_SCHEMA_GROUPNAME:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_SCHEMA_ID:
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_ID;GRAPH_LDAP_GROUP_ID_ATTRIBUTE
|
||||
defaultValue: owncloudUUID
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_ID;USERS_LDAP_GROUP_SCHEMA_ID
|
||||
defaultValue: ownclouduuid
|
||||
type: string
|
||||
description: LDAP Attribute to use as the unique id for groups. This should be a
|
||||
description: LDAP Attribute to use as the unique ID for groups. This should be a
|
||||
stable globally unique ID like a UUID.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_SCHEMA_ID_IS_OCTETSTRING:
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_ID_IS_OCTETSTRING;GRAPH_LDAP_GROUP_SCHEMA_ID_IS_OCTETSTRING
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_ID_IS_OCTETSTRING;USERS_LDAP_GROUP_SCHEMA_ID_IS_OCTETSTRING
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Set this to true if the defined 'ID' attribute for groups is of the
|
||||
'OCTETSTRING' syntax. This is required when using the 'objectGUID' attribute of
|
||||
Active Directory for the group ID's.
|
||||
description: Set this to true if the defined 'id' attribute for groups is of the
|
||||
'OCTETSTRING' syntax. This is e.g. required when using the 'objectGUID' attribute
|
||||
of Active Directory for the group ID's.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_SCHEMA_MAIL:
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_MAIL;GROUPS_LDAP_GROUP_SCHEMA_MAIL
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_MAIL;USERS_LDAP_GROUP_SCHEMA_MAIL
|
||||
defaultValue: mail
|
||||
type: string
|
||||
description: LDAP Attribute to use for the email address of groups (can be empty).
|
||||
@@ -8635,7 +8646,7 @@ OCIS_LDAP_GROUP_SCHEMA_MAIL:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_SCHEMA_MEMBER:
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_MEMBER;GRAPH_LDAP_GROUP_MEMBER_ATTRIBUTE
|
||||
name: OCIS_LDAP_GROUP_SCHEMA_MEMBER;USERS_LDAP_GROUP_SCHEMA_MEMBER
|
||||
defaultValue: member
|
||||
type: string
|
||||
description: LDAP Attribute that is used for group members.
|
||||
@@ -8644,17 +8655,17 @@ OCIS_LDAP_GROUP_SCHEMA_MEMBER:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_GROUP_SCOPE:
|
||||
name: OCIS_LDAP_GROUP_SCOPE;GRAPH_LDAP_GROUP_SEARCH_SCOPE
|
||||
name: OCIS_LDAP_GROUP_SCOPE;USERS_LDAP_GROUP_SCOPE
|
||||
defaultValue: sub
|
||||
type: string
|
||||
description: LDAP search scope to use when looking up groups. Supported scopes are
|
||||
description: LDAP search scope to use when looking up groups. Supported values are
|
||||
'base', 'one' and 'sub'.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_INSECURE:
|
||||
name: OCIS_LDAP_INSECURE;GRAPH_LDAP_INSECURE
|
||||
name: OCIS_LDAP_INSECURE;USERS_LDAP_INSECURE
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Disable TLS certificate validation for the LDAP connections. Do not
|
||||
@@ -8722,7 +8733,7 @@ OCIS_LDAP_PRECISE_SEARCH_ATTRIBUTE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_SERVER_WRITE_ENABLED:
|
||||
name: OCIS_LDAP_SERVER_WRITE_ENABLED;GRAPH_LDAP_SERVER_WRITE_ENABLED
|
||||
name: OCIS_LDAP_SERVER_WRITE_ENABLED;FRONTEND_LDAP_SERVER_WRITE_ENABLED
|
||||
defaultValue: "true"
|
||||
type: bool
|
||||
description: Allow creating, modifying and deleting LDAP users via the GRAPH API.
|
||||
@@ -8733,8 +8744,21 @@ OCIS_LDAP_SERVER_WRITE_ENABLED:
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE:
|
||||
name: OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE;GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE
|
||||
defaultValue: "true"
|
||||
type: bool
|
||||
description: 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
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_URI:
|
||||
name: OCIS_LDAP_URI;GRAPH_LDAP_URI
|
||||
name: OCIS_LDAP_URI;USERS_LDAP_URI
|
||||
defaultValue: ldaps://localhost:9235
|
||||
type: string
|
||||
description: URI of the LDAP Server to connect to. Supported URI schemes are 'ldaps://'
|
||||
@@ -8744,7 +8768,7 @@ OCIS_LDAP_URI:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_BASE_DN:
|
||||
name: OCIS_LDAP_USER_BASE_DN;GRAPH_LDAP_USER_BASE_DN
|
||||
name: OCIS_LDAP_USER_BASE_DN;USERS_LDAP_USER_BASE_DN
|
||||
defaultValue: ou=users,o=libregraph-idm
|
||||
type: string
|
||||
description: Search base DN for looking up LDAP users.
|
||||
@@ -8753,16 +8777,16 @@ OCIS_LDAP_USER_BASE_DN:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_ENABLED_ATTRIBUTE:
|
||||
name: OCIS_LDAP_USER_ENABLED_ATTRIBUTE;GRAPH_USER_ENABLED_ATTRIBUTE
|
||||
name: OCIS_LDAP_USER_ENABLED_ATTRIBUTE;USERS_LDAP_USER_ENABLED_ATTRIBUTE
|
||||
defaultValue: ownCloudUserEnabled
|
||||
type: string
|
||||
description: LDAP Attribute to use as a flag telling if the user is enabled or disabled.
|
||||
description: LDAP attribute to use as a flag telling if the user is enabled or disabled.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_FILTER:
|
||||
name: OCIS_LDAP_USER_FILTER;GRAPH_LDAP_USER_FILTER
|
||||
name: OCIS_LDAP_USER_FILTER;USERS_LDAP_USER_FILTER
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: LDAP filter to add to the default filters for user search like '(objectclass=ownCloud)'.
|
||||
@@ -8774,9 +8798,8 @@ OCIS_LDAP_USER_GUEST_ATTRIBUTE:
|
||||
name: OCIS_LDAP_USER_GUEST_ATTRIBUTE
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: LDAP Attribute to signal the user is guest of an instance. Requires
|
||||
OCIS_MULTI_INSTANCE_ENABLED.
|
||||
introductionVersion: 8.0.0
|
||||
description: LDAP attribute that marks a user as a guest of an instance.
|
||||
introductionVersion: "7.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
@@ -8784,31 +8807,30 @@ OCIS_LDAP_USER_MEMBER_ATTRIBUTE:
|
||||
name: OCIS_LDAP_USER_MEMBER_ATTRIBUTE
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: LDAP Attribute to signal the user is member of an instance. Requires
|
||||
OCIS_MULTI_INSTANCE_ENABLED.
|
||||
introductionVersion: 8.0.0
|
||||
description: LDAP attribute that marks a user as a member of an instance.
|
||||
introductionVersion: "7.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_OBJECTCLASS:
|
||||
name: OCIS_LDAP_USER_OBJECTCLASS;GRAPH_LDAP_USER_OBJECTCLASS
|
||||
name: OCIS_LDAP_USER_OBJECTCLASS;USERS_LDAP_USER_OBJECTCLASS
|
||||
defaultValue: inetOrgPerson
|
||||
type: string
|
||||
description: The object class to use for users in the default user search filter
|
||||
('inetOrgPerson').
|
||||
like 'inetOrgPerson'.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_SCHEMA_DISPLAYNAME:
|
||||
name: OCIS_LDAP_USER_SCHEMA_DISPLAYNAME;GRAPH_LDAP_USER_DISPLAYNAME_ATTRIBUTE
|
||||
defaultValue: displayName
|
||||
name: OCIS_LDAP_USER_SCHEMA_DISPLAYNAME;USERS_LDAP_USER_SCHEMA_DISPLAYNAME
|
||||
defaultValue: displayname
|
||||
type: string
|
||||
description: LDAP Attribute to use for the display name of users.
|
||||
description: LDAP Attribute to use for the displayname of users.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: 'LDAP_USER_SCHEMA_DISPLAY_NAME changing name for consistency | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '
|
||||
deprecationInfo: 'LDAP_USER_SCHEMA_DISPLAY_NAME changing name for consistency | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '
|
||||
OCIS_LDAP_USER_SCHEMA_EXTERNAL_ID:
|
||||
name: OCIS_LDAP_USER_SCHEMA_EXTERNAL_ID;GRAPH_LDAP_EXTERNAL_ID_ATTRIBUTE
|
||||
defaultValue: owncloudExternalID
|
||||
@@ -8821,8 +8843,8 @@ OCIS_LDAP_USER_SCHEMA_EXTERNAL_ID:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_SCHEMA_ID:
|
||||
name: OCIS_LDAP_USER_SCHEMA_ID;GRAPH_LDAP_USER_UID_ATTRIBUTE
|
||||
defaultValue: owncloudUUID
|
||||
name: OCIS_LDAP_USER_SCHEMA_ID;USERS_LDAP_USER_SCHEMA_ID
|
||||
defaultValue: ownclouduuid
|
||||
type: string
|
||||
description: LDAP Attribute to use as the unique ID for users. This should be a
|
||||
stable globally unique ID like a UUID.
|
||||
@@ -8831,18 +8853,18 @@ OCIS_LDAP_USER_SCHEMA_ID:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING:
|
||||
name: OCIS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING;GRAPH_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING
|
||||
name: OCIS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING;USERS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Set this to true if the defined 'ID' attribute for users is of the
|
||||
'OCTETSTRING' syntax. This is required when using the 'objectGUID' attribute of
|
||||
Active Directory for the user ID's.
|
||||
'OCTETSTRING' syntax. This is e.g. required when using the 'objectGUID' attribute
|
||||
of Active Directory for the user ID's.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_SCHEMA_MAIL:
|
||||
name: OCIS_LDAP_USER_SCHEMA_MAIL;GRAPH_LDAP_USER_EMAIL_ATTRIBUTE
|
||||
name: OCIS_LDAP_USER_SCHEMA_MAIL;USERS_LDAP_USER_SCHEMA_MAIL
|
||||
defaultValue: mail
|
||||
type: string
|
||||
description: LDAP Attribute to use for the email address of users.
|
||||
@@ -8851,7 +8873,7 @@ OCIS_LDAP_USER_SCHEMA_MAIL:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_SCHEMA_USER_TYPE:
|
||||
name: OCIS_LDAP_USER_SCHEMA_USER_TYPE;GRAPH_LDAP_USER_TYPE_ATTRIBUTE
|
||||
name: OCIS_LDAP_USER_SCHEMA_USER_TYPE;USERS_LDAP_USER_TYPE_ATTRIBUTE
|
||||
defaultValue: ownCloudUserType
|
||||
type: string
|
||||
description: LDAP Attribute to distinguish between 'Member' and 'Guest' users. Default
|
||||
@@ -8861,7 +8883,7 @@ OCIS_LDAP_USER_SCHEMA_USER_TYPE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_SCHEMA_USERNAME:
|
||||
name: OCIS_LDAP_USER_SCHEMA_USERNAME;GRAPH_LDAP_USER_NAME_ATTRIBUTE
|
||||
name: OCIS_LDAP_USER_SCHEMA_USERNAME;USERS_LDAP_USER_SCHEMA_USERNAME
|
||||
defaultValue: uid
|
||||
type: string
|
||||
description: LDAP Attribute to use for username of users.
|
||||
@@ -8870,17 +8892,17 @@ OCIS_LDAP_USER_SCHEMA_USERNAME:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LDAP_USER_SCOPE:
|
||||
name: OCIS_LDAP_USER_SCOPE;GRAPH_LDAP_USER_SCOPE
|
||||
name: OCIS_LDAP_USER_SCOPE;USERS_LDAP_USER_SCOPE
|
||||
defaultValue: sub
|
||||
type: string
|
||||
description: LDAP search scope to use when looking up users. Supported scopes are
|
||||
description: LDAP search scope to use when looking up users. Supported values are
|
||||
'base', 'one' and 'sub'.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LOG_COLOR:
|
||||
name: OCIS_LOG_COLOR;STORAGE_USERS_LOG_COLOR
|
||||
name: OCIS_LOG_COLOR;USERS_LOG_COLOR
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Activates colorized log output.
|
||||
@@ -8889,7 +8911,7 @@ OCIS_LOG_COLOR:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LOG_FILE:
|
||||
name: OCIS_LOG_FILE;STORAGE_USERS_LOG_FILE
|
||||
name: OCIS_LOG_FILE;USERS_LOG_FILE
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The path to the log file. Activates logging to this file if set.
|
||||
@@ -8898,7 +8920,7 @@ OCIS_LOG_FILE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LOG_LEVEL:
|
||||
name: OCIS_LOG_LEVEL;STORAGE_USERS_LOG_LEVEL
|
||||
name: OCIS_LOG_LEVEL;USERS_LOG_LEVEL
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: 'The log level. Valid values are: ''panic'', ''fatal'', ''error'',
|
||||
@@ -8908,7 +8930,7 @@ OCIS_LOG_LEVEL:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_LOG_PRETTY:
|
||||
name: OCIS_LOG_PRETTY;STORAGE_USERS_LOG_PRETTY
|
||||
name: OCIS_LOG_PRETTY;USERS_LOG_PRETTY
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Activates pretty log output.
|
||||
@@ -8917,23 +8939,23 @@ OCIS_LOG_PRETTY:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_MACHINE_AUTH_API_KEY:
|
||||
name: OCIS_MACHINE_AUTH_API_KEY;STORAGE_USERS_MACHINE_AUTH_API_KEY
|
||||
name: OCIS_MACHINE_AUTH_API_KEY;FRONTEND_MACHINE_AUTH_API_KEY
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: Machine auth API key used to validate internal requests necessary for
|
||||
the access to resources from other services.
|
||||
introductionVersion: "5.0"
|
||||
description: The machine auth API key used to validate internal requests necessary
|
||||
to access resources from other services.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_MAX_CONCURRENCY:
|
||||
name: OCIS_MAX_CONCURRENCY;STORAGE_USERS_S3NG_MAX_CONCURRENCY
|
||||
defaultValue: "5"
|
||||
name: OCIS_MAX_CONCURRENCY;FRONTEND_MAX_CONCURRENCY
|
||||
defaultValue: "1"
|
||||
type: int
|
||||
description: Maximum number of concurrent go-routines. Higher values can potentially
|
||||
get work done faster but will also cause more load on the system. Values of 0
|
||||
or below will be ignored and the default value of 100 will be used.
|
||||
introductionVersion: pre5.0
|
||||
or below will be ignored and the default value will be used.
|
||||
introductionVersion: 7.0.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
@@ -9012,7 +9034,7 @@ OCIS_MULTI_INSTANCE_INSTANCEID:
|
||||
name: OCIS_MULTI_INSTANCE_INSTANCEID
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The unique ID of this instance.
|
||||
description: The unique id of this instance
|
||||
introductionVersion: 8.0.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
@@ -9021,10 +9043,9 @@ OCIS_MULTI_INSTANCE_MASTER_ID:
|
||||
name: OCIS_MULTI_INSTANCE_MASTER_ID
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The master ID that grants access to all instances. Users with this
|
||||
ID in their memberOf or guestOf claims can access any instance. Leave empty to
|
||||
disable.
|
||||
introductionVersion: 8.1.0
|
||||
description: The master instance ID for multi-instance setups. When set, LDAP user
|
||||
filters are enhanced to also match users belonging to the master instance.
|
||||
introductionVersion: "7.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
@@ -9059,16 +9080,17 @@ OCIS_OIDC_CLIENT_ID:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_OIDC_ISSUER:
|
||||
name: OCIS_URL;OCIS_OIDC_ISSUER;AUTH_BEARER_OIDC_ISSUER
|
||||
name: OCIS_URL;OCIS_OIDC_ISSUER;USERS_IDP_URL
|
||||
defaultValue: https://localhost:9200
|
||||
type: string
|
||||
description: URL of the OIDC issuer. It defaults to URL of the builtin IDP.
|
||||
description: The identity provider value to set in the userids of the CS3 user objects
|
||||
for users returned by this user provider.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST:
|
||||
name: OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST;SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST
|
||||
name: OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST;FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: Path to the 'banned passwords list' file. This only impacts public
|
||||
@@ -9078,7 +9100,7 @@ OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PASSWORD_POLICY_DISABLED:
|
||||
name: OCIS_PASSWORD_POLICY_DISABLED;SHARING_PASSWORD_POLICY_DISABLED
|
||||
name: OCIS_PASSWORD_POLICY_DISABLED;FRONTEND_PASSWORD_POLICY_DISABLED
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Disable the password policy. Defaults to false if not set.
|
||||
@@ -9087,7 +9109,7 @@ OCIS_PASSWORD_POLICY_DISABLED:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PASSWORD_POLICY_MIN_CHARACTERS:
|
||||
name: OCIS_PASSWORD_POLICY_MIN_CHARACTERS;SHARING_PASSWORD_POLICY_MIN_CHARACTERS
|
||||
name: OCIS_PASSWORD_POLICY_MIN_CHARACTERS;FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS
|
||||
defaultValue: "8"
|
||||
type: int
|
||||
description: Define the minimum password length. Defaults to 8 if not set.
|
||||
@@ -9096,7 +9118,7 @@ OCIS_PASSWORD_POLICY_MIN_CHARACTERS:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PASSWORD_POLICY_MIN_DIGITS:
|
||||
name: OCIS_PASSWORD_POLICY_MIN_DIGITS;SHARING_PASSWORD_POLICY_MIN_DIGITS
|
||||
name: OCIS_PASSWORD_POLICY_MIN_DIGITS;FRONTEND_PASSWORD_POLICY_MIN_DIGITS
|
||||
defaultValue: "1"
|
||||
type: int
|
||||
description: Define the minimum number of digits. Defaults to 1 if not set.
|
||||
@@ -9105,7 +9127,7 @@ OCIS_PASSWORD_POLICY_MIN_DIGITS:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS:
|
||||
name: OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS;SHARING_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS
|
||||
name: OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS;FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS
|
||||
defaultValue: "1"
|
||||
type: int
|
||||
description: Define the minimum number of uppercase letters. Defaults to 1 if not
|
||||
@@ -9115,7 +9137,7 @@ OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS:
|
||||
name: OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS;SHARING_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS
|
||||
name: OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS;FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS
|
||||
defaultValue: "1"
|
||||
type: int
|
||||
description: Define the minimum number of characters from the special characters
|
||||
@@ -9125,7 +9147,7 @@ OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS:
|
||||
name: OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS;SHARING_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS
|
||||
name: OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS;FRONTEND_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS
|
||||
defaultValue: "1"
|
||||
type: int
|
||||
description: Define the minimum number of lowercase letters. Defaults to 1 if not
|
||||
@@ -9135,54 +9157,54 @@ OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PERSISTENT_STORE:
|
||||
name: OCIS_PERSISTENT_STORE;NOTIFICATIONS_STORE
|
||||
name: OCIS_PERSISTENT_STORE;EVENTHISTORY_STORE
|
||||
defaultValue: nats-js-kv
|
||||
type: string
|
||||
description: 'The type of the store. Supported values are: ''memory'', ''nats-js-kv'',
|
||||
''redis-sentinel'', ''noop''. See the text description for details.'
|
||||
introductionVersion: 7.1.0
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PERSISTENT_STORE_AUTH_PASSWORD:
|
||||
name: OCIS_PERSISTENT_STORE_AUTH_PASSWORD;NOTIFICATIONS_STORE_AUTH_PASSWORD
|
||||
name: OCIS_PERSISTENT_STORE_AUTH_PASSWORD;EVENTHISTORY_STORE_AUTH_PASSWORD
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The password to authenticate with the store. Only applies when store
|
||||
type 'nats-js-kv' is configured.
|
||||
introductionVersion: 7.1.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PERSISTENT_STORE_AUTH_USERNAME:
|
||||
name: OCIS_PERSISTENT_STORE_AUTH_USERNAME;NOTIFICATIONS_STORE_AUTH_USERNAME
|
||||
name: OCIS_PERSISTENT_STORE_AUTH_USERNAME;EVENTHISTORY_STORE_AUTH_USERNAME
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The username to authenticate with the store. Only applies when store
|
||||
type 'nats-js-kv' is configured.
|
||||
introductionVersion: 7.1.0
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PERSISTENT_STORE_NODES:
|
||||
name: OCIS_PERSISTENT_STORE_NODES;NOTIFICATIONS_STORE_NODES
|
||||
name: OCIS_PERSISTENT_STORE_NODES;EVENTHISTORY_STORE_NODES
|
||||
defaultValue: '[127.0.0.1:9233]'
|
||||
type: '[]string'
|
||||
description: 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: 7.1.0
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_PERSISTENT_STORE_TTL:
|
||||
name: OCIS_PERSISTENT_STORE_TTL;NOTIFICATIONS_STORE_TTL
|
||||
name: OCIS_PERSISTENT_STORE_TTL;EVENTHISTORY_STORE_TTL
|
||||
defaultValue: 336h0m0s
|
||||
type: Duration
|
||||
description: 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
|
||||
description: 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
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
@@ -9227,7 +9249,7 @@ OCIS_REVA_GATEWAY_TLS_MODE:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_SERVICE_ACCOUNT_ID:
|
||||
name: OCIS_SERVICE_ACCOUNT_ID;STORAGE_USERS_SERVICE_ACCOUNT_ID
|
||||
name: OCIS_SERVICE_ACCOUNT_ID;FRONTEND_SERVICE_ACCOUNT_ID
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The ID of the service account the service should use. See the 'auth-service'
|
||||
@@ -9237,7 +9259,7 @@ OCIS_SERVICE_ACCOUNT_ID:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_SERVICE_ACCOUNT_SECRET:
|
||||
name: OCIS_SERVICE_ACCOUNT_SECRET;STORAGE_USERS_SERVICE_ACCOUNT_SECRET
|
||||
name: OCIS_SERVICE_ACCOUNT_SECRET;FRONTEND_SERVICE_ACCOUNT_SECRET
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The service account secret.
|
||||
@@ -9246,7 +9268,7 @@ OCIS_SERVICE_ACCOUNT_SECRET:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD:
|
||||
name: OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD;SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD
|
||||
name: OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD
|
||||
defaultValue: "true"
|
||||
type: bool
|
||||
description: Set this to true if you want to enforce passwords on all public shares.
|
||||
@@ -9255,22 +9277,21 @@ OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD:
|
||||
name: OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD;SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD
|
||||
name: OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Set this to true if you want to enforce passwords on Uploader, Editor
|
||||
or Contributor shares.
|
||||
description: Set this to true if you want to enforce passwords for writable shares.
|
||||
Only effective if the setting for 'passwords on all public shares' is set to false.
|
||||
introductionVersion: "5.0"
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_SPACES_MAX_QUOTA:
|
||||
name: OCIS_SPACES_MAX_QUOTA;STORAGE_USERS_OCIS_MAX_QUOTA
|
||||
name: OCIS_SPACES_MAX_QUOTA;FRONTEND_MAX_QUOTA
|
||||
defaultValue: "0"
|
||||
type: uint64
|
||||
description: Set a global max quota for spaces in bytes. A value of 0 equals unlimited.
|
||||
If not using the global OCIS_SPACES_MAX_QUOTA, you must define the FRONTEND_MAX_QUOTA
|
||||
in the frontend service.
|
||||
description: Set the global max quota value in bytes. A value of 0 equals unlimited.
|
||||
The value is provided via capabilities.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
@@ -9297,7 +9318,7 @@ OCIS_SYSTEM_USER_ID:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_SYSTEM_USER_IDP:
|
||||
name: OCIS_SYSTEM_USER_IDP;SETTINGS_SYSTEM_USER_IDP
|
||||
name: OCIS_SYSTEM_USER_IDP;SHARING_PUBLIC_CS3_SYSTEM_USER_IDP
|
||||
defaultValue: internal
|
||||
type: string
|
||||
description: IDP of the oCIS STORAGE-SYSTEM system user.
|
||||
@@ -9306,7 +9327,7 @@ OCIS_SYSTEM_USER_IDP:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_TRACING_COLLECTOR:
|
||||
name: OCIS_TRACING_COLLECTOR;STORAGE_USERS_TRACING_COLLECTOR
|
||||
name: OCIS_TRACING_COLLECTOR;USERS_TRACING_COLLECTOR
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The HTTP endpoint for sending spans directly to a collector, i.e. http://jaeger-collector:14268/api/traces.
|
||||
@@ -9316,7 +9337,7 @@ OCIS_TRACING_COLLECTOR:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_TRACING_ENABLED:
|
||||
name: OCIS_TRACING_ENABLED;STORAGE_USERS_TRACING_ENABLED
|
||||
name: OCIS_TRACING_ENABLED;USERS_TRACING_ENABLED
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Activates tracing.
|
||||
@@ -9325,7 +9346,7 @@ OCIS_TRACING_ENABLED:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_TRACING_ENDPOINT:
|
||||
name: OCIS_TRACING_ENDPOINT;STORAGE_USERS_TRACING_ENDPOINT
|
||||
name: OCIS_TRACING_ENDPOINT;USERS_TRACING_ENDPOINT
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The endpoint of the tracing agent.
|
||||
@@ -9334,7 +9355,7 @@ OCIS_TRACING_ENDPOINT:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_TRACING_TYPE:
|
||||
name: OCIS_TRACING_TYPE;STORAGE_USERS_TRACING_TYPE
|
||||
name: OCIS_TRACING_TYPE;USERS_TRACING_TYPE
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The type of tracing. Defaults to '', which is the same as 'jaeger'.
|
||||
@@ -9347,13 +9368,13 @@ OCIS_TRANSFER_SECRET:
|
||||
name: OCIS_TRANSFER_SECRET
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The storage transfer secret.
|
||||
description: Transfer secret for signing file up- and download requests.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_TRANSLATION_PATH:
|
||||
name: OCIS_TRANSLATION_PATH;NOTIFICATIONS_TRANSLATION_PATH
|
||||
name: OCIS_TRANSLATION_PATH;USERLOG_TRANSLATION_PATH
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: (optional) Set this to a path with custom translations to overwrite
|
||||
@@ -9364,30 +9385,30 @@ OCIS_TRANSLATION_PATH:
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_URL:
|
||||
name: OCIS_URL;OCIS_OIDC_ISSUER;AUTH_BEARER_OIDC_ISSUER
|
||||
name: OCIS_URL;OCIS_OIDC_ISSUER;USERS_IDP_URL
|
||||
defaultValue: https://localhost:9200
|
||||
type: string
|
||||
description: URL of the OIDC issuer. It defaults to URL of the builtin IDP.
|
||||
description: The identity provider value to set in the userids of the CS3 user objects
|
||||
for users returned by this user provider.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES:
|
||||
name: OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES
|
||||
name: OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES;FRONTEND_USER_SEARCH_DISPLAYED_ATTRIBUTES
|
||||
defaultValue: '[]'
|
||||
type: '[]string'
|
||||
description: The attributes to display in the user search results.
|
||||
description: A list of user attributes to display in the user search results.
|
||||
introductionVersion: 7.3.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
OCIS_WOPI_DISABLE_CHAT:
|
||||
name: COLLABORATION_WOPI_DISABLE_CHAT;OCIS_WOPI_DISABLE_CHAT
|
||||
name: APP_PROVIDER_WOPI_DISABLE_CHAT;OCIS_WOPI_DISABLE_CHAT
|
||||
defaultValue: "false"
|
||||
type: bool
|
||||
description: Disable chat in the office web frontend. This feature applies to OnlyOffice
|
||||
and Microsoft.
|
||||
introductionVersion: 7.0.0
|
||||
description: Disable the chat functionality of the office app.
|
||||
introductionVersion: pre5.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
deprecationInfo: ""
|
||||
@@ -10697,9 +10718,11 @@ PROXY_AUTOPROVISION_CLAIM_EMAIL:
|
||||
deprecationInfo: ""
|
||||
PROXY_AUTOPROVISION_CLAIM_GROUPS:
|
||||
name: PROXY_AUTOPROVISION_CLAIM_GROUPS
|
||||
defaultValue: groups
|
||||
defaultValue: ""
|
||||
type: string
|
||||
description: The name of the OIDC claim that holds the groups.
|
||||
description: The name of the OIDC claim that holds the groups. When empty (the default),
|
||||
group membership sync is disabled and groups are not created from claim values.
|
||||
Set it (e.g. to 'groups') to enable syncing and creating groups from the claim.
|
||||
introductionVersion: 6.1.0
|
||||
deprecationVersion: ""
|
||||
removalVersion: ""
|
||||
|
||||
@@ -19,7 +19,6 @@ oCIS deployments are super simple, yet there are many configurations possible fo
|
||||
- [Basic oCIS setup]({{< ref "basic-remote-setup" >}}) - configure domain, certificates and port
|
||||
- [oCIS setup with Keycloak as identity provider]({{< ref "ocis_keycloak" >}})
|
||||
- [Flexible oCIS setup with WebOffice and Search capabilities]({{< ref "ocis_full" >}})
|
||||
- [Parallel deployment of oC10 and oCIS]({{< ref "oc10_ocis_parallel" >}})
|
||||
- [oCIS with the Hello extension example]({{< ref "ocis_hello" >}})
|
||||
|
||||
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
---
|
||||
title: "Parallel deployment of oC10 and oCIS"
|
||||
date: 2020-10-12T14:04:00+01:00
|
||||
weight: 24
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/ocis/deployment
|
||||
geekdocFilePath: oc10_ocis_parallel.md
|
||||
---
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
## Overview
|
||||
|
||||
- This setup reflects [stage 6 of the oC10 to oCIS migration plan]({{< ref "migration#stage-6-parallel-deployment" >}})
|
||||
- Traefik generating self-signed certificates for local setup or obtaining valid SSL certificates for a server setup
|
||||
- OpenLDAP server with demo users
|
||||
- LDAP admin interface to edit users
|
||||
- Keycloak as OpenID Connect provider in federation with the LDAP server
|
||||
- ownCloud Classic with MariaDB and Redis
|
||||
- ownCloud Classic is configured to synchronize users from the LDAP server
|
||||
- ownCloud Classic is used to use OpenID Connect for authentication with Keycloak
|
||||
- oCIS running behind Traefik as reverse proxy
|
||||
- oCIS is using the ownCloudSQL storage driver on the same files and same database as ownCloud Classic
|
||||
- oCIS is using Keycloak as OpenID Connect provider
|
||||
- oCIS is using the LDAP server as user backend
|
||||
- All requests to both oCIS and oC10 are routed through the oCIS proxy and will be routed based on an OIDC claim to one of them. Therefore admins can change on a user basis in the LDAP which backend is used.
|
||||
|
||||
[Find this example on GitHub](https://github.com/owncloud/ocis/tree/master/deployments/examples/oc10_ocis_parallel)
|
||||
|
||||
## Server Deployment
|
||||
|
||||
### Requirements
|
||||
|
||||
- Linux server with docker and docker-compose installed
|
||||
- four domains set up and pointing to your server
|
||||
- cloud.\* for serving oCIS
|
||||
- keycloak.\* for serving Keycloak
|
||||
- ldap .\* for serving the LDAP management UI
|
||||
- traefik.\* for serving the Traefik dashboard
|
||||
|
||||
See also [example server setup]({{< ref "preparing_server" >}})
|
||||
|
||||
### Install this example
|
||||
|
||||
- Clone oCIS repository
|
||||
|
||||
`git clone https://github.com/owncloud/ocis.git`
|
||||
|
||||
- Go to the deployment example
|
||||
|
||||
`cd ocis/deployment/examples/oc10_ocis_parallel`
|
||||
|
||||
- Open the `.env` file in a text editor
|
||||
The file by default looks like this:
|
||||
|
||||
```bash
|
||||
# If you're on a internet facing server please comment out following line.
|
||||
# It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates.
|
||||
INSECURE=true
|
||||
|
||||
### Traefik settings ###
|
||||
TRAEFIK_LOG_LEVEL=
|
||||
# Serve Traefik dashboard. Defaults to "false".
|
||||
TRAEFIK_DASHBOARD=
|
||||
# Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test"
|
||||
TRAEFIK_DOMAIN=
|
||||
# Basic authentication for the dashboard. Defaults to user "admin" and password "admin"
|
||||
TRAEFIK_BASIC_AUTH_USERS=
|
||||
# Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server
|
||||
TRAEFIK_ACME_MAIL=
|
||||
|
||||
### shared oCIS / oC10 settings ###
|
||||
# Domain of oCIS / oC10, where you can find the frontend. Defaults to "cloud.owncloud.test"
|
||||
CLOUD_DOMAIN=
|
||||
|
||||
### oCIS settings ###
|
||||
# oCIS version. Defaults to "latest"
|
||||
OCIS_DOCKER_TAG=
|
||||
# JWT secret which is used for the storage provider. Must be changed in order to have a secure oCIS. Defaults to "Pive-Fumkiu4"
|
||||
OCIS_JWT_SECRET=
|
||||
# JWT secret which is used for uploads to create transfer tokens. Must be changed in order to have a secure oCIS. Defaults to "replace-me-with-a-transfer-secret"
|
||||
STORAGE_TRANSFER_SECRET=
|
||||
# Machine auth api key secret. Must be changed in order to have a secure oCIS. Defaults to "change-me-please"
|
||||
OCIS_MACHINE_AUTH_API_KEY=
|
||||
|
||||
### oCIS settings ###
|
||||
# oC10 version. Defaults to "latest"
|
||||
OC10_DOCKER_TAG=
|
||||
# client secret which the openidconnect app uses to authenticate to Keycloak. Defaults to "oc10-oidc-secret"
|
||||
OC10_OIDC_CLIENT_SECRET=
|
||||
# app which will be shown when opening the ownCloud Classic UI. Defaults to "files" but also could be set to "web"
|
||||
OWNCLOUD_DEFAULT_APP=
|
||||
# if set to "false" (default) links will be opened in the classic UI, if set to "true" ownCloud Web is used
|
||||
OWNCLOUD_WEB_REWRITE_LINKS=
|
||||
|
||||
### LDAP settings ###
|
||||
# password for the LDAP admin user "cn=admin,dc=owncloud,dc=com", defaults to "admin"
|
||||
LDAP_ADMIN_PASSWORD=
|
||||
# Domain of the LDAP management frontend. Defaults to "ldap.owncloud.test"
|
||||
LDAP_MANAGER_DOMAIN=
|
||||
|
||||
### Keycloak ###
|
||||
# Domain of Keycloak, where you can find the management and authentication frontend. Defaults to "keycloak.owncloud.test"
|
||||
KEYCLOAK_DOMAIN=
|
||||
# Realm which to be used with oC10 and oCIS. Defaults to "owncloud"
|
||||
KEYCLOAK_REALM=
|
||||
# Admin user login name. Defaults to "admin"
|
||||
KEYCLOAK_ADMIN_USER=
|
||||
# Admin user login password. Defaults to "admin"
|
||||
KEYCLOAK_ADMIN_PASSWORD=
|
||||
```
|
||||
|
||||
You are installing oCIS on a server and Traefik will obtain valid certificates for you so please remove `INSECURE=true` or set it to `false`.
|
||||
|
||||
If you want to use the Traefik dashboard, set TRAEFIK_DASHBOARD to `true` (default is `false` and therefore not active). If you activate it, you must set a domain for the Traefik dashboard in `TRAEFIK_DOMAIN=` e.g. `TRAEFIK_DOMAIN=traefik.owncloud.test`.
|
||||
|
||||
The Traefik dashboard is secured by basic auth. Default credentials are the user `admin` with the password `admin`. To set your own credentials, generate a htpasswd (e.g. by using [an online tool](https://htpasswdgenerator.de/) or a cli tool).
|
||||
|
||||
Traefik will issue certificates with LetsEncrypt and therefore you must set an email address in `TRAEFIK_ACME_MAIL=`.
|
||||
|
||||
By default oCIS will be started in the `latest` version. If you want to start a specific version of oCIS set the version to `OCIS_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/owncloud/ocis/tags?page=1&ordering=last_updated).
|
||||
|
||||
Set your domain for the oC10 and oCIS frontend in `CLOUD_DOMAIN=`, e.g. `CLOUD_DOMAIN=cloud.owncloud.test`.
|
||||
|
||||
By default ownCloud Classic will be started in the `latest` version. If you want to start a specific version of oCIS set the version to `OC10_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/owncloud/ocis/tags?page=1&ordering=last_updated).
|
||||
|
||||
You can switch the default application of ownCloud Classic by setting`OWNCLOUD_DEFAULT_APP=files` in oder to have the classic UI as frontend, which is also the default. If you prefer ownCloud Web as the default application in ownCloud Classic just set `OWNCLOUD_DEFAULT_APP=web`.
|
||||
|
||||
In oder to change the default link open action which defaults to the classic UI (`OWNCLOUD_WEB_REWRITE_LINKS=false`) you can set it to `OWNCLOUD_WEB_REWRITE_LINKS=true`. This will lead to links being opened in ownCloud Web.
|
||||
|
||||
The OpenLDAP server in this example deployment has an admin users, which is also used as bind user in order to keep these examples simple. You can change the default password "admin" to a different one by setting it to `LDAP_ADMIN_PASSWORD=...`.
|
||||
|
||||
Set your domain for the LDAP manager UI in `LDAP_MANAGER_DOMAIN=`, e.g. `ldap.owncloud.test`.
|
||||
|
||||
Set your domain for the Keycloak administration panel and authentication endpoints to `KEYCLOAK_DOMAIN=` e.g. `KEYCLOAK_DOMAIN=keycloak.owncloud.test`.
|
||||
|
||||
Changing the used Keycloak realm can be done by setting `KEYCLOAK_REALM=`. This defaults to the ownCloud realm `KEYCLOAK_REALM=owncloud`. The ownCloud realm will be automatically imported on startup and includes our demo users.
|
||||
|
||||
You probably should secure your Keycloak admin account by setting `KEYCLOAK_ADMIN_USER=` and `KEYCLOAK_ADMIN_PASSWORD=` to values other than `admin`.
|
||||
|
||||
Now you have configured everything and can save the file.
|
||||
|
||||
- Start the docker stack
|
||||
|
||||
`docker-compose up -d`
|
||||
|
||||
- You now can visit the cloud, oC10 or oCIS depending on the user configuration. Marie defaults to oC10 and Richard and Einstein default to oCIS, but you can change the ownCloud selector at any time in the LDAP management UI.
|
||||
|
||||
## Local setup
|
||||
|
||||
For a more simple local ocis setup see [Getting started]({{< ref "../getting-started" >}})
|
||||
|
||||
This docker stack can also be run locally. One downside is that Traefik can not obtain valid SSL certificates and therefore will create self-signed ones. This means that your browser will show scary warnings. Another downside is that you can not point DNS entries to your localhost. So you have to add static host entries to your computer.
|
||||
|
||||
On Linux and macOS you can add them to your `/etc/hosts` file and on Windows to `C:\Windows\System32\Drivers\etc\hosts` file like this:
|
||||
|
||||
```
|
||||
127.0.0.1 cloud.owncloud.test
|
||||
127.0.0.1 keycloak.owncloud.test
|
||||
127.0.0.1 ldap.owncloud.test
|
||||
127.0.0.1 traefik.owncloud.test
|
||||
```
|
||||
|
||||
After that you're ready to start the application stack:
|
||||
|
||||
`docker-compose up -d`
|
||||
|
||||
You now can visit the cloud, oC10 or oCIS depending on the user configuration. Marie defaults to oC10 and Richard and Einstein default to oCIS, but you can change the ownCloud selector at any time in the LDAP management UI.
|
||||
@@ -78,20 +78,6 @@ documentation resources:
|
||||
| decline received share | shared resource should not be shown to the receiver | |
|
||||
|
||||
|
||||
## parallel deployment
|
||||
|
||||
- [configure ocis with LDAP](https://owncloud.dev/ocis/deployment/ocis_ldap/)
|
||||
- [setup oC10 and ocis in parallel](https://owncloud.dev/ocis/deployment/oc10_ocis_parallel/)
|
||||
- create users and groups in LDAP
|
||||
|
||||
documentation resources:
|
||||
- [sharing API is compatible to ownCloud Classic](https://doc.owncloud.com/server/10.9/developer_manual/core/apis/ocs-share-api.html)
|
||||
|
||||
| Test Case | Expected Result | Comment |
|
||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|---------|
|
||||
| share file / folder to a group in one implementation (use different permissions), access the items with the other implementation, try to violate the permissions | receiver should not be able to violate the permissions | |
|
||||
| share file / folder to a group, remove member from group in LDAP, try to access items with the removed member from both implementations | removed member should not have access to the shared item | |
|
||||
|
||||
## Spaces
|
||||
|
||||
Prerequisite:
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// # Added Variables between oCIS 8.1.0 and oCIS 8.2.0
|
||||
// commenting the headline to make it better includable
|
||||
|
||||
// table created per 2026.07.09
|
||||
// the table should be recreated/updated on source () changes
|
||||
|
||||
[width="100%",cols="~,~,~,~",options="header"]
|
||||
|===
|
||||
| Service | Variable | Description | Default
|
||||
|
||||
| xref:deployment/services/env-vars-special-scope.adoc[Special Scope Envvars]
|
||||
| OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE
|
||||
| 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.
|
||||
| true
|
||||
|
||||
| xref:{s-path}/graph.adoc[Graph]
|
||||
| GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE
|
||||
| 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.
|
||||
| true
|
||||
|
||||
|
|
||||
| GRAPH_RECEIVED_SHARES_STAT_TIMEOUT
|
||||
| The maximum duration to wait for the storage to respond while resolving a single received share's resource when listing 'sharedWithMe'. Bounding each resource lookup individually prevents one slow or unreachable resource from consuming the request deadline shared by all the other shares. A share whose resource cannot be statted within this time is still listed as a degraded item instead of being dropped. Defaults to '10s'. See the Environment Variable Types description for more details.
|
||||
| 10s
|
||||
|
||||
|===
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// # Deprecated Variables between oCIS 8.1.0 and oCIS 8.2.0
|
||||
// commenting the headline to make it better includable
|
||||
|
||||
// table created per 2026.07.09
|
||||
// the table should be recreated/updated on source () changes
|
||||
|
||||
[width="100%",cols="~,~,~,~,~",options="header"]
|
||||
|===
|
||||
| Service | Variable | Description | Removal Version | Deprecation Info
|
||||
|
||||
|===
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// # Removed Variables between oCIS 8.1.0 and oCIS 8.2.0
|
||||
// commenting the headline to make it better includable
|
||||
|
||||
// table created per 2026.07.09
|
||||
// the table should be recreated/updated on source () changes
|
||||
|
||||
[width="100%",cols="~,~,~,~",options="header"]
|
||||
|===
|
||||
| Service | Variable | Description | Default
|
||||
|
||||
|===
|
||||
|
||||
@@ -10,10 +10,10 @@ require (
|
||||
github.com/MicahParks/keyfunc/v2 v2.1.0
|
||||
github.com/Nerzal/gocloak/v13 v13.9.0
|
||||
github.com/bbalet/stopwords v1.0.0
|
||||
github.com/beevik/etree v1.6.0
|
||||
github.com/beevik/etree v1.7.0
|
||||
github.com/blevesearch/bleve/v2 v2.6.0
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible
|
||||
github.com/coreos/go-oidc/v3 v3.19.0
|
||||
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
|
||||
@@ -21,10 +21,10 @@ require (
|
||||
github.com/egirna/icap-client v0.1.1
|
||||
github.com/gabriel-vasile/mimetype v1.4.13
|
||||
github.com/ggwhite/go-masker v1.1.0
|
||||
github.com/go-chi/chi/v5 v5.3.0
|
||||
github.com/go-chi/chi/v5 v5.3.1
|
||||
github.com/go-chi/httprate v0.16.0
|
||||
github.com/go-chi/render v1.0.3
|
||||
github.com/go-ldap/ldap/v3 v3.4.13
|
||||
github.com/go-ldap/ldap/v3 v3.4.14
|
||||
github.com/go-ldap/ldif v0.0.0-20200320164324-fd88d9b715b3
|
||||
github.com/go-micro/plugins/v4/client/grpc v1.2.1
|
||||
github.com/go-micro/plugins/v4/logger/zerolog v1.2.0
|
||||
@@ -50,7 +50,7 @@ require (
|
||||
github.com/jellydator/ttlcache/v3 v3.4.1
|
||||
github.com/jinzhu/now v1.1.5
|
||||
github.com/justinas/alice v1.2.0
|
||||
github.com/kovidgoyal/imaging v1.8.22
|
||||
github.com/kovidgoyal/imaging v1.8.23
|
||||
github.com/leonelquinteros/gotext v1.7.2
|
||||
github.com/libregraph/idm v0.5.0
|
||||
github.com/libregraph/lico v0.67.0
|
||||
@@ -66,7 +66,7 @@ require (
|
||||
github.com/open-policy-agent/opa v1.18.2
|
||||
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-20260708103305-e819417ccd12
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260722150855-b3f3d8e889a3
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/pkg/xattr v0.4.12
|
||||
github.com/prometheus/client_golang v1.23.2
|
||||
@@ -96,16 +96,16 @@ require (
|
||||
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.53.0
|
||||
golang.org/x/crypto v0.54.0
|
||||
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f
|
||||
golang.org/x/image v0.43.0
|
||||
golang.org/x/net v0.56.0
|
||||
golang.org/x/image v0.44.0
|
||||
golang.org/x/net v0.57.0
|
||||
golang.org/x/oauth2 v0.36.0
|
||||
golang.org/x/sync v0.21.0
|
||||
golang.org/x/term v0.44.0
|
||||
golang.org/x/text v0.38.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.0
|
||||
google.golang.org/grpc v1.82.1
|
||||
google.golang.org/protobuf v1.36.11
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
gotest.tools/v3 v3.5.2
|
||||
@@ -186,7 +186,7 @@ require (
|
||||
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-0.20250403174932-29230038a667 // 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
|
||||
@@ -341,10 +341,10 @@ require (
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.4 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||
golang.org/x/mod v0.36.0 // indirect
|
||||
golang.org/x/sys v0.46.0 // indirect
|
||||
golang.org/x/mod v0.37.0 // indirect
|
||||
golang.org/x/sys v0.47.0 // indirect
|
||||
golang.org/x/time v0.15.0 // indirect
|
||||
golang.org/x/tools v0.45.0 // indirect
|
||||
golang.org/x/tools v0.47.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
|
||||
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
|
||||
|
||||
@@ -104,8 +104,8 @@ github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ
|
||||
github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk=
|
||||
github.com/bbalet/stopwords v1.0.0 h1:0TnGycCtY0zZi4ltKoOGRFIlZHv0WqpoIGUsObjztfo=
|
||||
github.com/bbalet/stopwords v1.0.0/go.mod h1:sAWrQoDMfqARGIn4s6dp7OW7ISrshUD8IP2q3KoqPjc=
|
||||
github.com/beevik/etree v1.6.0 h1:u8Kwy8pp9D9XeITj2Z0XtA5qqZEmtJtuXZRQi+j03eE=
|
||||
github.com/beevik/etree v1.6.0/go.mod h1:bh4zJxiIr62SOf9pRzN7UUYaEDa9HEKafK25+sLc0Gc=
|
||||
github.com/beevik/etree v1.7.0 h1:xjBk9O4p4x7D1YajePjfLzdaFC4/uYUENA7P0pv6gXA=
|
||||
github.com/beevik/etree v1.7.0/go.mod h1:bh4zJxiIr62SOf9pRzN7UUYaEDa9HEKafK25+sLc0Gc=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
@@ -188,8 +188,8 @@ github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJ
|
||||
github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=
|
||||
github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/coreos/go-oidc/v3 v3.19.0 h1:F/xyOi3x1UnG1U27YVnM1N6bHiL1K2upi6U/0qr8r+I=
|
||||
github.com/coreos/go-oidc/v3 v3.19.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4=
|
||||
github.com/coreos/go-oidc/v3 v3.20.0 h1:EtE0WIBHk03N+DqGkY4+UONzzZHk7amKt6IyNd7OsZE=
|
||||
github.com/coreos/go-oidc/v3 v3.20.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4=
|
||||
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
|
||||
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
|
||||
github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA=
|
||||
@@ -286,10 +286,10 @@ github.com/go-acme/lego/v4 v4.34.0 h1:oRsIuPJ4ORX7ufviXvelUpBSez2XxeKGwo5pNG9BVe
|
||||
github.com/go-acme/lego/v4 v4.34.0/go.mod h1:gsmdlx/ZS6OUeXbOj0U+VnCLLfEFj4WCYRkcGpZw+pc=
|
||||
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-asn1-ber/asn1-ber v1.4.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 h1:BP4M0CvQ4S3TGls2FvczZtj5Re/2ZzkV9VwqPHH/3Bo=
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-chi/chi/v5 v5.3.0 h1:halUjDxhshgXHMrao5bB8eNBXo/rnzwr8m5m36glehM=
|
||||
github.com/go-chi/chi/v5 v5.3.0/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8 h1:H9AZkK22UOmfX8J84ubyaZxKJZ3FMHVwn8swoMML7iQ=
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-chi/chi/v5 v5.3.1 h1:3j4HZLGZQ3JpMCrPJF/Jl3mYJfWLKBfNJ6quurUGCf8=
|
||||
github.com/go-chi/chi/v5 v5.3.1/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=
|
||||
github.com/go-chi/httprate v0.16.0 h1:8V5DH9j6pSK6UQoBsTpvMyFxycqaKEIToyPKzHJjUa8=
|
||||
github.com/go-chi/httprate v0.16.0/go.mod h1:A8lo+qRhk+s9LiuP5saS7XCGDXRXMcrueq0NfIuCa/I=
|
||||
github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
|
||||
@@ -317,8 +317,8 @@ github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBj
|
||||
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
|
||||
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
|
||||
github.com/go-ldap/ldap/v3 v3.1.7/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q=
|
||||
github.com/go-ldap/ldap/v3 v3.4.13 h1:+x1nG9h+MZN7h/lUi5Q3UZ0fJ1GyDQYbPvbuH38baDQ=
|
||||
github.com/go-ldap/ldap/v3 v3.4.13/go.mod h1:LxsGZV6vbaK0sIvYfsv47rfh4ca0JXokCoKjZxsszv0=
|
||||
github.com/go-ldap/ldap/v3 v3.4.14 h1:D6PYdEgsaVzsXyr6w/yDC06Ria4uUhWm+Rb+er8lfAs=
|
||||
github.com/go-ldap/ldap/v3 v3.4.14/go.mod h1:S4eJUMUNjDkE0ZJtIZdybwyb03sGGLW6gxXT1Hs8VKA=
|
||||
github.com/go-ldap/ldif v0.0.0-20200320164324-fd88d9b715b3 h1:sfz1YppV05y4sYaW7kXZtrocU/+vimnIWt4cxAYh7+o=
|
||||
github.com/go-ldap/ldif v0.0.0-20200320164324-fd88d9b715b3/go.mod h1:ZXFhGda43Z2TVbfGZefXyMJzsDHhCh0go3bZUcwTx7o=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
@@ -597,8 +597,8 @@ github.com/kovidgoyal/go-parallel v1.1.1 h1:1OzpNjtrUkBPq3UaqrnvOoB2F9RttSt811ui
|
||||
github.com/kovidgoyal/go-parallel v1.1.1/go.mod h1:BJNIbe6+hxyFWv7n6oEDPj3PA5qSw5OCtf0hcVxWJiw=
|
||||
github.com/kovidgoyal/go-shm v1.0.0 h1:HJEel9D1F9YhULvClEHJLawoRSj/1u/EDV7MJbBPgQo=
|
||||
github.com/kovidgoyal/go-shm v1.0.0/go.mod h1:Yzb80Xf9L3kaoB2RGok9hHwMIt7Oif61kT6t3+VnZds=
|
||||
github.com/kovidgoyal/imaging v1.8.22 h1:CtpoRXQpS79xxJsKu8+LUJJE/0i4FLquJZy0QH+QNlM=
|
||||
github.com/kovidgoyal/imaging v1.8.22/go.mod h1:y8wo4JTv4D+skbtQf6fHg8nA1qtagvCcn8J2Nu5k2Jg=
|
||||
github.com/kovidgoyal/imaging v1.8.23 h1:4WsboyQ/E8tic2kX49P93Rvscg33SPsCwTBG5EZZF54=
|
||||
github.com/kovidgoyal/imaging v1.8.23/go.mod h1:k3Iot3H0v2rSWXIxQISfT3e9wIryqzAHLHCuhG7z9lM=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
@@ -739,12 +739,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-20260707214005-0145c931d5c6 h1:cROX7fxbLXan3j3dYrYRZJ87DsNjPOfmQB42F0V7XYU=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260707214005-0145c931d5c6/go.mod h1:ssd3xexLs7ODkiWPZO7WnocuA/eAf6dpqP8Uc72KlIY=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260707221101-9930ac7c742f h1:IKnQSwGCaApB7YFAxz4lTkR57rzNzpEQ7E2BANj+FIs=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260707221101-9930ac7c742f/go.mod h1:ssd3xexLs7ODkiWPZO7WnocuA/eAf6dpqP8Uc72KlIY=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260708103305-e819417ccd12 h1:F5yCaIEKPNRfn8QK2Zg+T1hbMEd93UTJPNR9h1XDakQ=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260708103305-e819417ccd12/go.mod h1:m2fGRZDsnNSBszbnwysuq7uhlitQ90+weX4FFQRdkak=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260722150855-b3f3d8e889a3 h1:I0TINypq76zgV6bKXJgefErreWmPDNRzbI2B47DIngw=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260722150855-b3f3d8e889a3/go.mod h1:m2fGRZDsnNSBszbnwysuq7uhlitQ90+weX4FFQRdkak=
|
||||
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=
|
||||
@@ -774,8 +770,6 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pquerna/cachecontrol v0.2.0 h1:vBXSNuE5MYP9IJ5kjsdo8uq+w41jSPgvba2DEnkRx9k=
|
||||
github.com/pquerna/cachecontrol v0.2.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI=
|
||||
github.com/prometheus/alertmanager v0.33.0 h1:AAVa3wpCsaDxisTUUPXx+1qhnA2mx0f8Cc+smpAtN7w=
|
||||
github.com/prometheus/alertmanager v0.33.0/go.mod h1:V06Uc8EZ5X5wLOJRGhtXx+EE2LgrinFIADbKWMVm1RY=
|
||||
github.com/prometheus/alertmanager v0.33.1 h1:PJHGvTdb8Q0ZEpJnWff120WxB2kxIScLa707AaIudTo=
|
||||
github.com/prometheus/alertmanager v0.33.1/go.mod h1:V06Uc8EZ5X5wLOJRGhtXx+EE2LgrinFIADbKWMVm1RY=
|
||||
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
@@ -956,16 +950,10 @@ 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.12 h1:OLOZUKEuAA36TR48F0cIaa8FdzrWygjyfrJxXg4iDgs=
|
||||
go.etcd.io/etcd/api/v3 v3.6.12/go.mod h1:p14EIQXHbuOQbVvL/WEes5uqKnxP9AgKJgpjbMVvzvE=
|
||||
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.12 h1:36zzB+pQOdHbhN+kH2iJz/K8bJn0ZLtLfPPO7jozTDo=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.6.12/go.mod h1:hh2+ZXtfLzs3o6mn92ntgNPBrTJJOvXqICM5g3L3DMY=
|
||||
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.12 h1:kMSP6JcPZMqSJiX+TXdUIBU/4eXEZWBAaui4VihMbIc=
|
||||
go.etcd.io/etcd/client/v3 v3.6.12/go.mod h1:CMs6fJWYiZQk4ytFjd4lE1diOvvRMmtbbn/alZXd3dQ=
|
||||
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.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
@@ -1027,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.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto=
|
||||
golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio=
|
||||
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
|
||||
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
|
||||
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=
|
||||
@@ -1043,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.43.0 h1:FLxcP4ec2350nTfOC8ysKtqYSIFbk/QGjw1ZHNP4tsY=
|
||||
golang.org/x/image v0.43.0/go.mod h1:rrpelvGFt+kLPAjPM4HeWPgrl0FtafueU//e5N0qk/Q=
|
||||
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/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=
|
||||
@@ -1066,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.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4=
|
||||
golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ=
|
||||
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/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=
|
||||
@@ -1111,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.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o=
|
||||
golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec=
|
||||
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/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=
|
||||
@@ -1136,8 +1124,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM=
|
||||
golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
|
||||
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -1200,8 +1188,8 @@ golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
|
||||
golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
|
||||
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
@@ -1209,8 +1197,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
|
||||
golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc=
|
||||
golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y=
|
||||
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
|
||||
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -1222,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.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE=
|
||||
golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4=
|
||||
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/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=
|
||||
@@ -1276,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.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8=
|
||||
golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0=
|
||||
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/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=
|
||||
@@ -1355,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.0 h1:vguDnZUPjE26w09A63VoxZPnvPjB5Riyc0mkXPFmAIU=
|
||||
google.golang.org/grpc v1.82.0/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA=
|
||||
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/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=
|
||||
|
||||
@@ -128,6 +128,20 @@ func WopiContextAuthMiddleware(cfg *config.Config, st microstore.Store, next htt
|
||||
|
||||
claims.WopiContext.AccessToken = wopiContextAccessToken
|
||||
|
||||
// The view only token is encrypted the same way as the access token
|
||||
// (see GenerateWopiToken). Decrypt it so downstream consumers get the
|
||||
// plaintext reva token. It is only set for view only shares, so skip
|
||||
// the decryption when it is empty.
|
||||
if claims.WopiContext.ViewOnlyToken != "" {
|
||||
wopiContextViewOnlyToken, err := DecryptAES([]byte(cfg.Wopi.Secret), claims.WopiContext.ViewOnlyToken)
|
||||
if err != nil {
|
||||
wopiLogger.Error().Err(err).Msg("failed to decrypt view only token")
|
||||
http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
claims.WopiContext.ViewOnlyToken = wopiContextViewOnlyToken
|
||||
}
|
||||
|
||||
ctx = context.WithValue(ctx, wopiContextKey, claims.WopiContext)
|
||||
// authentication for the CS3 api
|
||||
ctx = metadata.AppendToOutgoingContext(ctx, ctxpkg.TokenHeader, claims.WopiContext.AccessToken)
|
||||
@@ -201,6 +215,18 @@ func GenerateWopiToken(wopiContext WopiContext, cfg *config.Config, st microstor
|
||||
return "", 0, err
|
||||
}
|
||||
|
||||
// The view only token is a reva token that impersonates the resource owner.
|
||||
// It must never be exposed in plaintext inside the (readable) WOPI JWT, so
|
||||
// encrypt it the same way as the access token. It is only set for view only
|
||||
// shares, so skip the encryption when it is empty.
|
||||
if wopiContext.ViewOnlyToken != "" {
|
||||
cryptedViewOnlyToken, err := EncryptAES([]byte(cfg.Wopi.Secret), wopiContext.ViewOnlyToken)
|
||||
if err != nil {
|
||||
return "", 0, err
|
||||
}
|
||||
wopiContext.ViewOnlyToken = cryptedViewOnlyToken
|
||||
}
|
||||
|
||||
cs3Claims := &jwt.RegisteredClaims{}
|
||||
_, err = jwt.ParseWithClaims(wopiContext.AccessToken, cs3Claims, func(token *jwt.Token) (interface{}, error) {
|
||||
if token.Method != jwt.SigningMethodHS256 {
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
appprovider "github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1"
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/owncloud/ocis/v2/services/collaboration/pkg/config"
|
||||
@@ -168,6 +169,60 @@ var _ = Describe("Wopi Context Middleware", func() {
|
||||
mw.ServeHTTP(resp, req)
|
||||
Expect(resp.Code).To(Equal(http.StatusOK))
|
||||
})
|
||||
It("Should encrypt the ViewOnlyToken inside the WOPI token and restore it on the way in", func() {
|
||||
// a known, recognizable plaintext so we can assert it is not readable in the JWT
|
||||
const viewOnlyPlaintext = "my-secret-view-only-token"
|
||||
|
||||
// capture the WopiContext the middleware hands to the next handler
|
||||
var captured middleware.WopiContext
|
||||
var capturedErr error
|
||||
capturingNext := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
captured, capturedErr = middleware.WopiContextFromCtx(r.Context())
|
||||
w.WriteHeader(http.StatusOK)
|
||||
})
|
||||
capturingMw := middleware.WopiContextAuthMiddleware(cfg, nil, capturingNext)
|
||||
|
||||
token, err := tknMngr.MintToken(ctx, user, nil)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
wopiContext := middleware.WopiContext{
|
||||
AccessToken: token,
|
||||
ViewOnlyToken: viewOnlyPlaintext,
|
||||
ViewMode: appprovider.ViewMode_VIEW_MODE_VIEW_ONLY,
|
||||
FileReference: &providerv1beta1.Reference{
|
||||
ResourceId: rid,
|
||||
Path: ".",
|
||||
},
|
||||
}
|
||||
wopiToken, ttl, err := middleware.GenerateWopiToken(wopiContext, cfg, nil)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
// Security property: the plaintext view-only token must not be recoverable
|
||||
// from the (readable) JWT. Parse the JWT and assert the ViewOnlyToken claim
|
||||
// is present but is ciphertext, not the plaintext value.
|
||||
claims := &middleware.Claims{}
|
||||
_, err = jwt.ParseWithClaims(wopiToken, claims, func(t *jwt.Token) (interface{}, error) {
|
||||
return []byte(cfg.Wopi.Secret), nil
|
||||
})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(claims.WopiContext.ViewOnlyToken).ToNot(BeEmpty())
|
||||
Expect(claims.WopiContext.ViewOnlyToken).ToNot(Equal(viewOnlyPlaintext))
|
||||
|
||||
// No-regression property: the middleware must decrypt the token back to the
|
||||
// original plaintext so downstream consumers get a usable reva token.
|
||||
req := httptest.NewRequest("GET", src.String(), nil).WithContext(ctx)
|
||||
q := req.URL.Query()
|
||||
q.Add("access_token", wopiToken)
|
||||
q.Add("access_token_ttl", strconv.FormatInt(ttl, 10))
|
||||
req.URL.RawQuery = q.Encode()
|
||||
resp := httptest.NewRecorder()
|
||||
|
||||
capturingMw.ServeHTTP(resp, req)
|
||||
|
||||
Expect(resp.Code).To(Equal(http.StatusOK))
|
||||
Expect(capturedErr).ToNot(HaveOccurred())
|
||||
Expect(captured.ViewOnlyToken).To(Equal(viewOnlyPlaintext))
|
||||
})
|
||||
It("Should authorize successful with template reference", func() {
|
||||
req := httptest.NewRequest("GET", src.String(), nil).WithContext(ctx)
|
||||
token, err := tknMngr.MintToken(ctx, user, nil)
|
||||
|
||||
@@ -33,6 +33,8 @@ type Config struct {
|
||||
DefaultUploadProtocol string `yaml:"default_upload_protocol" env:"FRONTEND_DEFAULT_UPLOAD_PROTOCOL" desc:"The default upload protocol to use in clients. Currently only 'tus' is available. See the developer API documentation for more details about TUS." introductionVersion:"pre5.0"`
|
||||
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%%"`
|
||||
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"`
|
||||
|
||||
@@ -124,6 +124,8 @@ func DefaultConfig() *config.Config {
|
||||
},
|
||||
},
|
||||
LDAPServerWriteEnabled: true,
|
||||
EnableUserSharing: true,
|
||||
EnablePublicSharing: true,
|
||||
AutoAcceptShares: true,
|
||||
Events: config.Events{
|
||||
Endpoint: "127.0.0.1:9233",
|
||||
|
||||
@@ -182,6 +182,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
|
||||
"machine_auth_apikey": cfg.MachineAuthAPIKey,
|
||||
"enable_denials": cfg.OCS.EnableDenials,
|
||||
"list_ocm_shares": cfg.OCS.ListOCMShares,
|
||||
"enable_user_sharing": cfg.EnableUserSharing,
|
||||
"cache_warmup_driver": cfg.OCS.CacheWarmupDriver,
|
||||
"cache_warmup_drivers": map[string]interface{}{
|
||||
"cbox": map[string]interface{}{
|
||||
@@ -254,7 +255,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
|
||||
"search_min_length": cfg.SearchMinLength,
|
||||
"public": map[string]interface{}{
|
||||
"alias": true,
|
||||
"enabled": true,
|
||||
"enabled": cfg.EnablePublicSharing,
|
||||
"send_mail": true,
|
||||
"defaultPublicLinkShareName": "Public link",
|
||||
"social_share": true,
|
||||
@@ -277,6 +278,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
|
||||
"can_edit": true,
|
||||
},
|
||||
"user": map[string]interface{}{
|
||||
"enabled": cfg.EnableUserSharing,
|
||||
"send_mail": true,
|
||||
"profile_picture": false,
|
||||
"settings": []map[string]interface{}{
|
||||
@@ -290,7 +292,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
|
||||
},
|
||||
},
|
||||
"user_enumeration": map[string]interface{}{
|
||||
"enabled": true,
|
||||
"enabled": cfg.EnableUserSharing,
|
||||
"group_members_only": true,
|
||||
},
|
||||
"federation": map[string]interface{}{
|
||||
|
||||
@@ -44,6 +44,8 @@ type Config struct {
|
||||
|
||||
EnableVaultMode bool `yaml:"enable_vault_mode" env:"OCIS_ENABLE_VAULT_MODE;GRAPH_ENABLE_VAULT_MODE" desc:"Enable vault mode in addition to the regular graph service. This only applies when the additional storage-users-vault service is running, which is a special configured storage-users service." introductionVersion:"8.1.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, group or federated shares via the drive item invite endpoints is rejected. Public link sharing and space membership are not affected." introductionVersion:"%%NEXT_PRODUCTION_VERSION%%"`
|
||||
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
|
||||
@@ -130,6 +130,7 @@ func DefaultConfig() *config.Config {
|
||||
},
|
||||
MaxConcurrency: 20,
|
||||
ReceivedSharesStatTimeout: 10 * time.Second,
|
||||
EnableUserSharing: true,
|
||||
UnifiedRoles: config.UnifiedRoles{
|
||||
AvailableRoles: nil, // will be populated with defaults in EnsureDefaults
|
||||
},
|
||||
|
||||
@@ -109,7 +109,6 @@ func NewDriveItemPermissionsService(logger log.Logger, gatewaySelector pool.Sele
|
||||
|
||||
// Invite invites a user to a drive item.
|
||||
func (s DriveItemPermissionsService) Invite(ctx context.Context, resourceId *storageprovider.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) {
|
||||
|
||||
ctx, span := s.tp.Tracer("graph").Start(ctx, "Invite")
|
||||
defer span.End()
|
||||
|
||||
@@ -125,6 +124,10 @@ func (s DriveItemPermissionsService) Invite(ctx context.Context, resourceId *sto
|
||||
return libregraph.Permission{}, err
|
||||
}
|
||||
|
||||
if !s.config.EnableUserSharing && !IsSpaceRoot(statResponse.GetInfo().GetId()) {
|
||||
return libregraph.Permission{}, errorcode.New(errorcode.NotAllowed, "direct sharing is disabled")
|
||||
}
|
||||
|
||||
var condition string
|
||||
if condition, err = roleConditionForResourceType(statResponse.GetInfo()); err != nil {
|
||||
s.logger.Error().Err(err).Str("resourceId", resourceId.GetStorageId()).Interface("condition.res", condition).Msg("role condition failed")
|
||||
@@ -321,6 +324,7 @@ func createShareRequestToGroup(group libregraph.Group, info *storageprovider.Res
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func createShareRequestToUser(user libregraph.User, info *storageprovider.ResourceInfo, cs3ResourcePermissions *storageprovider.ResourcePermissions) *collaboration.CreateShareRequest {
|
||||
return &collaboration.CreateShareRequest{
|
||||
ResourceInfo: info,
|
||||
@@ -337,6 +341,7 @@ func createShareRequestToUser(user libregraph.User, info *storageprovider.Resour
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func createShareRequestToFederatedUser(user libregraph.User, resourceId *storageprovider.ResourceId, providerInfo *ocmprovider.ProviderInfo, cs3ResourcePermissions *storageprovider.ResourcePermissions) *ocm.CreateOCMShareRequest {
|
||||
return &ocm.CreateOCMShareRequest{
|
||||
ResourceId: resourceId,
|
||||
@@ -363,7 +368,6 @@ func createShareRequestToFederatedUser(user libregraph.User, resourceId *storage
|
||||
|
||||
// SpaceRootInvite handles invitation request on project spaces
|
||||
func (s DriveItemPermissionsService) SpaceRootInvite(ctx context.Context, driveID *storageprovider.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) {
|
||||
|
||||
ctx, span := s.tp.Tracer("graph").Start(ctx, "SpaceRootInvite")
|
||||
defer span.End()
|
||||
|
||||
@@ -391,7 +395,6 @@ func (s DriveItemPermissionsService) SpaceRootInvite(ctx context.Context, driveI
|
||||
|
||||
// ListPermissions lists the permissions of a driveItem
|
||||
func (s DriveItemPermissionsService) ListPermissions(ctx context.Context, itemID *storageprovider.ResourceId, listFederatedRoles, selectRoles, selectActions bool) (libregraph.CollectionOfPermissionsWithAllowedValues, error) {
|
||||
|
||||
ctx, span := s.tp.Tracer("graph").Start(ctx, "ListPermissions")
|
||||
defer span.End()
|
||||
|
||||
@@ -508,7 +511,6 @@ func (s DriveItemPermissionsService) ListPermissions(ctx context.Context, itemID
|
||||
|
||||
// ListSpaceRootPermissions handles ListPermissions request on project spaces
|
||||
func (s DriveItemPermissionsService) ListSpaceRootPermissions(ctx context.Context, driveID *storageprovider.ResourceId) (libregraph.CollectionOfPermissionsWithAllowedValues, error) {
|
||||
|
||||
ctx, span := s.tp.Tracer("graph").Start(ctx, "ListSpaceRootPermissions")
|
||||
defer span.End()
|
||||
|
||||
@@ -559,7 +561,6 @@ func (s DriveItemPermissionsService) GetPermission(ctx context.Context, itemID *
|
||||
|
||||
// DeletePermission deletes a permission from a drive item
|
||||
func (s DriveItemPermissionsService) DeletePermission(ctx context.Context, itemID *storageprovider.ResourceId, permissionID string) error {
|
||||
|
||||
ctx, span := s.tp.Tracer("graph").Start(ctx, "DeletePermission")
|
||||
defer span.End()
|
||||
|
||||
@@ -652,7 +653,6 @@ func (s DriveItemPermissionsService) resolveItemPermission(ctx context.Context,
|
||||
|
||||
// DeleteSpaceRootPermission deletes a permission on the root item of a project space
|
||||
func (s DriveItemPermissionsService) DeleteSpaceRootPermission(ctx context.Context, driveID *storageprovider.ResourceId, permissionID string) error {
|
||||
|
||||
ctx, span := s.tp.Tracer("graph").Start(ctx, "DeleteSpaceRootPermission")
|
||||
defer span.End()
|
||||
|
||||
@@ -680,7 +680,6 @@ func (s DriveItemPermissionsService) DeleteSpaceRootPermission(ctx context.Conte
|
||||
|
||||
// UpdatePermission updates a permission on a drive item
|
||||
func (s DriveItemPermissionsService) UpdatePermission(ctx context.Context, itemID *storageprovider.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) {
|
||||
|
||||
ctx, span := s.tp.Tracer("graph").Start(ctx, "UpdatePermission")
|
||||
defer span.End()
|
||||
|
||||
@@ -735,7 +734,6 @@ func (s DriveItemPermissionsService) UpdatePermission(ctx context.Context, itemI
|
||||
|
||||
// UpdateSpaceRootPermission updates a permission on the root item of a project space
|
||||
func (s DriveItemPermissionsService) UpdateSpaceRootPermission(ctx context.Context, driveID *storageprovider.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) {
|
||||
|
||||
ctx, span := s.tp.Tracer("graph").Start(ctx, "UpdateSpaceRootPermission")
|
||||
defer span.End()
|
||||
|
||||
@@ -764,7 +762,6 @@ func (s DriveItemPermissionsService) UpdateSpaceRootPermission(ctx context.Conte
|
||||
|
||||
// GetSpaceRootPermission handles requests to fetch a single permission on a space root
|
||||
func (s DriveItemPermissionsService) GetSpaceRootPermission(ctx context.Context, driveID *storageprovider.ResourceId, permissionID string) (libregraph.Permission, error) {
|
||||
|
||||
ctx, span := s.tp.Tracer("graph").Start(ctx, "GetSpaceRootPermission")
|
||||
defer span.End()
|
||||
|
||||
@@ -865,7 +862,6 @@ func (api DriveItemPermissionsApi) SpaceRootInvite(w http.ResponseWriter, r *htt
|
||||
return
|
||||
}
|
||||
permission, err := api.driveItemPermissionsService.SpaceRootInvite(ctx, &driveID, *driveItemInvite)
|
||||
|
||||
if err != nil {
|
||||
errorcode.RenderError(w, r, err)
|
||||
return
|
||||
@@ -937,7 +933,6 @@ func (api DriveItemPermissionsApi) ListSpaceRootPermissions(w http.ResponseWrite
|
||||
|
||||
ctx := r.Context()
|
||||
permissions, err := api.driveItemPermissionsService.ListSpaceRootPermissions(ctx, &driveID)
|
||||
|
||||
if err != nil {
|
||||
errorcode.RenderError(w, r, err)
|
||||
return
|
||||
@@ -1105,7 +1100,8 @@ func (api DriveItemPermissionsApi) UpdatePermission(w http.ResponseWriter, r *ht
|
||||
return
|
||||
}
|
||||
|
||||
ctx := r.Context()
|
||||
// enforce the admin role allowlist on updates, same as invite
|
||||
ctx := validate.ContextWithAllowedRoleIDs(r.Context(), api.config.UnifiedRoles.AvailableRoles)
|
||||
if err = validate.StructCtx(ctx, permission); err != nil {
|
||||
api.logger.Error().Err(err).Interface("Body", r.Body).Msg("invalid request body")
|
||||
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, err.Error())
|
||||
@@ -1144,7 +1140,8 @@ func (api DriveItemPermissionsApi) UpdateSpaceRootPermission(w http.ResponseWrit
|
||||
return
|
||||
}
|
||||
|
||||
ctx := r.Context()
|
||||
// enforce the admin role allowlist on updates, same as invite
|
||||
ctx := validate.ContextWithAllowedRoleIDs(r.Context(), api.config.UnifiedRoles.AvailableRoles)
|
||||
if err = validate.StructCtx(ctx, permission); err != nil {
|
||||
api.logger.Error().Err(err).Interface("Body", r.Body).Msg("invalid request body")
|
||||
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, err.Error())
|
||||
|
||||
@@ -262,6 +262,10 @@ func (g Graph) GetGroup(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if !g.contextUserHasFullAccountPerms(r.Context()) {
|
||||
group.Members = nil
|
||||
}
|
||||
|
||||
render.Status(r, http.StatusOK)
|
||||
render.JSON(w, r, group)
|
||||
}
|
||||
|
||||
@@ -303,6 +303,12 @@ var _ = Describe("Groups", func() {
|
||||
|
||||
Context("with an existing group", func() {
|
||||
BeforeEach(func() {
|
||||
permissionService.On("GetPermissionByID", mock.Anything, mock.Anything).Return(&settings.GetPermissionByIDResponse{
|
||||
Permission: &settingsmsg.Permission{
|
||||
Operation: settingsmsg.Permission_OPERATION_UNKNOWN,
|
||||
Constraint: settingsmsg.Permission_CONSTRAINT_ALL,
|
||||
},
|
||||
}, nil)
|
||||
identityBackend.On("GetGroup", mock.Anything, mock.Anything, mock.Anything).Return(newGroup, nil)
|
||||
})
|
||||
|
||||
@@ -317,6 +323,76 @@ var _ = Describe("Groups", func() {
|
||||
Expect(rr.Code).To(Equal(http.StatusOK))
|
||||
})
|
||||
})
|
||||
|
||||
It("does not leak group members to unprivileged users", func() {
|
||||
permissionService.On("GetPermissionByID", mock.Anything, mock.Anything).Return(&settings.GetPermissionByIDResponse{}, nil)
|
||||
|
||||
group := &libregraph.Group{}
|
||||
group.SetId("group1")
|
||||
group.SetDisplayName("Group Name")
|
||||
group.SetMembers(
|
||||
[]libregraph.User{
|
||||
{
|
||||
Id: libregraph.PtrString("userid"),
|
||||
},
|
||||
},
|
||||
)
|
||||
identityBackend.On("GetGroup", mock.Anything, mock.Anything, mock.Anything).Return(group, nil)
|
||||
|
||||
r := httptest.NewRequest(http.MethodGet, "/graph/v1.0/groups/group1?$expand=members", nil)
|
||||
rctx := chi.NewRouteContext()
|
||||
rctx.URLParams.Add("groupID", "group1")
|
||||
r = r.WithContext(context.WithValue(revactx.ContextSetUser(ctx, nil), chi.RouteCtxKey, rctx))
|
||||
|
||||
svc.GetGroup(rr, r)
|
||||
|
||||
Expect(rr.Code).To(Equal(http.StatusOK))
|
||||
data, err := io.ReadAll(rr.Body)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
respGroup := libregraph.Group{}
|
||||
err = json.Unmarshal(data, &respGroup)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(respGroup.Members).To(BeEmpty())
|
||||
})
|
||||
|
||||
It("returns group members to privileged users", func() {
|
||||
permissionService.On("GetPermissionByID", mock.Anything, mock.Anything).Return(&settings.GetPermissionByIDResponse{
|
||||
Permission: &settingsmsg.Permission{
|
||||
Operation: settingsmsg.Permission_OPERATION_UNKNOWN,
|
||||
Constraint: settingsmsg.Permission_CONSTRAINT_ALL,
|
||||
},
|
||||
}, nil)
|
||||
|
||||
group := &libregraph.Group{}
|
||||
group.SetId("group1")
|
||||
group.SetDisplayName("Group Name")
|
||||
group.SetMembers(
|
||||
[]libregraph.User{
|
||||
{
|
||||
Id: libregraph.PtrString("userid"),
|
||||
},
|
||||
},
|
||||
)
|
||||
identityBackend.On("GetGroup", mock.Anything, mock.Anything, mock.Anything).Return(group, nil)
|
||||
|
||||
r := httptest.NewRequest(http.MethodGet, "/graph/v1.0/groups/group1?$expand=members", nil)
|
||||
rctx := chi.NewRouteContext()
|
||||
rctx.URLParams.Add("groupID", "group1")
|
||||
r = r.WithContext(context.WithValue(revactx.ContextSetUser(ctx, nil), chi.RouteCtxKey, rctx))
|
||||
|
||||
svc.GetGroup(rr, r)
|
||||
|
||||
Expect(rr.Code).To(Equal(http.StatusOK))
|
||||
data, err := io.ReadAll(rr.Body)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
respGroup := libregraph.Group{}
|
||||
err = json.Unmarshal(data, &respGroup)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(respGroup.Members).To(HaveLen(1))
|
||||
Expect(respGroup.Members[0].GetId()).To(Equal("userid"))
|
||||
})
|
||||
})
|
||||
|
||||
Describe("PostGroup", func() {
|
||||
|
||||
@@ -125,6 +125,28 @@ var _ = Describe("libregraph", func() {
|
||||
}),
|
||||
)
|
||||
|
||||
// Permission is validated on the update paths (PATCH). It must honour the
|
||||
// admin role allowlist just like DriveItemInvite does.
|
||||
DescribeTable("Permission",
|
||||
func(factory validatableFactory[libregraph.Permission]) {
|
||||
s, pass := factory()
|
||||
switch err := validate.StructCtx(ctx, s); pass {
|
||||
case false:
|
||||
Expect(err).To(HaveOccurred())
|
||||
default:
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
}
|
||||
},
|
||||
Entry("fail: disabled role rejected when allowlist is set", func() (libregraph.Permission, bool) {
|
||||
ctx = validate.ContextWithAllowedRoleIDs(ctx, []string{unifiedrole.UnifiedRoleEditorID})
|
||||
return libregraph.Permission{Roles: []string{unifiedrole.UnifiedRoleSecureViewerID}}, false
|
||||
}),
|
||||
Entry("succeed: allowed role accepted when allowlist is set", func() (libregraph.Permission, bool) {
|
||||
ctx = validate.ContextWithAllowedRoleIDs(ctx, []string{unifiedrole.UnifiedRoleEditorID})
|
||||
return libregraph.Permission{Roles: []string{unifiedrole.UnifiedRoleEditorID}}, true
|
||||
}),
|
||||
)
|
||||
|
||||
DescribeTable("DriveRecipient",
|
||||
func(factories ...validatableFactory[libregraph.DriveRecipient]) {
|
||||
for _, factory := range factories {
|
||||
|
||||
@@ -135,10 +135,11 @@ type OCMCoreJSONDriver struct {
|
||||
}
|
||||
|
||||
type OCMShareProvider struct {
|
||||
Driver string `yaml:"driver" env:"OCM_OCM_SHARE_PROVIDER_DRIVER" desc:"Driver to be used for the OCM share provider. Supported value is only 'json'." introductionVersion:"5.0"`
|
||||
Drivers OCMShareProviderDrivers `yaml:"drivers"`
|
||||
Insecure bool `yaml:"insecure" env:"OCM_OCM_SHARE_PROVIDER_INSECURE" desc:"Disable TLS certificate validation for the OCM connections. Do not set this in production environments." introductionVersion:"5.0"`
|
||||
WebappTemplate string `yaml:"webapp_template" env:"OCM_WEBAPP_TEMPLATE" desc:"Template for the webapp url." introductionVersion:"5.0"`
|
||||
Driver string `yaml:"driver" env:"OCM_OCM_SHARE_PROVIDER_DRIVER" desc:"Driver to be used for the OCM share provider. Supported value is only 'json'." introductionVersion:"5.0"`
|
||||
Drivers OCMShareProviderDrivers `yaml:"drivers"`
|
||||
Insecure bool `yaml:"insecure" env:"OCM_OCM_SHARE_PROVIDER_INSECURE" desc:"Disable TLS certificate validation for the OCM connections. Do not set this in production environments." introductionVersion:"5.0"`
|
||||
WebappTemplate string `yaml:"webapp_template" env:"OCM_WEBAPP_TEMPLATE" desc:"Template for the webapp url." introductionVersion:"5.0"`
|
||||
EnableUserSharing bool `yaml:"enable_user_sharing" env:"OCIS_ENABLE_USER_SHARING" desc:"Enables direct sharing with users and groups. When disabled, creating new federated user shares is rejected. Public link sharing is not affected." introductionVersion:"%%NEXT_PRODUCTION_VERSION%%"`
|
||||
}
|
||||
|
||||
type OCMShareProviderDrivers struct {
|
||||
|
||||
@@ -119,7 +119,8 @@ func DefaultConfig() *config.Config {
|
||||
File: filepath.Join(defaults.BaseDataPath(), "storage", "ocm", "ocmshares.json"),
|
||||
},
|
||||
},
|
||||
Insecure: false,
|
||||
Insecure: false,
|
||||
EnableUserSharing: true,
|
||||
},
|
||||
OCMCore: config.OCMCore{
|
||||
Driver: "json",
|
||||
|
||||
@@ -160,8 +160,9 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter
|
||||
"gatewaysvc": cfg.Reva.Address,
|
||||
"provider_domain": providerDomain,
|
||||
"webdav_endpoint": cfg.Commons.OcisURL,
|
||||
"webapp_template": cfg.OCMShareProvider.WebappTemplate,
|
||||
"client_insecure": cfg.OCMShareProvider.Insecure,
|
||||
"webapp_template": cfg.OCMShareProvider.WebappTemplate,
|
||||
"client_insecure": cfg.OCMShareProvider.Insecure,
|
||||
"enable_user_sharing": cfg.OCMShareProvider.EnableUserSharing,
|
||||
},
|
||||
"ocmcore": map[string]interface{}{
|
||||
"driver": cfg.OCMCore.Driver,
|
||||
|
||||
@@ -21,4 +21,3 @@ Make sure to configure the same store in the proxy service.
|
||||
Store specific notes:
|
||||
- When using `redis-sentinel`, the Redis master to use is configured via e.g. `OCS_PRESIGNEDURL_SIGNING_KEYS_STORE_NODES` in the form of `<sentinel-host>:<sentinel-port>/<redis-master>` like `10.10.0.200:26379/mymaster`.
|
||||
- When using `nats-js-kv` it is recommended to set `PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE_NODES` to the same value as `OCS_PRESIGNEDURL_SIGNING_KEYS_STORE_NODES`. That way the proxy uses the same nats instance as the ocs service.
|
||||
- When using `ocisstoreservice` the `OCS_PRESIGNEDURL_SIGNING_KEYS_STORE_NODES` must be set to the service name `com.owncloud.api.store`. It does not support TTL and stores the presigning keys indefinitely. Also, the store service needs to be started.
|
||||
@@ -365,7 +365,6 @@ Store specific notes:
|
||||
To authenticate presigned URLs the proxy service needs to read signing keys from a store that is populated by the ocs service. Possible stores are:
|
||||
- `nats-js-kv`: Stores data using key-value-store feature of [nats jetstream](https://docs.nats.io/nats-concepts/jetstream/key-value-store)
|
||||
- `redis-sentinel`: Stores data in a configured Redis Sentinel cluster.
|
||||
- `ocisstoreservice`: Stores data in the legacy ocis store service. Requires setting `PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE_NODES` to `com.owncloud.api.store`.
|
||||
|
||||
The `memory` store cannot be used as it does not share the memory from the ocs service signing key memory store, even in a single process.
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ type PreSignedURL struct {
|
||||
|
||||
// SigningKeys is a store configuration.
|
||||
type SigningKeys struct {
|
||||
Store string `yaml:"store" env:"OCIS_CACHE_STORE;PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE" desc:"The type of the signing key store. Supported values are: 'redis-sentinel', 'nats-js-kv' and 'ocisstoreservice' (deprecated). See the text description for details." introductionVersion:"5.0"`
|
||||
Store string `yaml:"store" env:"OCIS_CACHE_STORE;PROXY_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;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"`
|
||||
|
||||
@@ -28,6 +28,8 @@ type Config struct {
|
||||
WriteableShareMustHavePassword bool `yaml:"public_sharing_writeableshare_must_have_password" env:"OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD;SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD" desc:"Set this to true if you want to enforce passwords on Uploader, Editor or Contributor shares." introductionVersion:"5.0"`
|
||||
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%%"`
|
||||
PasswordPolicy PasswordPolicy `yaml:"password_policy"`
|
||||
|
||||
Context context.Context `yaml:"-"`
|
||||
|
||||
@@ -78,6 +78,8 @@ func DefaultConfig() *config.Config {
|
||||
},
|
||||
EnableExpiredSharesCleanup: true,
|
||||
PublicShareMustHavePassword: true,
|
||||
EnableUserSharing: true,
|
||||
EnablePublicSharing: true,
|
||||
PasswordPolicy: config.PasswordPolicy{
|
||||
MinCharacters: 8,
|
||||
MinLowerCaseCharacters: 1,
|
||||
|
||||
@@ -37,7 +37,8 @@ func SharingConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string]
|
||||
// TODO build services dynamically
|
||||
"services": map[string]interface{}{
|
||||
"usershareprovider": map[string]interface{}{
|
||||
"driver": cfg.UserSharingDriver,
|
||||
"driver": cfg.UserSharingDriver,
|
||||
"enable_user_sharing": cfg.EnableUserSharing,
|
||||
"drivers": map[string]interface{}{
|
||||
"json": map[string]interface{}{
|
||||
"file": cfg.UserSharingDrivers.JSON.File,
|
||||
@@ -94,6 +95,7 @@ func SharingConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string]
|
||||
"public_share_must_have_password": cfg.PublicShareMustHavePassword,
|
||||
"password_policy": passwordPolicyCfg,
|
||||
"driver": cfg.PublicSharingDriver,
|
||||
"enable_public_sharing": cfg.EnablePublicSharing,
|
||||
"drivers": map[string]interface{}{
|
||||
"json": map[string]interface{}{
|
||||
"file": cfg.PublicSharingDrivers.JSON.File,
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
"colorPalette": {
|
||||
"background-accentuate": "rgba(255, 255, 5, 0.1)",
|
||||
"background-default": "#ffffff",
|
||||
"background-highlight": "#ffffff",
|
||||
"background-highlight": "oklch(87.2% 0.01 258.338)",
|
||||
"background-muted": "#ffffff",
|
||||
"background-secondary": "#ffffff",
|
||||
"background-hover": "oklch(87.2% 0.01 258.338)",
|
||||
@@ -212,7 +212,7 @@
|
||||
"colorPalette": {
|
||||
"background-accentuate": "#696969",
|
||||
"background-default": "#000000",
|
||||
"background-highlight": "#000000",
|
||||
"background-highlight": "#383838",
|
||||
"background-muted": "oklch(21% 0.034 264.665)",
|
||||
"background-secondary": "#404040",
|
||||
"background-hover": "#383838",
|
||||
@@ -279,7 +279,7 @@
|
||||
"colorPalette": {
|
||||
"background-accentuate": "#696969",
|
||||
"background-default": "#000000",
|
||||
"background-highlight": "#000000",
|
||||
"background-highlight": "oklch(21% 0.034 264.665)",
|
||||
"background-muted": "#000000",
|
||||
"background-secondary": "#000000",
|
||||
"background-hover": "oklch(21% 0.034 264.665)",
|
||||
@@ -423,7 +423,7 @@
|
||||
"colorPalette": {
|
||||
"background-accentuate": "rgba(255, 255, 5, 0.1)",
|
||||
"background-default": "#ffffff",
|
||||
"background-highlight": "#ffffff",
|
||||
"background-highlight": "oklch(87.2% 0.01 258.338)",
|
||||
"background-muted": "#ffffff",
|
||||
"background-secondary": "#ffffff",
|
||||
"background-hover": "oklch(87.2% 0.01 258.338)",
|
||||
@@ -489,7 +489,7 @@
|
||||
"colorPalette": {
|
||||
"background-accentuate": "#696969",
|
||||
"background-default": "#000000",
|
||||
"background-highlight": "#000000",
|
||||
"background-highlight": "#383838",
|
||||
"background-muted": "oklch(21% 0.034 264.665)",
|
||||
"background-secondary": "#404040",
|
||||
"background-hover": "#383838",
|
||||
@@ -563,7 +563,7 @@
|
||||
"colorPalette": {
|
||||
"background-accentuate": "#696969",
|
||||
"background-default": "#000000",
|
||||
"background-highlight": "#000000",
|
||||
"background-highlight": "oklch(21% 0.034 264.665)",
|
||||
"background-muted": "#000000",
|
||||
"background-secondary": "#000000",
|
||||
"background-hover": "oklch(21% 0.034 264.665)",
|
||||
|
||||
@@ -191,15 +191,20 @@ class GraphHelper {
|
||||
/**
|
||||
* @param string $baseUrl
|
||||
* @param string $path
|
||||
* @param boolean $isVault
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getFullUrl(string $baseUrl, string $path): string {
|
||||
public static function getFullUrl(string $baseUrl, string $path, bool $isVault = false): string {
|
||||
$fullUrl = $baseUrl;
|
||||
if (\substr($fullUrl, -1) !== '/') {
|
||||
$fullUrl .= '/';
|
||||
}
|
||||
$fullUrl .= 'graph/v1.0/' . $path;
|
||||
if ($isVault) {
|
||||
$fullUrl .= 'vault/graph/v1.0/' . $path;
|
||||
} else {
|
||||
$fullUrl .= 'graph/v1.0/' . $path;
|
||||
}
|
||||
return $fullUrl;
|
||||
}
|
||||
|
||||
@@ -338,12 +343,24 @@ class GraphHelper {
|
||||
string $userName,
|
||||
): ResponseInterface {
|
||||
$url = self::getFullUrl($baseUrl, 'users/' . $userName);
|
||||
if (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
return HttpRequestHelper::get(
|
||||
$url,
|
||||
null,
|
||||
null,
|
||||
[
|
||||
'Authorization' => 'Bearer ' . KeycloakHelper::getAdminAccessToken(),
|
||||
'Content-Type' => 'application/json',
|
||||
],
|
||||
);
|
||||
}
|
||||
return HttpRequestHelper::get(
|
||||
$url,
|
||||
$adminUser,
|
||||
$adminPassword,
|
||||
self::getRequestHeaders(),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -416,24 +433,27 @@ class GraphHelper {
|
||||
|
||||
/**
|
||||
* @param string $baseUrl
|
||||
* @param string $adminUser
|
||||
* @param string $adminPassword
|
||||
* @param string $userName
|
||||
* @param string|null $adminUser
|
||||
* @param string|null $adminPassword
|
||||
* @param array|null $headers
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function deleteUser(
|
||||
string $baseUrl,
|
||||
string $adminUser,
|
||||
string $adminPassword,
|
||||
string $userName,
|
||||
?string $adminUser = null,
|
||||
?string $adminPassword = null,
|
||||
?array $headers = null,
|
||||
): ResponseInterface {
|
||||
$url = self::getFullUrl($baseUrl, 'users/' . $userName);
|
||||
return HttpRequestHelper::delete(
|
||||
$url,
|
||||
$adminUser,
|
||||
$adminPassword,
|
||||
$headers,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -911,22 +931,24 @@ class GraphHelper {
|
||||
* Send Graph Create Space Request
|
||||
*
|
||||
* @param string $baseUrl
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param string|null $user
|
||||
* @param string|null $password
|
||||
* @param string $body
|
||||
* @param array $headers
|
||||
* @param boolean $isVault
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function createSpace(
|
||||
string $baseUrl,
|
||||
string $user,
|
||||
string $password,
|
||||
?string $user = null,
|
||||
?string $password = null,
|
||||
string $body,
|
||||
array $headers = [],
|
||||
bool $isVault = false,
|
||||
): ResponseInterface {
|
||||
$url = self::getFullUrl($baseUrl, 'drives');
|
||||
$url = self::getFullUrl($baseUrl, 'drives', $isVault);
|
||||
|
||||
return HttpRequestHelper::post($url, $user, $password, $headers, $body);
|
||||
}
|
||||
@@ -961,11 +983,12 @@ class GraphHelper {
|
||||
* Send Graph List My Spaces Request
|
||||
*
|
||||
* @param string $baseUrl
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param string $urlArguments
|
||||
* @param array $body
|
||||
* @param array $headers
|
||||
* @param string|null $user
|
||||
* @param string|null $password
|
||||
* @param string|null $urlArguments
|
||||
* @param array|null $body
|
||||
* @param array|null $headers
|
||||
* @param boolean $isVault
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*
|
||||
@@ -973,14 +996,15 @@ class GraphHelper {
|
||||
*/
|
||||
public static function getMySpaces(
|
||||
string $baseUrl,
|
||||
string $user,
|
||||
string $password,
|
||||
string $urlArguments = '',
|
||||
array $body = [],
|
||||
array $headers = [],
|
||||
?string $user = null,
|
||||
?string $password = null,
|
||||
?string $urlArguments = '',
|
||||
?array $body = [],
|
||||
?array $headers = [],
|
||||
?bool $isVault = false,
|
||||
): ResponseInterface {
|
||||
$urlArguments = $urlArguments ? "?$urlArguments" : "";
|
||||
$url = self::getFullUrl($baseUrl, "me/drives" . $urlArguments);
|
||||
$url = self::getFullUrl($baseUrl, "me/drives" . $urlArguments, $isVault);
|
||||
|
||||
return HttpRequestHelper::get($url, $user, $password, $headers, $body);
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@ class HttpRequestHelper {
|
||||
* than download it all up-front.
|
||||
* @param int|null $timeout
|
||||
* @param Client|null $client
|
||||
* @param bool $allowRedirects
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
@@ -118,6 +119,7 @@ class HttpRequestHelper {
|
||||
bool $stream = false,
|
||||
?int $timeout = 0,
|
||||
?Client $client = null,
|
||||
?bool $allowRedirects = false,
|
||||
): ResponseInterface {
|
||||
if ($client === null) {
|
||||
$client = self::createClient(
|
||||
@@ -127,6 +129,7 @@ class HttpRequestHelper {
|
||||
$cookies,
|
||||
$stream,
|
||||
$timeout,
|
||||
$allowRedirects,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -197,6 +200,7 @@ class HttpRequestHelper {
|
||||
* @param CookieJar|null $cookies
|
||||
* @param bool $stream Set to true to stream a response rather
|
||||
* than download it all up-front.
|
||||
* @param bool $allowRedirects
|
||||
* @param int|null $timeout
|
||||
* @param Client|null $client
|
||||
* @param bool|null $isGivenStep
|
||||
@@ -215,6 +219,7 @@ class HttpRequestHelper {
|
||||
?array $config = null,
|
||||
?CookieJar $cookies = null,
|
||||
bool $stream = false,
|
||||
?bool $allowRedirects = false,
|
||||
?int $timeout = 0,
|
||||
?Client $client = null,
|
||||
?bool $isGivenStep = false,
|
||||
@@ -241,6 +246,7 @@ class HttpRequestHelper {
|
||||
$stream,
|
||||
$timeout,
|
||||
$client,
|
||||
$allowRedirects,
|
||||
);
|
||||
|
||||
if ($response->getStatusCode() >= 400
|
||||
@@ -378,6 +384,7 @@ class HttpRequestHelper {
|
||||
* @param bool $stream Set to true to stream a response rather
|
||||
* than download it all up-front.
|
||||
* @param int|null $timeout
|
||||
* @param bool $allowRedirects
|
||||
*
|
||||
* @return Client
|
||||
*/
|
||||
@@ -388,6 +395,7 @@ class HttpRequestHelper {
|
||||
?CookieJar $cookies = null,
|
||||
?bool $stream = false,
|
||||
?int $timeout = 0,
|
||||
?bool $allowRedirects = false,
|
||||
): Client {
|
||||
$options = [];
|
||||
if ($user !== null) {
|
||||
@@ -402,6 +410,7 @@ class HttpRequestHelper {
|
||||
$options['stream'] = $stream;
|
||||
$options['verify'] = false;
|
||||
$options['timeout'] = $timeout ?: self::getRequestTimeout();
|
||||
$options['allow_redirects'] = $allowRedirects;
|
||||
return new Client($options);
|
||||
}
|
||||
|
||||
@@ -459,6 +468,7 @@ class HttpRequestHelper {
|
||||
* @param array|null $config
|
||||
* @param CookieJar|null $cookies
|
||||
* @param boolean $stream
|
||||
* @param boolean $allowRedirects
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
@@ -473,6 +483,7 @@ class HttpRequestHelper {
|
||||
?array $config = null,
|
||||
?CookieJar $cookies = null,
|
||||
?bool $stream = false,
|
||||
?bool $allowRedirects = false,
|
||||
): ResponseInterface {
|
||||
return self::sendRequest(
|
||||
$url,
|
||||
@@ -484,6 +495,7 @@ class HttpRequestHelper {
|
||||
$config,
|
||||
$cookies,
|
||||
$stream,
|
||||
$allowRedirects,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,445 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* ownCloud
|
||||
*
|
||||
* @author Prajwol Amatya <prajwol@jankaritech.com>
|
||||
* @copyright Copyright (c) 2022 Prajwol Amatya prajwol@jankaritech.com
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License,
|
||||
* as published by the Free Software Foundation;
|
||||
* either version 3 of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace TestHelpers;
|
||||
|
||||
use Exception;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use InvalidArgumentException;
|
||||
use JsonException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* A helper class for Keycloak admin API requests.
|
||||
*/
|
||||
class KeycloakHelper {
|
||||
private const OCIS_KEYCLOAK_USER_ROLES = [
|
||||
'Admin' => 'ocisAdmin',
|
||||
'Space Admin' => 'ocisSpaceAdmin',
|
||||
'User' => 'ocisUser',
|
||||
'User Light' => 'ocisGuest',
|
||||
];
|
||||
private const OCIS_KEYCLOAK_USER_ROLE_IDS = [
|
||||
'ocisAdmin' => '0bb40fa2-4490-4687-9159-b1d27ec7423a',
|
||||
'ocisSpaceAdmin' => 'bd5f5012-48bb-4ea4-bfe6-0623e3ca0552',
|
||||
'ocisUser' => '8c79ff81-c256-48fd-b0b9-795c7941eedf',
|
||||
'ocisGuest' => '7eedfa6d-a2d9-4296-b6db-e75e4e9c0963',
|
||||
'offline_access' => 'e2145b30-bf6f-49fb-af3f-1b40168bfcef',
|
||||
];
|
||||
private static ?string $adminAccessToken = null;
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function isTestingWithKeycloak(): bool {
|
||||
return (\getenv('KEYCLOAK') === "true");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getKeycloakUrl(): string {
|
||||
$keycloakUrl = \getenv('KC_URL');
|
||||
if ($keycloakUrl !== false && $keycloakUrl !== '') {
|
||||
return $keycloakUrl;
|
||||
}
|
||||
return 'https://keycloak.owncloud.test';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $accessToken
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setAdminAccessToken(string $accessToken): void {
|
||||
self::$adminAccessToken = $accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the cached admin access token
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function resetAdminAccessToken(): void {
|
||||
self::$adminAccessToken = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function getAdminAccessToken(): string {
|
||||
if (self::$adminAccessToken === null) {
|
||||
self::setAdminAccessToken(self::generateAdminAccessToken());
|
||||
}
|
||||
|
||||
return (string)self::$adminAccessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $roleName
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function getRealmRole(string $roleName): array {
|
||||
$roleId = self::OCIS_KEYCLOAK_USER_ROLE_IDS[$roleName]
|
||||
?? throw new InvalidArgumentException("Unknown Keycloak role: {$roleName}");
|
||||
return [
|
||||
'id' => $roleId,
|
||||
'name' => $roleName,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param string|null $email
|
||||
* @param string|null $displayName
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws Exception
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function createUser(
|
||||
string $username,
|
||||
string $password,
|
||||
?string $email = null,
|
||||
?string $displayName = null,
|
||||
): ResponseInterface {
|
||||
$accessToken = self::getAdminAccessToken();
|
||||
$url = self::getKeycloakUrl() . '/admin/realms/oCIS/users';
|
||||
|
||||
return HttpRequestHelper::post(
|
||||
$url,
|
||||
null,
|
||||
null,
|
||||
[
|
||||
'Authorization' => 'Bearer ' . $accessToken,
|
||||
'Content-Type' => 'application/json',
|
||||
],
|
||||
self::prepareCreateUserPayload($username, $password, $email, $displayName),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $uuid
|
||||
* @param string $role
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public static function assignRole(
|
||||
string $uuid,
|
||||
string $role,
|
||||
): ResponseInterface {
|
||||
$url = self::getKeycloakUrl() . "/admin/realms/oCIS/users/" . $uuid . "/role-mappings/realm";
|
||||
$ocisRole = self::OCIS_KEYCLOAK_USER_ROLES[$role]
|
||||
?? throw new InvalidArgumentException("Unknown oCIS role: {$role}");
|
||||
$body = [
|
||||
self::getRealmRole($ocisRole),
|
||||
self::getRealmRole('offline_access'),
|
||||
];
|
||||
return HttpRequestHelper::post(
|
||||
$url,
|
||||
null,
|
||||
null,
|
||||
[
|
||||
"Content-Type" => "application/json",
|
||||
"Authorization" => "Bearer " . self::getAdminAccessToken(),
|
||||
],
|
||||
json_encode($body, JSON_THROW_ON_ERROR),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws Exception
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
private static function generateAdminAccessToken(): string {
|
||||
$url = self::getKeycloakUrl()
|
||||
. '/realms/master/protocol/openid-connect/token';
|
||||
$response = HttpRequestHelper::post(
|
||||
$url,
|
||||
null,
|
||||
null,
|
||||
['Content-Type' => 'application/x-www-form-urlencoded'],
|
||||
[
|
||||
'client_id' => 'admin-cli',
|
||||
'username' => 'admin',
|
||||
'password' => 'admin',
|
||||
'grant_type' => 'password',
|
||||
],
|
||||
);
|
||||
|
||||
if ($response->getStatusCode() >= 400) {
|
||||
throw new Exception(
|
||||
__METHOD__
|
||||
. ' failed to get Keycloak admin access token, status '
|
||||
. $response->getStatusCode()
|
||||
. ', response '
|
||||
. (string)$response->getBody(),
|
||||
);
|
||||
}
|
||||
|
||||
$decodedResponse = HttpRequestHelper::getJsonDecodedResponseBodyContent($response);
|
||||
if (!isset($decodedResponse->access_token)) {
|
||||
throw new Exception(__METHOD__ . ' could not find access_token in Keycloak token response');
|
||||
}
|
||||
return (string)$decodedResponse->access_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param string|null $email
|
||||
* @param string|null $displayName
|
||||
*
|
||||
* @return string
|
||||
* @throws JsonException
|
||||
*/
|
||||
private static function prepareCreateUserPayload(
|
||||
string $username,
|
||||
string $password,
|
||||
?string $email = null,
|
||||
?string $displayName = null,
|
||||
): string {
|
||||
$firstName = $username;
|
||||
$lastName = '';
|
||||
if ($displayName !== null && \trim($displayName) !== '') {
|
||||
$nameParts = \preg_split('/\s+/', \trim($displayName), 2);
|
||||
if ($nameParts !== false && isset($nameParts[0])) {
|
||||
$firstName = $nameParts[0];
|
||||
}
|
||||
if ($nameParts !== false && isset($nameParts[1])) {
|
||||
$lastName = $nameParts[1];
|
||||
}
|
||||
}
|
||||
|
||||
$payload = [
|
||||
'username' => $username,
|
||||
'credentials' => [[
|
||||
'value' => $password,
|
||||
'type' => 'password',
|
||||
]],
|
||||
'firstName' => $firstName,
|
||||
'lastName' => $lastName,
|
||||
'emailVerified' => true,
|
||||
'enabled' => true,
|
||||
];
|
||||
|
||||
if ($email !== null) {
|
||||
$payload['email'] = $email;
|
||||
}
|
||||
|
||||
return \json_encode($payload, JSON_THROW_ON_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function getAuthorizationEndPoint(): array {
|
||||
$loginParams = [
|
||||
'client_id' => 'web',
|
||||
'redirect_uri' => OcisHelper::getServerUrl() . '/oidc-callback.html',
|
||||
'response_mode' => 'query',
|
||||
'response_type' => 'code',
|
||||
'scope' => 'openid profile email acr',
|
||||
];
|
||||
$queryString = \http_build_query($loginParams);
|
||||
$authUrl = self::getKeycloakUrl() . "/realms/oCIS/protocol/openid-connect/auth?" . $queryString;
|
||||
$response = HttpRequestHelper::get(
|
||||
$authUrl,
|
||||
);
|
||||
$cookie = $response->getHeader("Set-Cookie")[0];
|
||||
$htmlData = $response->getBody()->getContents();
|
||||
if (!preg_match('/action="([^"]+)"/i', $htmlData, $match)) {
|
||||
throw new Exception('No authorization url found in the HTML response body.');
|
||||
}
|
||||
$authorizationUrl = $match[1];
|
||||
return [$authorizationUrl, $cookie];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $user
|
||||
* @param string $authorizationUrl
|
||||
* @param string $cookie
|
||||
*
|
||||
* @return string
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function getCode(array $user, string $authorizationUrl, string $cookie): string {
|
||||
$authCodeResponse = HttpRequestHelper::post(
|
||||
$authorizationUrl,
|
||||
null,
|
||||
null,
|
||||
[
|
||||
'Cookie' => $cookie,
|
||||
],
|
||||
[
|
||||
'username' => $user['actualUsername'],
|
||||
'password' => $user['password'],
|
||||
],
|
||||
);
|
||||
$locationHeader = $authCodeResponse->getHeader('Location');
|
||||
$queryString = parse_url($locationHeader[0], PHP_URL_QUERY);
|
||||
parse_str($queryString, $urlParams);
|
||||
return $urlParams['code'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $authorizationCode
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getToken(string $authorizationCode): ResponseInterface {
|
||||
$url = self::getKeycloakUrl() . '/realms/oCIS/protocol/openid-connect/token';
|
||||
$tokenResponse = HttpRequestHelper::post(
|
||||
$url,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
[
|
||||
'client_id' => 'web',
|
||||
'code' => $authorizationCode,
|
||||
'redirect_uri' => OcisHelper::getServerUrl() . '/oidc-callback.html',
|
||||
'grant_type' => 'authorization_code',
|
||||
],
|
||||
);
|
||||
if ($tokenResponse->getStatusCode() !== 200) {
|
||||
throw new Exception(
|
||||
'Failed to retrieve token: Expected status code to be 200 but received ' .
|
||||
$tokenResponse->getStatusCode() .
|
||||
'.\nMessage: ' .
|
||||
$tokenResponse->getBody()->getContents(),
|
||||
);
|
||||
}
|
||||
return $tokenResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $user
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public static function setAccessTokenForKeycloakOcisUser(array $user): array {
|
||||
[$authorizationUrl, $cookie] = self::getAuthorizationEndPoint();
|
||||
$authorizationCode = self::getCode($user, $authorizationUrl, $cookie);
|
||||
$tokenResponse = self::getToken($authorizationCode);
|
||||
return json_decode($tokenResponse->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getRealm(): array {
|
||||
$url = self::getKeycloakUrl() . '/admin/realms/oCIS';
|
||||
$response = HttpRequestHelper::get(
|
||||
$url,
|
||||
null,
|
||||
null,
|
||||
[
|
||||
'Authorization' => 'Bearer ' . self::getAdminAccessToken(),
|
||||
],
|
||||
);
|
||||
if ($response->getStatusCode() !== 200) {
|
||||
throw new Exception("Failed to get realm roles.");
|
||||
}
|
||||
return json_decode($response->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param string $value
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public static function updateRealmAttribute(string $key, string $value): ResponseInterface {
|
||||
$realm = self::getRealm();
|
||||
$attributes = $realm['attributes'] ?? [];
|
||||
$attributes[$key] = $value;
|
||||
$url = self::getKeycloakUrl() . '/admin/realms/oCIS';
|
||||
return HttpRequestHelper::put(
|
||||
$url,
|
||||
null,
|
||||
null,
|
||||
[
|
||||
'Authorization' => 'Bearer ' . self::getAdminAccessToken(),
|
||||
'Content-Type' => 'application/json',
|
||||
],
|
||||
json_encode(['attributes' => $attributes], JSON_THROW_ON_ERROR),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public static function deleteRealmAttribute(string $key): ResponseInterface {
|
||||
$realm = self::getRealm();
|
||||
$attributes = $realm['attributes'] ?? [];
|
||||
unset($attributes[$key]);
|
||||
$url = self::getKeycloakUrl() . '/admin/realms/oCIS';
|
||||
return HttpRequestHelper::put(
|
||||
$url,
|
||||
null,
|
||||
null,
|
||||
[
|
||||
'Authorization' => 'Bearer ' . self::getAdminAccessToken(),
|
||||
'Content-Type' => 'application/json',
|
||||
],
|
||||
json_encode(['attributes' => $attributes], JSON_THROW_ON_ERROR),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $uuid
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function deleteKeycloakUser(string $uuid): ResponseInterface {
|
||||
$url = self::getKeycloakUrl() . '/admin/realms/oCIS/users/' . $uuid;
|
||||
return HttpRequestHelper::delete(
|
||||
$url,
|
||||
null,
|
||||
null,
|
||||
[
|
||||
"Authorization" => "Bearer " . self::getAdminAccessToken(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -493,8 +493,9 @@ class WebDavHelper {
|
||||
* fetches personal space id for provided user
|
||||
*
|
||||
* @param string $baseUrl
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param string|null $user
|
||||
* @param string|null $password
|
||||
* @param array|null $headers
|
||||
*
|
||||
* @return string
|
||||
* @throws GuzzleException
|
||||
@@ -502,8 +503,9 @@ class WebDavHelper {
|
||||
*/
|
||||
public static function getPersonalSpaceIdForUser(
|
||||
string $baseUrl,
|
||||
string $user,
|
||||
string $password,
|
||||
?string $user = null,
|
||||
?string $password = null,
|
||||
?array $headers = [],
|
||||
): string {
|
||||
if (\array_key_exists($user, self::$spacesIdRef) && \array_key_exists("personal", self::$spacesIdRef[$user])) {
|
||||
return self::$spacesIdRef[$user]["personal"];
|
||||
@@ -511,7 +513,7 @@ class WebDavHelper {
|
||||
|
||||
$personalSpaceId = '';
|
||||
if (!OcisHelper::isTestingOnReva()) {
|
||||
$response = GraphHelper::getMySpaces($baseUrl, $user, $password, '');
|
||||
$response = GraphHelper::getMySpaces($baseUrl, $user, $password, '', [], $headers);
|
||||
Assert::assertEquals(200, $response->getStatusCode(), "Cannot list drives for user '$user'");
|
||||
|
||||
$drives = HttpRequestHelper::getJsonDecodedResponseBodyContent($response);
|
||||
@@ -564,18 +566,21 @@ class WebDavHelper {
|
||||
* In case of any exception, it returns a fake space ID
|
||||
*
|
||||
* @param string $baseUrl
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param string|null $user
|
||||
* @param string|null $password
|
||||
* @param array|null $headers
|
||||
*
|
||||
* @return string
|
||||
* @throws Exception|GuzzleException
|
||||
*/
|
||||
public static function getPersonalSpaceIdForUserOrFakeIfNotFound(
|
||||
string $baseUrl,
|
||||
string $user,
|
||||
string $password,
|
||||
?string $user = null,
|
||||
?string $password = null,
|
||||
?array $headers = [],
|
||||
): string {
|
||||
if (\str_starts_with($user, "non-exist") || \str_starts_with($user, "nonexist")) {
|
||||
// only fake for non-existent users
|
||||
if ($user !== null && (\str_starts_with($user, "non-exist") || \str_starts_with($user, "nonexist"))) {
|
||||
return self::generateUUIDv4();
|
||||
}
|
||||
|
||||
@@ -583,6 +588,7 @@ class WebDavHelper {
|
||||
$baseUrl,
|
||||
$user,
|
||||
$password,
|
||||
$headers,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -660,6 +666,7 @@ class WebDavHelper {
|
||||
$baseUrl,
|
||||
$user,
|
||||
$password,
|
||||
$headers,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -732,6 +739,7 @@ class WebDavHelper {
|
||||
$config,
|
||||
null,
|
||||
$stream,
|
||||
false,
|
||||
$timeout,
|
||||
$client,
|
||||
$isGivenStep,
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* ownCloud
|
||||
*
|
||||
* @author Prajwol Amatya <prajwol@jankaritech.com>
|
||||
* @copyright Copyright (c) 2022 Prajwol Amatya prajwol@jankaritech.com
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License,
|
||||
* as published by the Free Software Foundation;
|
||||
* either version 3 of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace TestHelpers;
|
||||
|
||||
require __DIR__ . '/../../../vendor-php/autoload.php';
|
||||
use Exception;
|
||||
use Playwright\Playwright;
|
||||
use Zxing\QrReader;
|
||||
use OTPHP\TOTP;
|
||||
|
||||
/**
|
||||
* A helper class for setting up user and store user access token using web UI
|
||||
*/
|
||||
class WebUIHelper {
|
||||
private static int $defaultTimeout = 5000;
|
||||
private static string $keycloakHeader = '#kc-header';
|
||||
private static string $usernameInput = '#username';
|
||||
private static string $passwordInput = '#password';
|
||||
private static string $loginButton = '#kc-login';
|
||||
private static string $filesView = '#files-view';
|
||||
private static string $modeSwitchButton = '#oc-topbar-mode-switch-btn';
|
||||
private static string $vaultModeSelector
|
||||
= "//button[contains(@class, 'oc-topbar-mode-switch-option')][.//span[text()='Vault']]";
|
||||
private static string $qrCode = '#kc-totp-secret-qr-code';
|
||||
private static string $totpInput = '#totp';
|
||||
private static string $userLabel = '#userLabel';
|
||||
private static string $saveTotpButton = '#saveTOTPBtn';
|
||||
|
||||
/**
|
||||
* @param string $ocisUrl
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function setUpUser(string $ocisUrl, string $username, string $password): array {
|
||||
$context = Playwright::chromium(
|
||||
[
|
||||
'headless' => true,
|
||||
'args' => ['--ignore-certificate-errors', '--no-sandbox'],
|
||||
],
|
||||
);
|
||||
$screenshotPath = '/tmp/qr_' . uniqid() . '.png';
|
||||
try {
|
||||
$page = $context->newPage();
|
||||
$page->goto($ocisUrl, ['waitUntil' => 'networkidle']);
|
||||
$page->waitForSelector(self::$keycloakHeader, ['timeout' => self::$defaultTimeout]);
|
||||
$page->locator(self::$usernameInput)->fill($username);
|
||||
$page->locator(self::$passwordInput)->fill($password);
|
||||
$page->locator(self::$loginButton)->click();
|
||||
$page->waitForSelector(self::$filesView, ['timeout' => self::$defaultTimeout]);
|
||||
|
||||
// change to vault mode
|
||||
$page->locator(self::$modeSwitchButton)->click();
|
||||
$page->locator(self::$vaultModeSelector)->click();
|
||||
$page->waitForSelector(self::$qrCode, ['timeout' => self::$defaultTimeout]);
|
||||
$qrLocator = $page->locator(self::$qrCode);
|
||||
|
||||
// setup mfa
|
||||
$qrLocator->screenshot($screenshotPath);
|
||||
if (!file_exists($screenshotPath)) {
|
||||
throw new Exception("Failed to save QR code screenshot to: " . $screenshotPath);
|
||||
}
|
||||
$otp = self::extractOtpFromQr($screenshotPath);
|
||||
$page->locator(self::$totpInput)->fill((string)$otp);
|
||||
$page->locator(self::$userLabel)->fill('test');
|
||||
$page->locator(self::$saveTotpButton)->click();
|
||||
$page->waitForSelector(self::$filesView, ['timeout' => self::$defaultTimeout]);
|
||||
return $context->storageState();
|
||||
} catch (\Exception $e) {
|
||||
throw new Exception("Login failed for user '$username': " . $e->getMessage(), 0, $e);
|
||||
} finally {
|
||||
if (file_exists($screenshotPath)) {
|
||||
unlink($screenshotPath);
|
||||
}
|
||||
$context->close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $imagePath
|
||||
*
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function extractOtpFromQr(string $imagePath): string {
|
||||
$qrReader = new QrReader($imagePath);
|
||||
$qrData = $qrReader->text();
|
||||
|
||||
if (empty($qrData)) {
|
||||
throw new Exception("Could not decode QR code from image: " . $imagePath);
|
||||
}
|
||||
|
||||
$parsedUrl = parse_url($qrData);
|
||||
if (!isset($parsedUrl['query'])) {
|
||||
throw new Exception("QR code data does not contain a valid otpauth URL: " . $qrData);
|
||||
}
|
||||
|
||||
parse_str($parsedUrl['query'], $queryParams);
|
||||
$secret = $queryParams['secret'] ?? null;
|
||||
|
||||
if ($secret === null) {
|
||||
throw new Exception("No 'secret' parameter found in QR code URL: " . $qrData);
|
||||
}
|
||||
|
||||
$totp = TOTP::createFromSecret($secret);
|
||||
|
||||
return $totp->now();
|
||||
}
|
||||
}
|
||||
@@ -60,20 +60,33 @@ class CapabilitiesContext implements Context {
|
||||
*
|
||||
* @param string $username
|
||||
* @param boolean $formatJson // if true then formats the response in json
|
||||
* @param boolean $vaultMode
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function userGetsCapabilities(string $username, ?bool $formatJson = false): ResponseInterface {
|
||||
public function userGetsCapabilities(
|
||||
string $username,
|
||||
?bool $formatJson = false,
|
||||
?bool $vaultMode = false,
|
||||
): ResponseInterface {
|
||||
$user = $this->featureContext->getActualUsername($username);
|
||||
$password = $this->featureContext->getPasswordForUser($user);
|
||||
$queryParams = [];
|
||||
if ($formatJson) {
|
||||
$queryParams['format'] = 'json';
|
||||
}
|
||||
if ($vaultMode) {
|
||||
$queryParams['vault'] = 'true';
|
||||
}
|
||||
$queryString = $queryParams ? '?' . http_build_query($queryParams) : '';
|
||||
return OcsApiHelper::sendRequest(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$user,
|
||||
$password,
|
||||
'GET',
|
||||
'/cloud/capabilities' . ($formatJson ? '?format=json' : ''),
|
||||
'/cloud/capabilities' . $queryString,
|
||||
[],
|
||||
$this->featureContext->getOcsApiVersion(),
|
||||
);
|
||||
@@ -134,17 +147,19 @@ class CapabilitiesContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When user :username retrieves the capabilities using the capabilities API
|
||||
* @When /^user "([^"]*)" retrieves the(| vault mode)? capabilities using the capabilities API$/
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $vaultMode
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function userRetrievesCapabilities(string $username): void {
|
||||
public function userRetrievesCapabilities(string $username, string $vaultMode): void {
|
||||
$user = $this->featureContext->getActualUsername($username);
|
||||
$this->featureContext->setResponse($this->userGetsCapabilities($user, true));
|
||||
$vaultMode = trim($vaultMode) === "vault mode";
|
||||
$this->featureContext->setResponse($this->userGetsCapabilities($user, true, $vaultMode));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2046,10 +2046,20 @@ class FeatureContext extends BehatVariablesContext {
|
||||
if ($response === null) {
|
||||
$response = $this->getResponse();
|
||||
}
|
||||
return \json_decode(
|
||||
(string)$response->getBody(),
|
||||
true,
|
||||
);
|
||||
|
||||
$body = $response->getBody();
|
||||
$body->rewind();
|
||||
$bodyContent = $body->getContents();
|
||||
if ($bodyContent === '') {
|
||||
return [];
|
||||
}
|
||||
|
||||
$decodedResponse = \json_decode($bodyContent, true);
|
||||
if (!\is_array($decodedResponse)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $decodedResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,6 +19,7 @@ use TestHelpers\GraphHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
use TestHelpers\KeycloakHelper;
|
||||
|
||||
require_once 'bootstrap.php';
|
||||
|
||||
@@ -293,11 +294,21 @@ class GraphContext implements Context {
|
||||
*/
|
||||
public function adminDeletesUserUsingTheGraphApi(string $user, ?string $byUser = null): ResponseInterface {
|
||||
$credentials = $this->getAdminOrUserCredentials($byUser);
|
||||
$adminUser = $credentials["username"];
|
||||
$adminPass = $credentials["password"];
|
||||
$headers = [];
|
||||
if (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$access_token = $this->featureContext->getOcisUserToken($adminUser)["token"]["accessToken"];
|
||||
$headers['Authorization'] = 'Bearer ' . $access_token;
|
||||
$adminUser = null;
|
||||
$adminPass = null;
|
||||
}
|
||||
$response = GraphHelper::deleteUser(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$credentials["username"],
|
||||
$credentials["password"],
|
||||
$user,
|
||||
$adminUser,
|
||||
$adminPass,
|
||||
$headers,
|
||||
);
|
||||
if ($response->getStatusCode() === 204) {
|
||||
$this->featureContext->rememberThatUserIsNotExpectedToExist($user);
|
||||
@@ -1805,25 +1816,34 @@ class GraphContext implements Context {
|
||||
*/
|
||||
public function theAdministratorHasGivenTheRoleUsingTheGraphApi(string $role, string $user): void {
|
||||
$userId = $this->featureContext->getAttributeOfCreatedUser($user, 'id') ?: $user;
|
||||
if (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$response = KeycloakHelper::assignrole($userId, $role);
|
||||
Assert::assertEquals(
|
||||
204,
|
||||
$response->getStatusCode(),
|
||||
__METHOD__
|
||||
. "\nExpected status code '204' but got '" . $response->getStatusCode() . "'",
|
||||
);
|
||||
} else {
|
||||
if (empty($this->appEntity)) {
|
||||
$this->setApplicationEntity();
|
||||
}
|
||||
|
||||
if (empty($this->appEntity)) {
|
||||
$this->setApplicationEntity();
|
||||
$response = GraphHelper::assignRole(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getAdminUsername(),
|
||||
$this->featureContext->getAdminPassword(),
|
||||
$this->appEntity["appRoles"][$role],
|
||||
$this->appEntity["id"],
|
||||
$userId,
|
||||
);
|
||||
Assert::assertEquals(
|
||||
201,
|
||||
$response->getStatusCode(),
|
||||
__METHOD__
|
||||
. "\nExpected status code '200' but got '" . $response->getStatusCode() . "'",
|
||||
);
|
||||
}
|
||||
|
||||
$response = GraphHelper::assignRole(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getAdminUsername(),
|
||||
$this->featureContext->getAdminPassword(),
|
||||
$this->appEntity["appRoles"][$role],
|
||||
$this->appEntity["id"],
|
||||
$userId,
|
||||
);
|
||||
Assert::assertEquals(
|
||||
201,
|
||||
$response->getStatusCode(),
|
||||
__METHOD__
|
||||
. "\nExpected status code '200' but got '" . $response->getStatusCode() . "'",
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
use Behat\Behat\Context\Context;
|
||||
use Behat\Gherkin\Node\TableNode;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\KeycloakHelper;
|
||||
use TestHelpers\OcisConfigHelper;
|
||||
use TestHelpers\GraphHelper;
|
||||
use PHPUnit\Framework\Assert;
|
||||
@@ -110,11 +113,9 @@ class OcisConfigContext implements Context {
|
||||
$response = OcisConfigHelper::reConfigureOcis($envs);
|
||||
}
|
||||
|
||||
$resBody = $response->getBody()->getContents();
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
"Failed to set config $configVariable=$configValue. Response: $resBody",
|
||||
$this->assertOcisRestarted(
|
||||
$response,
|
||||
"Failed to set config $configVariable=$configValue.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -346,11 +347,66 @@ class OcisConfigContext implements Context {
|
||||
*/
|
||||
public function rollbackOcis(): void {
|
||||
$response = OcisConfigHelper::rollbackOcis();
|
||||
$resBody = $response->getBody()->getContents();
|
||||
$this->assertOcisRestarted(
|
||||
$response,
|
||||
"Failed to rollback ocis server. Check if oCIS is started with ociswrapper.",
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that an oCIS restart triggered by ociswrapper succeeded.
|
||||
* In vault mode the wrapper's admin health-check uses basic-auth which is
|
||||
* disabled (OIDC role assignment only), so the wrapper always returns HTTP 500
|
||||
* even after a successful restart. When Keycloak/vault mode is detected we
|
||||
* poll the unauthenticated proxy debug readyz endpoint instead of failing.
|
||||
*
|
||||
* @param ResponseInterface $response
|
||||
* @param string $errorMessage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function assertOcisRestarted(ResponseInterface $response, string $errorMessage): void {
|
||||
$statusCode = $response->getStatusCode();
|
||||
if ($statusCode === 200) {
|
||||
return;
|
||||
}
|
||||
if (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$this->waitForOcisProxyReady();
|
||||
return;
|
||||
}
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
"Failed to rollback ocis server. Check if oCIS is started with ociswrapper. Response: $resBody",
|
||||
$statusCode,
|
||||
$errorMessage . " Response: " . $response->getBody()->getContents(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Poll the unauthenticated proxy debug readyz endpoint until oCIS is ready.
|
||||
* Used in vault/Keycloak mode where basic-auth health checks are unavailable.
|
||||
*
|
||||
* @param int $timeoutSeconds
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
private function waitForOcisProxyReady(int $timeoutSeconds = 60): void {
|
||||
$readyzUrl = 'http://localhost:9205/readyz';
|
||||
$deadline = time() + $timeoutSeconds;
|
||||
while (time() < $deadline) {
|
||||
try {
|
||||
$response = HttpRequestHelper::get($readyzUrl);
|
||||
if ($response->getStatusCode() === 200) {
|
||||
return;
|
||||
}
|
||||
echo "oCIS not ready yet. Retrying in 1s...\n";
|
||||
} catch (\Exception $e) {
|
||||
throw new Exception("oCIS not ready. Error: $e");
|
||||
}
|
||||
sleep(1);
|
||||
}
|
||||
throw new \RuntimeException(
|
||||
"Timed out after {$timeoutSeconds}s waiting for oCIS proxy readyz at {$readyzUrl}",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,10 @@ use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\OcisHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\GraphHelper;
|
||||
use TestHelpers\KeycloakHelper;
|
||||
use Laminas\Ldap\Exception\LdapException;
|
||||
use Laminas\Ldap\Ldap;
|
||||
use TestHelpers\WebUIHelper;
|
||||
|
||||
/**
|
||||
* Functions for provisioning of users and groups
|
||||
@@ -44,6 +46,38 @@ trait Provisioning {
|
||||
private array $startingGroups = [];
|
||||
private array $createdRemoteGroups = [];
|
||||
private array $createdGroups = [];
|
||||
private array $userTokens = [];
|
||||
|
||||
/**
|
||||
* @param array $user
|
||||
* @param mixed $tokenData
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setOcisUserToken(array $user, mixed $tokenData): void {
|
||||
$userId = $user['actualUsername'] ?? null;
|
||||
if (\is_object($tokenData)) {
|
||||
$tokenData = (array) $tokenData;
|
||||
}
|
||||
|
||||
$this->userTokens[$userId] = [
|
||||
'user' => $user,
|
||||
'token' => [
|
||||
'userid' => $userId,
|
||||
'accessToken' => $tokenData['access_token'],
|
||||
'refreshToken' => $tokenData['refresh_token'],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $userId
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOcisUserToken(string $userId): array {
|
||||
return $this->userTokens[$userId];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this is the admin group. That group is always a local group in
|
||||
@@ -524,6 +558,97 @@ trait Provisioning {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $userAttributes
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function createKeycloakUser(array $userAttributes): void {
|
||||
$response = KeycloakHelper::createUser(
|
||||
$userAttributes['userid'],
|
||||
$userAttributes['password'],
|
||||
$userAttributes['email'],
|
||||
$userAttributes['displayName'],
|
||||
);
|
||||
if ($response->getStatusCode() !== 201) {
|
||||
$responseBody = (string)$response->getBody();
|
||||
throw new Exception(
|
||||
__METHOD__ .
|
||||
" Unexpected failure when creating the user in keycloak '" .
|
||||
$userAttributes['userid'] . "'" .
|
||||
"\nHTTP status " . $response->getStatusCode() .
|
||||
"\nKeycloak response " . $responseBody,
|
||||
);
|
||||
}
|
||||
$locationHeader = explode("/", $response->getHeader("Location")[0]);
|
||||
$uuid = end($locationHeader);
|
||||
$this->addUserToCreatedUsersList(
|
||||
$userAttributes['userid'],
|
||||
$userAttributes['password'],
|
||||
$userAttributes['displayName'],
|
||||
$userAttributes['email'],
|
||||
$uuid,
|
||||
);
|
||||
|
||||
// assign default ocisUser role to newly created user
|
||||
$res = KeycloakHelper::assignRole($uuid, "User");
|
||||
Assert::assertEquals(
|
||||
204,
|
||||
$res->getStatusCode(),
|
||||
__METHOD__ . " failed to assign realm role to user '" .
|
||||
$userAttributes['userid'] . "'" .
|
||||
"\nHTTP status " . $res->getStatusCode() .
|
||||
"\nKeycloak response " . (string)$res->getBody(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @BeforeScenario
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function setAccessTokenForAdmin(): void {
|
||||
if (!KeycloakHelper::isTestingWithKeycloak()) {
|
||||
return;
|
||||
}
|
||||
KeycloakHelper::resetAdminAccessToken();
|
||||
$adminUser = [
|
||||
"password" => "admin",
|
||||
"displayname" => "Admin Admin",
|
||||
"email" => "admin@example.org",
|
||||
"actualUsername" => "admin",
|
||||
];
|
||||
$tokenData = KeycloakHelper::setAccessTokenForKeycloakOcisUser($adminUser);
|
||||
$this->setOcisUserToken($adminUser, $tokenData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up Keycloak user in oCIS
|
||||
* User is logged in via web UI and user access token is extracted
|
||||
*
|
||||
* @Given user :user has logged in via web UI
|
||||
*
|
||||
* @param string $user
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function userHasLoggedInViaWebUI(string $user): void {
|
||||
$createdUsers = $this->getCreatedUsers();
|
||||
$user = $createdUsers[strtolower($user)];
|
||||
$state = WebUIHelper::setUpUser(
|
||||
$this->getBaseUrl(),
|
||||
$user["actualUsername"],
|
||||
$user["password"],
|
||||
);
|
||||
$stateData = \json_decode($state['origins'][0]['localStorage'][2]['value']);
|
||||
$this->setOcisUserToken($user, $stateData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates multiple users
|
||||
*
|
||||
@@ -556,6 +681,8 @@ trait Provisioning {
|
||||
foreach ($users as $userAttributes) {
|
||||
if ($this->isTestingWithLdap()) {
|
||||
$this->createLdapUser($userAttributes);
|
||||
} elseif (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$this->createKeycloakUser($userAttributes);
|
||||
} else {
|
||||
$attributesToCreateUser['userid'] = $userAttributes['userid'];
|
||||
$attributesToCreateUser['password'] = $userAttributes['password'];
|
||||
@@ -588,7 +715,7 @@ trait Provisioning {
|
||||
}
|
||||
|
||||
$exceptionToThrow = null;
|
||||
if (!$this->isTestingWithLdap()) {
|
||||
if (!$this->isTestingWithLdap() && !KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$results = HttpRequestHelper::sendBatchRequest($requests, $client);
|
||||
// Check all requests to inspect failures.
|
||||
foreach ($results as $key => $e) {
|
||||
@@ -611,38 +738,40 @@ trait Provisioning {
|
||||
|
||||
// Create requests for setting displayname and email for the newly created users.
|
||||
// These values cannot be set while creating the user, so we have to edit the newly created user to set these values.
|
||||
foreach ($users as $userAttributes) {
|
||||
if (!$this->isTestingWithLdap()) {
|
||||
// for graph api, we need to save the user id to be able to add it in some group
|
||||
// can be fetched with the "onPremisesSamAccountName" i.e. userid
|
||||
$response = $this->graphContext->adminHasRetrievedUserUsingTheGraphApi($userAttributes['userid']);
|
||||
$userAttributes['id'] = $this->getJsonDecodedResponse($response)['id'];
|
||||
} else {
|
||||
$userAttributes['id'] = null;
|
||||
if (!KeycloakHelper::isTestingWithKeycloak()) {
|
||||
foreach ($users as $userAttributes) {
|
||||
if (!$this->isTestingWithLdap()) {
|
||||
// for graph api, we need to save the user id to be able to add it in some group
|
||||
// can be fetched with the "onPremisesSamAccountName" i.e. userid
|
||||
$response = $this->graphContext->adminHasRetrievedUserUsingTheGraphApi($userAttributes['userid']);
|
||||
$userAttributes['id'] = $this->getJsonDecodedResponse($response)['id'];
|
||||
} else {
|
||||
$userAttributes['id'] = null;
|
||||
}
|
||||
$this->addUserToCreatedUsersList(
|
||||
$userAttributes['userid'],
|
||||
$userAttributes['password'],
|
||||
$userAttributes['displayName'],
|
||||
$userAttributes['email'],
|
||||
$userAttributes['id'],
|
||||
);
|
||||
}
|
||||
$this->addUserToCreatedUsersList(
|
||||
$userAttributes['userid'],
|
||||
$userAttributes['password'],
|
||||
$userAttributes['displayName'],
|
||||
$userAttributes['email'],
|
||||
$userAttributes['id'],
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($exceptionToThrow)) {
|
||||
throw $exceptionToThrow;
|
||||
}
|
||||
if (isset($exceptionToThrow)) {
|
||||
throw $exceptionToThrow;
|
||||
}
|
||||
|
||||
foreach ($users as $user) {
|
||||
Assert::assertTrue(
|
||||
$this->userExists($user["userid"]),
|
||||
"User '" . $user["userid"] . "' should exist but does not exist",
|
||||
);
|
||||
}
|
||||
|
||||
if ($initialize) {
|
||||
foreach ($users as $user) {
|
||||
$this->initializeUser($user['userid'], $user['password']);
|
||||
Assert::assertTrue(
|
||||
$this->userExists($user["userid"]),
|
||||
"User '" . $user["userid"] . "' should exist but does not exist",
|
||||
);
|
||||
}
|
||||
|
||||
if ($initialize) {
|
||||
foreach ($users as $user) {
|
||||
$this->initializeUser($user['userid'], $user['password']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1944,6 +2073,7 @@ trait Provisioning {
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function cleanupDatabaseUsers(): void {
|
||||
$previousServer = $this->currentServer;
|
||||
@@ -1961,6 +2091,12 @@ trait Provisioning {
|
||||
$this->userExists($user),
|
||||
"User '$user' should not exist but does exist",
|
||||
);
|
||||
|
||||
// delete user from keycloak
|
||||
if (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$res = KeycloakHelper::deleteKeycloakUser($userData['id']);
|
||||
$this->theHTTPStatusCodeShouldBe(204, "Failed to delete keycloak user '$user'", $res);
|
||||
}
|
||||
}
|
||||
$this->usingServer($previousServer);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\GraphHelper;
|
||||
use TestHelpers\OcisHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
use TestHelpers\KeycloakHelper;
|
||||
|
||||
require_once 'bootstrap.php';
|
||||
|
||||
@@ -132,13 +133,15 @@ class SpacesContext implements Context {
|
||||
/**
|
||||
* @param string $user
|
||||
* @param object $space
|
||||
* @param boolean $isVault
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPersonalSpaceForUser(string $user, object $space): void {
|
||||
public function addPersonalSpaceForUser(string $user, object $space, bool $isVault = false): void {
|
||||
$spaceName = $this->featureContext->getUserDisplayName($user);
|
||||
$this->personalSpaces[$spaceName] = $space;
|
||||
$this->personalSpaces[$spaceName]->serverType = $this->featureContext->getCurrentServer();
|
||||
$this->personalSpaces[$spaceName]->isVault = $isVault;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,11 +192,12 @@ class SpacesContext implements Context {
|
||||
/**
|
||||
* @param string $user
|
||||
* @param string $spaceName
|
||||
* @param boolean $isVault
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function getSpaceByName(string $user, string $spaceName): array {
|
||||
public function getSpaceByName(string $user, string $spaceName, bool $isVault = false): array {
|
||||
$password = $this->featureContext->getPasswordForUser($user);
|
||||
$createdSpaces = $this->getCreatedSpaces();
|
||||
$personalSpaces = $this->getPersonalSpaces();
|
||||
@@ -205,10 +209,16 @@ class SpacesContext implements Context {
|
||||
|
||||
if (isset($allSpaces[$spaceName])
|
||||
&& $allSpaces[$spaceName]->serverType === $this->featureContext->getCurrentServer()
|
||||
&& (!isset($allSpaces[$spaceName]->isVault) || $allSpaces[$spaceName]->isVault === $isVault)
|
||||
) {
|
||||
return json_decode(json_encode($allSpaces[$spaceName]), true);
|
||||
}
|
||||
|
||||
$headers = [];
|
||||
if (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$access_token = $this->featureContext->getOcisUserToken($user)["token"]["accessToken"];
|
||||
$headers['Authorization'] = 'Bearer ' . $access_token;
|
||||
}
|
||||
// Sometimes listing available spaces might not return newly created/shared spaces.
|
||||
// So we try again until we find the space or we reach the max number of retries (i.e. 10)
|
||||
$retried = 0;
|
||||
@@ -216,9 +226,12 @@ class SpacesContext implements Context {
|
||||
// list 'me/drives' as given user
|
||||
$response = GraphHelper::getMySpaces(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$user,
|
||||
$password,
|
||||
KeycloakHelper::isTestingWithKeycloak() ? null : $user,
|
||||
KeycloakHelper::isTestingWithKeycloak() ? null : $password,
|
||||
"",
|
||||
[],
|
||||
$headers,
|
||||
$isVault,
|
||||
);
|
||||
// NOTE: user can be created with empty password
|
||||
// so if that's the case, the user won't be able to request using empty password
|
||||
@@ -254,7 +267,7 @@ class SpacesContext implements Context {
|
||||
if ($space->driveType === "project") {
|
||||
$this->addToCreatedSpace($user, $space);
|
||||
} elseif (!($space->name === "Shares" && $space->driveType === "virtual")) {
|
||||
$this->addPersonalSpaceForUser($user, $space);
|
||||
$this->addPersonalSpaceForUser($user, $space, $isVault);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -278,12 +291,13 @@ class SpacesContext implements Context {
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $spaceName
|
||||
* @param boolean $isVault
|
||||
*
|
||||
* @return string
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function getSpaceIdByName(string $user, string $spaceName): string {
|
||||
$space = $this->getSpaceByName($user, $spaceName);
|
||||
public function getSpaceIdByName(string $user, string $spaceName, bool $isVault = false): string {
|
||||
$space = $this->getSpaceByName($user, $spaceName, $isVault);
|
||||
return $space["id"];
|
||||
}
|
||||
|
||||
@@ -797,22 +811,38 @@ class SpacesContext implements Context {
|
||||
* @param string $user
|
||||
* @param string $spaceName
|
||||
* @param string $foldersPath
|
||||
* @param boolean $isVault
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function propfindSpace(string $user, string $spaceName, string $foldersPath = ''): ResponseInterface {
|
||||
$spaceId = $this->getSpaceIdByName($user, $spaceName);
|
||||
public function propfindSpace(
|
||||
string $user,
|
||||
string $spaceName,
|
||||
string $foldersPath = '',
|
||||
bool $isVault = false,
|
||||
): ResponseInterface {
|
||||
$spaceId = $this->getSpaceIdByName($user, $spaceName, $isVault);
|
||||
$password = $this->featureContext->getPasswordForUser($user);
|
||||
$headers = [];
|
||||
if (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$access_token = $this->featureContext->getOcisUserToken($user)["token"]["accessToken"];
|
||||
$headers['Authorization'] = 'Bearer ' . $access_token;
|
||||
$user = null;
|
||||
$password = null;
|
||||
}
|
||||
return WebDavHelper::propfind(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$user,
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
$password,
|
||||
$foldersPath,
|
||||
[],
|
||||
null,
|
||||
$spaceId,
|
||||
'files',
|
||||
WebDavHelper::DAV_VERSION_SPACES,
|
||||
null,
|
||||
$headers,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -888,10 +918,11 @@ class SpacesContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^for user "([^"]*)" the space "([^"]*)" should (not|)\s?contain these (?:files|entries):$/
|
||||
* @Then /^for user "([^"]*)" the space "([^"]*)"(| in vault)? should (not|)\s?contain these (?:files|entries):$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $spaceName
|
||||
* @param string $isVault
|
||||
* @param string $shouldOrNot (not|)
|
||||
* @param TableNode $expectedFiles
|
||||
*
|
||||
@@ -902,11 +933,13 @@ class SpacesContext implements Context {
|
||||
public function userTheSpaceShouldContainEntries(
|
||||
string $user,
|
||||
string $spaceName,
|
||||
string $isVault,
|
||||
string $shouldOrNot,
|
||||
TableNode $expectedFiles,
|
||||
): void {
|
||||
$space = $this->getSpaceByName($user, $spaceName);
|
||||
$this->featureContext->setResponse($this->propfindSpace($user, $spaceName));
|
||||
$isVault = trim($isVault) === "in vault";
|
||||
$space = $this->getSpaceByName($user, $spaceName, $isVault);
|
||||
$this->featureContext->setResponse($this->propfindSpace($user, $spaceName, '', $isVault));
|
||||
$this->featureContext->propfindResultShouldContainEntries(
|
||||
$shouldOrNot,
|
||||
$expectedFiles,
|
||||
@@ -1275,11 +1308,12 @@ class SpacesContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^user "([^"]*)" creates a (?:folder|subfolder) "([^"]*)" in space "([^"]*)" using the WebDav Api$/
|
||||
* @When /^user "([^"]*)" creates a (?:folder|subfolder) "([^"]*)" in space "([^"]*)"(| in vault)? using the WebDav Api$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $folder
|
||||
* @param string $spaceName
|
||||
* @param string $isVault
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
@@ -1289,13 +1323,15 @@ class SpacesContext implements Context {
|
||||
string $user,
|
||||
string $folder,
|
||||
string $spaceName,
|
||||
string $isVault,
|
||||
): void {
|
||||
$folder = \trim($folder, '/');
|
||||
$exploded = explode('/', $folder);
|
||||
$path = '';
|
||||
$isVault = trim($isVault) === "in vault";
|
||||
for ($i = 0; $i < \count($exploded); $i++) {
|
||||
$path = $path . $exploded[$i] . '/';
|
||||
$response = $this->createFolderInSpace($user, $path, $spaceName);
|
||||
$response = $this->createFolderInSpace($user, $path, $spaceName, '', $isVault);
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
}
|
||||
@@ -1344,11 +1380,12 @@ class SpacesContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^user "([^"]*)" has created a (?:folder|subfolder) "([^"]*)" in space "([^"]*)"$/
|
||||
* @Given /^user "([^"]*)" has created a (?:folder|subfolder) "([^"]*)" in space "([^"]*)"(| in vault)?$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $folder
|
||||
* @param string $spaceName
|
||||
* @param string $isVault
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
@@ -1358,13 +1395,15 @@ class SpacesContext implements Context {
|
||||
string $user,
|
||||
string $folder,
|
||||
string $spaceName,
|
||||
string $isVault,
|
||||
): void {
|
||||
$folder = \trim($folder, '/');
|
||||
$paths = explode('/', $folder);
|
||||
$folderPath = '';
|
||||
$isVault = trim($isVault) === "in vault";
|
||||
foreach ($paths as $path) {
|
||||
$folderPath .= "$path/";
|
||||
$response = $this->createFolderInSpace($user, $folderPath, $spaceName);
|
||||
$response = $this->createFolderInSpace($user, $folderPath, $spaceName, '', $isVault);
|
||||
}
|
||||
$this->featureContext->theHTTPStatusCodeShouldBe(
|
||||
201,
|
||||
@@ -1378,6 +1417,7 @@ class SpacesContext implements Context {
|
||||
* @param string $folder
|
||||
* @param string $spaceName
|
||||
* @param string $ownerUser
|
||||
* @param boolean $isVault
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*
|
||||
@@ -1388,11 +1428,12 @@ class SpacesContext implements Context {
|
||||
string $folder,
|
||||
string $spaceName,
|
||||
string $ownerUser = '',
|
||||
bool $isVault = false,
|
||||
): ResponseInterface {
|
||||
if ($ownerUser === '') {
|
||||
$ownerUser = $user;
|
||||
}
|
||||
$spaceId = $this->getSpaceIdByName($ownerUser, $spaceName);
|
||||
$spaceId = $this->getSpaceIdByName($ownerUser, $spaceName, $isVault);
|
||||
return $this->featureContext->createFolder($user, $folder, false, null, $spaceId);
|
||||
}
|
||||
|
||||
@@ -1419,12 +1460,13 @@ class SpacesContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^user "([^"]*)" uploads a file inside space "([^"]*)" with content "([^"]*)" to "([^"]*)" using the WebDAV API$/
|
||||
* @When /^user "([^"]*)" uploads a file inside space "([^"]*)" with content "([^"]*)" to "([^"]*)"(| in vault)? using the WebDAV API$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $spaceName
|
||||
* @param string $content
|
||||
* @param string $destination
|
||||
* @param string $isVault
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
@@ -1435,8 +1477,10 @@ class SpacesContext implements Context {
|
||||
string $spaceName,
|
||||
string $content,
|
||||
string $destination,
|
||||
string $isVault,
|
||||
): void {
|
||||
$spaceId = $this->getSpaceIdByName($user, $spaceName);
|
||||
$isVault = trim($isVault) === "in vault";
|
||||
$spaceId = $this->getSpaceIdByName($user, $spaceName, $isVault);
|
||||
if ($spaceName === "Shares" && !\str_starts_with($destination, "Shares/")) {
|
||||
$destination = "Shares/" . \ltrim($destination, "/");
|
||||
}
|
||||
@@ -1831,10 +1875,11 @@ class SpacesContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^user "([^"]*)" has created a space "([^"]*)" with the default quota using the Graph API$/
|
||||
* @Given /^user "([^"]*)" has created a space "([^"]*)"(| in vault)? with the default quota using the Graph API$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $spaceName
|
||||
* @param string $isVault
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
@@ -1844,9 +1889,11 @@ class SpacesContext implements Context {
|
||||
public function theUserHasCreatedASpaceByDefaultUsingTheGraphApi(
|
||||
string $user,
|
||||
string $spaceName,
|
||||
string $isVault,
|
||||
): void {
|
||||
$space = ["name" => $spaceName];
|
||||
$response = $this->createSpace($user, $space);
|
||||
$isVault = trim($isVault) === "in vault";
|
||||
$response = $this->createSpace($user, $space, $isVault);
|
||||
$this->featureContext->theHTTPStatusCodeShouldBe(
|
||||
201,
|
||||
"Expected response status code should be 201 (Created)",
|
||||
@@ -1859,6 +1906,7 @@ class SpacesContext implements Context {
|
||||
/**
|
||||
* @param string $user
|
||||
* @param string $space
|
||||
* @param boolean $isVault
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
@@ -1867,13 +1915,24 @@ class SpacesContext implements Context {
|
||||
public function createSpace(
|
||||
string $user,
|
||||
array $space,
|
||||
bool $isVault = false,
|
||||
): ResponseInterface {
|
||||
$body = json_encode($space, JSON_THROW_ON_ERROR);
|
||||
$password = $this->featureContext->getPasswordForUser($user);
|
||||
$headers = [];
|
||||
if (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$access_token = $this->featureContext->getOcisUserToken($user)["token"]["accessToken"];
|
||||
$headers['Authorization'] = 'Bearer ' . $access_token;
|
||||
$user = null;
|
||||
$password = null;
|
||||
}
|
||||
return GraphHelper::createSpace(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$user,
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
$password,
|
||||
$body,
|
||||
$headers,
|
||||
$isVault,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* ownCloud
|
||||
*
|
||||
* @author Prajwol Amatya <prajwol@jankaritech.com>
|
||||
* @copyright Copyright (c) 2026 Prajwol Amatya prajwol@jankaritech.com
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License,
|
||||
* as published by the Free Software Foundation;
|
||||
* either version 3 of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
|
||||
use Behat\Behat\Context\Context;
|
||||
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use JsonException;
|
||||
use PHPUnit\Framework\Assert;
|
||||
use TestHelpers\BehatHelper;
|
||||
use TestHelpers\KeycloakHelper;
|
||||
|
||||
require_once 'bootstrap.php';
|
||||
|
||||
/**
|
||||
* Context for ocis vault specific steps
|
||||
*/
|
||||
class VaultContext implements Context {
|
||||
private FeatureContext $featureContext;
|
||||
private array $originalRealmAttributes = [];
|
||||
|
||||
/**
|
||||
* @BeforeScenario
|
||||
*
|
||||
* @param BeforeScenarioScope $scope
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function before(BeforeScenarioScope $scope): void {
|
||||
// Get the environment
|
||||
$environment = $scope->getEnvironment();
|
||||
// Get all the contexts you need in this context
|
||||
$this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the administrator has set the Keycloak realm attribute :key to :value
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $value
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function theAdministratorHasSetTheKeycloakRealmAttributeTo(string $key, string $value): void {
|
||||
$realm = KeycloakHelper::getRealm();
|
||||
$this->originalRealmAttributes[$key] = $realm['attributes'][$key] ?? null;
|
||||
$response = KeycloakHelper::updateRealmAttribute($key, $value);
|
||||
Assert::assertEquals(
|
||||
204,
|
||||
$response->getStatusCode(),
|
||||
"Failed to update Keycloak realm attribute $key. Response: " . $response->getBody()->getContents(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @AfterScenario @keycloak-config
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function restoreKeycloakRealmAttributes(): void {
|
||||
foreach ($this->originalRealmAttributes as $key => $value) {
|
||||
if ($value === null) {
|
||||
KeycloakHelper::deleteRealmAttribute($key);
|
||||
continue;
|
||||
}
|
||||
KeycloakHelper::updateRealmAttribute($key, $value);
|
||||
}
|
||||
$this->originalRealmAttributes = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then user :user should have acr value :acr
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $acr
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function userShouldHaveAcrValue(string $user, string $acr): void {
|
||||
$accessToken = $this->featureContext->getOcisUserToken($user)['token']['accessToken'];
|
||||
|
||||
// Decode JWT token
|
||||
$parts = explode('.', $accessToken);
|
||||
if (\count($parts) !== 3) {
|
||||
throw new Exception("Invalid JWT token format.");
|
||||
}
|
||||
$payload = $parts[1];
|
||||
$decodedPayload = base64_decode(strtr($payload, '-_', '+/'), true);
|
||||
$payloadArray = json_decode($decodedPayload, true);
|
||||
$actualAcr = $payloadArray['acr'] ?? null;
|
||||
Assert::assertEquals(
|
||||
$acr,
|
||||
$actualAcr,
|
||||
"Expected acr value to be $acr but got $actualAcr",
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\Asserts\WebDav as WebDavAssert;
|
||||
use TestHelpers\GraphHelper;
|
||||
use TestHelpers\KeycloakHelper;
|
||||
|
||||
/**
|
||||
* WebDav functions
|
||||
@@ -310,6 +311,13 @@ trait WebDav {
|
||||
$password = $this->getPasswordForUser($user);
|
||||
}
|
||||
|
||||
if (KeycloakHelper::isTestingWithKeycloak()) {
|
||||
$access_token = $this->getOcisUserToken($user)["token"]["accessToken"];
|
||||
$headers["Authorization"] = "Bearer " . $access_token;
|
||||
$user = null;
|
||||
$password = null;
|
||||
}
|
||||
|
||||
return WebDavHelper::makeDavRequest(
|
||||
$this->getBaseUrl(),
|
||||
$user,
|
||||
|
||||
@@ -487,6 +487,16 @@ default:
|
||||
- AuthAppContext:
|
||||
- OcisConfigContext:
|
||||
|
||||
apiVault:
|
||||
paths:
|
||||
- "%paths.base%/../features/apiVault"
|
||||
context: *common_ldap_suite_context
|
||||
contexts:
|
||||
- FeatureContext: *common_feature_context_params
|
||||
- VaultContext:
|
||||
- OcisConfigContext:
|
||||
- CapabilitiesContext:
|
||||
|
||||
cliCommands:
|
||||
paths:
|
||||
- "%paths.base%/../features/cliCommands"
|
||||
|
||||
@@ -406,7 +406,7 @@ The expected failures in this file are from features in the owncloud/ocis repo.
|
||||
- [apiSearchContent/metadataSerch.feature:53](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearchContent/metadataSerch.feature#L53)
|
||||
- [apiSearchContent/metadataSerch.feature:78](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearchContent/metadataSerch.feature#L78)
|
||||
- [apiSearchContent/metadataSerch.feature:108](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearchContent/metadataSerch.feature#L108)
|
||||
- [apiSearchContent/metadataSerch.feature:138](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearchContent/metadataSerch.feature#L138)
|
||||
- [apiSearchContent/metadataSerch.feature:140](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearchContent/metadataSerch.feature#L140)
|
||||
|
||||
|
||||
Note: always have an empty line at the end of this file.
|
||||
|
||||
@@ -123,19 +123,33 @@ Feature: metadata type search
|
||||
| permissionsRole | Space Viewer |
|
||||
When user "Brian" searches for '<query>' using the WebDAV API
|
||||
Then the HTTP status code should be "207"
|
||||
And the search result should contain "1" entries
|
||||
And the search result should contain "<expectedCount>" entries
|
||||
And the search result of user "Brian" should contain these entries:
|
||||
| testavatar.jpg |
|
||||
| <expectedFile1> |
|
||||
| <expectedFile2> |
|
||||
Examples:
|
||||
| query |
|
||||
| photo.cameraMake=NIKON |
|
||||
| photo.cameraModel="COOLPIX P6000" |
|
||||
| photo.exposureDenominator=178 |
|
||||
| photo.exposureNumerator=1 |
|
||||
| photo.fNumber=4.5 |
|
||||
| photo.focalLength=6 |
|
||||
| photo.orientation=1 |
|
||||
| photo.takenDateTime=2008-10-22 |
|
||||
| location.latitude=43.467157 |
|
||||
| location.longitude=11.885395 |
|
||||
| location.altitude=100 |
|
||||
| query | expectedCount | expectedFile1 | expectedFile2 |
|
||||
| photo.cameraMake=NIKON | 1 | testavatar.jpg | |
|
||||
| photo.cameraMake=CANON | 0 | | |
|
||||
| photo.cameraModel="COOLPIX P6000" | 1 | testavatar.jpg | |
|
||||
| photo.exposureDenominator=178 | 1 | testavatar.jpg | |
|
||||
| photo.exposureNumerator=1 | 1 | testavatar.jpg | |
|
||||
| photo.fNumber=4.5 | 1 | testavatar.jpg | |
|
||||
| photo.focalLength=6 | 1 | testavatar.jpg | |
|
||||
| photo.orientation=1 | 1 | testavatar.jpg | |
|
||||
| photo.takenDateTime=2008-10-22 | 1 | testavatar.jpg | |
|
||||
| location.latitude=43.467157 | 1 | testavatar.jpg | |
|
||||
| location.longitude=11.885395 | 1 | testavatar.jpg | |
|
||||
| location.altitude=100 | 1 | testavatar.jpg | |
|
||||
| NOT photo.cameraMake=CANON | 2 | testavatar.jpg | testavatar.png |
|
||||
| NOT photo.orientation=2 | 2 | testavatar.jpg | testavatar.png |
|
||||
| NOT photo.exposureDenominator=180 | 2 | testavatar.jpg | testavatar.png |
|
||||
| photo.exposureDenominator<180 | 1 | testavatar.jpg | |
|
||||
| photo.focalLength<10 | 1 | testavatar.jpg | |
|
||||
| photo.exposureDenominator<=178 | 1 | testavatar.jpg | |
|
||||
| photo.focalLength<=6 | 1 | testavatar.jpg | |
|
||||
| photo.fNumber>4 | 1 | testavatar.jpg | |
|
||||
| photo.focalLength>4 | 1 | testavatar.jpg | |
|
||||
| location.altitude>=100 | 1 | testavatar.jpg | |
|
||||
| photo.focalLength>=6 | 1 | testavatar.jpg | |
|
||||
| photo.focalLength>8 | 0 | | |
|
||||
+11
-43
@@ -886,7 +886,7 @@ Feature: Update permission of a share
|
||||
| Manager | Space Editor |
|
||||
|
||||
@issue-10768
|
||||
Scenario Outline: sharer updates share permissions role of space to Space Editor Without Versions without enabling it
|
||||
Scenario Outline: sharer tries to update share permissions role of space to Space Editor Without Versions without enabling it
|
||||
Given using spaces DAV path
|
||||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
And user "Alice" has created a space "new-space" with the default quota using the Graph API
|
||||
@@ -900,56 +900,24 @@ Feature: Update permission of a share
|
||||
| space | new-space |
|
||||
| shareType | user |
|
||||
| sharee | Brian |
|
||||
Then the HTTP status code should be "200"
|
||||
Then the HTTP status code should be "400"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.permissions.actions",
|
||||
"grantedToV2",
|
||||
"id"
|
||||
],
|
||||
"required": ["error"],
|
||||
"properties": {
|
||||
"@libre.graph.permissions.actions": {
|
||||
"const": [
|
||||
"libre.graph/driveItem/children/create",
|
||||
"libre.graph/driveItem/standard/delete",
|
||||
"libre.graph/driveItem/path/read",
|
||||
"libre.graph/driveItem/quota/read",
|
||||
"libre.graph/driveItem/content/read",
|
||||
"libre.graph/driveItem/upload/create",
|
||||
"libre.graph/driveItem/permissions/read",
|
||||
"libre.graph/driveItem/children/read",
|
||||
"libre.graph/driveItem/deleted/read",
|
||||
"libre.graph/driveItem/path/update",
|
||||
"libre.graph/driveItem/deleted/update",
|
||||
"libre.graph/driveItem/basic/read"
|
||||
]
|
||||
},
|
||||
"grantedToV2": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties":{
|
||||
"user": {
|
||||
"required": ["code", "innererror", "message"],
|
||||
"properties": {
|
||||
"code": { "const": "invalidRequest" },
|
||||
"innererror": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Brian Murphy"
|
||||
},
|
||||
"id": {
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
"required": ["date", "request-id"]
|
||||
},
|
||||
"message": { "const": "Key: 'Permission.Roles' Error:Field validation for 'Roles' failed on the 'available_role' tag" }
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"pattern": "^u:%user_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+20
-106
@@ -308,7 +308,7 @@ Feature: Update permission of a share
|
||||
| Uploader | Editor | FolderToShare |
|
||||
|
||||
@issue-10768
|
||||
Scenario Outline: sharer updates share permissions role of a resource to Secure Viewer without enabling it
|
||||
Scenario Outline: sharer tries to update share permissions role of a resource to Secure Viewer without enabling it
|
||||
Given user "Alice" has created folder "folderToShare"
|
||||
And user "Alice" has uploaded file with content "hello world" to "textfile.txt"
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
@@ -321,68 +321,23 @@ Feature: Update permission of a share
|
||||
| permissionsRole | Secure Viewer |
|
||||
| space | Personal |
|
||||
| resource | <resource> |
|
||||
Then the HTTP status code should be "200"
|
||||
Then the HTTP status code should be "400"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.permissions.actions",
|
||||
"grantedToV2",
|
||||
"id",
|
||||
"invitation"
|
||||
],
|
||||
"required": ["error"],
|
||||
"properties": {
|
||||
"@libre.graph.permissions.actions": {
|
||||
"const": [
|
||||
"libre.graph/driveItem/path/read",
|
||||
"libre.graph/driveItem/children/read",
|
||||
"libre.graph/driveItem/basic/read"
|
||||
]
|
||||
},
|
||||
"grantedToV2": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"required": ["code", "innererror", "message"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"code": { "const": "invalidRequest" },
|
||||
"innererror": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id"],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Brian Murphy"
|
||||
},
|
||||
"id": {
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"pattern": "^%permissions_id_pattern%$"
|
||||
},
|
||||
"invitation": {
|
||||
"type": "object",
|
||||
"required": ["invitedBy"],
|
||||
"properties": {
|
||||
"invitedBy": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id"],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
},
|
||||
"id": {
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"required": ["date", "request-id"]
|
||||
},
|
||||
"message": { "const": "Key: 'Permission.Roles' Error:Field validation for 'Roles' failed on the 'available_role' tag" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -397,7 +352,7 @@ Feature: Update permission of a share
|
||||
| textfile.txt | Viewer |
|
||||
|
||||
@issue-10768
|
||||
Scenario Outline: sharer updates share permissions role of a resource to Denied without enabling it
|
||||
Scenario Outline: sharer tries to update share permissions role of a resource to Denied without enabling it
|
||||
Given user "Alice" has created folder "folderToShare"
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | folderToShare |
|
||||
@@ -409,64 +364,23 @@ Feature: Update permission of a share
|
||||
| permissionsRole | Denied |
|
||||
| space | Personal |
|
||||
| resource | folderToShare |
|
||||
Then the HTTP status code should be "200"
|
||||
Then the HTTP status code should be "400"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.permissions.actions",
|
||||
"grantedToV2",
|
||||
"id",
|
||||
"invitation"
|
||||
],
|
||||
"required": ["error"],
|
||||
"properties": {
|
||||
"@libre.graph.permissions.actions": {
|
||||
"const": ["none"]
|
||||
},
|
||||
"grantedToV2": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"required": ["code", "innererror", "message"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"code": { "const": "invalidRequest" },
|
||||
"innererror": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id"],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Brian Murphy"
|
||||
},
|
||||
"id": {
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"pattern": "^%permissions_id_pattern%$"
|
||||
},
|
||||
"invitation": {
|
||||
"type": "object",
|
||||
"required": ["invitedBy"],
|
||||
"properties": {
|
||||
"invitedBy": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id"],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
},
|
||||
"id": {
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"required": ["date", "request-id"]
|
||||
},
|
||||
"message": { "const": "Key: 'Permission.Roles' Error:Field validation for 'Roles' failed on the 'available_role' tag" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
Feature: vault
|
||||
As a user
|
||||
I want to store resource in vault storage
|
||||
So that vault resources are isolated with regular drive storage
|
||||
|
||||
Background:
|
||||
Given using spaces DAV path
|
||||
And these users have been created with default attributes:
|
||||
| username |
|
||||
| Alice |
|
||||
|
||||
|
||||
Scenario: user can create folders and files in personal space in vault
|
||||
Given user "Alice" has logged in via web UI
|
||||
When user "Alice" creates a folder "vaultFolder" in space "Personal" in vault using the WebDav Api
|
||||
Then the HTTP status code should be "201"
|
||||
When user "Alice" uploads a file inside space "Personal" with content "some content" to "vaultFile.txt" in vault using the WebDAV API
|
||||
Then the HTTP status code should be "201"
|
||||
And for user "Alice" the space "Personal" in vault should contain these entries:
|
||||
| vaultFolder |
|
||||
| vaultFile.txt |
|
||||
|
||||
|
||||
Scenario: user can create folders and files in project space in vault
|
||||
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
And user "Alice" has logged in via web UI
|
||||
And user "Alice" has created a space "vault-space" in vault with the default quota using the Graph API
|
||||
When user "Alice" creates a folder "vaultFolder" in space "vault-space" in vault using the WebDav Api
|
||||
Then the HTTP status code should be "201"
|
||||
When user "Alice" uploads a file inside space "vault-space" with content "some content" to "vaultFile.txt" in vault using the WebDAV API
|
||||
Then the HTTP status code should be "201"
|
||||
And for user "Alice" the space "vault-space" in vault should contain these entries:
|
||||
| vaultFolder |
|
||||
| vaultFile.txt |
|
||||
|
||||
|
||||
Scenario: resources in drive and vault are isolated
|
||||
Given user "Alice" has logged in via web UI
|
||||
And user "Alice" has created a folder "driveFolder" in space "Personal"
|
||||
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "driveFile.txt"
|
||||
And user "Alice" has created a folder "vaultFolder" in space "Personal" in vault
|
||||
When user "Alice" uploads a file inside space "Personal" with content "some content" to "vaultFile.txt" in vault using the WebDAV API
|
||||
Then the HTTP status code should be "201"
|
||||
And for user "Alice" the space "Personal" in vault should contain these entries:
|
||||
| vaultFolder |
|
||||
| vaultFile.txt |
|
||||
And for user "Alice" the space "Personal" should contain these entries:
|
||||
| driveFolder |
|
||||
| driveFile.txt |
|
||||
And for user "Alice" the space "Personal" in vault should not contain these entries:
|
||||
| driveFolder |
|
||||
| driveFile.txt |
|
||||
And for user "Alice" the space "Personal" should not contain these entries:
|
||||
| vaultFolder |
|
||||
| vaultFile.txt |
|
||||
|
||||
@env-config @keycloak-config
|
||||
Scenario: user can set custom auth level names
|
||||
Given the administrator has set the Keycloak realm attribute "acr.loa.map" to '{"regular":"1","testing":"2"}'
|
||||
And the config "OCIS_MFA_AUTH_LEVEL_NAMES" has been set to "testing"
|
||||
And user "Alice" has logged in via web UI
|
||||
When user "Alice" uploads a file inside space "Personal" with content "some content" to "vaultFile.txt" in vault using the WebDAV API
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Alice" should have acr value "testing"
|
||||
|
||||
|
||||
Scenario: check capabilities endpoint for vault
|
||||
Given using OCS API version "2"
|
||||
And user "Alice" has logged in via web UI
|
||||
When user "Alice" retrieves the vault mode capabilities using the capabilities API
|
||||
Then the OCS status code should be "200"
|
||||
And the HTTP status code should be "200"
|
||||
And the ocs JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [ "capabilities" ],
|
||||
"properties": {
|
||||
"capabilities": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"core",
|
||||
"files",
|
||||
"files_sharing",
|
||||
"auth",
|
||||
"vault"
|
||||
],
|
||||
"properties": {
|
||||
"files_sharing": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"api_enabled",
|
||||
"default_permissions",
|
||||
"public",
|
||||
"resharing",
|
||||
"federation",
|
||||
"group_sharing",
|
||||
"share_with_group_members_only",
|
||||
"share_with_membership_groups_only",
|
||||
"auto_accept_share",
|
||||
"user_enumeration"
|
||||
],
|
||||
"properties": {
|
||||
"federation": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"outgoing",
|
||||
"incoming"
|
||||
],
|
||||
"properties": {
|
||||
"outgoing": {
|
||||
"const": false
|
||||
},
|
||||
"incoming": {
|
||||
"const": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"public": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"enabled",
|
||||
"multiple",
|
||||
"upload",
|
||||
"supports_upload_only",
|
||||
"send_mail",
|
||||
"social_share"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"const": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"mfa"
|
||||
],
|
||||
"properties": {
|
||||
"mfa": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"enabled",
|
||||
"levelnames"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"const": true
|
||||
},
|
||||
"levelnames": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"const": "advanced"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"vault": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"enabled",
|
||||
"vault_storage_provider"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"const": true
|
||||
},
|
||||
"vault_storage_provider": {
|
||||
"pattern": "%uuidv4_pattern%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -25,6 +25,9 @@ EMAIL_SMTP_PORT = "1025"
|
||||
EMAIL_PORT = "8025"
|
||||
EMAIL_SMTP_SENDER = "ownCloud <noreply@example.com>"
|
||||
|
||||
KEYCLOAK_IMAGE = "quay.io/keycloak/keycloak:26.5.6"
|
||||
POSTGRES_ALPINE_IMAGE = "postgres:alpine3.18"
|
||||
|
||||
LOCAL_API_TESTS = {
|
||||
"contractAndLock": {
|
||||
"suites": ["apiContract", "apiLocks"],
|
||||
@@ -135,6 +138,37 @@ LOCAL_API_TESTS = {
|
||||
"GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
|
||||
},
|
||||
},
|
||||
"vault": {
|
||||
"suites": ["apiVault"],
|
||||
"keycloakNeeded": True,
|
||||
"vaultStorage": True,
|
||||
"extraEnvironment": {
|
||||
"KEYCLOAK": "true",
|
||||
"KC_URL": "https://localhost:8443"
|
||||
},
|
||||
"extraServerEnvironment": {
|
||||
"OCIS_ENABLE_VAULT_MODE": "true",
|
||||
"FRONTEND_ENABLE_VAULT_MODE": "true",
|
||||
"OCIS_MFA_ENABLED": "true",
|
||||
"SETTINGS_GRPC_ADDR": "localhost:9191",
|
||||
# Keycloak as external OIDC provider — disable built-in IDP
|
||||
"OCIS_EXCLUDE_RUN_SERVICES": "idp",
|
||||
"OCIS_OIDC_ISSUER": "https://localhost:8443/realms/oCIS",
|
||||
"PROXY_OIDC_REWRITE_WELLKNOWN": "true",
|
||||
"PROXY_AUTOPROVISION_ACCOUNTS": "true",
|
||||
"PROXY_ROLE_ASSIGNMENT_DRIVER": "oidc",
|
||||
"PROXY_USER_OIDC_CLAIM": "preferred_username",
|
||||
"PROXY_USER_CS3_CLAIM": "username",
|
||||
"WEB_OIDC_CLIENT_ID": "web",
|
||||
"KEYCLOAK_DOMAIN": "localhost:8443",
|
||||
"OCIS_ADMIN_USER_ID": "",
|
||||
"GRAPH_ASSIGN_DEFAULT_USER_ROLE": "false",
|
||||
"GRAPH_USERNAME_MATCH": "none",
|
||||
"IDM_CREATE_DEMO_USERS": "false",
|
||||
"MICRO_REGISTRY_ADDRESS": "127.0.0.1:9233",
|
||||
"WEB_OIDC_SCOPE": "openid profile email acr"
|
||||
}
|
||||
},
|
||||
"cliCommands": {
|
||||
"suites": ["cliCommands", "apiServiceAvailability"],
|
||||
"antivirusNeeded": True,
|
||||
@@ -182,13 +216,16 @@ def merged_config(suites: list) -> dict:
|
||||
"tikaNeeded": False,
|
||||
"federationServer": False,
|
||||
"collaborationServiceNeeded": False,
|
||||
"keycloakNeeded": False,
|
||||
"vaultStorage": False,
|
||||
"extraServerEnvironment": {},
|
||||
"extraEnvironment": {},
|
||||
}
|
||||
for suite in suites:
|
||||
cfg = _SUITE_TO_CONFIG.get(suite, {})
|
||||
for flag in ("emailNeeded", "antivirusNeeded", "tikaNeeded",
|
||||
"federationServer", "collaborationServiceNeeded"):
|
||||
"federationServer", "collaborationServiceNeeded",
|
||||
"keycloakNeeded", "vaultStorage"):
|
||||
if cfg.get(flag):
|
||||
merged[flag] = True
|
||||
merged["extraServerEnvironment"].update(cfg.get("extraServerEnvironment", {}))
|
||||
@@ -297,6 +334,20 @@ def ocis_healthy(ocis_url: str) -> bool:
|
||||
return r.stdout.strip() == "200"
|
||||
|
||||
|
||||
def ocis_proxy_ready() -> bool:
|
||||
"""Check ocis readiness via the proxy debug port (no auth required).
|
||||
|
||||
In vault mode PROXY_ROLE_ASSIGNMENT_DRIVER=oidc means basic-auth users
|
||||
never receive the admin role, so /graph/v1.0/users/admin returns 403.
|
||||
The proxy debug readyz endpoint (PROXY_DEBUG_ADDR 0.0.0.0:9205) is
|
||||
unauthenticated and becomes available once the proxy is fully started.
|
||||
"""
|
||||
return subprocess.run(
|
||||
["curl", "-sf", "http://localhost:9205/readyz"],
|
||||
capture_output=True,
|
||||
).returncode == 0
|
||||
|
||||
|
||||
def mailpit_healthy() -> bool:
|
||||
return subprocess.run(
|
||||
["curl", "-sf", "http://localhost:8025/api/v1/messages"],
|
||||
@@ -325,6 +376,20 @@ def clamav_healthy() -> bool:
|
||||
return _tcp_ready("localhost", 3310)
|
||||
|
||||
|
||||
def keycloak_healthy() -> bool:
|
||||
return subprocess.run(
|
||||
["curl", "-skf", "https://localhost:9000/health/ready"],
|
||||
capture_output=True,
|
||||
).returncode == 0
|
||||
|
||||
|
||||
def postgres_healthy() -> bool:
|
||||
return subprocess.run(
|
||||
["docker", "exec", "postgres", "pg_isready", "-U", "keycloak"],
|
||||
capture_output=True,
|
||||
).returncode == 0
|
||||
|
||||
|
||||
|
||||
def load_env_file(path: Path) -> dict:
|
||||
"""Parse a bash-style env file (export KEY=value) into a dict."""
|
||||
@@ -435,6 +500,66 @@ def main() -> int:
|
||||
providers_tmp.close()
|
||||
cfg["extraServerEnvironment"]["OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE"] = providers_tmp.name
|
||||
|
||||
if cfg["keycloakNeeded"]:
|
||||
# Install Playwright runtime and browsers (required for web UI tests)
|
||||
print("Installing Playwright...")
|
||||
run([str(repo_root / "vendor-php/bin/playwright-install")])
|
||||
run([str(repo_root / "vendor-php/bin/playwright-install"), "--browsers"])
|
||||
print("Playwright ready.")
|
||||
|
||||
# Generate TLS certs for keycloak
|
||||
print("Generating keycloak certs...")
|
||||
keycloak_certs_dir = repo_root / "keycloak-certs"
|
||||
keycloak_certs_dir.mkdir(parents=True, exist_ok=True)
|
||||
run(["openssl", "req", "-x509", "-newkey", "rsa:2048",
|
||||
"-keyout", str(keycloak_certs_dir / "keycloakkey.pem"),
|
||||
"-out", str(keycloak_certs_dir / "keycloakcrt.pem"),
|
||||
"-nodes", "-days", "365", "-subj", "/CN=keycloak"])
|
||||
for f in keycloak_certs_dir.iterdir():
|
||||
f.chmod(0o777)
|
||||
|
||||
# Set up postgres (keycloak backend)
|
||||
print("Setting up postgres...")
|
||||
# GitHub runners ship PostgreSQL pre-started on 5432; stop it to avoid conflicts.
|
||||
subprocess.run(["sudo", "systemctl", "stop", "postgresql"], capture_output=True)
|
||||
run(["docker", "run", "-d", "--name", "postgres", "--network", "host",
|
||||
"-e", "POSTGRES_DB=keycloak",
|
||||
"-e", "POSTGRES_USER=keycloak",
|
||||
"-e", "POSTGRES_PASSWORD=keycloak",
|
||||
POSTGRES_ALPINE_IMAGE])
|
||||
wait_for(postgres_healthy, 30, "postgres", container="postgres")
|
||||
print("postgres ready.")
|
||||
|
||||
# Patch realm and start keycloak
|
||||
realm_src = repo_root / "tests/config/ci/ocis-mfa-ci-realm.dist.json"
|
||||
realm_patched = Path("/tmp/ocis-realm.json")
|
||||
realm_patched.write_text(
|
||||
realm_src.read_text()
|
||||
.replace("https://ocis:9200", "https://localhost:9200")
|
||||
)
|
||||
print("Starting keycloak...")
|
||||
run(["docker", "run", "-d", "--name", "keycloak", "--network", "host",
|
||||
"-e", "OCIS_DOMAIN=https://localhost:9200",
|
||||
"-e", "KC_HOSTNAME=localhost",
|
||||
"-e", "KC_PORT=8443",
|
||||
"-e", "KC_DB=postgres",
|
||||
"-e", "KC_DB_URL=jdbc:postgresql://localhost:5432/keycloak",
|
||||
"-e", "KC_DB_USERNAME=keycloak",
|
||||
"-e", "KC_DB_PASSWORD=keycloak",
|
||||
"-e", "KC_FEATURES=impersonation",
|
||||
"-e", "KC_BOOTSTRAP_ADMIN_USERNAME=admin",
|
||||
"-e", "KC_BOOTSTRAP_ADMIN_PASSWORD=admin",
|
||||
"-e", "KC_HTTPS_CERTIFICATE_FILE=/keycloak-certs/keycloakcrt.pem",
|
||||
"-e", "KC_HTTPS_CERTIFICATE_KEY_FILE=/keycloak-certs/keycloakkey.pem",
|
||||
"-v", f"{repo_root}/keycloak-certs:/keycloak-certs:ro",
|
||||
"-v", "/tmp/ocis-realm.json:/opt/keycloak/data/import/ocis-mfa-ci-realm.dist.json:ro",
|
||||
KEYCLOAK_IMAGE,
|
||||
"start-dev", "--proxy-headers", "xforwarded",
|
||||
"--spi-connections-http-client-default-disable-trust-manager=true",
|
||||
"--import-realm", "--health-enabled=true"])
|
||||
wait_for(keycloak_healthy, 300, "keycloak", container="keycloak")
|
||||
print("keycloak ready.")
|
||||
|
||||
# init ocis
|
||||
run([str(ocis_bin), "init", "--insecure", "true"])
|
||||
shutil.copy(
|
||||
@@ -455,6 +580,21 @@ def main() -> int:
|
||||
server_env["THUMBNAILS_TXT_FONTMAP_FILE"] = fontmap_tmp.name
|
||||
server_env.update(cfg["extraServerEnvironment"])
|
||||
|
||||
# Patch web UI config: replace container DNS name with localhost so the
|
||||
# browser's 'self' CSP origin (localhost:9200) is not violated.
|
||||
web_cfg_src = Path(server_env["WEB_UI_CONFIG_FILE"])
|
||||
web_cfg_data = json.loads(
|
||||
web_cfg_src.read_text().replace("ocis-server:9200", "localhost:9200")
|
||||
)
|
||||
if cfg["vaultStorage"]:
|
||||
web_cfg_data.setdefault("openIdConnect", {})["scope"] = "openid profile email acr"
|
||||
server_env["PROXY_CSP_CONFIG_FILE_LOCATION"] = str(repo_root / "tests/config/ci/csp.yaml")
|
||||
web_cfg_tmp = tempfile.NamedTemporaryFile(
|
||||
mode="w", suffix=".json", prefix="ocis-web-config-", delete=False)
|
||||
json.dump(web_cfg_data, web_cfg_tmp, indent=2)
|
||||
web_cfg_tmp.close()
|
||||
server_env["WEB_UI_CONFIG_FILE"] = web_cfg_tmp.name
|
||||
|
||||
# start ociswrapper (primary ocis)
|
||||
print("Starting ocis...")
|
||||
wrapper_proc = subprocess.Popen(
|
||||
@@ -659,13 +799,49 @@ def main() -> int:
|
||||
signal.signal(signal.SIGINT, cleanup)
|
||||
|
||||
try:
|
||||
wait_for(lambda: ocis_healthy(ocis_url), 300, "ocis")
|
||||
if cfg["vaultStorage"]:
|
||||
# Basic auth is blocked in vault mode (OIDC role assignment),
|
||||
# use the unauthenticated proxy debug readyz endpoint instead.
|
||||
wait_for(ocis_proxy_ready, 300, "ocis")
|
||||
else:
|
||||
wait_for(lambda: ocis_healthy(ocis_url), 300, "ocis")
|
||||
print("ocis ready.")
|
||||
|
||||
if cfg["federationServer"]:
|
||||
wait_for(lambda: ocis_healthy(ocis_fed_url), 300, "federation ocis")
|
||||
print("federation ocis ready.")
|
||||
|
||||
if cfg["vaultStorage"]:
|
||||
vault_data_dir = Path.home() / "ocis/storage/users-vault"
|
||||
vault_data_dir.mkdir(parents=True, exist_ok=True)
|
||||
# Inherit the full server env so the process has PATH, OCIS_JWT_SECRET,
|
||||
# OCIS_CONFIG_DIR, SSL settings, etc. — then override with vault-specific values.
|
||||
vault_env = {
|
||||
**server_env,
|
||||
"STORAGE_USERS_ENABLE_VAULT_MODE": "true",
|
||||
"STORAGE_USERS_SERVICE_NAME": "storage-users-vault",
|
||||
"STORAGE_USERS_GRPC_ADDR": "localhost:19285",
|
||||
"STORAGE_USERS_HTTP_ADDR": "localhost:19286",
|
||||
"STORAGE_USERS_DATA_SERVER_URL": "http://localhost:19286/data",
|
||||
"STORAGE_USERS_DEBUG_ADDR": "localhost:19287",
|
||||
"STORAGE_USERS_OCIS_ROOT": str(vault_data_dir),
|
||||
"STORAGE_USERS_EVENTS_CONSUMER_GROUP": "vault-dcfs",
|
||||
}
|
||||
print("Starting storage-users-vault...")
|
||||
vault_proc = subprocess.Popen(
|
||||
[str(ocis_bin), "storage-users", "server"],
|
||||
env=vault_env,
|
||||
)
|
||||
procs.append(vault_proc)
|
||||
wait_for(
|
||||
lambda: subprocess.run(
|
||||
["curl", "-sf", "http://localhost:19287/healthz"],
|
||||
capture_output=True,
|
||||
).returncode == 0,
|
||||
120, "storage-users-vault",
|
||||
)
|
||||
print("vault ready.")
|
||||
|
||||
# expected failures file
|
||||
if acceptance_test_type == "core-api":
|
||||
filter_tags = "~@skipOnGraph&&~@skipOnOcis-OCIS-Storage"
|
||||
@@ -720,4 +896,4 @@ def main() -> int:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
sys.exit(main())
|
||||
@@ -7,6 +7,7 @@ directives:
|
||||
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
|
||||
# In contrary to bash and docker the default is given after the | character
|
||||
- 'https://${KEYCLOAK_DOMAIN|keycloak.owncloud.test}/'
|
||||
- 'https://localhost:8443/'
|
||||
default-src:
|
||||
- '''none'''
|
||||
font-src:
|
||||
|
||||
@@ -138,11 +138,48 @@ func WaitForConnection() (bool, string) {
|
||||
}
|
||||
|
||||
log.Println("oCIS server is ready to accept requests")
|
||||
|
||||
// Proxy health alone causes flakiness: tests hit sharing/gateway before they finish init.
|
||||
results := make(chan bool, 2)
|
||||
go func() { results <- waitServiceReady("sharing") }()
|
||||
go func() { results <- waitServiceReady("gateway") }()
|
||||
sharingOK, gatewayOK := <-results, <-results
|
||||
if !sharingOK || !gatewayOK {
|
||||
return false, "Timeout waiting for sharing/gateway to become ready"
|
||||
}
|
||||
|
||||
return true, "oCIS server is up and running"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// waitServiceReady polls http://localhost:<debugPort>/readyz until 200 or 30 s.
|
||||
func waitServiceReady(service string) bool {
|
||||
port := config.GetServiceDebugPort(service)
|
||||
url := fmt.Sprintf("http://localhost:%d/readyz", port)
|
||||
timeout := time.After(30 * time.Second)
|
||||
client := http.Client{Timeout: 2 * time.Second}
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-timeout:
|
||||
log.Println(fmt.Sprintf("Timeout waiting for %s /readyz on port %d", service, port))
|
||||
return false
|
||||
default:
|
||||
res, err := client.Get(url)
|
||||
if err == nil && res.StatusCode == 200 {
|
||||
res.Body.Close()
|
||||
log.Println(fmt.Sprintf("%s service is ready (readyz port %d)", service, port))
|
||||
return true
|
||||
}
|
||||
if res != nil {
|
||||
res.Body.Close()
|
||||
}
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func waitUntilCompleteShutdown() (bool, string) {
|
||||
timeout := 30 * time.Second
|
||||
startTime := time.Now()
|
||||
|
||||
+24
@@ -1,3 +1,27 @@
|
||||
Release 1.7.0
|
||||
=============
|
||||
|
||||
**Changes**
|
||||
|
||||
**Breaking changes**
|
||||
|
||||
* To address a security issue, it was necessary to add a `MaxDepth` option to
|
||||
`ReadSettings` to limit the depth of XML trees during parsing. A generous
|
||||
default value of 1024 was chosen to avoid breaking most existing code.
|
||||
However, if your code is processing XML hierarchies with a depth greater
|
||||
than 1024, you will need to assign your `Document` a `ReadSettings` that has
|
||||
a `MaxDepth` set to a higher value.
|
||||
|
||||
**Security Fixes**
|
||||
|
||||
* Limited the depth of XML trees processed by all `ReadFrom` functions during
|
||||
parsing.
|
||||
* Fixed a `CompilePath` index-out-of-range panic that could be caused by a
|
||||
missing path filter key.
|
||||
* Sanitized the contents of XML text, comment, ProcInst and Directive tokens
|
||||
provided by the user.
|
||||
|
||||
|
||||
Release 1.6.0
|
||||
=============
|
||||
|
||||
|
||||
+31
-17
@@ -13,6 +13,7 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
"iter"
|
||||
"maps"
|
||||
"os"
|
||||
"slices"
|
||||
"strings"
|
||||
@@ -27,6 +28,10 @@ const (
|
||||
// ErrXML is returned when XML parsing fails due to incorrect formatting.
|
||||
var ErrXML = errors.New("etree: invalid XML format")
|
||||
|
||||
// ErrMaxDepth is returned when the depth of the XML tree being read exceeds
|
||||
// the maximum depth allowed by ReadSettings.MaxDepth.
|
||||
var ErrMaxDepth = errors.New("etree: XML tree exceeds maximum depth")
|
||||
|
||||
// cdataPrefix is used to detect CDATA text when ReadSettings.PreserveCData is
|
||||
// true.
|
||||
var cdataPrefix = []byte("<![CDATA[")
|
||||
@@ -76,8 +81,18 @@ type ReadSettings struct {
|
||||
// whether an end element is present. Commonly set to xml.HTMLAutoClose.
|
||||
// Default: nil.
|
||||
AutoClose []string
|
||||
|
||||
// MaxDepth is the maximum depth of the XML tree to parse. If the depth of
|
||||
// the XML tree exceeds this value, all ReadFrom* functions return the
|
||||
// error ErrMaxDepth. If MaxDepth is zero or negative, a depth limit of
|
||||
// 1024 is used. Default: 0 (i.e., a limit of 1024).
|
||||
MaxDepth int
|
||||
}
|
||||
|
||||
// defaultMaxDepth is the maximum depth of an XML tree parsed by ReadFrom*
|
||||
// functions when ReadSettings.MaxDepth is not set to a positive value.
|
||||
const defaultMaxDepth = 1024
|
||||
|
||||
// defaultCharsetReader is used by the xml decoder when the ReadSettings
|
||||
// CharsetReader value is nil. It behaves as a "pass-through", ignoring
|
||||
// the requested charset parameter and skipping conversion altogether.
|
||||
@@ -87,18 +102,9 @@ func defaultCharsetReader(charset string, input io.Reader) (io.Reader, error) {
|
||||
|
||||
// dup creates a duplicate of the ReadSettings object.
|
||||
func (s *ReadSettings) dup() ReadSettings {
|
||||
var entityCopy map[string]string
|
||||
if s.Entity != nil {
|
||||
entityCopy = make(map[string]string)
|
||||
for k, v := range s.Entity {
|
||||
entityCopy[k] = v
|
||||
}
|
||||
}
|
||||
return ReadSettings{
|
||||
CharsetReader: s.CharsetReader,
|
||||
Permissive: s.Permissive,
|
||||
Entity: entityCopy,
|
||||
}
|
||||
c := *s
|
||||
c.Entity = maps.Clone(s.Entity)
|
||||
return c
|
||||
}
|
||||
|
||||
// WriteSettings determine the behavior of the Document's WriteTo* functions.
|
||||
@@ -913,6 +919,11 @@ func (e *Element) readFrom(ri io.Reader, settings ReadSettings) (n int64, err er
|
||||
attrCheck := make(map[xml.Name]int)
|
||||
dec := newDecoder(r, settings)
|
||||
|
||||
maxDepth := settings.MaxDepth
|
||||
if maxDepth <= 0 {
|
||||
maxDepth = defaultMaxDepth
|
||||
}
|
||||
|
||||
var stack stack[*Element]
|
||||
stack.push(e)
|
||||
for {
|
||||
@@ -942,6 +953,9 @@ func (e *Element) readFrom(ri io.Reader, settings ReadSettings) (n int64, err er
|
||||
|
||||
switch t := t.(type) {
|
||||
case xml.StartElement:
|
||||
if len(stack.data) > maxDepth {
|
||||
return r.Bytes(), ErrMaxDepth
|
||||
}
|
||||
e := newElement(t.Name.Space, t.Name.Local, top)
|
||||
if settings.PreserveDuplicateAttrs || len(t.Attr) < 2 {
|
||||
for _, a := range t.Attr {
|
||||
@@ -1622,7 +1636,7 @@ func (c *CharData) Index() int {
|
||||
func (c *CharData) WriteTo(w Writer, s *WriteSettings) {
|
||||
if c.IsCData() {
|
||||
w.WriteString(`<![CDATA[`)
|
||||
w.WriteString(c.Data)
|
||||
sanitizeCData(w, c.Data)
|
||||
w.WriteString(`]]>`)
|
||||
} else {
|
||||
var m escapeMode
|
||||
@@ -1704,7 +1718,7 @@ func (c *Comment) Index() int {
|
||||
// WriteTo serialies the comment to the writer.
|
||||
func (c *Comment) WriteTo(w Writer, s *WriteSettings) {
|
||||
w.WriteString("<!--")
|
||||
w.WriteString(c.Data)
|
||||
sanitizeComment(w, c.Data)
|
||||
w.WriteString("-->")
|
||||
}
|
||||
|
||||
@@ -1769,7 +1783,7 @@ func (d *Directive) Index() int {
|
||||
// WriteTo serializes the XML directive to the writer.
|
||||
func (d *Directive) WriteTo(w Writer, s *WriteSettings) {
|
||||
w.WriteString("<!")
|
||||
w.WriteString(d.Data)
|
||||
sanitizeDirective(w, d.Data)
|
||||
w.WriteString(">")
|
||||
}
|
||||
|
||||
@@ -1837,10 +1851,10 @@ func (p *ProcInst) Index() int {
|
||||
// WriteTo serializes the processing instruction to the writer.
|
||||
func (p *ProcInst) WriteTo(w Writer, s *WriteSettings) {
|
||||
w.WriteString("<?")
|
||||
w.WriteString(p.Target)
|
||||
sanitizeProcInst(w, p.Target)
|
||||
if p.Inst != "" {
|
||||
w.WriteByte(' ')
|
||||
w.WriteString(p.Inst)
|
||||
sanitizeProcInst(w, p.Inst)
|
||||
}
|
||||
w.WriteString("?>")
|
||||
}
|
||||
|
||||
+114
@@ -384,6 +384,120 @@ func escapeString(w Writer, s string, m escapeMode) {
|
||||
w.WriteString(s[last:])
|
||||
}
|
||||
|
||||
// sanitizeCData writes the sanitized contents of a CDATA section to the
|
||||
// writer. XML provides no way to escape the "]]>" sequence within a CDATA
|
||||
// section, so any occurrence of it is split across two CDATA sections.
|
||||
func sanitizeCData(w Writer, s string) {
|
||||
for {
|
||||
i := strings.Index(s, "]]>")
|
||||
if i < 0 {
|
||||
break
|
||||
}
|
||||
w.WriteString(s[:i+2])
|
||||
w.WriteString("]]><![CDATA[")
|
||||
s = s[i+2:]
|
||||
}
|
||||
w.WriteString(s)
|
||||
}
|
||||
|
||||
// sanitizeComment writes the sanitized contents of a comment to the writer.
|
||||
// An XML comment may not contain the string "--", and it may not end with a
|
||||
// '-'. Because XML provides no way to escape these sequences, spaces are
|
||||
// inserted where necessary.
|
||||
func sanitizeComment(w Writer, s string) {
|
||||
last, hyphen := 0, false
|
||||
for i := 0; i < len(s); i++ {
|
||||
if s[i] != '-' {
|
||||
hyphen = false
|
||||
continue
|
||||
}
|
||||
if hyphen {
|
||||
w.WriteString(s[last:i])
|
||||
w.WriteByte(' ')
|
||||
last = i
|
||||
}
|
||||
hyphen = true
|
||||
}
|
||||
w.WriteString(s[last:])
|
||||
if hyphen {
|
||||
w.WriteByte(' ')
|
||||
}
|
||||
}
|
||||
|
||||
// sanitizeProcInst writes the contents of a sanitized processing instruction
|
||||
// to the writer. XML provides no way to escape the "?>" sequence within a
|
||||
// processing instruction, so a space is inserted between the two characters.
|
||||
func sanitizeProcInst(w Writer, s string) {
|
||||
for {
|
||||
i := strings.Index(s, "?>")
|
||||
if i < 0 {
|
||||
break
|
||||
}
|
||||
w.WriteString(s[:i+1])
|
||||
w.WriteByte(' ')
|
||||
s = s[i+1:]
|
||||
}
|
||||
w.WriteString(s)
|
||||
}
|
||||
|
||||
// sanitizeDirective writes the sanitized contents of an XML directive to the
|
||||
// writer.
|
||||
func sanitizeDirective(w Writer, s string) {
|
||||
// The XML decoder reserves the character following "<!" for comments
|
||||
// ('-') and CDATA sections ('['), and it treats "<!>" as an unterminated
|
||||
// directive. Insert a space to avoid conflicts with reserved sequences.
|
||||
scan := s
|
||||
if s == "" || s[0] == '-' || s[0] == '[' {
|
||||
w.WriteByte(' ')
|
||||
} else {
|
||||
scan = s[1:]
|
||||
}
|
||||
|
||||
// A directive's contents may legitimately contain '<' and '>' characters,
|
||||
// so write them without modification when they are balanced.
|
||||
if isDirectiveBalanced(scan) {
|
||||
w.WriteString(s)
|
||||
return
|
||||
}
|
||||
|
||||
// The contents are unbalanced, so escape every character in the string.
|
||||
escapeString(w, s, escapeNormal)
|
||||
}
|
||||
|
||||
// isDirectiveBalanced returns true if the interpreted portion of an XML
|
||||
// directive's contents may be enclosed by "<!" and ">" without changing the
|
||||
// extents of the resulting directive.
|
||||
func isDirectiveBalanced(s string) bool {
|
||||
var quote byte
|
||||
var depth int
|
||||
for i := 0; i < len(s); i++ {
|
||||
switch c := s[i]; {
|
||||
case quote != 0:
|
||||
if c == quote {
|
||||
quote = 0
|
||||
}
|
||||
case c == '\'' || c == '"':
|
||||
quote = c
|
||||
case c == '>':
|
||||
if depth == 0 {
|
||||
return false
|
||||
}
|
||||
depth--
|
||||
case c == '<':
|
||||
if !strings.HasPrefix(s[i+1:], "!--") {
|
||||
depth++
|
||||
break
|
||||
}
|
||||
j := strings.Index(s[i+4:], "-->")
|
||||
if j < 0 {
|
||||
return false
|
||||
}
|
||||
i += 4 + j + 2
|
||||
}
|
||||
}
|
||||
return quote == 0 && depth == 0
|
||||
}
|
||||
|
||||
func isInCharacterRange(r rune) bool {
|
||||
return r == 0x09 ||
|
||||
r == 0x0A ||
|
||||
|
||||
+14
-2
@@ -281,7 +281,11 @@ func (c *compiler) parseSegment(path string) segment {
|
||||
c.err = ErrPath("path has invalid filter [brackets].")
|
||||
break
|
||||
}
|
||||
seg.filters = append(seg.filters, c.parseFilter(fpath[:len(fpath)-1]))
|
||||
filter := c.parseFilter(fpath[:len(fpath)-1])
|
||||
if c.err != ErrPath("") {
|
||||
break
|
||||
}
|
||||
seg.filters = append(seg.filters, filter)
|
||||
}
|
||||
return seg
|
||||
}
|
||||
@@ -320,7 +324,11 @@ func (c *compiler) parseFilter(path string) filter {
|
||||
// Filter contains [@attr='val'], [@attr="val"], [fn()='val'],
|
||||
// [fn()="val"], [tag='val'] or [tag="val"]?
|
||||
eqindex := strings.IndexByte(path, '=')
|
||||
if eqindex >= 0 && eqindex+1 < len(path) {
|
||||
if eqindex == 0 {
|
||||
c.err = ErrPath("path contains a filter expression with no key.")
|
||||
return nil
|
||||
}
|
||||
if eqindex > 0 && eqindex+1 < len(path) {
|
||||
quote := path[eqindex+1]
|
||||
if quote == '\'' || quote == '"' {
|
||||
rindex := nextIndex(path, quote, eqindex+2)
|
||||
@@ -334,6 +342,10 @@ func (c *compiler) parseFilter(path string) filter {
|
||||
|
||||
switch {
|
||||
case key[0] == '@':
|
||||
if len(key) == 1 {
|
||||
c.err = ErrPath("path contains a filter expression with no key.")
|
||||
return nil
|
||||
}
|
||||
return newFilterAttrVal(key[1:], value)
|
||||
case strings.HasSuffix(key, "()"):
|
||||
name := key[:len(key)-2]
|
||||
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
// Package oidc implements OpenID Connect client logic for the golang.org/x/oauth2 package.
|
||||
//
|
||||
// Construct a [Provider] and [oauth2.Config] through the identity provider's
|
||||
// discovery document with [NewProvider], and construct an ID Token verifier
|
||||
// with [Provider.Verifier]:
|
||||
//
|
||||
// provider, err := oidc.NewProvider(ctx, "https://accounts.google.com")
|
||||
// if err != nil {
|
||||
// // handle error
|
||||
// }
|
||||
//
|
||||
// // Configure an OpenID Connect aware OAuth2 client.
|
||||
// oauth2Config := oauth2.Config{
|
||||
// ClientID: clientID,
|
||||
// ClientSecret: clientSecret,
|
||||
// RedirectURL: redirectURL,
|
||||
// // Discovery returns the OAuth2 endpoints.
|
||||
// Endpoint: provider.Endpoint(),
|
||||
// // "openid" is a required scope for OpenID Connect flows.
|
||||
// Scopes: []string{oidc.ScopeOpenID, oidc.ScopeProfile, oidc.ScopeEmail},
|
||||
// }
|
||||
//
|
||||
// idTokenVerifier := provider.Verifier(&oidc.Config{ClientID: clientID})
|
||||
//
|
||||
// OAuth 2.0 redirects then opt into the OpenID Connect flow with [ScopeOpenID]:
|
||||
//
|
||||
// func handleRedirect(w http.ResponseWriter, r *http.Request) {
|
||||
// http.Redirect(w, r, oauth2Config.AuthCodeURL(state), http.StatusFound)
|
||||
// }
|
||||
//
|
||||
// When handling an OAuth 2.0 response, an [IDTokenVerifier] can be used to
|
||||
// validate the "id_token" payload, containing well-known fields such as the
|
||||
// user's email, name, and picture URL:
|
||||
//
|
||||
// func handleOAuth2Callback(w http.ResponseWriter, r *http.Request) {
|
||||
// // Verify state and other OAuth 2.0 responses.
|
||||
//
|
||||
// // Perform standard token exchange.
|
||||
// oauth2Token, err := oauth2Config.Exchange(r.Context(), r.URL.Query().Get("code"))
|
||||
// if err != nil {
|
||||
// // ...
|
||||
// }
|
||||
// // Extract the ID Token from OAuth2 token.
|
||||
// rawIDToken, ok := oauth2Token.Extra("id_token").(string)
|
||||
// if !ok {
|
||||
// // ...
|
||||
// }
|
||||
// // Parse and verify ID Token payload.
|
||||
// idToken, err := idTokenVerifier.Verify(r.Context(), rawIDToken)
|
||||
// if err != nil {
|
||||
// // ...
|
||||
// }
|
||||
// // Parse well-known claims from the token.
|
||||
// // https://openid.net/specs/openid-connect-core-1_0.html#Claims
|
||||
// var claims struct {
|
||||
// Email string `json:"email"`
|
||||
// EmailVerified bool `json:"email_verified"`
|
||||
// Name string `json:"name"`
|
||||
// Picture string `json:"picture"`
|
||||
// }
|
||||
// if err := idToken.Claims(&claims); err != nil {
|
||||
// // ...
|
||||
// }
|
||||
// }
|
||||
package oidc
|
||||
+8
@@ -30,3 +30,11 @@ var allAlgs = []jose.SignatureAlgorithm{
|
||||
jose.PS512,
|
||||
jose.EdDSA,
|
||||
}
|
||||
|
||||
var supportedJOSEAlgs = map[string]bool{}
|
||||
|
||||
func init() {
|
||||
for _, alg := range allAlgs {
|
||||
supportedJOSEAlgs[string(alg)] = true
|
||||
}
|
||||
}
|
||||
+58
-6
@@ -6,6 +6,7 @@ import (
|
||||
"crypto/ecdsa"
|
||||
"crypto/ed25519"
|
||||
"crypto/rsa"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -17,8 +18,8 @@ import (
|
||||
|
||||
// StaticKeySet is a verifier that validates JWT against a static set of public keys.
|
||||
type StaticKeySet struct {
|
||||
// PublicKeys used to verify the JWT. Supported types are *rsa.PublicKey and
|
||||
// *ecdsa.PublicKey.
|
||||
// PublicKeys used to verify the JWT. Supported types are *rsa.PublicKey,
|
||||
// *ecdsa.PublicKey, and ed25519.PublicKey.
|
||||
PublicKeys []crypto.PublicKey
|
||||
}
|
||||
|
||||
@@ -53,8 +54,10 @@ func (s *StaticKeySet) VerifySignature(ctx context.Context, jwt string) ([]byte,
|
||||
// exposed for providers that don't support discovery or to prevent round trips to the
|
||||
// discovery URL.
|
||||
//
|
||||
// The returned KeySet is a long lived verifier that caches keys based on any
|
||||
// keys change. Reuse a common remote key set instead of creating new ones as needed.
|
||||
// The returned KeySet is a long lived verifier that caches keys in memory,
|
||||
// re-fetching from the remote URL when it encounters a key ID it hasn't seen.
|
||||
// Reuse a single remote key set rather than creating a new one for each
|
||||
// verification.
|
||||
func NewRemoteKeySet(ctx context.Context, jwksURL string) *RemoteKeySet {
|
||||
return newRemoteKeySet(ctx, jwksURL)
|
||||
}
|
||||
@@ -123,7 +126,7 @@ func (i *inflight) result() ([]jose.JSONWebKey, error) {
|
||||
return i.keys, i.err
|
||||
}
|
||||
|
||||
// paresdJWTKey is a context key that allows common setups to avoid parsing the
|
||||
// parsedJWTKey is a context key that allows common setups to avoid parsing the
|
||||
// JWT twice. It holds a *jose.JSONWebSignature value.
|
||||
var parsedJWTKey contextKey
|
||||
|
||||
@@ -233,6 +236,55 @@ func (r *RemoteKeySet) keysFromRemote(ctx context.Context) ([]jose.JSONWebKey, e
|
||||
}
|
||||
}
|
||||
|
||||
// jwkJSON implements custom logic for unmarshaling JSON Web Key Sets.
|
||||
type jwkJSON struct {
|
||||
Keys []jose.JSONWebKey
|
||||
}
|
||||
|
||||
func (j *jwkJSON) UnmarshalJSON(data []byte) error {
|
||||
var raw struct {
|
||||
Keys []json.RawMessage `json:"keys"`
|
||||
}
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
return err
|
||||
}
|
||||
// For each key, attempt to determine if the algorithm is supported before
|
||||
// unmarshaling the key. This allows us to ignore keys with unsupported
|
||||
// algorithms, rather than failing to load the entire set.
|
||||
for _, key := range raw.Keys {
|
||||
var metadata struct {
|
||||
Alg string `json:"alg"`
|
||||
}
|
||||
if err := json.Unmarshal(key, &metadata); err != nil {
|
||||
return err
|
||||
}
|
||||
if metadata.Alg != "" {
|
||||
// Algorithms are technically optional, but if the key advertises an
|
||||
// algorithm we don't support, ignore it rather than failing to load
|
||||
// the entire key set.
|
||||
//
|
||||
// https://datatracker.ietf.org/doc/html/rfc7517#section-4.4
|
||||
//
|
||||
// This skip is currently implemented due to secp256k1, which some
|
||||
// providers use for signing with "ES256K". While we could also
|
||||
// ignore the curve, this seems like a more general check in case
|
||||
// providers start throwing in post-quantum algorithims or something
|
||||
// like that.
|
||||
//
|
||||
// https://github.com/coreos/go-oidc/issues/490
|
||||
if !supportedJOSEAlgs[metadata.Alg] {
|
||||
continue
|
||||
}
|
||||
}
|
||||
var jwk jose.JSONWebKey
|
||||
if err := json.Unmarshal(key, &jwk); err != nil {
|
||||
return err
|
||||
}
|
||||
j.Keys = append(j.Keys, jwk)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *RemoteKeySet) updateKeys() ([]jose.JSONWebKey, error) {
|
||||
req, err := http.NewRequest("GET", r.jwksURL, nil)
|
||||
if err != nil {
|
||||
@@ -255,7 +307,7 @@ func (r *RemoteKeySet) updateKeys() ([]jose.JSONWebKey, error) {
|
||||
return nil, fmt.Errorf("oidc: get keys failed: %s %s", resp.Status, body)
|
||||
}
|
||||
|
||||
var keySet jose.JSONWebKeySet
|
||||
var keySet jwkJSON
|
||||
err = unmarshalResp(resp, body, &keySet)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("oidc: failed to decode keys: %v %s", err, body)
|
||||
|
||||
Loaded 100 of 388 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user