'''Secret Management Service Integration'''
from conductor.common import config_loader
from onapsmsclient import Client
-
from oslo_config import cfg
from oslo_log import log
-import conductor.data.plugins.inventory_provider.aai
-import conductor.api.controllers.v1.plans
-import conductor.common.music.api
-import conductor.data.plugins.service_controller.sdnc
+
+
from conductor.common.utils import cipherUtils
LOG = log.getLogger(__name__)
AAF_SMS_OPTS = [
cfg.BoolOpt('is_enabled',
- default=True,
- help='Is Secret Management service enabled'),
+ default=True,
+ help='Is Secret Management service enabled'),
cfg.StrOpt('aaf_sms_url',
default='https://aaf-sms.onap:10443',
help='Base URL for SMS, up to and not including '
def preload_secrets():
- """ This is intended to load the secrets required for testing Application
+ """This is intended to load the secrets required for testing Application
+
Actual deployment will have a preload script. Make sure the config is
- in sync"""
+
+ in sync
+ """
preload_config = config_loader.load_config_file(
config_spec.get("preload_secrets"))
domain = preload_config.get("domain")
config.set_override('username', secret_dict['aaf_api']['username'], 'aaf_api')
config.set_override('password', decrypt_pass(secret_dict['aaf_api']['password']), 'aaf_api')
config.set_override('aaf_conductor_user', secret_dict['aaf_api']['aaf_conductor_user'], 'aaf_api')
+ config.set_override('username', secret_dict['sdc']['username'], 'sdc')
+ config.set_override('password', decrypt_pass(secret_dict['sdc']['password']), 'sdc')
def decrypt_pass(passwd):
def delete_secrets():
- """ This is intended to delete the secrets for a clean initialization for
+ """This is intended to delete the secrets for a clean initialization for
+
testing Application. Actual deployment will have a preload script.
- Make sure the config is in sync"""
+
+ Make sure the config is in sync
+ """
config = CONF.aaf_sms
sms_url = config.aaf_sms_url
timeout = config.aaf_sms_timeout
default='certificate_key.pem',
help='Private Certificate Key file in pem format.'),
cfg.StrOpt('certificate_authority_bundle_file',
- default='certificate_authority_bundle.pem',
+ default='',
help='Certificate Authority Bundle file in pem format. '
'Must contain the appropriate trust chain for the '
'Certificate file.'),
context=None, value=None):
"""Performs HTTP request."""
headers = {
- 'X-FromAppId': 'CONDUCTOR',
+ 'X-FromAppId': 'AAI',
'X-TransactionId': str(uuid.uuid4()),
+ 'X-ECOMP-InstanceID': 'AAI',
}
kwargs = {
"method": method,
"path": path,
"headers": headers,
"data": data,
+ "content_type": "application/octet-stream"
}
# TODO(jdandrea): Move timing/response logging into the rest helper?
"username": self.username,
"password": self.password,
"read_timeout": self.timeout,
+ "ca_bundle_file": self.verify,
}
self.rest = rest.REST(**kwargs)