diff --git a/.vscode/launch.json b/.vscode/launch.json index 47106ab9924..d39ef63e6ed 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,214 +1,211 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Listen for Xdebug", - "type": "php", - "request": "launch" - }, - { - "name": "Debug remote :40000", - "type": "go", - "request": "attach", - "mode": "remote", - "port": 40000 - }, - { - "name": "oCIS server", - "type": "go", - "request": "launch", - "mode": "debug", - "buildFlags": [ - // "-tags", "enable_vips" - ], - "program": "${workspaceFolder}/ocis/cmd/ocis", - "args": [ - "server" - ], - "env": { - // log settings for human developers - "OCIS_LOG_LEVEL": "debug", - "OCIS_LOG_PRETTY": "true", - "OCIS_LOG_COLOR": "true", - // set insecure options because we don't have valid certificates in dev environments - "OCIS_INSECURE": "true", - // enable basic auth for dev setup so that we can use curl for testing - "PROXY_ENABLE_BASIC_AUTH": "true", - // demo users - "IDM_CREATE_DEMO_USERS": "true", - // OCIS_RUN_SERVICES allows to start a subset of services even in the supervised mode - //"OCIS_RUN_SERVICES": "settings,storage-system,graph,idp,idm,ocs,store,thumbnails,web,webdav,frontend,gateway,users,groups,auth-basic,storage-authmachine,storage-users,storage-shares,storage-publiclink,storage-system,app-provider,sharing,proxy,ocdav", + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch" + }, + { + "name": "Debug remote :40000", + "type": "go", + "request": "attach", + "mode": "remote", + "port": 40000 + }, + { + "name": "oCIS server", + "type": "go", + "request": "launch", + "mode": "debug", + "buildFlags": [ + // "-tags", "enable_vips" + ], + "program": "${workspaceFolder}/ocis/cmd/ocis", + "args": ["server"], + "env": { + // log settings for human developers + "OCIS_LOG_LEVEL": "debug", + "OCIS_LOG_PRETTY": "true", + "OCIS_LOG_COLOR": "true", + // set insecure options because we don't have valid certificates in dev environments + "OCIS_INSECURE": "true", + // enable basic auth for dev setup so that we can use curl for testing + "PROXY_ENABLE_BASIC_AUTH": "true", + // demo users + "IDM_CREATE_DEMO_USERS": "true", + // OCIS_RUN_SERVICES allows to start a subset of services even in the supervised mode + //"OCIS_RUN_SERVICES": "settings,storage-system,graph,idp,idm,ocs,store,thumbnails,web,webdav,frontend,gateway,users,groups,auth-basic,storage-authmachine,storage-users,storage-shares,storage-publiclink,storage-system,app-provider,sharing,proxy,ocdav", - /* - * Keep secrets and passwords in one block to allow easy uncommenting - */ - // user id of "admin", for user creation and admin role assignement - "OCIS_ADMIN_USER_ID": "some-admin-user-id-0000-000000000000", // FIXME currently must have the length of a UUID, see reva/pkg/storage/utils/decomposedfs/spaces.go:228 - // admin user default password - "IDM_ADMIN_PASSWORD": "admin", - // system user - "OCIS_SYSTEM_USER_ID": "some-system-user-id-000-000000000000", // FIXME currently must have the length of a UUID, see reva/pkg/storage/utils/decomposedfs/spaces.go:228 - "OCIS_SYSTEM_USER_API_KEY": "some-system-user-machine-auth-api-key", - // set some hardcoded secrets - "OCIS_JWT_SECRET": "some-ocis-jwt-secret", - "OCIS_MACHINE_AUTH_API_KEY": "some-ocis-machine-auth-api-key", - "OCIS_TRANSFER_SECRET": "some-ocis-transfer-secret", - // collaboration - "COLLABORATION_WOPIAPP_SECRET": "some-wopi-secret", - // idm ldap - "IDM_SVC_PASSWORD": "some-ldap-idm-password", - "GRAPH_LDAP_BIND_PASSWORD": "some-ldap-idm-password", - // reva ldap - "IDM_REVASVC_PASSWORD": "some-ldap-reva-password", - "GROUPS_LDAP_BIND_PASSWORD": "some-ldap-reva-password", - "USERS_LDAP_BIND_PASSWORD": "some-ldap-reva-password", - "AUTH_BASIC_LDAP_BIND_PASSWORD": "some-ldap-reva-password", - // idp ldap - "IDM_IDPSVC_PASSWORD": "some-ldap-idp-password", - "IDP_LDAP_BIND_PASSWORD": "some-ldap-idp-password", - // storage users mount ID - "GATEWAY_STORAGE_USERS_MOUNT_ID": "storage-users-1", - "STORAGE_USERS_MOUNT_ID": "storage-users-1", - // graph application ID - "GRAPH_APPLICATION_ID": "application-1", + /* + * Keep secrets and passwords in one block to allow easy uncommenting + */ + // user id of "admin", for user creation and admin role assignement + "OCIS_ADMIN_USER_ID": "some-admin-user-id-0000-000000000000", // FIXME currently must have the length of a UUID, see reva/pkg/storage/utils/decomposedfs/spaces.go:228 + // admin user default password + "IDM_ADMIN_PASSWORD": "admin", + // system user + "OCIS_SYSTEM_USER_ID": "some-system-user-id-000-000000000000", // FIXME currently must have the length of a UUID, see reva/pkg/storage/utils/decomposedfs/spaces.go:228 + "OCIS_SYSTEM_USER_API_KEY": "some-system-user-machine-auth-api-key", + // set some hardcoded secrets + "OCIS_JWT_SECRET": "some-ocis-jwt-secret", + "OCIS_MACHINE_AUTH_API_KEY": "some-ocis-machine-auth-api-key", + "OCIS_TRANSFER_SECRET": "some-ocis-transfer-secret", + // collaboration + "COLLABORATION_WOPIAPP_SECRET": "some-wopi-secret", + // idm ldap + "IDM_SVC_PASSWORD": "some-ldap-idm-password", + "GRAPH_LDAP_BIND_PASSWORD": "some-ldap-idm-password", + // reva ldap + "IDM_REVASVC_PASSWORD": "some-ldap-reva-password", + "GROUPS_LDAP_BIND_PASSWORD": "some-ldap-reva-password", + "USERS_LDAP_BIND_PASSWORD": "some-ldap-reva-password", + "AUTH_BASIC_LDAP_BIND_PASSWORD": "some-ldap-reva-password", + // idp ldap + "IDM_IDPSVC_PASSWORD": "some-ldap-idp-password", + "IDP_LDAP_BIND_PASSWORD": "some-ldap-idp-password", + // storage users mount ID + "GATEWAY_STORAGE_USERS_MOUNT_ID": "storage-users-1", + "STORAGE_USERS_MOUNT_ID": "storage-users-1", + // graph application ID + "GRAPH_APPLICATION_ID": "application-1", - // service accounts - "OCIS_SERVICE_ACCOUNT_ID": "service-account-id", - "OCIS_SERVICE_ACCOUNT_SECRET": "service-account-secret" - } - }, - { - "name": "10200", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/ocis/cmd/ocis/main.go", - "args": [ - "server" - ], - "env": { - "OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE": "${workspaceFolder}/tests/config/drone/providers.json", - "OCM_OCM_INVITE_MANAGER_INSECURE": "true", - "OCM_OCM_SHARE_PROVIDER_INSECURE": "true", - "OCM_OCM_STORAGE_PROVIDER_INSECURE": "true", - "OCIS_BASE_DATA_PATH": "${env:HOME}/.ocis-10200", - "OCIS_CONFIG_DIR": "${env:HOME}/.ocis-10200/config", - "OCIS_EVENTS_ENDPOINT": "127.0.0.1:10233", - "OCIS_LDAP_URI": "ldaps://localhost:10235", - "OCIS_RUNTIME_PORT": "10250", - "OCIS_URL": "https://federation-ocis-server:10200", - "OCIS_ADD_RUN_SERVICES": "ocm", - "OCIS_ENABLE_OCM": "true", - "APP_PROVIDER_DEBUG_ADDR": "127.0.0.1:10165", - "APP_PROVIDER_GRPC_ADDR": "127.0.0.1:10164", - "APP_REGISTRY_DEBUG_ADDR": "127.0.0.1:10243", - "APP_REGISTRY_GRPC_ADDR": "127.0.0.1:10242", - "AUTH_BASIC_DEBUG_ADDR": "127.0.0.1:10147", - "AUTH_BASIC_GRPC_ADDR": "127.0.0.1:10146", - "AUTH_MACHINE_DEBUG_ADDR": "127.0.0.1:10167", - "AUTH_MACHINE_GRPC_ADDR": "127.0.0.1:10166", - "AUTH_SERVICE_DEBUG_ADDR": "127.0.0.1:10169", - "AUTH_SERVICE_GRPC_ADDR": "127.0.0.1:10199", - "CLIENTLOG_DEBUG_ADDR": "127.0.0.1:10260", - "ACTIVITYLOG_HTTP_ADDR": "127.0.0.1:10195", - "ACTIVITYLOG_DEBUG_ADDR": "127.0.0.1:10261", - "EVENTHISTORY_GRPC_ADDR": "127.0.0.1:10274", - "EVENTHISTORY_DEBUG_ADDR": "127.0.0.1:10270", - "FRONTEND_DEBUG_ADDR": "127.0.0.1:10141", - "FRONTEND_HTTP_ADDR": "127.0.0.1:10140", - "GATEWAY_DEBUG_ADDR": "127.0.0.1:10143", - "GATEWAY_GRPC_ADDR": "127.0.0.1:10142", - "GRAPH_DEBUG_ADDR": "127.0.0.1:10124", - "GRAPH_HTTP_ADDR": "127.0.0.1:10120", - "GROUPS_DEBUG_ADDR": "127.0.0.1:10161", - "GROUPS_GRPC_ADDR": "127.0.0.1:10160", - "IDM_DEBUG_ADDR": "127.0.0.1:10239", - "IDM_LDAPS_ADDR": "127.0.0.1:10235", - "IDP_DEBUG_ADDR": "127.0.0.1:10134", - "IDP_HTTP_ADDR": "127.0.0.1:10130", - "NATS_DEBUG_ADDR": "127.0.0.1:10234", - "NATS_NATS_PORT": "10233", - "OCDAV_HTTP_ADDR": "127.0.0.1:10350", - "OCDAV_DEBUG_ADDR": "127.0.0.1:10163", - "OCM_DEBUG_ADDR": "127.0.0.1:10281", - "OCM_HTTP_ADDR": "127.0.0.1:10280", - "OCM_GRPC_ADDR": "127.0.0.1:10282", - "OCS_DEBUG_ADDR": "127.0.0.1:10114", - "OCS_HTTP_ADDR": "127.0.0.1:10110", - "POSTPROCESSING_DEBUG_ADDR": "127.0.0.1:10255", - "POSTPROCESSING_SERVICE_DEBUG_ADDR": "127.0.0.1:10255", - "PROXY_DEBUG_ADDR": "127.0.0.1:10205", - "PROXY_HTTP_ADDR": "127.0.0.1:10200", - "SEARCH_DEBUG_ADDR": "127.0.0.1:10224", - "SEARCH_GRPC_ADDR": "127.0.0.1:10220", - "SETTINGS_DEBUG_ADDR": "127.0.0.1:10189", - "SETTINGS_GRPC_ADDR": "127.0.0.1:10185", - "SETTINGS_HTTP_ADDR": "127.0.0.1:10186", - "SHARING_DEBUG_ADDR": "127.0.0.1:10151", - "SHARING_GRPC_ADDR": "127.0.0.1:10150", - "SSE_HTTP_ADDR": "127.0.0.1:10132", - "SSE_DEBUG_ADDR": "127.0.0.1:10135", - "STORAGE_PUBLICLINK_DEBUG_ADDR": "127.0.0.1:10179", - "STORAGE_PUBLICLINK_GRPC_ADDR": "127.0.0.1:10178", - "STORAGE_SHARES_DEBUG_ADDR": "127.0.0.1:10156", - "STORAGE_SHARES_GRPC_ADDR": "127.0.0.1:10154", - "STORAGE_SYSTEM_DATA_SERVER_URL": "http://localhost:10216/data", - "STORAGE_SYSTEM_DEBUG_ADDR": "127.0.0.1:10217", - "STORAGE_SYSTEM_GRPC_ADDR": "127.0.0.1:10215", - "STORAGE_SYSTEM_HTTP_ADDR": "127.0.0.1:10216", - "STORAGE_USERS_DEBUG_ADDR": "127.0.0.1:10159", - "STORAGE_USERS_GRPC_ADDR": "127.0.0.1:10157", - "STORAGE_USERS_HTTP_ADDR": "127.0.0.1:10158", - "STORAGE_USERS_DATA_SERVER_URL": "http://localhost:10158/data", - "STORE_DEBUG_ADDR": "127.0.0.1:10464", - "STORE_GRPC_ADDR": "127.0.0.1:10460", - "THUMBNAILS_DEBUG_ADDR": "127.0.0.1:10194", - "THUMBNAILS_GRPC_ADDR": "127.0.0.1:10191", - "THUMBNAILS_HTTP_ADDR": "127.0.0.1:10190", - "USERLOG_HTTP_ADDR": "127.0.0.1:10211", - "USERLOG_DEBUG_ADDR": "127.0.0.1:10210", - "USERS_DEBUG_ADDR": "127.0.0.1:10145", - "USERS_GRPC_ADDR": "127.0.0.1:10144", - "WEB_DEBUG_ADDR": "localhost:10104", - "WEB_HTTP_ADDR": "localhost:10100", - "WEBDAV_DEBUG_ADDR": "127.0.0.1:10119", - "WEBDAV_HTTP_ADDR": "127.0.0.1:10115", - "WEBFINGER_DEBUG_ADDR": "127.0.0.1:10279", - "WEBFINGER_HTTP_ADDR": "127.0.0.1:10275", - "OCIS_SERVICE_ACCOUNT_ID": "serviceaccount", - "OCIS_SERVICE_ACCOUNT_SECRET": "serviceaccountsecret", - "OCIS_DECOMPOSEDFS_PROPAGATOR": "async", - "STORAGE_USERS_ASYNC_PROPAGATOR_PROPAGATION_DELAY": "10s", - "TLS_INSECURE": "true", - "OCIS_INSECURE": "true", - "IDP_ACCESS_TOKEN_EXPIRATION": "9000", - "GATEWAY_STORAGE_USERS_MOUNT_ID": "storage-users-1", - "STORAGE_USERS_MOUNT_ID": "storage-users-1", - "MICRO_REGISTRY": "memory", - "SHARING_PUBLIC_DRIVER": "jsoncs3", - "FRONTEND_OCS_RESOURCE_INFO_CACHE_TTL": "0", - "OCIS_LOG_LEVEL": "info", - "OCIS_LOG_PRETTY": "true", - "OCIS_LOG_COLOR": "true", - "PROXY_ENABLE_BASIC_AUTH": "true", - "IDM_CREATE_DEMO_USERS": "true", - "OCIS_ADMIN_USER_ID": "some-admin-user-id-0000-000000000000", - "IDM_ADMIN_PASSWORD": "admin", - "OCIS_SYSTEM_USER_ID": "some-system-user-id-000-000000000000", - "OCIS_SYSTEM_USER_API_KEY": "some-system-user-machine-auth-api-key", - "OCIS_JWT_SECRET": "some-ocis-jwt-secret", - "OCIS_MACHINE_AUTH_API_KEY": "some-ocis-machine-auth-api-key", - "OCIS_TRANSFER_SECRET": "some-ocis-transfer-secret", - "IDM_SVC_PASSWORD": "some-ldap-idm-password", - "GRAPH_LDAP_BIND_PASSWORD": "some-ldap-idm-password", - "IDM_REVASVC_PASSWORD": "some-ldap-reva-password", - "GROUPS_LDAP_BIND_PASSWORD": "some-ldap-reva-password", - "USERS_LDAP_BIND_PASSWORD": "some-ldap-reva-password", - "AUTH_BASIC_LDAP_BIND_PASSWORD": "some-ldap-reva-password", - "IDM_IDPSVC_PASSWORD": "some-ldap-idp-password", - "IDP_LDAP_BIND_PASSWORD": "some-ldap-idp-password", - "GRAPH_APPLICATION_ID": "application-1" - } - }, - ] + // service accounts + "OCIS_SERVICE_ACCOUNT_ID": "service-account-id", + "OCIS_SERVICE_ACCOUNT_SECRET": "service-account-secret" + } + }, + { + "name": "Fed oCIS server", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/ocis/cmd/ocis/main.go", + "args": ["server"], + "env": { + "WEB_UI_CONFIG_FILE": "${workspaceFolder}/tests/config/local/fed-ocis-web.json", + "OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE": "${workspaceFolder}/tests/config/local/providers.json", + "OCM_OCM_INVITE_MANAGER_INSECURE": "true", + "OCM_OCM_SHARE_PROVIDER_INSECURE": "true", + "OCM_OCM_STORAGE_PROVIDER_INSECURE": "true", + "OCIS_BASE_DATA_PATH": "${env:HOME}/.ocis-10200", + "OCIS_CONFIG_DIR": "${env:HOME}/.ocis-10200/config", + "OCIS_EVENTS_ENDPOINT": "127.0.0.1:10233", + "OCIS_LDAP_URI": "ldaps://localhost:10235", + "OCIS_RUNTIME_PORT": "10250", + "OCIS_URL": "https://localhost:10200", + "OCIS_ADD_RUN_SERVICES": "ocm", + "OCIS_ENABLE_OCM": "true", + "APP_PROVIDER_DEBUG_ADDR": "127.0.0.1:10165", + "APP_PROVIDER_GRPC_ADDR": "127.0.0.1:10164", + "APP_REGISTRY_DEBUG_ADDR": "127.0.0.1:10243", + "APP_REGISTRY_GRPC_ADDR": "127.0.0.1:10242", + "AUTH_BASIC_DEBUG_ADDR": "127.0.0.1:10147", + "AUTH_BASIC_GRPC_ADDR": "127.0.0.1:10146", + "AUTH_MACHINE_DEBUG_ADDR": "127.0.0.1:10167", + "AUTH_MACHINE_GRPC_ADDR": "127.0.0.1:10166", + "AUTH_SERVICE_DEBUG_ADDR": "127.0.0.1:10169", + "AUTH_SERVICE_GRPC_ADDR": "127.0.0.1:10199", + "CLIENTLOG_DEBUG_ADDR": "127.0.0.1:10260", + "ACTIVITYLOG_HTTP_ADDR": "127.0.0.1:10195", + "ACTIVITYLOG_DEBUG_ADDR": "127.0.0.1:10261", + "EVENTHISTORY_GRPC_ADDR": "127.0.0.1:10274", + "EVENTHISTORY_DEBUG_ADDR": "127.0.0.1:10270", + "FRONTEND_DEBUG_ADDR": "127.0.0.1:10141", + "FRONTEND_HTTP_ADDR": "127.0.0.1:10140", + "GATEWAY_DEBUG_ADDR": "127.0.0.1:10143", + "GATEWAY_GRPC_ADDR": "127.0.0.1:10142", + "GRAPH_DEBUG_ADDR": "127.0.0.1:10124", + "GRAPH_HTTP_ADDR": "127.0.0.1:10120", + "GROUPS_DEBUG_ADDR": "127.0.0.1:10161", + "GROUPS_GRPC_ADDR": "127.0.0.1:10160", + "IDM_DEBUG_ADDR": "127.0.0.1:10239", + "IDM_LDAPS_ADDR": "127.0.0.1:10235", + "IDP_DEBUG_ADDR": "127.0.0.1:10134", + "IDP_HTTP_ADDR": "127.0.0.1:10130", + "NATS_DEBUG_ADDR": "127.0.0.1:10234", + "NATS_NATS_PORT": "10233", + "OCDAV_HTTP_ADDR": "127.0.0.1:10350", + "OCDAV_DEBUG_ADDR": "127.0.0.1:10163", + "OCM_DEBUG_ADDR": "127.0.0.1:10281", + "OCM_HTTP_ADDR": "127.0.0.1:10280", + "OCM_GRPC_ADDR": "127.0.0.1:10282", + "OCS_DEBUG_ADDR": "127.0.0.1:10114", + "OCS_HTTP_ADDR": "127.0.0.1:10110", + "POSTPROCESSING_DEBUG_ADDR": "127.0.0.1:10255", + "POSTPROCESSING_SERVICE_DEBUG_ADDR": "127.0.0.1:10255", + "PROXY_DEBUG_ADDR": "127.0.0.1:10205", + "PROXY_HTTP_ADDR": "127.0.0.1:10200", + "SEARCH_DEBUG_ADDR": "127.0.0.1:10224", + "SEARCH_GRPC_ADDR": "127.0.0.1:10220", + "SETTINGS_DEBUG_ADDR": "127.0.0.1:10189", + "SETTINGS_GRPC_ADDR": "127.0.0.1:10185", + "SETTINGS_HTTP_ADDR": "127.0.0.1:10186", + "SHARING_DEBUG_ADDR": "127.0.0.1:10151", + "SHARING_GRPC_ADDR": "127.0.0.1:10150", + "SSE_HTTP_ADDR": "127.0.0.1:10132", + "SSE_DEBUG_ADDR": "127.0.0.1:10135", + "STORAGE_PUBLICLINK_DEBUG_ADDR": "127.0.0.1:10179", + "STORAGE_PUBLICLINK_GRPC_ADDR": "127.0.0.1:10178", + "STORAGE_SHARES_DEBUG_ADDR": "127.0.0.1:10156", + "STORAGE_SHARES_GRPC_ADDR": "127.0.0.1:10154", + "STORAGE_SYSTEM_DATA_SERVER_URL": "http://localhost:10216/data", + "STORAGE_SYSTEM_DEBUG_ADDR": "127.0.0.1:10217", + "STORAGE_SYSTEM_GRPC_ADDR": "127.0.0.1:10215", + "STORAGE_SYSTEM_HTTP_ADDR": "127.0.0.1:10216", + "STORAGE_USERS_DEBUG_ADDR": "127.0.0.1:10159", + "STORAGE_USERS_GRPC_ADDR": "127.0.0.1:10157", + "STORAGE_USERS_HTTP_ADDR": "127.0.0.1:10158", + "STORAGE_USERS_DATA_SERVER_URL": "http://localhost:10158/data", + "STORE_DEBUG_ADDR": "127.0.0.1:10464", + "STORE_GRPC_ADDR": "127.0.0.1:10460", + "THUMBNAILS_DEBUG_ADDR": "127.0.0.1:10194", + "THUMBNAILS_GRPC_ADDR": "127.0.0.1:10191", + "THUMBNAILS_HTTP_ADDR": "127.0.0.1:10190", + "USERLOG_HTTP_ADDR": "127.0.0.1:10211", + "USERLOG_DEBUG_ADDR": "127.0.0.1:10210", + "USERS_DEBUG_ADDR": "127.0.0.1:10145", + "USERS_GRPC_ADDR": "127.0.0.1:10144", + "WEB_DEBUG_ADDR": "localhost:10104", + "WEB_HTTP_ADDR": "localhost:10100", + "WEBDAV_DEBUG_ADDR": "127.0.0.1:10119", + "WEBDAV_HTTP_ADDR": "127.0.0.1:10115", + "WEBFINGER_DEBUG_ADDR": "127.0.0.1:10279", + "WEBFINGER_HTTP_ADDR": "127.0.0.1:10275", + "OCIS_SERVICE_ACCOUNT_ID": "serviceaccount", + "OCIS_SERVICE_ACCOUNT_SECRET": "serviceaccountsecret", + "OCIS_DECOMPOSEDFS_PROPAGATOR": "async", + "STORAGE_USERS_ASYNC_PROPAGATOR_PROPAGATION_DELAY": "10s", + "TLS_INSECURE": "true", + "OCIS_INSECURE": "true", + "IDP_ACCESS_TOKEN_EXPIRATION": "9000", + "GATEWAY_STORAGE_USERS_MOUNT_ID": "storage-users-1", + "STORAGE_USERS_MOUNT_ID": "storage-users-1", + "MICRO_REGISTRY": "memory", + "SHARING_PUBLIC_DRIVER": "jsoncs3", + "FRONTEND_OCS_RESOURCE_INFO_CACHE_TTL": "0", + "OCIS_LOG_LEVEL": "info", + "OCIS_LOG_PRETTY": "true", + "OCIS_LOG_COLOR": "true", + "PROXY_ENABLE_BASIC_AUTH": "true", + "IDM_CREATE_DEMO_USERS": "true", + "OCIS_ADMIN_USER_ID": "some-admin-user-id-0000-000000000000", + "IDM_ADMIN_PASSWORD": "admin", + "OCIS_SYSTEM_USER_ID": "some-system-user-id-000-000000000000", + "OCIS_SYSTEM_USER_API_KEY": "some-system-user-machine-auth-api-key", + "OCIS_JWT_SECRET": "some-ocis-jwt-secret", + "OCIS_MACHINE_AUTH_API_KEY": "some-ocis-machine-auth-api-key", + "OCIS_TRANSFER_SECRET": "some-ocis-transfer-secret", + "IDM_SVC_PASSWORD": "some-ldap-idm-password", + "GRAPH_LDAP_BIND_PASSWORD": "some-ldap-idm-password", + "IDM_REVASVC_PASSWORD": "some-ldap-reva-password", + "GROUPS_LDAP_BIND_PASSWORD": "some-ldap-reva-password", + "USERS_LDAP_BIND_PASSWORD": "some-ldap-reva-password", + "AUTH_BASIC_LDAP_BIND_PASSWORD": "some-ldap-reva-password", + "IDM_IDPSVC_PASSWORD": "some-ldap-idp-password", + "IDP_LDAP_BIND_PASSWORD": "some-ldap-idp-password", + "GRAPH_APPLICATION_ID": "application-1" + } + } + ] } diff --git a/docs/ocis/development/testing.md b/docs/ocis/development/testing.md index e9e3cd1f3e9..7f1f1539c31 100644 --- a/docs/ocis/development/testing.md +++ b/docs/ocis/development/testing.md @@ -472,6 +472,10 @@ docker run -d -p 3310:3310 -v /your/local/filesystem/path/to/clamav/:/var/lib/cl As `antivirus` service is not enabled by default we need to enable the service while running oCIS server. We also need to enable `async upload` and as virus scan is performed in post-processing step, we need to set it as well. Documentation for environment variables related to antivirus is available [here](https://owncloud.dev/services/antivirus/#environment-variables) ```bash +# init oCIS +IDM_ADMIN_PASSWORD=admin \ +ocis/bin/ocis init --insecure true + # run oCIS PROXY_ENABLE_BASIC_AUTH=true \ ANTIVIRUS_SCANNER_TYPE="clamav" \ @@ -504,47 +508,47 @@ make test-acceptance-api Test suites that are tagged with `@ocm` require running two different ocis instances. More detailed information and configuration related to it can be found [here](https://doc.owncloud.com/ocis/5.0/deployment/services/s-list/ocm.html). -Put +### Setup First oCIS Instance ```bash -127.0.0.1 ocis-server -127.0.0.1 federation-ocis-server -``` - -in the `/etc/hosts` file - -### Setup first ocis instance +# init oCIS +IDM_ADMIN_PASSWORD=admin \ +ocis/bin/ocis init --insecure true -```bash # run oCIS -OCIS_URL="https://ocis-server:9200" \ +OCIS_URL="https://localhost:9200" \ PROXY_ENABLE_BASIC_AUTH=true \ OCIS_ENABLE_OCM=true \ -OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE="${workspaceFolder}/tests/config/drone/providers.json" \ +OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE="tests/config/local/providers.json" \ OCIS_ADD_RUN_SERVICES="ocm" \ OCM_OCM_INVITE_MANAGER_INSECURE=true \ OCM_OCM_SHARE_PROVIDER_INSECURE=true \ OCM_OCM_STORAGE_PROVIDER_INSECURE=true \ +WEB_UI_CONFIG_FILE="tests/config/local/ocis-web.json" \ ocis/bin/ocis server ``` -The first oCIS instance should be available at: https://ocis-server:9200/ +The first oCIS instance should be available at: https://localhost:9200/ -### Setup second ocis instance +### Setup Second oCIS Instance -#### Using .vscode/launch.json +You can run the second oCIS instance in two ways: -#### Using .env file +#### Using `.vscode/launch.json` + +From the `Run and Debug` panel of VSCode, select `Fed oCIS Server` and start the debugger. + +#### Using env file ```bash # init oCIS -source tests/config/drone/.env-federation && ocis/bin/ocis init +source tests/config/local/.env-federation && ocis/bin/ocis init # run oCIS ocis/bin/ocis server ``` -The second oCIS instance should be available at: https://federation-ocis-server:10200/ +The second oCIS instance should be available at: https://localhost:10200/ {{< hint info >}} To enable ocm in the web interface, you need to set the following envs: @@ -557,8 +561,8 @@ To enable ocm in the web interface, you need to set the following envs: Run the acceptance test with the following command: ```bash -TEST_SERVER_URL="https://ocis-server:9200" \ -TEST_SERVER_FED_URL="https://federation-ocis-server:10200" \ +TEST_SERVER_URL="https://localhost:9200" \ +TEST_SERVER_FED_URL="https://localhost:10200" \ BEHAT_FEATURE="tests/acceptance/features/apiOcm/ocm.feature" \ make test-acceptance-api ``` diff --git a/tests/acceptance/TestHelpers/OcisHelper.php b/tests/acceptance/TestHelpers/OcisHelper.php index 2aa14ad34ad..993caf8beae 100644 --- a/tests/acceptance/TestHelpers/OcisHelper.php +++ b/tests/acceptance/TestHelpers/OcisHelper.php @@ -43,6 +43,16 @@ public static function getServerUrl(): string { return 'https://localhost:9200'; } + /** + * @return string + */ + public static function getFederatedServerUrl(): string { + if (\getenv('TEST_SERVER_FED_URL')) { + return \getenv('TEST_SERVER_FED_URL'); + } + return 'https://localhost:10200'; + } + /** * @return bool */ diff --git a/tests/acceptance/bootstrap/FeatureContext.php b/tests/acceptance/bootstrap/FeatureContext.php index 01f49050916..842a71d3200 100644 --- a/tests/acceptance/bootstrap/FeatureContext.php +++ b/tests/acceptance/bootstrap/FeatureContext.php @@ -146,10 +146,6 @@ class FeatureContext extends BehatVariablesContext { */ private string $stepLineRef = ''; - /** - * @var boolean true if TEST_SERVER_FED_URL is defined - */ - private bool $federatedServerExists; private int $ocsApiVersion = 1; private ?ResponseInterface $response = null; private string $responseUser = ''; @@ -484,19 +480,10 @@ public function __construct( $this->alternateAdminPassword = "IHave99LotsOfPriv"; $this->publicLinkSharePassword = "publicPwd:1"; - $testServerUrl = OcisHelper::getServerUrl(); - $this->baseUrl = \rtrim($testServerUrl, '/'); + $this->baseUrl = OcisHelper::getServerUrl(); $this->localBaseUrl = $this->baseUrl; - // federated server url from the environment - $testRemoteServerUrl = \getenv('TEST_SERVER_FED_URL'); - if ($testRemoteServerUrl !== false) { - $this->remoteBaseUrl = \rtrim($testRemoteServerUrl, '/'); - $this->federatedServerExists = true; - } else { - $this->remoteBaseUrl = $this->localBaseUrl; - $this->federatedServerExists = false; - } + $this->remoteBaseUrl = OcisHelper::getFederatedServerUrl(); // get the admin username from the environment (if defined) $adminUsernameFromEnvironment = $this->getAdminUsernameFromEnvironment(); @@ -737,11 +724,8 @@ private static function getPublicLinkSharePasswordFromEnvironment() { * @return string */ public function removeSchemeFromUrl(string $url): string { - return \preg_replace( - "(^https?://)", - "", - $url - ); + $parsedUrl = parse_url($url); + return $parsedUrl["host"] . ":" . $parsedUrl["port"]; } /** @@ -1018,14 +1002,6 @@ public function usingServer(?string $server): string { return $previousServer; } - /** - * - * @return boolean - */ - public function federatedServerExists(): bool { - return $this->federatedServerExists; - } - /** * Parses the response as XML * @@ -2146,6 +2122,46 @@ public function substituteInLineCodes( ], "parameter" => [] ], + [ + "code" => "%local_base_url%", + "function" => [ + $this, + "getLocalBaseUrl" + ], + "parameter" => [] + ], + [ + "code" => "%remote_base_url%", + "function" => [ + $this, + "getRemoteBaseUrl" + ], + "parameter" => [] + ], + [ + "code" => "%base_host_port%", + "function" => [ + $this, + "getBaseUrlWithoutScheme" + ], + "parameter" => [] + ], + [ + "code" => "%local_host_port%", + "function" => [ + $this, + "getLocalBaseUrlWithoutScheme" + ], + "parameter" => [] + ], + [ + "code" => "%remote_host_port%", + "function" => [ + $this, + "getRemoteBaseUrlWithoutScheme" + ], + "parameter" => [] + ], [ "code" => "%storage_path%", "function" => [ diff --git a/tests/acceptance/bootstrap/OcmContext.php b/tests/acceptance/bootstrap/OcmContext.php index 725664f162c..48392365a41 100644 --- a/tests/acceptance/bootstrap/OcmContext.php +++ b/tests/acceptance/bootstrap/OcmContext.php @@ -52,20 +52,6 @@ public function before(BeforeScenarioScope $scope): void { $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } - /** - * @return string - */ - public function getOcisDomain(): string { - return $this->extractDomain(OcisHelper::getServerUrl()); - } - - /** - * @return string - */ - public function getFedOcisDomain(): string { - return $this->extractDomain(\getenv('TEST_SERVER_FED_URL')); - } - /** * @return string * @throws Exception @@ -77,18 +63,6 @@ public function getLastFederatedInvitationToken():string { return $this->invitationToken; } - /** - * @param string $url - * - * @return string - */ - public function extractDomain($url): string { - if (!$url) { - return "localhost"; - } - return parse_url($url)["host"]; - } - /** * @param string $user * @param string $email @@ -152,7 +126,10 @@ public function userHasCreatedTheFederationShareInvitation(string $user, $email * @throws GuzzleException */ public function acceptInvitation(string $user, string $token = null): ResponseInterface { - $providerDomain = ($this->featureContext->getCurrentServer() === "LOCAL") ? $this->getFedOcisDomain() : $this->getOcisDomain(); + $providerDomain = $this->featureContext->getLocalBaseUrlWithoutScheme(); + if ($this->featureContext->getCurrentServer() === "LOCAL") { + $providerDomain = $this->featureContext->getRemoteBaseUrlWithoutScheme(); + } return OcmHelper::acceptInvitation( $this->featureContext->getBaseUrl(), $this->featureContext->getStepLineRef(), diff --git a/tests/acceptance/bootstrap/Provisioning.php b/tests/acceptance/bootstrap/Provisioning.php index 487644d8ade..054d4fa8ba3 100644 --- a/tests/acceptance/bootstrap/Provisioning.php +++ b/tests/acceptance/bootstrap/Provisioning.php @@ -451,13 +451,8 @@ public function createLdapUser(array $setting):void { $entry['ownCloudUUID'] = WebDavHelper::generateUUIDv4(); } - if ($this->federatedServerExists()) { - if (!\in_array($setting['userid'], $this->ldapCreatedUsers)) { - $this->ldap->add($newDN, $entry); - } - } else { - $this->ldap->add($newDN, $entry); - } + $this->ldap->add($newDN, $entry); + $this->ldapCreatedUsers[] = $setting["userid"]; } diff --git a/tests/acceptance/bootstrap/SharingNgContext.php b/tests/acceptance/bootstrap/SharingNgContext.php index fbc7b43ac3f..360d328a938 100644 --- a/tests/acceptance/bootstrap/SharingNgContext.php +++ b/tests/acceptance/bootstrap/SharingNgContext.php @@ -237,6 +237,7 @@ public function userTriesToListThePermissionsOfSpaceUsingPermissionsEndpointOfTh * @param string $user * @param array $shareInfo * @param string|null $fileId + * @param bool $federatedShare * * @return ResponseInterface * @@ -244,7 +245,12 @@ public function userTriesToListThePermissionsOfSpaceUsingPermissionsEndpointOfTh * @throws GuzzleException * @throws Exception */ - public function sendShareInvitation(string $user, array $shareInfo, string $fileId = null): ResponseInterface { + public function sendShareInvitation( + string $user, + array $shareInfo, + string $fileId = null, + bool $federatedShare = false + ): ResponseInterface { if ($shareInfo['space'] === 'Personal' || $shareInfo['space'] === 'Shares') { $space = $this->spacesContext->getSpaceByName($user, $shareInfo['space']); } else { @@ -280,7 +286,7 @@ public function sendShareInvitation(string $user, array $shareInfo, string $file $shareeId = ""; if ($shareType === "user") { $shareeId = $this->featureContext->getAttributeOfCreatedUser($sharee, 'id'); - if (isset($shareInfo['federatedServer'])) { + if ($federatedShare) { $shareeId = ($this->featureContext->ocmContext->getAcceptedUserByName($user, $sharee))['user_id']; } } elseif ($shareType === "group") { @@ -319,6 +325,7 @@ public function sendShareInvitation(string $user, array $shareInfo, string $file * * @param string $user * @param TableNode $table + * @param bool $federatedShare * * @return ResponseInterface * @@ -326,7 +333,7 @@ public function sendShareInvitation(string $user, array $shareInfo, string $file * @throws GuzzleException * @throws Exception */ - public function sendDriveShareInvitation(string $user, TableNode $table): ResponseInterface { + public function sendDriveShareInvitation(string $user, TableNode $table, bool $federatedShare = false): ResponseInterface { $shareeIds = []; $rows = $table->getRowsHash(); if ($rows['space'] === 'Personal' || $rows['space'] === 'Shares') { @@ -349,7 +356,7 @@ public function sendDriveShareInvitation(string $user, TableNode $table): Respon $shareeId = ""; if ($shareType === "user") { $shareeId = $this->featureContext->getAttributeOfCreatedUser($sharee, 'id'); - if (isset($rows['federatedServer'])) { + if ($federatedShare) { $shareeId = ($this->featureContext->ocmContext->getAcceptedUserByName($user, $sharee))['user_id']; } } elseif ($shareType === "group") { @@ -379,7 +386,6 @@ public function sendDriveShareInvitation(string $user, TableNode $table): Respon /** * @Given /^user "([^"]*)" has sent the following resource share invitation:$/ - * @Given /^user "([^"]*)" has sent the following resource share invitation to federated user:$/ * * @param string $user * @param TableNode $table @@ -395,6 +401,23 @@ public function userHasSentTheFollowingResourceShareInvitation(string $user, Tab $this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response); } + /** + * @Given /^user "([^"]*)" has sent the following resource share invitation to federated user:$/ + * + * @param string $user + * @param TableNode $table + * + * @return void + * @throws Exception + * @throws GuzzleException + */ + public function userHasSentTheFollowingResourceShareInvitationToFederatedUser(string $user, TableNode $table): void { + $rows = $table->getRowsHash(); + Assert::assertArrayHasKey("resource", $rows, "'resource' should be provided in the data-table while sharing a resource"); + $response = $this->sendShareInvitation($user, $rows, null, true); + $this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response); + } + /** * @Given /^user "([^"]*)" has sent the following space share invitation:$/ * @@ -415,7 +438,6 @@ public function userHasSentTheFollowingShareShareInvitation(string $user, TableN /** * @When /^user "([^"]*)" sends the following resource share invitation using the Graph API:$/ * @When /^user "([^"]*)" tries to send the following resource share invitation using the Graph API:$/ - * @When /^user "([^"]*)" sends the following resource share invitation to federated user using the Graph API:$/ * * @param string $user * @param TableNode $table @@ -432,9 +454,26 @@ public function userSendsTheFollowingResourceShareInvitationUsingTheGraphApi(str ); } + /** + * @When /^user "([^"]*)" sends the following resource share invitation to federated user using the Graph API:$/ + * + * @param string $user + * @param TableNode $table + * + * @return void + * @throws Exception + * @throws GuzzleException + */ + public function userSendsTheFollowingResourceShareInvitationToFederatedUserUsingTheGraphApi(string $user, TableNode $table): void { + $rows = $table->getRowsHash(); + Assert::assertArrayHasKey("resource", $rows, "'resource' should be provided in the data-table while sharing a resource"); + $this->featureContext->setResponse( + $this->sendShareInvitation($user, $rows, null, true) + ); + } + /** * @When /^user "([^"]*)" sends the following space share invitation using permissions endpoint of the Graph API:$/ - * @When /^user "([^"]*)" tries to send the following space share invitation to federated user using permissions endpoint of the Graph API:$/ * * @param string $user * @param TableNode $table @@ -451,6 +490,24 @@ public function userSendsTheFollowingSpaceShareInvitationUsingPermissionsEndpoin ); } + /** + * @When /^user "([^"]*)" tries to send the following space share invitation to federated user using permissions endpoint of the Graph API:$/ + * + * @param string $user + * @param TableNode $table + * + * @return void + * @throws Exception + * @throws GuzzleException + */ + public function userSendsTheFollowingSpaceShareInvitationToFederatedUserUsingPermissionsEndpointOfTheGraphApi(string $user, TableNode $table): void { + $rows = $table->getRowsHash(); + Assert::assertArrayNotHasKey("resource", $rows, "'resource' should not be provided in the data-table while sharing a space"); + $this->featureContext->setResponse( + $this->sendShareInvitation($user, $rows, null, true) + ); + } + /** * @When user :user updates the last resource share with the following using the Graph API: * @@ -1428,7 +1485,6 @@ public function userListsThePermissionsOfDriveUsingRootEndPointOFTheGraphApi(str /** * @When /^user "([^"]*)" (?:tries to send|sends) the following space share invitation using root endpoint of the Graph API:$/ - * @When /^user "([^"]*)" tries to send the following space share invitation to federated user using root endpoint of the Graph API:$/ * * @param string $user * @param TableNode $table @@ -1441,6 +1497,20 @@ public function userSendsTheFollowingShareInvitationUsingRootEndPointTheGraphApi $this->featureContext->setResponse($response); } + /** + * @When /^user "([^"]*)" tries to send the following space share invitation to federated user using root endpoint of the Graph API:$/ + * + * @param string $user + * @param TableNode $table + * + * @return void + * @throws GuzzleException + */ + public function userSendsTheFollowingShareInvitationToFederatedUserUsingRootEndPointTheGraphApi(string $user, TableNode $table):void { + $response = $this->sendDriveShareInvitation($user, $table, true); + $this->featureContext->setResponse($response); + } + /** * @When user :user updates the last drive share with the following using root endpoint of the Graph API: * diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 385744c4838..367a1cf8eef 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -255,7 +255,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. #### [OCM. server crash after deleting share for ocm user](https://github.com/owncloud/ocis/issues/10213) -- [apiOcm/deleteFederatedConnections.feature:103](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L103) +- [apiOcm/deleteFederatedConnections.feature:102](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L102) #### [same href in REPORT request for all dav-path-version](https://github.com/owncloud/ocis/issues/7060) diff --git a/tests/acceptance/features/apiOcm/createInvitation.feature b/tests/acceptance/features/apiOcm/createInvitation.feature index bf4c849ed23..dbc618a7f88 100755 --- a/tests/acceptance/features/apiOcm/createInvitation.feature +++ b/tests/acceptance/features/apiOcm/createInvitation.feature @@ -148,7 +148,7 @@ Feature: create invitation Please visit your federation settings and use the following details: Token: %fed_invitation_token% - ProviderDomain: https://ocis-server:9200 + ProviderDomain: %local_base_url% """ @env-config diff --git a/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature b/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature index 39f6da2584c..de6167afb3a 100755 --- a/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature +++ b/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature @@ -71,12 +71,11 @@ Feature: delete federated connections And using server "LOCAL" And user "Alice" has created folder "folderToShare" And user "Alice" has sent the following resource share invitation to federated user: - | resource | folderToShare | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | - | federatedServer | @federation-ocis-server:10200 | + | resource | folderToShare | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | And using server "REMOTE" When user "Brian" deletes federated connection with user "Alice" using the Graph API Then the HTTP status code should be "200" @@ -108,12 +107,11 @@ Feature: delete federated connections And using server "LOCAL" And user "Alice" has created folder "folderToShare" And user "Alice" has sent the following resource share invitation to federated user: - | resource | folderToShare | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | - | federatedServer | @federation-ocis-server:10200 | + | resource | folderToShare | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | When user "Alice" deletes federated connection with user "Brian" using the Graph API Then the HTTP status code should be "200" And using server "REMOTE" diff --git a/tests/acceptance/features/apiOcm/searchFederationUsers.feature b/tests/acceptance/features/apiOcm/searchFederationUsers.feature index c5160b7e39e..61dc4a8e3d1 100755 --- a/tests/acceptance/features/apiOcm/searchFederationUsers.feature +++ b/tests/acceptance/features/apiOcm/searchFederationUsers.feature @@ -64,7 +64,7 @@ Feature: search federation users ], "properties": { "issuer": { - "const": "ocis-server:9200" + "const": "%local_host_port%" }, "issuerAssignedId": { "type": "string", @@ -126,7 +126,7 @@ Feature: search federation users ], "properties": { "issuer": { - "const": "federation-ocis-server:10200" + "const": "%remote_host_port%" }, "issuerAssignedId": { "type": "string", @@ -194,7 +194,7 @@ Feature: search federation users ], "properties": { "issuer": { - "const": "ocis-server:9200" + "const": "%local_host_port%" }, "issuerAssignedId": { "type": "string", @@ -256,7 +256,7 @@ Feature: search federation users ], "properties": { "issuer": { - "const": "federation-ocis-server:10200" + "const": "%remote_host_port%" }, "issuerAssignedId": { "type": "string", @@ -346,7 +346,7 @@ Feature: search federation users }, "idp": { "type": "string", - "const": "federation-ocis-server:10200" + "const": "%remote_host_port%" }, "mail": { "type": "string", @@ -385,7 +385,7 @@ Feature: search federation users "const": "Alice Hansen" }, "idp": { - "const": "ocis-server:9200" + "const": "%local_host_port%" }, "mail": { "pattern": "alice@example.org" @@ -409,7 +409,7 @@ Feature: search federation users "const": "Carol King" }, "idp": { - "const": "ocis-server:9200" + "const": "%local_host_port%" }, "mail": { "pattern": "carol@example.org" @@ -480,7 +480,7 @@ Feature: search federation users ], "properties": { "issuer": { - "const": "ocis-server:9200" + "const": "%local_host_port%" }, "issuerAssignedId": { "type": "string", @@ -545,7 +545,7 @@ Feature: search federation users ], "properties": { "issuer": { - "const": "federation-ocis-server:10200" + "const": "%remote_host_port%" }, "issuerAssignedId": { "type": "string", @@ -692,7 +692,7 @@ Feature: search federation users ], "properties": { "issuer": { - "const": "federation-ocis-server:10200" + "const": "%remote_host_port%" }, "issuerAssignedId": { "type": "string", diff --git a/tests/acceptance/features/apiOcm/share.feature b/tests/acceptance/features/apiOcm/share.feature index f43c7cc2e7d..40cdd8624a0 100755 --- a/tests/acceptance/features/apiOcm/share.feature +++ b/tests/acceptance/features/apiOcm/share.feature @@ -18,12 +18,11 @@ Feature: an user shares resources using ScienceMesh application And user "Alice" has created folder "folderToShare" And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt" When user "Alice" sends the following resource share invitation to federated user using the Graph API: - | resource | | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | - | federatedServer | @federation-ocis-server:10200 | + | resource | | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | Then the HTTP status code should be "200" When using server "REMOTE" And user "Brian" lists the shares shared with him without retry using the Graph API @@ -112,12 +111,11 @@ Feature: an user shares resources using ScienceMesh application And user "Alice" has created a space "projectSpace" with the default quota using the Graph API And user "Alice" has created a folder "folderToShare" in space "projectSpace" When user "Alice" sends the following resource share invitation to federated user using the Graph API: - | resource | folderToShare | - | space | projectSpace | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | - | federatedServer | @federation-ocis-server:10200 | + | resource | folderToShare | + | space | projectSpace | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | Then the HTTP status code should be "200" When using server "REMOTE" And user "Brian" lists the shares shared with him without retry using the Graph API @@ -185,12 +183,11 @@ Feature: an user shares resources using ScienceMesh application And user "Brian" has created folder "folderToShare" And user "Brian" has uploaded file with content "ocm test" to "/textfile.txt" When user "Brian" sends the following resource share invitation to federated user using the Graph API: - | resource | | - | space | Personal | - | sharee | Alice | - | shareType | user | - | permissionsRole | Viewer | - | federatedServer | @ocis-server:9200 | + | resource | | + | space | Personal | + | sharee | Alice | + | shareType | user | + | permissionsRole | Viewer | Then the HTTP status code should be "200" When using server "LOCAL" And user "Alice" lists the shares shared with her without retry using the Graph API @@ -277,11 +274,10 @@ Feature: an user shares resources using ScienceMesh application And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API And user "Alice" has created a space "alice's space" with the default quota using the Graph API When user "Alice" tries to send the following space share invitation to federated user using permissions endpoint of the Graph API: - | space | alice's space | - | sharee | Brian | - | shareType | user | - | permissionsRole | | - | federatedServer | @federation-ocis-server:10200 | + | space | alice's space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | Then the HTTP status code should be "400" And the JSON data of the response should match """ @@ -334,11 +330,10 @@ Feature: an user shares resources using ScienceMesh application And "Brian" has accepted invitation And using server "LOCAL" When user "Alice" tries to send the following space share invitation to federated user using root endpoint of the Graph API: - | space | alice's space | - | sharee | Brian | - | shareType | user | - | permissionsRole | | - | federatedServer | @federation-ocis-server:10200 | + | space | alice's space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | Then the HTTP status code should be "400" And the JSON data of the response should match """ @@ -389,12 +384,11 @@ Feature: an user shares resources using ScienceMesh application And "Brian" has accepted invitation And using server "LOCAL" And user "Alice" has sent the following resource share invitation to federated user: - | resource | textfile.txt | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | - | federatedServer | @federation-ocis-server:10200 | + | resource | textfile.txt | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | When user "Alice" lists the shares shared by her using the Graph API Then the HTTP status code should be "200" And the JSON data of the response should contain resource "textfile.txt" with the following data: @@ -511,12 +505,11 @@ Feature: an user shares resources using ScienceMesh application And using server "LOCAL" And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt" And user "Alice" has sent the following resource share invitation to federated user: - | resource | textfile.txt | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | - | federatedServer | @federation-ocis-server:10200 | + | resource | textfile.txt | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | And using server "LOCAL" When user "Alice" gets permissions list for file "textfile.txt" of the space "Personal" using the Graph API Then the HTTP status code should be "200" diff --git a/tests/config/drone/identifier-registration.yml b/tests/config/drone/identifier-registration.yml deleted file mode 100644 index a7f51f858b8..00000000000 --- a/tests/config/drone/identifier-registration.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- - -# OpenID Connect client registry. -clients: - - id: web - name: OCIS - application_type: web - trusted: yes - redirect_uris: - - https://ocis-server:9200/oidc-callback.html - - https://ocis-server:9200/ - origins: - - https://ocis-server:9200 - -authorities: diff --git a/tests/config/drone/providers.json b/tests/config/drone/providers.json index be7cc6bc1ee..8044bd424b8 100644 --- a/tests/config/drone/providers.json +++ b/tests/config/drone/providers.json @@ -1,46 +1,46 @@ [ { - "name": "ocis-server", - "full_name": "first-ocis-instance", - "organization": "Owncloud", - "domain": "ocis-server:9200", - "homepage": "https://owncloud.com", - "services": [ - { - "endpoint": { - "type": { - "name": "OCM", - "description": "CERNBox Open Cloud Mesh API" - }, - "name": "CERNBox - OCM API", - "path": "https://ocis-server:9200/ocm/", - "is_monitored": true - }, - "api_version": "0.0.1", - "host": "ocis-server:9200" - } - ] + "name": "ocis-server", + "full_name": "first-ocis-instance", + "organization": "Owncloud", + "domain": "ocis-server:9200", + "homepage": "https://owncloud.com", + "services": [ + { + "endpoint": { + "type": { + "name": "OCM", + "description": "CERNBox Open Cloud Mesh API" + }, + "name": "CERNBox - OCM API", + "path": "https://ocis-server:9200/ocm/", + "is_monitored": true + }, + "api_version": "0.0.1", + "host": "ocis-server:9200" + } + ] }, { - "name": "federation-ocis-server", - "full_name": "Federation ocis", - "organization": "Owncloud", - "domain": "federation-ocis-server:10200", - "homepage": "https://owncloud.com", - "services": [ - { - "endpoint": { - "type": { - "name": "OCM", - "description": "CERNBox Open Cloud Mesh API" - }, - "name": "CERNBox - OCM API", - "path": "https://federation-ocis-server:10200/ocm/", - "is_monitored": true - }, - "api_version": "0.0.1", - "host": "federation-ocis-server:10200" - } - ] + "name": "federation-ocis-server", + "full_name": "Federation ocis", + "organization": "Owncloud", + "domain": "federation-ocis-server:10200", + "homepage": "https://owncloud.com", + "services": [ + { + "endpoint": { + "type": { + "name": "OCM", + "description": "CERNBox Open Cloud Mesh API" + }, + "name": "CERNBox - OCM API", + "path": "https://federation-ocis-server:10200/ocm/", + "is_monitored": true + }, + "api_version": "0.0.1", + "host": "federation-ocis-server:10200" + } + ] } ] diff --git a/tests/config/drone/.env-federation b/tests/config/local/.env-federation similarity index 96% rename from tests/config/drone/.env-federation rename to tests/config/local/.env-federation index b6d5cc4d2f1..fb2e9238d8b 100644 --- a/tests/config/drone/.env-federation +++ b/tests/config/local/.env-federation @@ -1,4 +1,7 @@ -export OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE=tests/config/drone/providers.json +#!/bin/bash + +export WEB_UI_CONFIG_FILE=tests/config/local/fed-ocis-web.json +export OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE=tests/config/local/providers.json export OCM_OCM_INVITE_MANAGER_INSECURE=true export OCM_OCM_SHARE_PROVIDER_INSECURE=true export OCM_OCM_STORAGE_PROVIDER_INSECURE=true @@ -7,7 +10,7 @@ export OCIS_CONFIG_DIR=${HOME}/.ocis-10200/config export OCIS_EVENTS_ENDPOINT=127.0.0.1:10233 export OCIS_LDAP_URI=ldaps://localhost:10235 export OCIS_RUNTIME_PORT=10250 -export OCIS_URL=https://federation-ocis-server:10200 +export OCIS_URL=https://localhost:10200 export OCIS_ADD_RUN_SERVICES=ocm export OCIS_ENABLE_OCM=true export APP_PROVIDER_DEBUG_ADDR=127.0.0.1:10165 diff --git a/tests/config/local/fed-ocis-web.json b/tests/config/local/fed-ocis-web.json new file mode 100644 index 00000000000..f4ec1072237 --- /dev/null +++ b/tests/config/local/fed-ocis-web.json @@ -0,0 +1,31 @@ +{ + "server": "https://localhost:10200", + "theme": "https://localhost:10200/themes/owncloud/theme.json", + "version": "0.1.0", + "openIdConnect": { + "metadata_url": "https://localhost:10200/.well-known/openid-configuration", + "authority": "https://localhost:10200", + "client_id": "web", + "response_type": "code", + "scope": "openid profile email" + }, + "options": { + "topCenterNotifications": true, + "displayResourcesLazy": false, + "sidebar": { + "shares": { + "showAllOnLoad": true + } + } + }, + "apps": [ + "files", + "ocm", + "text-editor", + "preview", + "pdf-viewer", + "search", + "admin-settings", + "app-store" + ] +} diff --git a/tests/config/local/ocis-web.json b/tests/config/local/ocis-web.json new file mode 100644 index 00000000000..caa6c617678 --- /dev/null +++ b/tests/config/local/ocis-web.json @@ -0,0 +1,31 @@ +{ + "server": "https://localhost:9200", + "theme": "https://localhost:9200/themes/owncloud/theme.json", + "version": "0.1.0", + "openIdConnect": { + "metadata_url": "https://localhost:9200/.well-known/openid-configuration", + "authority": "https://localhost:9200", + "client_id": "web", + "response_type": "code", + "scope": "openid profile email" + }, + "options": { + "topCenterNotifications": true, + "displayResourcesLazy": false, + "sidebar": { + "shares": { + "showAllOnLoad": true + } + } + }, + "apps": [ + "files", + "ocm", + "text-editor", + "preview", + "pdf-viewer", + "search", + "admin-settings", + "app-store" + ] +} diff --git a/tests/config/local/providers.json b/tests/config/local/providers.json new file mode 100644 index 00000000000..07e14212a65 --- /dev/null +++ b/tests/config/local/providers.json @@ -0,0 +1,46 @@ +[ + { + "name": "ocis-server", + "full_name": "first-ocis-instance", + "organization": "Owncloud", + "domain": "localhost:9200", + "homepage": "https://owncloud.com", + "services": [ + { + "endpoint": { + "type": { + "name": "OCM", + "description": "CERNBox Open Cloud Mesh API" + }, + "name": "CERNBox - OCM API", + "path": "https://localhost:9200/ocm/", + "is_monitored": true + }, + "api_version": "0.0.1", + "host": "localhost:9200" + } + ] + }, + { + "name": "federation-ocis-server", + "full_name": "Federation ocis", + "organization": "Owncloud", + "domain": "localhost:10200", + "homepage": "https://owncloud.com", + "services": [ + { + "endpoint": { + "type": { + "name": "OCM", + "description": "CERNBox Open Cloud Mesh API" + }, + "name": "CERNBox - OCM API", + "path": "https://localhost:10200/ocm/", + "is_monitored": true + }, + "api_version": "0.0.1", + "host": "localhost:10200" + } + ] + } +]