{"id":20484747,"url":"https://github.com/sap-samples/btp-destination-service-samples","last_synced_at":"2025-03-05T16:20:49.362Z","repository":{"id":222394801,"uuid":"753766512","full_name":"SAP-samples/btp-destination-service-samples","owner":"SAP-samples","description":"Sample code and documentation for migrating SAP BTP Destinations services from NEO to Cloud Foundry, showcasing step-by-step processes and best practices.","archived":false,"fork":false,"pushed_at":"2024-02-20T11:36:41.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-16T04:28:03.951Z","etag":null,"topics":["cloud-foundry","connectivity","destinations","migration","neo","sample","sample-code"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SAP-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-06T18:51:24.000Z","updated_at":"2024-03-27T15:33:57.000Z","dependencies_parsed_at":"2024-02-20T12:37:23.142Z","dependency_job_id":null,"html_url":"https://github.com/SAP-samples/btp-destination-service-samples","commit_stats":null,"previous_names":["sap-samples/btp-destination-service-samples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fbtp-destination-service-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fbtp-destination-service-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fbtp-destination-service-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fbtp-destination-service-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SAP-samples","download_url":"https://codeload.github.com/SAP-samples/btp-destination-service-samples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242058449,"owners_count":20065108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-foundry","connectivity","destinations","migration","neo","sample","sample-code"],"created_at":"2024-11-15T16:25:23.881Z","updated_at":"2025-03-05T16:20:49.310Z","avatar_url":"https://github.com/SAP-samples.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to SAP BTP Neo Destinations Migration Sample\n\n[![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/btp-destination-service-samples)](https://api.reuse.software/info/github.com/SAP-samples/btp-destination-service-samples)\n\n## Table of Contents\n\n* [Overview](#overview)\n* [Description](#description)\n* [Requirements](#requirements)\n    * [Local build](#local-build)\n    * [Environment](#environment)\n    * [Deploy](#deploy)\n* [Installation and Usage](#installation-and-usage)\n    * [Build and Deploy](#build-and-deploy)\n    * [Postman Usage](#postman-usage)\n    * [Client-based Security](#client-based-security)\n    * [How to get an access token](#how-to-get-an-access-token)\n        * [Trust and Roles pre-requisites](#trust-and-roles-pre-requisites)\n        * [Get the access token](#get-the-access-token)\n        * [Endpoints Description](#endpoints-description)\n            * [GET /destinations (Read Destinations)](#get-destinations)\n            * [POST /destinations/migrate (Migrate Destinations)](#post-destinationsmigrate)\n            * [GET /destinations/json (Prepare config.json with NEO destination properties)](#get-destinationsjson)\n* [Known Issues](#known-issues)\n* [How to obtain support](#how-to-obtain-support)\n* [Contributing](#contributing)\n\n# Overview\n\n\u003c!-- Please include descriptive title --\u003e\n\n\u003c!--- Register repository https://api.reuse.software/register, then add REUSE badge:\n[![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/REPO-NAME)](https://api.reuse.software/info/github.com/SAP-samples/REPO-NAME)\n--\u003e\nThis is a simple example of a Java project that contains\nthe following functionality:\n\n* Read Neo Destinations (via Connectivity API)\n* Migration of Neo Destinations to CF Destinations\n\n## Description\n\nThis Java project is a straightforward example that focuses on two main functionalities: reading Neo Destinations\nthrough the Connectivity API and migrating Neo Destinations to CF Destinations. It's designed to be simple and\nefficient, making it suitable for anyone looking to handle data connectivity and migration in Java.\n\n## Requirements\n\n#### Local build\n\nTo build the application locally, the following prerequisites must be met:\n\n* Java 8 or higher installed - [JAVA Installation Readme](/docs/JAVA-INSTALLATION.md#java-installation-guide)\n* Maven 3.8.6 or higher installed - [Maven Installation Readme](/docs/JAVA-INSTALLATION.md#maven-installation-guide)\n\n#### Environment\n\nTo deploy the application to the Neo environment, the following prerequisites must be met:\n\n* SAP BTP Neo account (trial or productive)\n* Account User with Administrator role\n\n#### Deploy\n\nTo deploy the application to the Neo environment, the following prerequisites must be met:\n\n* NEO Console Client (Neo CLI) with SDK Version 4.47.11 or higher\n  installed - [SAP Installation Guide](https://help.sap.com/docs/btp/sap-btp-neo-environment/install-sap-btp-sdk-for-neo-environment)\n\n## Installation and Usage\n\n### Build and Deploy\n\nJust build and deploy the application to the Neo environment using\nthe Neo CLI:\n\nBuild:\n\n```shell\nmvn clean package\n```\n\nDeploy:\n\n```shell\nneo deploy --host \u003cneo_host\u003e --account \u003cneo_account\u003e --application neodestinationdemo --source-path target/dest-1.0-SNAPSHOT.war --user \u003cyour_user\u003e\n```\n\n### Postman Usage\n\nThe `postman` folder contains both Postman Collection and Postman Environment.\nSo it can be easily imported into Postman. After importing the collection, all environment variables should be set\nbased on the deployed application and user credentials.\n\nJust run the `Get Token` request to get the access token, it will be automatically saved in the environment variable\nso further requests will use it.\n\n### Client-based security\n\nThe application is secured for any authenticated SAP BTP user of the account or can be accessed via OAuth Clients.\n\n### How to get an access token\n\n#### Trust pre-requisites\n\n\u003e **Note:** The following steps are require the already deployed app.\n\n1. Go to the `SAP BTP NEO Cockpit`/`Security`/`OAuth`/`Clients` tab\n2. Create a new client  (Authorization Grant is `Client Credentials`, Subscription is your application name), provide\n   and remember `client secret`\n   and `client id` attributes.\n\n#### Get the access token\n\n1. Get the `Token Endpoint` from the `Security`/`OAuth`/`Branding` tab\n2. Get the `client id` and `client secret` from the `Security`/`OAuth`/`Clients` tab\n3. Make an API call to the `Token Endpoint` via Postman Collection (`postman` folder) and Get Token request or via\n   custom API call with the following parameters:\n\n[POST] /\u003ctoken_endpoint\u003e\n\n**Body** (x-www-form-urlencoded)\n\n| Name         | Required |  Type  | Value                           |\n|:-------------|:--------:|:------:|---------------------------------|\n| `grant_type` | required | string | `password`                      |\n| `username`   | required | string | `\u003cusername_with_assigned_role\u003e` |\n| `password`   | required | string | `\u003cusername_password\u003e`           |\n\nOR\n\n**Body** (x-www-form-urlencoded)\n\n| Name         | Required |  Type  | Value                 |\n|:-------------|:--------:|:------:|-----------------------|\n| `grant_type` | required | string | `client_credentials`  |\n| `username`   | required | string | `\u003cneo_client_id\u003e`     |\n| `password`   | required | string | `\u003cneo_client_secret\u003e` |\n\n**Headers**\n\n| Name                                   | Required |  Type  | Description                                                                                                  |\n|:---------------------------------------|:--------:|:------:|--------------------------------------------------------------------------------------------------------------|\n| `Authorization: Basic \u003cbase64encoded\u003e` | required | string | Where the `\u003cbase64encoded\u003e` is the Base 64 Encoded string: `\u003cneo_oauth_client_id\u003e:\u003cneo_oauth_client_secret\u003e` |\n\n### Endpoints Description\n\nAfter the deployment is completed, the resulted url of the deployed application\nwill look like this: `https://neodestinationdemotbxg6xlzhd.eu2.hana.ondemand.com/dest-1.0-SNAPSHOT/`\n\n#### GET /destinations\n\nGet all destinations from the Neo environment for the specified account name\ntaken in the GET query parameters.\n\n**Parameters**\n\n| Name          | Required |  Type  | Description                                |\n|:--------------|:--------:|:------:|--------------------------------------------|\n| `accountName` | required | string | The Neo account, for example: `tbxg6xlzhd` |\n\n**Headers**\n\n| Name                            | Required |  Type  | Description                      |\n|:--------------------------------|:--------:|:------:|----------------------------------|\n| `Authorization: Bearer \u003ctoken\u003e` | required | string | Previously received access token |\n\n**Response** (example)\n\nList of destinations with all parameters and properties fetched via Connectivity API.\n\n```json\n{\n  \"test_saml_bearer_destination\": {\n    \"configurationLevel\": \"TENANT\",\n    \"keyStore\": null,\n    \"trustStore\": {},\n    \"tokenServiceKeyStore\": null,\n    \"allProperties\": {\n      \"Type\": \"HTTP\",\n      \"audience\": \"test\",\n      \"clientKey\": \"test\",\n      \"Authentication\": \"OAuth2SAMLBearerAssertion\",\n      \"tokenServiceUser\": \"test\",\n      \"tokenServiceURL\": \"http://test.com\",\n      \"ProxyType\": \"Internet\",\n      \"URL\": \"http://demo0474470.mockable.io\",\n      \"Name\": \"test_saml_bearer\",\n      \"tokenServicePassword\": \"test\"\n    }\n  }\n}\n```\n\n#### POST /destinations/migrate\n\n**Parameters**\n\n| Name                      | Required |  Type  | Description                                                                                                                   |\n|:--------------------------|:--------:|:------:|-------------------------------------------------------------------------------------------------------------------------------|\n| `accountName`             | required | string | The Neo account, for example: `tbxg6xlzhd`                                                                                    |\n| `destinationUrl`          | required | string | The CF Destination Service URL, for example \u003cbr/\u003ehttps://destination-configuration.cfapps.eu10.hana.ondemand.com              |\n| `destinationAuthUrl`      | required | string | The CF Destination Service Auth URL, usually UAA Url, for example \u003cbr/\u003ehttps://migrate.authentication.eu10.hana.ondemand.com` |                                            |\n| `destinationClientId`     | required | string | The CF Destination Service Client Id                                                                                          |                                                                                         |\n| `destinationClientSecret` | required | string | The CF Destination Service Client Secret                                                                                      |\n\n**Headers**\n\n| Name                            | Required |  Type  | Description                      |\n|:--------------------------------|:--------:|:------:|----------------------------------|\n| `Authorization: Bearer \u003ctoken\u003e` | required | string | Previously received access token |\n\n\u003e **Note:** Currently the application supports only the following authentication types to be migrated:\n\u003e * `OAuth2SAMLBearerAssertion`\n\u003e * `OAuth2ClientCredentials`\n\u003e * `BasicAuthentication`\n\n**Response** (example)\n\nResult messages and migration details about each destination.\n\n```json\n{\n  \"result\": \"Migration completed\",\n  \"details\": [\n    {\n      \"destinationName\": \"test_saml_bearer\",\n      \"result\": \"Success\"\n    },\n    {\n      \"destinationName\": \"webide_di\",\n      \"result\": \"Destination authentication type is not supported\"\n    },\n    {\n      \"destinationName\": \"Northwind\",\n      \"result\": \"Destination authentication type is not supported\"\n    },\n    {\n      \"destinationName\": \"Mockable\",\n      \"result\": \"Destination authentication type is not supported\"\n    },\n    {\n      \"destinationName\": \"documentmanagement\",\n      \"result\": \"Success\"\n    },\n    {\n      \"destinationName\": \"test_client_credentials\",\n      \"result\": \"Success\"\n    },\n    {\n      \"destinationName\": \"ESPMSSO\",\n      \"result\": \"Destination authentication type is not supported\"\n    }\n  ]\n}\n```\n\n#### GET /destinations/json\n\nThis endpoint prepares the config.json compatible structure with NEO destinations properties for further MTA deployment.\n\n**Headers**\n\n| Name                            | Required |  Type  | Description                                                                                                                                                                                 |\n|:--------------------------------|:--------:|:------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `Authorization: Bearer \u003ctoken\u003e` | required | string | Previously received access token                                                                                                                                                            |\n| `X-Account-Name`                | required | string | Account name                                                                                                                                                                                |\n| `X-Subaccount-Destinations`     | required | string | Comma-separated (space and case-sensitive) list of destinations to be added to JSON response at the **subaccount** destinations level, for example: destination_1,destination_2             |\n| `X-Instance-Destinations`       | required | string | Comma-separated (space and case-sensitive) list of destinations to be added to JSON response at the **instance** destinations level, for example: destination_1,destination_3,destination_4 |\n\n**Response** (example)\n\nJSON configuration with NEO destination properties divided by specified destination levels.\n\n```json\n{\n  \"HTML5Runtime_enabled\": true,\n  \"init_data\": {\n    \"instance\": {\n      \"existing_destinations_policy\": \"ignore\",\n      \"destinations\": [\n        {\n          \"KeyStorePassword\": \"\",\n          \"Type\": \"HTTP\",\n          \"KeyStoreLocation\": \"mocked.p12\",\n          \"Authentication\": \"ClientCertificateAuthentication\",\n          \"ProxyType\": \"Internet\",\n          \"URL\": \"https://test.com\",\n          \"Name\": \"test_client_certificate\"\n        },\n        {\n          \"Type\": \"HTTP\",\n          \"audience\": \"test\",\n          \"clientKey\": \"test\",\n          \"Authentication\": \"OAuth2SAMLBearerAssertion\",\n          \"tokenServiceUser\": \"test\",\n          \"tokenServiceURL\": \"http://test.com\",\n          \"ProxyType\": \"Internet\",\n          \"URL\": \"http://mockable.io\",\n          \"Name\": \"test_saml_bearer\",\n          \"tokenServicePassword\": \"test\"\n        }\n      ],\n      \"existing_certificates_policy\": \"ignore\"\n    },\n    \"subaccount\": {\n      \"existing_destinations_policy\": \"ignore\",\n      \"destinations\": [\n        {\n          \"KeyStorePassword\": \"\",\n          \"Type\": \"HTTP\",\n          \"KeyStoreLocation\": \"mocked.p12\",\n          \"Authentication\": \"ClientCertificateAuthentication\",\n          \"ProxyType\": \"Internet\",\n          \"URL\": \"https://test.com\",\n          \"Name\": \"test_client_certificate\"\n        }\n      ],\n      \"existing_certificates_policy\": \"ignore\"\n    }\n  }\n}\n```\n\n## Known Issues\n\n\u003c!-- You may simply state \"No known issues. --\u003e\nNo known issues.\n\n## How to obtain support\n\n[Create an issue](https://github.com/SAP-samples/\u003crepository-name\u003e/issues) in this repository if you find a bug or have\nquestions about the content.\n\nFor additional support, [ask a question in SAP Community](https://answers.sap.com/questions/ask.html).\n\n## Contributing\n\nIf you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons,\ncontributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an\nautomated fashion during the submission process. SAP\nuses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).\n\n## License\n\nCopyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache\nSoftware License, version 2.0 except as noted otherwise in the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsap-samples%2Fbtp-destination-service-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsap-samples%2Fbtp-destination-service-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsap-samples%2Fbtp-destination-service-samples/lists"}