From 92035db053e67575443ca10b6c5d6d1c666c1142 Mon Sep 17 00:00:00 2001 From: hkad98 Date: Wed, 11 Oct 2023 09:12:02 +0200 Subject: [PATCH 1/3] Add OrganizationSettings, CspDirectives support --- gooddata-sdk/gooddata_sdk/__init__.py | 2 + .../organization/entity_model/directive.py | 33 ++++ .../organization/entity_model/setting.py | 34 ++++ .../catalog/organization/service.py | 177 +++++++++++++++++- 4 files changed, 245 insertions(+), 1 deletion(-) create mode 100644 gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/directive.py create mode 100644 gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/setting.py diff --git a/gooddata-sdk/gooddata_sdk/__init__.py b/gooddata-sdk/gooddata_sdk/__init__.py index d3ef4f9c5..5a1089732 100644 --- a/gooddata-sdk/gooddata_sdk/__init__.py +++ b/gooddata-sdk/gooddata_sdk/__init__.py @@ -55,6 +55,7 @@ ExportSettings, ) from gooddata_sdk.catalog.identifier import CatalogDatasetWorkspaceDataFilterIdentifier, CatalogWorkspaceIdentifier +from gooddata_sdk.catalog.organization.entity_model.directive import CatalogCspDirective from gooddata_sdk.catalog.organization.entity_model.jwk import ( CatalogJwk, CatalogJwkAttributes, @@ -62,6 +63,7 @@ CatalogRsaSpecification, ) from gooddata_sdk.catalog.organization.entity_model.organization import CatalogOrganization +from gooddata_sdk.catalog.organization.entity_model.setting import CatalogOrganizationSetting from gooddata_sdk.catalog.organization.service import CatalogOrganizationService from gooddata_sdk.catalog.permission.declarative_model.dashboard_assignees import ( CatalogAvailableAssignees, diff --git a/gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/directive.py b/gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/directive.py new file mode 100644 index 000000000..9a79618ed --- /dev/null +++ b/gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/directive.py @@ -0,0 +1,33 @@ +# (C) 2023 GoodData Corporation +from __future__ import annotations + +from typing import List, Type + +import attr + +from gooddata_api_client.model.json_api_csp_directive_in import JsonApiCspDirectiveIn +from gooddata_api_client.model.json_api_csp_directive_in_attributes import JsonApiCspDirectiveInAttributes +from gooddata_sdk.catalog.base import Base + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogCspDirective(Base): + id: str + attributes: CatalogCspDirectiveAttributes + + @classmethod + def init(cls, directive_id: str, sources: List[str]) -> CatalogCspDirective: + return cls(id=directive_id, attributes=CatalogCspDirectiveAttributes(sources=sources)) + + @staticmethod + def client_class() -> Type[JsonApiCspDirectiveIn]: + return JsonApiCspDirectiveIn + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogCspDirectiveAttributes(Base): + sources: List[str] + + @staticmethod + def client_class() -> Type[JsonApiCspDirectiveInAttributes]: + return JsonApiCspDirectiveInAttributes diff --git a/gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/setting.py b/gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/setting.py new file mode 100644 index 000000000..978669fe5 --- /dev/null +++ b/gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/setting.py @@ -0,0 +1,34 @@ +# (C) 2023 GoodData Corporation +from __future__ import annotations + +from typing import Any, Dict, Optional, Type + +import attr + +from gooddata_api_client.model.json_api_organization_setting_in import JsonApiOrganizationSettingIn +from gooddata_api_client.model.json_api_organization_setting_in_attributes import JsonApiOrganizationSettingInAttributes +from gooddata_sdk.catalog.base import Base + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogOrganizationSetting(Base): + id: str + attributes: CatalogOrganizationSettingAttributes + + @classmethod + def init(cls, setting_id: str, setting_type: str, content: Dict[str, Any]) -> CatalogOrganizationSetting: + return cls(id=setting_id, attributes=CatalogOrganizationSettingAttributes(type=setting_type, content=content)) + + @staticmethod + def client_class() -> Type[JsonApiOrganizationSettingIn]: + return JsonApiOrganizationSettingIn + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogOrganizationSettingAttributes(Base): + type: Optional[str] + content: Dict[str, Any] + + @staticmethod + def client_class() -> Type[JsonApiOrganizationSettingInAttributes]: + return JsonApiOrganizationSettingInAttributes diff --git a/gooddata-sdk/gooddata_sdk/catalog/organization/service.py b/gooddata-sdk/gooddata_sdk/catalog/organization/service.py index e8f4e55d3..81a11c6a3 100644 --- a/gooddata-sdk/gooddata_sdk/catalog/organization/service.py +++ b/gooddata-sdk/gooddata_sdk/catalog/organization/service.py @@ -5,9 +5,13 @@ from typing import List, Optional from gooddata_api_client.exceptions import NotFoundException +from gooddata_api_client.model.json_api_csp_directive_in_document import JsonApiCspDirectiveInDocument +from gooddata_api_client.model.json_api_organization_setting_in_document import JsonApiOrganizationSettingInDocument from gooddata_sdk.catalog.catalog_service_base import CatalogServiceBase +from gooddata_sdk.catalog.organization.entity_model.directive import CatalogCspDirective from gooddata_sdk.catalog.organization.entity_model.jwk import CatalogJwk, CatalogJwkDocument from gooddata_sdk.catalog.organization.entity_model.organization import CatalogOrganizationDocument +from gooddata_sdk.catalog.organization.entity_model.setting import CatalogOrganizationSetting from gooddata_sdk.client import GoodDataApiClient from gooddata_sdk.utils import load_all_entities @@ -119,7 +123,7 @@ def delete_jwk(self, jwk_id: str) -> None: raise ValueError(f"Can not delete {jwk_id} jwk. This jwk does not exist.") def list_jwks(self) -> List[CatalogJwk]: - """Returns a list of all jwks in current organization. + """Returns a list of all jwks in the current organization. Returns: List[CatalogJwk]: @@ -128,3 +132,174 @@ def list_jwks(self) -> List[CatalogJwk]: get_jwks = functools.partial(self._entities_api.get_all_entities_jwks, _check_return_type=False) jwks = load_all_entities(get_jwks) return [CatalogJwk.from_api(jwk) for jwk in jwks.data] + + def list_organization_settings(self) -> List[CatalogOrganizationSetting]: + """Returns a list of all organization settings in the current organization. + + Returns: + List[CatalogOrganizationSettings]: + List of organization settings in the current organization. + """ + get_organization_settings = functools.partial( + self._entities_api.get_all_entities_organization_settings, _check_return_type=False + ) + organization_settings = load_all_entities(get_organization_settings) + return [ + CatalogOrganizationSetting.from_api(organization_settings) + for organization_settings in organization_settings.data + ] + + def get_organization_setting(self, organization_setting_id: str) -> CatalogOrganizationSetting: + """Get an individual organization setting. + + Args: + organization_setting_id (str): + Organization setting identification string e.g. "demo" + + Returns: + CatalogOrganizationSettings: + Catalog organization setting object containing structure of the organization setting. + """ + organization_setting_api = self._entities_api.get_entity_organization_settings(id=organization_setting_id).data + return CatalogOrganizationSetting.from_api(organization_setting_api) + + def create_organization_setting(self, organization_setting: CatalogOrganizationSetting) -> None: + """Create a new organization setting. + + Args: + organization_setting (CatalogOrganizationSettings): + A catalog organization setting an object to be created. + + Returns: + None + """ + organization_setting_document = JsonApiOrganizationSettingInDocument(data=organization_setting.to_api()) + self._entities_api.create_entity_organization_settings( + json_api_organization_setting_in_document=organization_setting_document + ) + + def delete_organization_setting(self, organization_setting_id: str) -> None: + """Delete an organization setting. + + Args: + organization_setting_id (str): + Organization setting identification string e.g. "demo" + + Returns: + None + + Raises: + ValueError: + Organization setting does not exist. + """ + try: + self._entities_api.delete_entity_organization_settings(organization_setting_id) + except NotFoundException: + raise ValueError( + f"Can not delete {organization_setting_id} organization setting. " + f"This organization setting does not exist." + ) + + def update_organization_setting(self, organization_setting: CatalogOrganizationSetting) -> None: + """Update an organization setting. + + Args: + organization_setting (CatalogOrganizationSettings): + A catalog organization setting an object to be updated. + + Returns: + None + + Raises: + ValueError: + Organization setting does not exist. + """ + try: + organization_setting_document = JsonApiOrganizationSettingInDocument(data=organization_setting.to_api()) + self._entities_api.update_entity_organization_settings( + organization_setting.id, organization_setting_document + ) + except NotFoundException: + raise ValueError( + f"Can not update {organization_setting.id} organization setting. " + f"This organization setting does not exist." + ) + + def list_csp_directives(self) -> List[CatalogCspDirective]: + """Returns a list of all csp directives in the current organization. + + Returns: + List[CatalogOrganizationSettings]: + List of csp directives in the current organization. + """ + get_csp_directives = functools.partial( + self._entities_api.get_all_entities_csp_directives, _check_return_type=False + ) + csp_directives = load_all_entities(get_csp_directives) + return [CatalogCspDirective.from_api(csp_directive) for csp_directive in csp_directives.data] + + def get_csp_directive(self, directive_id: str) -> CatalogCspDirective: + """Get an individual csp directive. + + Args: + directive_id (str): + Csp directive identification string e.g. "demo" + + Returns: + CatalogCspDirective: + Catalog csp directive object containing structure of the csp directive. + """ + csp_directive_api = self._entities_api.get_entity_csp_directives(id=directive_id).data + return CatalogCspDirective.from_api(csp_directive_api) + + def create_csp_directive(self, csp_directive: CatalogCspDirective) -> None: + """Create a new csp directive. + + Args: + csp_directive (CatalogCspDirective): + A catalog csp directive an object to be created. + + Returns: + None + """ + csp_directive_document = JsonApiCspDirectiveInDocument(data=csp_directive.to_api()) + self._entities_api.create_entity_csp_directives(json_api_csp_directive_in_document=csp_directive_document) + + def delete_csp_directive(self, csp_directive_id: str) -> None: + """Delete a csp directive. + + Args: + csp_directive_id (str): + Csp directive identification string e.g. "demo" + + Returns: + None + + Raises: + ValueError: + Csp directive does not exist. + """ + try: + self._entities_api.delete_entity_csp_directives(csp_directive_id) + except NotFoundException: + raise ValueError(f"Can not delete {csp_directive_id} csp directive. " f"This csp directive does not exist.") + + def update_csp_directive(self, csp_directive: CatalogCspDirective) -> None: + """Update a csp directive. + + Args: + csp_directive (CatalogCspDirective): + A catalog csp directive an object to be updated. + + Returns: + None + + Raises: + ValueError: + Csp directive does not exist. + """ + try: + csp_directive_document = JsonApiCspDirectiveInDocument(data=csp_directive.to_api()) + self._entities_api.update_entity_csp_directives(csp_directive.id, csp_directive_document) + except NotFoundException: + raise ValueError(f"Can not update {csp_directive.id} csp directive. " f"This csp directive does not exist.") From 39018177766cce4e3cba9345bff5ae4073009316 Mon Sep 17 00:00:00 2001 From: hkad98 Date: Wed, 11 Oct 2023 09:12:32 +0200 Subject: [PATCH 2/3] Add tests for OrganizationSettings, CspDirectives --- .../organization/create_csp_directive.yaml | 318 ++++++++++++ .../create_organization_setting.yaml | 321 ++++++++++++ .../organization/delete_csp_directive.yaml | 392 ++++++++++++++ .../delete_organization_setting.yaml | 394 ++++++++++++++ .../organization/list_csp_directives.yaml | 484 +++++++++++++++++ .../list_organization_settings.yaml | 490 ++++++++++++++++++ .../organization/update_csp_directive.yaml | 407 +++++++++++++++ .../update_organization_setting.yaml | 412 +++++++++++++++ .../catalog/test_catalog_organization.py | 163 +++++- 9 files changed, 3380 insertions(+), 1 deletion(-) create mode 100644 gooddata-sdk/tests/catalog/fixtures/organization/create_csp_directive.yaml create mode 100644 gooddata-sdk/tests/catalog/fixtures/organization/create_organization_setting.yaml create mode 100644 gooddata-sdk/tests/catalog/fixtures/organization/delete_csp_directive.yaml create mode 100644 gooddata-sdk/tests/catalog/fixtures/organization/delete_organization_setting.yaml create mode 100644 gooddata-sdk/tests/catalog/fixtures/organization/list_csp_directives.yaml create mode 100644 gooddata-sdk/tests/catalog/fixtures/organization/list_organization_settings.yaml create mode 100644 gooddata-sdk/tests/catalog/fixtures/organization/update_csp_directive.yaml create mode 100644 gooddata-sdk/tests/catalog/fixtures/organization/update_organization_setting.yaml diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/create_csp_directive.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/create_csp_directive.yaml new file mode 100644 index 000000000..f1aa46268 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/create_csp_directive.yaml @@ -0,0 +1,318 @@ +# (C) 2023 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/cspDirectives + body: + data: + attributes: + sources: + - https://test.com + id: font-src + type: cspDirective + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '174' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: &id001 + - PLACEHOLDER + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: font-src + type: cspDirective + attributes: + sources: + - https://test.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/font-src + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/cspDirectives/font-src + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '174' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: font-src + type: cspDirective + attributes: + sources: + - https://test.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/font-src + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/cspDirectives/font-src + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '175' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + next: http://localhost:3000/api/v1/entities/cspDirectives?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/create_organization_setting.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/create_organization_setting.yaml new file mode 100644 index 000000000..344723bb5 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/create_organization_setting.yaml @@ -0,0 +1,321 @@ +# (C) 2023 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/organizationSettings + body: + data: + id: test_setting + type: organizationSetting + attributes: + type: LOCALE + content: + value: fr-FR + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '209' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: &id001 + - PLACEHOLDER + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: test_setting + type: organizationSetting + attributes: + content: + value: fr-FR + type: LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '209' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: test_setting + type: organizationSetting + attributes: + content: + value: fr-FR + type: LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '189' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + next: http://localhost:3000/api/v1/entities/organizationSettings?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/delete_csp_directive.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/delete_csp_directive.yaml new file mode 100644 index 000000000..f708009a9 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/delete_csp_directive.yaml @@ -0,0 +1,392 @@ +# (C) 2023 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/cspDirectives + body: + data: + attributes: + sources: + - https://test.com + id: font-src + type: cspDirective + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '174' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: &id001 + - PLACEHOLDER + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: font-src + type: cspDirective + attributes: + sources: + - https://test.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/font-src + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/cspDirectives/font-src + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/cspDirectives/font-src + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 404 + message: Not Found + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '156' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/problem+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + detail: The requested endpoint does not exist or you do not have permission + to access it. + status: 404 + title: Not Found + traceId: 333afd1f4e424cde + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '175' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + next: http://localhost:3000/api/v1/entities/cspDirectives?page=1&size=500 + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '175' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + next: http://localhost:3000/api/v1/entities/cspDirectives?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/delete_organization_setting.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/delete_organization_setting.yaml new file mode 100644 index 000000000..976d853c6 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/delete_organization_setting.yaml @@ -0,0 +1,394 @@ +# (C) 2023 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/organizationSettings + body: + data: + id: test_setting + type: organizationSetting + attributes: + type: LOCALE + content: + value: fr-FR + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '209' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: &id001 + - PLACEHOLDER + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: test_setting + type: organizationSetting + attributes: + content: + value: fr-FR + type: LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 404 + message: Not Found + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '156' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/problem+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + detail: The requested endpoint does not exist or you do not have permission + to access it. + status: 404 + title: Not Found + traceId: 4ae6be41b51822a1 + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '189' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + next: http://localhost:3000/api/v1/entities/organizationSettings?page=1&size=500 + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '189' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + next: http://localhost:3000/api/v1/entities/organizationSettings?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/list_csp_directives.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/list_csp_directives.yaml new file mode 100644 index 000000000..2b04e2f99 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/list_csp_directives.yaml @@ -0,0 +1,484 @@ +# (C) 2023 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/cspDirectives + body: + data: + attributes: + sources: + - https://test.com + id: font-src + type: cspDirective + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '174' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: &id001 + - PLACEHOLDER + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: font-src + type: cspDirective + attributes: + sources: + - https://test.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/font-src + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/cspDirectives + body: + data: + attributes: + sources: + - https://test2.com + id: script-src + type: cspDirective + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '179' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: script-src + type: cspDirective + attributes: + sources: + - https://test2.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/script-src + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '511' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + - id: font-src + type: cspDirective + attributes: + sources: + - https://test.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/font-src + - id: script-src + type: cspDirective + attributes: + sources: + - https://test2.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/script-src + links: + self: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + next: http://localhost:3000/api/v1/entities/cspDirectives?page=1&size=500 + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/cspDirectives/font-src + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/cspDirectives/script-src + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '175' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + next: http://localhost:3000/api/v1/entities/cspDirectives?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/list_organization_settings.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/list_organization_settings.yaml new file mode 100644 index 000000000..a329c7659 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/list_organization_settings.yaml @@ -0,0 +1,490 @@ +# (C) 2023 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/organizationSettings + body: + data: + id: test_setting_1 + type: organizationSetting + attributes: + type: LOCALE + content: + value: fr-FR + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '213' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: &id001 + - PLACEHOLDER + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: test_setting_1 + type: organizationSetting + attributes: + content: + value: fr-FR + type: LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting_1 + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/organizationSettings + body: + data: + id: test_setting_2 + type: organizationSetting + attributes: + type: FORMAT_LOCALE + content: + value: en-GB + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '220' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: test_setting_2 + type: organizationSetting + attributes: + content: + value: en-GB + type: FORMAT_LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting_2 + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '605' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + - id: test_setting_1 + type: organizationSetting + attributes: + content: + value: fr-FR + type: LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting_1 + - id: test_setting_2 + type: organizationSetting + attributes: + content: + value: en-GB + type: FORMAT_LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting_2 + links: + self: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + next: http://localhost:3000/api/v1/entities/organizationSettings?page=1&size=500 + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/organizationSettings/test_setting_1 + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/organizationSettings/test_setting_2 + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '189' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + next: http://localhost:3000/api/v1/entities/organizationSettings?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/update_csp_directive.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/update_csp_directive.yaml new file mode 100644 index 000000000..67a9e7321 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/update_csp_directive.yaml @@ -0,0 +1,407 @@ +# (C) 2023 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/cspDirectives + body: + data: + attributes: + sources: + - https://test.com + id: font-src + type: cspDirective + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '174' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: &id001 + - PLACEHOLDER + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: font-src + type: cspDirective + attributes: + sources: + - https://test.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/font-src + - request: + method: PUT + uri: http://localhost:3000/api/v1/entities/cspDirectives/font-src + body: + data: + attributes: + sources: + - https://test2.com + id: font-src + type: cspDirective + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '175' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: font-src + type: cspDirective + attributes: + sources: + - https://test2.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/font-src + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/cspDirectives/font-src + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '175' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: font-src + type: cspDirective + attributes: + sources: + - https://test2.com + links: + self: http://localhost:3000/api/v1/entities/cspDirectives/font-src + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/cspDirectives/font-src + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '175' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/cspDirectives?page=0&size=500 + next: http://localhost:3000/api/v1/entities/cspDirectives?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/update_organization_setting.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/update_organization_setting.yaml new file mode 100644 index 000000000..9b94ec9a8 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/update_organization_setting.yaml @@ -0,0 +1,412 @@ +# (C) 2023 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/organizationSettings + body: + data: + id: test_setting + type: organizationSetting + attributes: + type: LOCALE + content: + value: fr-FR + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 201 + message: Created + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '209' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: &id001 + - PLACEHOLDER + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: test_setting + type: organizationSetting + attributes: + content: + value: fr-FR + type: LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + - request: + method: PUT + uri: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + body: + data: + id: test_setting + type: organizationSetting + attributes: + type: LOCALE + content: + value: en-GB + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '209' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: test_setting + type: organizationSetting + attributes: + content: + value: en-GB + type: LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '209' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: test_setting + type: organizationSetting + attributes: + content: + value: en-GB + type: LOCALE + links: + self: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/organizationSettings/test_setting + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 204 + message: No Content + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + body: null + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '189' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/organizationSettings?page=0&size=500 + next: http://localhost:3000/api/v1/entities/organizationSettings?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/test_catalog_organization.py b/gooddata-sdk/tests/catalog/test_catalog_organization.py index 65896c234..6d8c940b2 100644 --- a/gooddata-sdk/tests/catalog/test_catalog_organization.py +++ b/gooddata-sdk/tests/catalog/test_catalog_organization.py @@ -6,7 +6,14 @@ from tests_support.vcrpy_utils import get_vcr from gooddata_api_client.exceptions import NotFoundException -from gooddata_sdk import CatalogJwk, CatalogOrganization, CatalogRsaSpecification, GoodDataSdk +from gooddata_sdk import ( + CatalogCspDirective, + CatalogJwk, + CatalogOrganization, + CatalogOrganizationSetting, + CatalogRsaSpecification, + GoodDataSdk, +) gd_vcr = get_vcr() @@ -166,3 +173,157 @@ def test_list_jwk(test_config): sdk.catalog_organization.delete_jwk(jwk1.id) sdk.catalog_organization.delete_jwk(jwk2.id) assert len(sdk.catalog_organization.list_jwks()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "create_organization_setting.yaml")) +def test_create_organization_setting(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + setting_id = "test_setting" + setting_type = "LOCALE" + content = {"value": "fr-FR"} + + new_setting = CatalogOrganizationSetting.init(setting_id, setting_type, content) + try: + sdk.catalog_organization.create_organization_setting(new_setting) + setting = sdk.catalog_organization.get_organization_setting(setting_id) + assert setting.id == setting_id + assert setting.attributes.type == setting_type + assert setting.attributes.content == content + finally: + sdk.catalog_organization.delete_organization_setting(setting_id) + assert len(sdk.catalog_organization.list_organization_settings()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "list_organization_settings.yaml")) +def test_list_organization_settings(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + setting_id_1 = "test_setting_1" + setting_id_2 = "test_setting_2" + new_setting_1 = CatalogOrganizationSetting.init(setting_id_1, "LOCALE", {"value": "fr-FR"}) + new_setting_2 = CatalogOrganizationSetting.init(setting_id_2, "FORMAT_LOCALE", {"value": "en-GB"}) + + try: + sdk.catalog_organization.create_organization_setting(new_setting_1) + sdk.catalog_organization.create_organization_setting(new_setting_2) + organization_settings = sdk.catalog_organization.list_organization_settings() + assert len(organization_settings) == 2 + assert new_setting_1 in organization_settings + assert new_setting_2 in organization_settings + finally: + sdk.catalog_organization.delete_organization_setting(setting_id_1) + sdk.catalog_organization.delete_organization_setting(setting_id_2) + assert len(sdk.catalog_organization.list_organization_settings()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "delete_organization_setting.yaml")) +def test_delete_organization_setting(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + setting_id = "test_setting" + new_setting = CatalogOrganizationSetting.init(setting_id, "LOCALE", {"value": "fr-FR"}) + + try: + sdk.catalog_organization.create_organization_setting(new_setting) + sdk.catalog_organization.delete_organization_setting(setting_id) + sdk.catalog_organization.get_organization_setting(setting_id) + except NotFoundException: + assert len(sdk.catalog_organization.list_organization_settings()) == 0 + finally: + assert len(sdk.catalog_organization.list_organization_settings()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "update_organization_setting.yaml")) +def test_update_organization_setting(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + setting_id = "test_setting" + new_setting = CatalogOrganizationSetting.init(setting_id, "LOCALE", {"value": "fr-FR"}) + update_setting = CatalogOrganizationSetting.init(setting_id, "LOCALE", {"value": "en-GB"}) + + try: + sdk.catalog_organization.create_organization_setting(new_setting) + sdk.catalog_organization.update_organization_setting(update_setting) + setting = sdk.catalog_organization.get_organization_setting(setting_id) + assert setting.id == setting_id + assert setting.attributes.type == "LOCALE" + assert setting.attributes.content == {"value": "en-GB"} + finally: + sdk.catalog_organization.delete_organization_setting(setting_id) + assert len(sdk.catalog_organization.list_organization_settings()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "create_csp_directive.yaml")) +def test_create_csp_directive(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + directive_id = "font-src" + sources = ["https://test.com"] + + new_csp_directive = CatalogCspDirective.init(directive_id, sources) + try: + sdk.catalog_organization.create_csp_directive(new_csp_directive) + csp_directive = sdk.catalog_organization.get_csp_directive(directive_id) + assert csp_directive.id == directive_id + assert csp_directive.attributes.sources == sources + finally: + sdk.catalog_organization.delete_csp_directive(directive_id) + assert len(sdk.catalog_organization.list_csp_directives()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "list_csp_directives.yaml")) +def test_list_csp_directives(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + directive_id_1 = "font-src" + directive_id_2 = "script-src" + new_csp_directive_1 = CatalogCspDirective.init(directive_id_1, ["https://test.com"]) + new_csp_directive_2 = CatalogCspDirective.init(directive_id_2, ["https://test2.com"]) + + try: + sdk.catalog_organization.create_csp_directive(new_csp_directive_1) + sdk.catalog_organization.create_csp_directive(new_csp_directive_2) + csp_directives = sdk.catalog_organization.list_csp_directives() + assert len(csp_directives) == 2 + assert new_csp_directive_1 in csp_directives + assert new_csp_directive_2 in csp_directives + finally: + sdk.catalog_organization.delete_csp_directive(directive_id_1) + sdk.catalog_organization.delete_csp_directive(directive_id_2) + assert len(sdk.catalog_organization.list_csp_directives()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "delete_csp_directive.yaml")) +def test_delete_csp_directive(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + directive_id = "font-src" + new_csp_directive = CatalogCspDirective.init(directive_id, ["https://test.com"]) + + try: + sdk.catalog_organization.create_csp_directive(new_csp_directive) + sdk.catalog_organization.delete_csp_directive(directive_id) + sdk.catalog_organization.get_csp_directive(directive_id) + except NotFoundException: + assert len(sdk.catalog_organization.list_csp_directives()) == 0 + finally: + assert len(sdk.catalog_organization.list_csp_directives()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "update_csp_directive.yaml")) +def test_update_csp_directive(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + directive_id = "font-src" + new_csp_directive = CatalogCspDirective.init(directive_id, ["https://test.com"]) + update_csp_directive = CatalogCspDirective.init(directive_id, ["https://test2.com"]) + + try: + sdk.catalog_organization.create_csp_directive(new_csp_directive) + sdk.catalog_organization.update_csp_directive(update_csp_directive) + csp_directive = sdk.catalog_organization.get_csp_directive(directive_id) + assert csp_directive.id == directive_id + assert csp_directive.attributes.sources == ["https://test2.com"] + finally: + sdk.catalog_organization.delete_csp_directive(directive_id) + assert len(sdk.catalog_organization.list_csp_directives()) == 0 From 8aad95f84270900cfedf240f7c5acc4f873d9eb6 Mon Sep 17 00:00:00 2001 From: hkad98 Date: Wed, 11 Oct 2023 09:59:35 +0200 Subject: [PATCH 3/3] Add update allowed origins --- .../catalog/organization/service.py | 15 + .../organization/update_allowed_origins.yaml | 801 ++++++++++++++++++ .../catalog/test_catalog_organization.py | 16 + 3 files changed, 832 insertions(+) create mode 100644 gooddata-sdk/tests/catalog/fixtures/organization/update_allowed_origins.yaml diff --git a/gooddata-sdk/gooddata_sdk/catalog/organization/service.py b/gooddata-sdk/gooddata_sdk/catalog/organization/service.py index 81a11c6a3..c4adc50b5 100644 --- a/gooddata-sdk/gooddata_sdk/catalog/organization/service.py +++ b/gooddata-sdk/gooddata_sdk/catalog/organization/service.py @@ -69,6 +69,21 @@ def update_name(self, name: str) -> None: organization_document = CatalogOrganizationDocument(data=organization) self._entities_api.update_entity_organizations(organization.id, organization_document.to_api()) + def update_allowed_origins(self, allowed_origins: List[str]) -> None: + """Updates the allowed origins of the organization. + + Args: + allowed_origins (List[str]): + New allowed origins of the organization + + Returns: + None + """ + organization = self.get_organization() + organization.attributes.allowed_origins = allowed_origins + organization_document = CatalogOrganizationDocument(data=organization) + self._entities_api.update_entity_organizations(organization.id, organization_document.to_api()) + def create_or_update_jwk(self, jwk: CatalogJwk) -> None: """Create a new jwk or overwrite an existing jwk with the same id. diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/update_allowed_origins.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/update_allowed_origins.yaml new file mode 100644 index 000000000..1210d8f26 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/update_allowed_origins.yaml @@ -0,0 +1,801 @@ +# (C) 2023 GoodData Corporation +version: 1 +interactions: + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organization + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 302 + message: Found + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: &id001 + - PLACEHOLDER + Expires: + - '0' + GoodData-Deployment: + - aio + Location: + - /api/v1/entities/admin/organizations/default + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/admin/organizations/default + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '255' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: default + type: organization + attributes: + name: Default Organization + hostname: localhost + oauthClientId: 8575edbf-aa5d-4b6f-a36c-9f1469c83c75 + links: + self: http://localhost:3000/api/v1/entities/admin/organizations/default + - request: + method: PUT + uri: http://localhost:3000/api/v1/entities/admin/organizations/default + body: + data: + id: default + type: organization + attributes: + name: Default Organization + hostname: localhost + allowedOrigins: + - https://test.com + oauthClientId: 8575edbf-aa5d-4b6f-a36c-9f1469c83c75 + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '293' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: default + type: organization + attributes: + name: Default Organization + hostname: localhost + allowedOrigins: + - https://test.com + oauthClientId: 8575edbf-aa5d-4b6f-a36c-9f1469c83c75 + links: + self: http://localhost:3000/api/v1/entities/admin/organizations/default + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organization + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 302 + message: Found + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Location: + - /api/v1/entities/admin/organizations/default + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/admin/organizations/default + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '293' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: default + type: organization + attributes: + name: Default Organization + hostname: localhost + allowedOrigins: + - https://test.com + oauthClientId: 8575edbf-aa5d-4b6f-a36c-9f1469c83c75 + links: + self: http://localhost:3000/api/v1/entities/admin/organizations/default + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organization + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 302 + message: Found + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Location: + - /api/v1/entities/admin/organizations/default + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/admin/organizations/default + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '293' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: default + type: organization + attributes: + name: Default Organization + hostname: localhost + allowedOrigins: + - https://test.com + oauthClientId: 8575edbf-aa5d-4b6f-a36c-9f1469c83c75 + links: + self: http://localhost:3000/api/v1/entities/admin/organizations/default + - request: + method: PUT + uri: http://localhost:3000/api/v1/entities/admin/organizations/default + body: + data: + id: default + type: organization + attributes: + name: Default Organization + hostname: localhost + allowedOrigins: [] + oauthClientId: 8575edbf-aa5d-4b6f-a36c-9f1469c83c75 + headers: + Accept: + - application/vnd.gooddata.api+json + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/vnd.gooddata.api+json + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '275' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: default + type: organization + attributes: + name: Default Organization + hostname: localhost + allowedOrigins: [] + oauthClientId: 8575edbf-aa5d-4b6f-a36c-9f1469c83c75 + links: + self: http://localhost:3000/api/v1/entities/admin/organizations/default + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/organization + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 302 + message: Found + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Location: + - /api/v1/entities/admin/organizations/default + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/admin/organizations/default + body: null + headers: + Accept-Encoding: + - br, gzip, deflate + X-GDC-VALIDATE-RELATIONS: + - 'true' + X-Requested-With: + - XMLHttpRequest + response: + status: + code: 200 + message: OK + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - Content-Disposition, Content-Length, Content-Range, Set-Cookie + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '275' + Content-Security-Policy: + - 'default-src ''self'' *.wistia.com *.wistia.net; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' *.wistia.com *.wistia.net *.hsforms.net *.hsforms.com + src.litix.io matomo.anywhere.gooddata.com *.jquery.com unpkg.com cdn.jsdelivr.net + cdnjs.cloudflare.com; img-src ''self'' data: blob: *.wistia.com *.wistia.net + *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net privacy-policy.truste.com + www.gooddata.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com + cdn.jsdelivr.net fast.fonts.net; font-src ''self'' data: fonts.gstatic.com + *.alicdn.com *.wistia.com cdn.jsdelivr.net info.gooddata.com; frame-src + ''self'' *.hsforms.net *.hsforms.com; object-src ''none''; worker-src + ''self'' blob:; child-src blob:; connect-src ''self'' *.tiles.mapbox.com + *.mapbox.com *.litix.io *.wistia.com *.hsforms.net *.hsforms.com embedwistia-a.akamaihd.net + matomo.anywhere.gooddata.com; media-src ''self'' blob: data: *.wistia.com + *.wistia.net embedwistia-a.akamaihd.net' + Content-Type: + - application/vnd.gooddata.api+json + DATE: *id001 + Expires: + - '0' + GoodData-Deployment: + - aio + Permission-Policy: + - geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera + 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment + 'none'; + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Server: + - nginx + Set-Cookie: + - SPRING_REDIRECT_URI=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 + GMT; HttpOnly; SameSite=Lax + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - 1 ; mode=block + body: + string: + data: + id: default + type: organization + attributes: + name: Default Organization + hostname: localhost + allowedOrigins: [] + oauthClientId: 8575edbf-aa5d-4b6f-a36c-9f1469c83c75 + links: + self: http://localhost:3000/api/v1/entities/admin/organizations/default diff --git a/gooddata-sdk/tests/catalog/test_catalog_organization.py b/gooddata-sdk/tests/catalog/test_catalog_organization.py index 6d8c940b2..77254c9d6 100644 --- a/gooddata-sdk/tests/catalog/test_catalog_organization.py +++ b/gooddata-sdk/tests/catalog/test_catalog_organization.py @@ -327,3 +327,19 @@ def test_update_csp_directive(test_config): finally: sdk.catalog_organization.delete_csp_directive(directive_id) assert len(sdk.catalog_organization.list_csp_directives()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "update_allowed_origins.yaml")) +def test_update_allowed_origins(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + allowed_origins = ["https://test.com"] + + try: + sdk.catalog_organization.update_allowed_origins(allowed_origins) + organization = sdk.catalog_organization.get_organization() + assert organization.attributes.allowed_origins == allowed_origins + finally: + sdk.catalog_organization.update_allowed_origins([]) + organization = sdk.catalog_organization.get_organization() + assert organization.attributes.allowed_origins == []