isururanawaka commented on a change in pull request #16:
URL: 
https://github.com/apache/airavata-custos-portal/pull/16#discussion_r499306221



##########
File path: custos_portal/custos_portal/apps/auth/forms.py
##########
@@ -1,13 +1,22 @@
 import logging
 
-from clients.user_management_client import UserManagementClient
-from custos.core import IamAdminService_pb2
+from custos.clients.user_management_client import UserManagementClient
+from custos.transport.settings import CustosServerClientSettings
+from custos.server.core import IamAdminService_pb2
 from django import forms
 from django.conf import settings
 from django.core import validators
+import os
 
 logger = logging.getLogger(__name__)
-user_management_client = UserManagementClient()
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+settings = os.path.join(BASE_DIR, 'transport', 'settings.ini')
+custos_settings = CustosServerClientSettings(custos_host='custos.scigap.org',
+                                             custos_port='31499',
+                                             
custos_client_id='custos-6nwoqodstpe5mvcq09lh-10000101',

Review comment:
       remove this

##########
File path: custos_portal/custos_portal/context_processors.py
##########
@@ -2,27 +2,36 @@
 import logging
 import re
 
-from clients.identity_management_client import IdentityManagementClient
-from clients.user_management_client import UserManagementClient
+from custos.clients.identity_management_client import IdentityManagementClient
+from custos.clients.user_management_client import UserManagementClient
 from django.apps import apps
 from django.conf import settings
 
+from custos.transport.settings import CustosServerClientSettings
+import os
+
 from custos_portal.app_config import CustosAppConfig
 
 logger = logging.getLogger(__name__)
 
 
 # load APIServerClient with default configuration
-client = UserManagementClient()
-id_client = IdentityManagementClient()
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+settings = os.path.join(BASE_DIR, 'transport', 'settings.ini')
+custos_settings = CustosServerClientSettings(custos_host='custos.scigap.org',
+                                             custos_port='31499',
+                                             
custos_client_id='custos-6nwoqodstpe5mvcq09lh-10000101',

Review comment:
       remove this

##########
File path: custos_portal/custos_portal/context_processors.py
##########
@@ -2,27 +2,36 @@
 import logging
 import re
 
-from clients.identity_management_client import IdentityManagementClient
-from clients.user_management_client import UserManagementClient
+from custos.clients.identity_management_client import IdentityManagementClient
+from custos.clients.user_management_client import UserManagementClient
 from django.apps import apps
 from django.conf import settings
 
+from custos.transport.settings import CustosServerClientSettings
+import os
+
 from custos_portal.app_config import CustosAppConfig
 
 logger = logging.getLogger(__name__)
 
 
 # load APIServerClient with default configuration
-client = UserManagementClient()
-id_client = IdentityManagementClient()
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+settings = os.path.join(BASE_DIR, 'transport', 'settings.ini')
+custos_settings = CustosServerClientSettings(custos_host='custos.scigap.org',
+                                             custos_port='31499',
+                                             
custos_client_id='custos-6nwoqodstpe5mvcq09lh-10000101',
+                                             
custos_client_sec='GiKrGGVLW7zDoPZwzgCiFM7WUz3PhIumTmFxAkr7',
+                                             configuration_file_location=None)
+client = UserManagementClient(custos_settings)
+id_client = IdentityManagementClient(custos_settings)
 
 token = 
"Y3VzdG9zLTZud29xb2RzdHBlNW12Y3EwOWxoLTEwMDAwMTAxOkdpS3JHR1ZMVzd6RG9QWnd6Z0NpRk03V1V6M1BoSXVtVG1GeEFrcjc=";

Review comment:
       remove

##########
File path: custos_portal/custos_portal/__init__.py
##########
@@ -1,5 +1,16 @@
-from clients.identity_management_client import IdentityManagementClient
-from clients.user_management_client import UserManagementClient
+from custos.clients.identity_management_client import IdentityManagementClient
+from custos.clients.user_management_client import UserManagementClient
+from custos.transport.settings import CustosServerClientSettings
+import os
 
-user_management_client = UserManagementClient()
-identity_management_client = IdentityManagementClient()
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+settings = os.path.join(BASE_DIR, 'transport', 'settings.ini')
+
+custos_settings = CustosServerClientSettings(custos_host='custos.scigap.org',
+                                             custos_port='31499',
+                                             
custos_client_id='custos-6nwoqodstpe5mvcq09lh-10000101',

Review comment:
       remove this

##########
File path: custos_portal/custos_portal/static/common/js/apps/config/config.js
##########
@@ -0,0 +1,2 @@
+export const CLIENT_ID = 'custos-6nwoqodstpe5mvcq09lh-10000101';

Review comment:
       remove

##########
File path: custos_portal/custos_portal/settings.py
##########
@@ -23,6 +23,7 @@
 
 # Custos server secret key
 CUSTOS_TOKEN = 
'Y3VzdG9zLTZud29xb2RzdHBlNW12Y3EwOWxoLTEwMDAwMTAxOkdpS3JHR1ZMVzd6RG9QWnd6Z0NpRk03V1V6M1BoSXVtVG1GeEFrcjc='

Review comment:
       remove




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to