wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
748 stars 729 forks source link

Error when importing a service provider from a yaml file #16572

Closed ThaminduR closed 11 months ago

ThaminduR commented 1 year ago

Describe the issue: Following error occurs when importing a service provider from a yaml file. This is happening after upgrading to snakeyaml 2.xx (https://github.com/wso2/identity-api-server/pull/480). Need to check the other places where resources are being imported from yaml files (idp import API).

Caused by: Global tag is not allowed: tag:yaml.org,2002:org.wso2.carbon.identity.application.common.model.ServiceProvider
 in 'string', line 1, column 1:
    !!org.wso2.carbon.identity.appli ...
    ^

How to reproduce:

  1. Register an application.
  2. Export the application using following curl
curl --location 'https://localhost:9443/t/carbon.super/api/server/v1/applications/<app_id>/exportFile' \
--header 'Accept: application/yaml' \
--header 'Authorization: Basic YWRtaW46YWRtaW4='
  1. Try importing the response of the above curl using following curl. (Change the service provider name before importing.)
curl --location 'https://localhost:9443/t/carbon.super/api/server/v1/applications/import' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--form 'file="yaml_content";type=application/yaml'

Possible Fix: https://stackoverflow.com/questions/76717530/global-tag-is-not-allowed-exception-in-snakeyaml-2-0

sahandilshan commented 12 months ago

This is not reproducible anymore. Hence closing the issue

https://github.com/wso2/product-is/assets/32576163/8bf03525-2316-453c-8849-bf5fd4b5d610