summaryrefslogtreecommitdiffstats
path: root/osdf
diff options
context:
space:
mode:
authorDileep Ranganathan <dileep.ranganathan@intel.com>2018-10-12 02:29:49 -0700
committerDileep Ranganathan <dileep.ranganathan@intel.com>2018-10-19 04:55:34 -0700
commitc3aa7ebbb6f17c93958103077614f5bdac9837b0 (patch)
tree5688c63850524dabe9eba9cd96cf29df3cd91279 /osdf
parent8d495104b8174cdc19b4bf27b98d9b4210fec01f (diff)
Enable SMS in OSDF
Load secrets from SMS in OSDF. Removed secrets from osdf_config.yaml. Unit tests to use the test/config/osdf_config.yaml. Helm charts uses a Job to load secrets. CSIT needs to load it using the preload tool provided by SMS. Change-Id: I0f832033476c02958f6392abba74e4d5a36cc902 Issue-ID: OPTFRA-343 Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
Diffstat (limited to 'osdf')
-rw-r--r--osdf/adapters/aaf/sms.py4
-rw-r--r--osdf/webapp/appcontroller.py6
2 files changed, 8 insertions, 2 deletions
diff --git a/osdf/adapters/aaf/sms.py b/osdf/adapters/aaf/sms.py
index 9c7af51..25ae7f2 100644
--- a/osdf/adapters/aaf/sms.py
+++ b/osdf/adapters/aaf/sms.py
@@ -21,6 +21,8 @@
from onapsmsclient import Client
+import osdf.config.base as cfg_base
+import osdf.config.credentials as creds
import osdf.config.loader as config_loader
from osdf.config.base import osdf_config
from osdf.logging.osdf_logging import debug_log
@@ -98,6 +100,8 @@ def load_secrets():
config['pciHMSPassword'] = secret_dict['pciHMS']['Password']
config['osdfPCIOptUsername'] = secret_dict['osdfPCIOpt']['UserName']
config['osdfPCIOptPassword'] = secret_dict['osdfPCIOpt']['Password']
+ cfg_base.http_basic_auth_credentials = creds.load_credentials(osdf_config)
+ cfg_base.dmaap_creds = creds.dmaap_creds()
def delete_secrets():
diff --git a/osdf/webapp/appcontroller.py b/osdf/webapp/appcontroller.py
index 3a5385d..9714fb5 100644
--- a/osdf/webapp/appcontroller.py
+++ b/osdf/webapp/appcontroller.py
@@ -21,7 +21,8 @@ from flask_httpauth import HTTPBasicAuth
from flask import Response
import json
import osdf
-from osdf.config.base import http_basic_auth_credentials, osdf_config
+import osdf.config.base as cfg_base
+from osdf.config.base import osdf_config
from osdf.adapters.aaf import aaf_authentication as aaf_auth
auth_basic = HTTPBasicAuth()
@@ -38,7 +39,8 @@ unauthorized_message = json.dumps(error_body)
def get_pw(username):
end_point = request.url.split('/')[-1]
auth_group = osdf.end_point_auth_mapping.get(end_point)
- return http_basic_auth_credentials[auth_group].get(username) if auth_group else None
+ return cfg_base.http_basic_auth_credentials[auth_group].get(
+ username) if auth_group else None
@auth_basic.error_handler
def auth_error():