From 9c5f3bbdcd3b28b9a8011e61b6702a6eab34f792 Mon Sep 17 00:00:00 2001 From: Karthik Date: Tue, 23 Jun 2020 10:41:22 +0200 Subject: [PATCH 1/2] Update index file Compliance with security guidance --- docs/source/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index d703094..0fd76d7 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -20,8 +20,8 @@ First, let's train a model with :class:`~sap.aibus.dar.client.flow.create.Create from sap.aibus.dar.client.workflow.model import ModelCreator creator = ModelCreator.construct_from_credentials( - dar_url='https://data-attribute-recommendation-internalproduction.cfapps.sap.hana.ondemand.com', - clientid="sb-e52aad05-411c-4b52-a3cc-3d1c162e2f8d!b7898|dar-v3-std!b4321", + dar_url='https://sap-ai-business-services.cfapps.sap.hana.ondemand.com', + clientid="sb-abcdefgh-ijkl-mnop-q1rs-tu2v345w6y7z!b8901|dar-v3-std!b234", clientsecret="XXXXXXXXXXX", uaa_url="https://abcd.authentication.sap.hana.ondemand.com" ) From 7ad49a22bd170589e0464cd9ffcadab341754088 Mon Sep 17 00:00:00 2001 From: Karthik Date: Thu, 2 Jul 2020 16:02:26 +0200 Subject: [PATCH 2/2] Update index.rst Making the example adhere to security guide. --- docs/source/index.rst | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 0fd76d7..79c2cf6 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -18,12 +18,21 @@ Getting Started First, let's train a model with :class:`~sap.aibus.dar.client.flow.create.CreateModel`:: from sap.aibus.dar.client.workflow.model import ModelCreator + import json + + # Read file with service key + with open('dar_service_key.json', 'r') as sk_file: + sk_data = sk_file.read() + + # Load from file + json_data = json.loads(sk_data) + creator = ModelCreator.construct_from_credentials( - dar_url='https://sap-ai-business-services.cfapps.sap.hana.ondemand.com', - clientid="sb-abcdefgh-ijkl-mnop-q1rs-tu2v345w6y7z!b8901|dar-v3-std!b234", - clientsecret="XXXXXXXXXXX", - uaa_url="https://abcd.authentication.sap.hana.ondemand.com" + dar_url = json_data['url'], + clientid = json_data['uaa']['clientid'], + clientsecret = json_data['uaa']['clientsecret'], + uaa_url = json_data['uaa']['url'], ) new_schema = {