diff --git a/gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/identity_provider.py b/gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/identity_provider.py new file mode 100644 index 000000000..5e4850271 --- /dev/null +++ b/gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/identity_provider.py @@ -0,0 +1,88 @@ +# (C) 2024 GoodData Corporation +from __future__ import annotations + +from typing import Any, Optional + +import attr +from gooddata_api_client.model.json_api_identity_provider_in import JsonApiIdentityProviderIn +from gooddata_api_client.model.json_api_identity_provider_in_attributes import JsonApiIdentityProviderInAttributes +from gooddata_api_client.model.json_api_identity_provider_in_document import JsonApiIdentityProviderInDocument + +from gooddata_sdk.catalog.base import Base +from gooddata_sdk.utils import safeget + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogIdentityProviderDocument(Base): + data: CatalogIdentityProvider + + @staticmethod + def client_class() -> type[JsonApiIdentityProviderInDocument]: + return JsonApiIdentityProviderInDocument + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogIdentityProvider(Base): + id: str + attributes: Optional[CatalogIdentityProviderAttributes] = None + + @staticmethod + def client_class() -> type[JsonApiIdentityProviderIn]: + return JsonApiIdentityProviderIn + + @classmethod + def init( + cls, + identity_provider_id: str, + custom_claim_mapping: Optional[dict[str, str]] = None, + identifiers: Optional[list[str]] = None, + oauth_client_id: Optional[str] = None, + oauth_client_secret: Optional[str] = None, + oauth_issuer_id: Optional[str] = None, + oauth_issuer_location: Optional[str] = None, + saml_metadata: Optional[str] = None, + ) -> CatalogIdentityProvider: + return cls( + id=identity_provider_id, + attributes=CatalogIdentityProviderAttributes( + custom_claim_mapping=custom_claim_mapping, + identifiers=identifiers, + oauth_client_id=oauth_client_id, + oauth_client_secret=oauth_client_secret, + oauth_issuer_id=oauth_issuer_id, + oauth_issuer_location=oauth_issuer_location, + saml_metadata=saml_metadata, + ), + ) + + @classmethod + def from_api(cls, entity: dict[str, Any]) -> CatalogIdentityProvider: + ea = entity["attributes"] + attr = CatalogIdentityProviderAttributes( + custom_claim_mapping=safeget(ea, ["custom_claim_mapping"]), + identifiers=safeget(ea, ["identifiers"]), + oauth_client_id=safeget(ea, ["oauth_client_id"]), + oauth_client_secret=safeget(ea, ["oauth_client_secret"]), + oauth_issuer_id=safeget(ea, ["oauth_issuer_id"]), + oauth_issuer_location=safeget(ea, ["oauth_issuer_location"]), + saml_metadata=safeget(ea, ["saml_metadata"]), + ) + return cls( + id=entity["id"], + attributes=attr, + ) + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogIdentityProviderAttributes(Base): + custom_claim_mapping: Optional[dict[str, str]] = None + identifiers: Optional[list[str]] = None + oauth_client_id: Optional[str] = None + oauth_client_secret: Optional[str] = None + oauth_issuer_id: Optional[str] = None + oauth_issuer_location: Optional[str] = None + saml_metadata: Optional[str] = None + + @staticmethod + def client_class() -> type[JsonApiIdentityProviderInAttributes]: + return JsonApiIdentityProviderInAttributes diff --git a/gooddata-sdk/gooddata_sdk/catalog/organization/layout/identity_provider.py b/gooddata-sdk/gooddata_sdk/catalog/organization/layout/identity_provider.py new file mode 100644 index 000000000..3d338a1ca --- /dev/null +++ b/gooddata-sdk/gooddata_sdk/catalog/organization/layout/identity_provider.py @@ -0,0 +1,24 @@ +# (C) 2024 GoodData Corporation +import builtins +from typing import Optional + +import attr +from gooddata_api_client.model.declarative_identity_provider import DeclarativeIdentityProvider + +from gooddata_sdk.catalog.base import Base + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogDeclarativeIdentityProvider(Base): + id: str + custom_claim_mapping: Optional[dict[str, str]] = None + identifiers: Optional[list[str]] = None + oauth_client_id: Optional[str] = None + oauth_client_secret: Optional[str] = None + oauth_issuer_id: Optional[str] = None + oauth_issuer_location: Optional[str] = None + saml_metadata: Optional[str] = None + + @staticmethod + def client_class() -> builtins.type[DeclarativeIdentityProvider]: + return DeclarativeIdentityProvider diff --git a/gooddata-sdk/gooddata_sdk/catalog/organization/service.py b/gooddata-sdk/gooddata_sdk/catalog/organization/service.py index e7c748009..dc0548884 100644 --- a/gooddata-sdk/gooddata_sdk/catalog/organization/service.py +++ b/gooddata-sdk/gooddata_sdk/catalog/organization/service.py @@ -7,16 +7,19 @@ from gooddata_api_client.exceptions import NotFoundException from gooddata_api_client.model.declarative_notification_channels import DeclarativeNotificationChannels from gooddata_api_client.model.json_api_csp_directive_in_document import JsonApiCspDirectiveInDocument +from gooddata_api_client.model.json_api_identity_provider_in_document import JsonApiIdentityProviderInDocument 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.identity_provider import CatalogIdentityProvider 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.catalog.organization.layout.identity_provider import CatalogDeclarativeIdentityProvider from gooddata_sdk.catalog.organization.layout.notification_channel import CatalogDeclarativeNotificationChannel from gooddata_sdk.client import GoodDataApiClient -from gooddata_sdk.utils import load_all_entities +from gooddata_sdk.utils import load_all_entities, load_all_entities_dict class CatalogOrganizationService(CatalogServiceBase): @@ -188,7 +191,7 @@ def create_organization_setting(self, organization_setting: CatalogOrganizationS Args: organization_setting (CatalogOrganizationSettings): - A catalog organization setting an object to be created. + A catalog organization setting object to be created. Returns: None @@ -225,7 +228,7 @@ def update_organization_setting(self, organization_setting: CatalogOrganizationS Args: organization_setting (CatalogOrganizationSettings): - A catalog organization setting an object to be updated. + A catalog organization setting object to be updated. Returns: None @@ -249,7 +252,7 @@ def list_csp_directives(self) -> list[CatalogCspDirective]: """Returns a list of all csp directives in the current organization. Returns: - list[CatalogOrganizationSettings]: + list[CatalogCspDirective]: List of csp directives in the current organization. """ get_csp_directives = functools.partial( @@ -277,7 +280,7 @@ def create_csp_directive(self, csp_directive: CatalogCspDirective) -> None: Args: csp_directive (CatalogCspDirective): - A catalog csp directive an object to be created. + A catalog csp directive object to be created. Returns: None @@ -309,7 +312,7 @@ def update_csp_directive(self, csp_directive: CatalogCspDirective) -> None: Args: csp_directive (CatalogCspDirective): - A catalog csp directive an object to be updated. + A catalog csp directive object to be updated. Returns: None @@ -324,6 +327,86 @@ def update_csp_directive(self, csp_directive: CatalogCspDirective) -> None: except NotFoundException: raise ValueError(f"Can not update {csp_directive.id} csp directive. This csp directive does not exist.") + def list_identity_providers(self) -> list[CatalogIdentityProvider]: + """Returns a list of all identity providers in the current organization. + + Returns: + list[CatalogIdentityProvider]: + List of identity providers in the current organization. + """ + get_identity_providers = functools.partial( + self._entities_api.get_all_entities_identity_providers, + _check_return_type=False, + ) + identity_providers = load_all_entities_dict(get_identity_providers, camel_case=False) + return [ + CatalogIdentityProvider.from_dict(identity_provider, camel_case=False) + for identity_provider in identity_providers["data"] + ] + + def get_identity_provider(self, identity_provider_id: str) -> CatalogIdentityProvider: + """Get an individual identity provider. + + Args: + identity_provider_id (str): + Identity provider identification string e.g. "demo" + + Returns: + CatalogIdentityProvider: + Catalog identity provider object containing structure of the identity provider. + """ + identity_provider_api = self._entities_api.get_entity_identity_providers(id=identity_provider_id).data + return CatalogIdentityProvider.from_api(identity_provider_api) + + def create_identity_provider(self, identity_provider: CatalogIdentityProvider) -> None: + """Create a new identity provider. + + Args: + identity_provider (CatalogIdentityProvider): + A catalog identity provider object to be created. + + Returns: + None + """ + identity_provider_document = JsonApiIdentityProviderInDocument(data=identity_provider.to_api()) + self._entities_api.create_entity_identity_providers( + json_api_identity_provider_in_document=identity_provider_document + ) + + def delete_identity_provider(self, identity_provider_id: str) -> None: + """Delete an identity provider. + + Args: + identity_provider_id (str): + Identity provider identification string e.g. "demo" + + Returns: + None + """ + self._entities_api.delete_entity_identity_providers(identity_provider_id) + + def update_identity_provider(self, identity_provider: CatalogIdentityProvider) -> None: + """Update an identity provider. + + Args: + identity_provider (CatalogIdentityProvider): + A catalog identity provider object to be updated. + + Returns: + None + + Raises: + ValueError: + Identity provider does not exist. + """ + try: + identity_provider_document = JsonApiIdentityProviderInDocument(data=identity_provider.to_api()) + self._entities_api.update_entity_identity_providers(identity_provider.id, identity_provider_document) + except NotFoundException: + raise ValueError( + f"Can not update {identity_provider.id} identity provider. " f"This identity provider does not exist." + ) + # Layout APIs def get_declarative_notification_channels(self) -> list[CatalogDeclarativeNotificationChannel]: @@ -354,3 +437,29 @@ def put_declarative_notification_channels( """ api_ncs = [nc.to_api() for nc in notification_channels] self._layout_api.set_notification_channels(DeclarativeNotificationChannels(notification_channels=api_ncs)) + + def get_declarative_identity_providers(self) -> list[CatalogDeclarativeIdentityProvider]: + """ + Get all declarative identity providers in the current organization. + + Returns: + list[CatalogDeclarativeIdentityProvider]: + List of declarative identity providers. + """ + return [ + CatalogDeclarativeIdentityProvider.from_api(idp) for idp in self._layout_api.get_identity_providers_layout() + ] + + def put_declarative_identity_providers(self, identity_providers: list[CatalogDeclarativeIdentityProvider]) -> None: + """ + Put declarative identity providers in the current organization. + + Args: + identity_providers (list[CatalogDeclarativeIdentityProvider]): + List of declarative identity providers. + + Returns: + None + """ + api_idps = [idp.to_api() for idp in identity_providers] + self._layout_api.set_identity_providers(declarative_identity_provider=api_idps) diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/create_identity_provider.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/create_identity_provider.yaml new file mode 100644 index 000000000..f6a1ba33f --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/create_identity_provider.yaml @@ -0,0 +1,326 @@ +# (C) 2024 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/identityProviders + body: + data: + id: test_identity_provider + type: identityProvider + attributes: + customClaimMapping: + email: email + identifiers: + - goodtesting.com + oauthClientId: test_client_id + oauthClientSecret: test_client_secret + oauthIssuerId: test_issuer_id + oauthIssuerLocation: https://issuer.goodtesting.com + 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: + - '373' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:23 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: + id: test_identity_provider + type: identityProvider + attributes: + identifiers: + - goodtesting.com + customClaimMapping: + email: email + oauthClientId: test_client_id + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + 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: + - '373' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:23 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: + id: test_identity_provider + type: identityProvider + attributes: + identifiers: + - goodtesting.com + customClaimMapping: + email: email + oauthClientId: test_client_id + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:23 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/identityProviders?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: + - '183' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:23 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/identityProviders?page=0&size=500 + next: http://localhost:3000/api/v1/entities/identityProviders?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/delete_identity_provider.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/delete_identity_provider.yaml new file mode 100644 index 000000000..cd6fb55f8 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/delete_identity_provider.yaml @@ -0,0 +1,393 @@ +# (C) 2024 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/identityProviders + body: + data: + id: test_identity_provider + type: identityProvider + attributes: + customClaimMapping: + email: email + identifiers: + - goodtesting.com + oauthClientId: test_client_id + oauthClientSecret: test_client_secret + oauthIssuerId: test_issuer_id + oauthIssuerLocation: https://issuer.goodtesting.com + 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: + - '373' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: + id: test_identity_provider + type: identityProvider + attributes: + identifiers: + - goodtesting.com + customClaimMapping: + email: email + oauthClientId: test_client_id + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + 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: + - '172' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + detail: The requested endpoint does not exist or you do not have permission + to access it. + status: 404 + title: Not Found + traceId: 674490cc6c7b69e73b0d3e3e900238a4 + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/identityProviders?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: + - '183' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/identityProviders?page=0&size=500 + next: http://localhost:3000/api/v1/entities/identityProviders?page=1&size=500 + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/identityProviders?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: + - '183' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/identityProviders?page=0&size=500 + next: http://localhost:3000/api/v1/entities/identityProviders?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/layout_identity_providers.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/layout_identity_providers.yaml new file mode 100644 index 000000000..68880e6b5 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/layout_identity_providers.yaml @@ -0,0 +1,370 @@ +# (C) 2024 GoodData Corporation +version: 1 +interactions: + - request: + method: GET + uri: http://localhost:3000/api/v1/layout/identityProviders + body: null + headers: + Accept: + - application/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: + - '2' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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/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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: [] + - request: + method: PUT + uri: http://localhost:3000/api/v1/layout/identityProviders + body: + - id: test_identity_provider + customClaimMapping: + email: email + identifiers: + - goodtesting.com + oauthClientId: test_client_id + oauthClientSecret: test_client_secret + oauthIssuerId: test_issuer_id + oauthIssuerLocation: https://issuer.goodtesting.com + headers: + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/json + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/layout/identityProviders + body: null + headers: + Accept: + - application/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-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 cdnjs.cloudflare.com; + img-src * data: blob:; 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/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 + Transfer-Encoding: + - chunked + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + content-length: + - '227' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + - customClaimMapping: + email: email + id: test_identity_provider + identifiers: + - goodtesting.com + oauthClientId: test_client_id + oauthIssuerId: test_issuer_id + oauthIssuerLocation: https://issuer.goodtesting.com + - request: + method: PUT + uri: http://localhost:3000/api/v1/layout/identityProviders + body: [] + headers: + Accept-Encoding: + - br, gzip, deflate + Content-Type: + - application/json + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/layout/identityProviders + body: null + headers: + Accept: + - application/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: + - '2' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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/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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: [] diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/list_identity_providers.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/list_identity_providers.yaml new file mode 100644 index 000000000..c521d6fb3 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/list_identity_providers.yaml @@ -0,0 +1,504 @@ +# (C) 2024 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/identityProviders + body: + data: + id: test_identity_provider_1 + type: identityProvider + attributes: + customClaimMapping: + email: email + identifiers: + - goodtesting.com + oauthClientId: test_client_id_1 + oauthClientSecret: test_client_secret_1 + oauthIssuerId: test_issuer_id_1 + oauthIssuerLocation: https://issuer.goodtesting.com + 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: + - '381' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:23 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: + id: test_identity_provider_1 + type: identityProvider + attributes: + identifiers: + - goodtesting.com + customClaimMapping: + email: email + oauthClientId: test_client_id_1 + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id_1 + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider_1 + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/identityProviders + body: + data: + id: test_identity_provider_2 + type: identityProvider + attributes: + customClaimMapping: + email: email + identifiers: + - goodtesting.com + oauthClientId: test_client_id_2 + oauthClientSecret: test_client_secret_2 + oauthIssuerId: test_issuer_id_2 + oauthIssuerLocation: https://issuer.goodtesting.com + 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: + - '381' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: + id: test_identity_provider_2 + type: identityProvider + attributes: + identifiers: + - goodtesting.com + customClaimMapping: + email: email + oauthClientId: test_client_id_2 + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id_2 + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider_2 + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/identityProviders?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: + - '928' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: + - id: test_identity_provider_1 + type: identityProvider + attributes: + identifiers: + - goodtesting.com + customClaimMapping: + email: email + oauthClientId: test_client_id_1 + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id_1 + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider_1 + - id: test_identity_provider_2 + type: identityProvider + attributes: + identifiers: + - goodtesting.com + customClaimMapping: + email: email + oauthClientId: test_client_id_2 + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id_2 + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider_2 + links: + self: http://localhost:3000/api/v1/entities/identityProviders?page=0&size=500 + next: http://localhost:3000/api/v1/entities/identityProviders?page=1&size=500 + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider_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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: '' + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider_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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/identityProviders?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: + - '183' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:24 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/identityProviders?page=0&size=500 + next: http://localhost:3000/api/v1/entities/identityProviders?page=1&size=500 diff --git a/gooddata-sdk/tests/catalog/fixtures/organization/update_identity_provider.yaml b/gooddata-sdk/tests/catalog/fixtures/organization/update_identity_provider.yaml new file mode 100644 index 000000000..bb533f591 --- /dev/null +++ b/gooddata-sdk/tests/catalog/fixtures/organization/update_identity_provider.yaml @@ -0,0 +1,427 @@ +# (C) 2024 GoodData Corporation +version: 1 +interactions: + - request: + method: POST + uri: http://localhost:3000/api/v1/entities/identityProviders + body: + data: + id: test_identity_provider + type: identityProvider + attributes: + customClaimMapping: + email: email + identifiers: + - goodtesting.com + oauthClientId: test_client_id + oauthClientSecret: test_client_secret + oauthIssuerId: test_issuer_id + oauthIssuerLocation: https://issuer.goodtesting.com + 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: + - '373' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: + id: test_identity_provider + type: identityProvider + attributes: + identifiers: + - goodtesting.com + customClaimMapping: + email: email + oauthClientId: test_client_id + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + - request: + method: PUT + uri: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + body: + data: + id: test_identity_provider + type: identityProvider + attributes: + customClaimMapping: + email: email + identifiers: + - goodtesting.com + - anotheridentifier.com + oauthClientId: test_client_id + oauthClientSecret: test_client_secret + oauthIssuerId: test_issuer_id + oauthIssuerLocation: https://issuer.goodtesting.com + 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: + - '397' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: + id: test_identity_provider + type: identityProvider + attributes: + identifiers: + - goodtesting.com + - anotheridentifier.com + customClaimMapping: + email: email + oauthClientId: test_client_id + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + 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: + - '397' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: + id: test_identity_provider + type: identityProvider + attributes: + identifiers: + - goodtesting.com + - anotheridentifier.com + customClaimMapping: + email: email + oauthClientId: test_client_id + oauthIssuerLocation: https://issuer.goodtesting.com + oauthIssuerId: test_issuer_id + links: + self: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + - request: + method: DELETE + uri: http://localhost:3000/api/v1/entities/identityProviders/test_identity_provider + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: '' + - request: + method: GET + uri: http://localhost:3000/api/v1/entities/identityProviders?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: + - '183' + 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 cdnjs.cloudflare.com; + img-src * data: blob:; 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 + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-GDC-TRACE-ID: *id001 + X-XSS-Protection: + - '0' + set-cookie: + - SPRING_REDIRECT_URI=; Max-Age=0; Expires=Mon, 25 Nov 2024 14:59:25 GMT; + Path=/; HTTPOnly; SameSite=Lax + body: + string: + data: [] + links: + self: http://localhost:3000/api/v1/entities/identityProviders?page=0&size=500 + next: http://localhost:3000/api/v1/entities/identityProviders?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 02dcc2fcf..9f6b63874 100644 --- a/gooddata-sdk/tests/catalog/test_catalog_organization.py +++ b/gooddata-sdk/tests/catalog/test_catalog_organization.py @@ -14,6 +14,8 @@ CatalogWebhook, GoodDataSdk, ) +from gooddata_sdk.catalog.organization.entity_model.identity_provider import CatalogIdentityProvider +from gooddata_sdk.catalog.organization.layout.identity_provider import CatalogDeclarativeIdentityProvider from tests_support.vcrpy_utils import get_vcr gd_vcr = get_vcr() @@ -374,3 +376,208 @@ def test_layout_notification_channels(test_config): sdk.catalog_organization.put_declarative_notification_channels([]) ncs = sdk.catalog_organization.get_declarative_notification_channels() assert len(ncs) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "create_identity_provider.yaml")) +def test_create_identity_provider(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + identity_provider_id = "test_identity_provider" + custom_claim_mapping = {"email": "email"} + identifiers = ["goodtesting.com"] + oauth_client_id = "test_client_id" + oauth_client_secret = "test_client_secret" + oauth_issuer_id = "test_issuer_id" + oauth_issuer_location = "https://issuer.goodtesting.com" + + new_identity_provider = CatalogIdentityProvider.init( + identity_provider_id=identity_provider_id, + custom_claim_mapping=custom_claim_mapping, + identifiers=identifiers, + oauth_client_id=oauth_client_id, + oauth_client_secret=oauth_client_secret, + oauth_issuer_id=oauth_issuer_id, + oauth_issuer_location=oauth_issuer_location, + ) + + try: + sdk.catalog_organization.create_identity_provider(new_identity_provider) + identity_provider = sdk.catalog_organization.get_identity_provider(identity_provider_id) + assert identity_provider.id == identity_provider_id + assert identity_provider.attributes.custom_claim_mapping == custom_claim_mapping + assert identity_provider.attributes.identifiers == identifiers + assert identity_provider.attributes.oauth_client_id == oauth_client_id + assert identity_provider.attributes.oauth_client_secret is None # oauth_client_secret is not returned + assert identity_provider.attributes.oauth_issuer_id == oauth_issuer_id + assert identity_provider.attributes.oauth_issuer_location == oauth_issuer_location + finally: + sdk.catalog_organization.delete_identity_provider(identity_provider_id) + assert len(sdk.catalog_organization.list_identity_providers()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "list_identity_providers.yaml")) +def test_list_identity_providers(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + identity_provider_id = "test_identity_provider" + custom_claim_mapping = {"email": "email"} + identifiers = ["goodtesting.com"] + oauth_client_id = "test_client_id" + oauth_client_secret = "test_client_secret" + oauth_issuer_id = "test_issuer_id" + oauth_issuer_location = "https://issuer.goodtesting.com" + + new_identity_provider_1 = CatalogIdentityProvider.init( + identity_provider_id=identity_provider_id + "_1", + custom_claim_mapping=custom_claim_mapping, + identifiers=identifiers, + oauth_client_id=oauth_client_id + "_1", + oauth_client_secret=oauth_client_secret + "_1", + oauth_issuer_id=oauth_issuer_id + "_1", + oauth_issuer_location=oauth_issuer_location, + ) + new_identity_provider_2 = CatalogIdentityProvider.init( + identity_provider_id=identity_provider_id + "_2", + custom_claim_mapping=custom_claim_mapping, + identifiers=identifiers, + oauth_client_id=oauth_client_id + "_2", + oauth_client_secret=oauth_client_secret + "_2", + oauth_issuer_id=oauth_issuer_id + "_2", + oauth_issuer_location=oauth_issuer_location, + ) + + try: + sdk.catalog_organization.create_identity_provider(new_identity_provider_1) + sdk.catalog_organization.create_identity_provider(new_identity_provider_2) + identity_providers = sdk.catalog_organization.list_identity_providers() + # oauth_client_secret is not returned + new_identity_provider_1.attributes.oauth_client_secret = None + new_identity_provider_2.attributes.oauth_client_secret = None + assert len(identity_providers) == 2 + assert new_identity_provider_1 in identity_providers + assert new_identity_provider_2 in identity_providers + finally: + sdk.catalog_organization.delete_identity_provider(new_identity_provider_1.id) + sdk.catalog_organization.delete_identity_provider(new_identity_provider_2.id) + assert len(sdk.catalog_organization.list_identity_providers()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "delete_identity_provider.yaml")) +def test_delete_identity_provider(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + identity_provider_id = "test_identity_provider" + custom_claim_mapping = {"email": "email"} + identifiers = ["goodtesting.com"] + oauth_client_id = "test_client_id" + oauth_client_secret = "test_client_secret" + oauth_issuer_id = "test_issuer_id" + oauth_issuer_location = "https://issuer.goodtesting.com" + + new_identity_provider = CatalogIdentityProvider.init( + identity_provider_id=identity_provider_id, + custom_claim_mapping=custom_claim_mapping, + identifiers=identifiers, + oauth_client_id=oauth_client_id, + oauth_client_secret=oauth_client_secret, + oauth_issuer_id=oauth_issuer_id, + oauth_issuer_location=oauth_issuer_location, + ) + + try: + sdk.catalog_organization.create_identity_provider(new_identity_provider) + sdk.catalog_organization.delete_identity_provider(identity_provider_id) + sdk.catalog_organization.get_identity_provider(identity_provider_id) + except NotFoundException: + assert len(sdk.catalog_organization.list_identity_providers()) == 0 + finally: + assert len(sdk.catalog_organization.list_identity_providers()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "update_identity_provider.yaml")) +def test_update_identity_provider(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + identity_provider_id = "test_identity_provider" + custom_claim_mapping = {"email": "email"} + identifiers = ["goodtesting.com"] + oauth_client_id = "test_client_id" + oauth_client_secret = "test_client_secret" + oauth_issuer_id = "test_issuer_id" + oauth_issuer_location = "https://issuer.goodtesting.com" + + new_identity_provider = CatalogIdentityProvider.init( + identity_provider_id=identity_provider_id, + custom_claim_mapping=custom_claim_mapping, + identifiers=identifiers, + oauth_client_id=oauth_client_id, + oauth_client_secret=oauth_client_secret, + oauth_issuer_id=oauth_issuer_id, + oauth_issuer_location=oauth_issuer_location, + ) + update_identity_provider = CatalogIdentityProvider.init( + identity_provider_id=identity_provider_id, + custom_claim_mapping=custom_claim_mapping, + identifiers=identifiers + ["anotheridentifier.com"], + oauth_client_id=oauth_client_id, + oauth_client_secret=oauth_client_secret, + oauth_issuer_id=oauth_issuer_id, + oauth_issuer_location=oauth_issuer_location, + ) + + try: + sdk.catalog_organization.create_identity_provider(new_identity_provider) + sdk.catalog_organization.update_identity_provider(update_identity_provider) + identity_provider = sdk.catalog_organization.get_identity_provider(identity_provider_id) + assert identity_provider.id == identity_provider_id + assert identity_provider.attributes.custom_claim_mapping == custom_claim_mapping + assert identity_provider.attributes.identifiers == identifiers + ["anotheridentifier.com"] + assert identity_provider.attributes.oauth_client_id == oauth_client_id + assert identity_provider.attributes.oauth_client_secret is None # oauth_client_secret is not returned + assert identity_provider.attributes.oauth_issuer_id == oauth_issuer_id + assert identity_provider.attributes.oauth_issuer_location == oauth_issuer_location + finally: + sdk.catalog_organization.delete_identity_provider(identity_provider_id) + assert len(sdk.catalog_organization.list_identity_providers()) == 0 + + +@gd_vcr.use_cassette(str(_fixtures_dir / "layout_identity_providers.yaml")) +def test_layout_identity_providers(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + idps = sdk.catalog_organization.get_declarative_identity_providers() + assert len(idps) == 0 + + try: + identity_provider_id = "test_identity_provider" + custom_claim_mapping = {"email": "email"} + identifiers = ["goodtesting.com"] + oauth_client_id = "test_client_id" + oauth_client_secret = "test_client_secret" + oauth_issuer_id = "test_issuer_id" + oauth_issuer_location = "https://issuer.goodtesting.com" + + identity_providers_e = [ + CatalogDeclarativeIdentityProvider( + id=identity_provider_id, + custom_claim_mapping=custom_claim_mapping, + identifiers=identifiers, + oauth_client_id=oauth_client_id, + oauth_client_secret=oauth_client_secret, + oauth_issuer_id=oauth_issuer_id, + oauth_issuer_location=oauth_issuer_location, + ), + ] + sdk.catalog_organization.put_declarative_identity_providers(identity_providers_e) + identity_providers_o = sdk.catalog_organization.get_declarative_identity_providers() + assert identity_providers_o[0].id == identity_providers_e[0].id + assert identity_providers_o[0].custom_claim_mapping == identity_providers_e[0].custom_claim_mapping + assert identity_providers_o[0].identifiers == identity_providers_e[0].identifiers + assert identity_providers_o[0].oauth_client_id == identity_providers_e[0].oauth_client_id + assert identity_providers_o[0].oauth_client_secret is None + assert identity_providers_o[0].oauth_issuer_id == identity_providers_o[0].oauth_issuer_id + assert identity_providers_o[0].oauth_issuer_location == identity_providers_e[0].oauth_issuer_location + finally: + sdk.catalog_organization.put_declarative_identity_providers([]) + idps = sdk.catalog_organization.get_declarative_identity_providers() + assert len(idps) == 0