summaryrefslogtreecommitdiffstats
path: root/dmaap/dmaapplugin/dr_relationships.py
diff options
context:
space:
mode:
authorxufeiliu <xl085b@att.com>2018-12-17 20:50:16 +0000
committerxufeiliu <xl085b@att.com>2018-12-17 20:50:37 +0000
commitf429e8f161c95c35d7247f928482dba5491d3665 (patch)
treeaac7eea964c58f3666f5c22ef7eb25124a10236b /dmaap/dmaapplugin/dr_relationships.py
parent2e93164490b3ad9cd85f63ad6619ec02947dd3a3 (diff)
sync ONAP DMaaP-plugin with AT&T internal
Changes: security enhancement, support topic-name, more logs Change-Id: I7649505847a49b32d56d6e891aebb2521b54a7bd Issue-ID: CCSDK-794 Signed-off-by: xufeiliu <xl085b@att.com>
Diffstat (limited to 'dmaap/dmaapplugin/dr_relationships.py')
-rw-r--r--dmaap/dmaapplugin/dr_relationships.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/dmaap/dmaapplugin/dr_relationships.py b/dmaap/dmaapplugin/dr_relationships.py
index 8796354..eff0fa1 100644
--- a/dmaap/dmaapplugin/dr_relationships.py
+++ b/dmaap/dmaapplugin/dr_relationships.py
@@ -59,7 +59,7 @@ def add_dr_publisher(**kwargs):
feed_id = ctx.target.instance.runtime_properties["feed_id"]
location = ctx.source.instance.runtime_properties[target_feed]["location"]
username = random_string(8)
- password = random_string(10)
+ password = random_string(16)
# Make the request to add the publisher to the feed
dmc = DMaaPControllerHandle(DMAAP_API_URL, DMAAP_USER, DMAAP_PASS, ctx.logger)
@@ -81,7 +81,9 @@ def add_dr_publisher(**kwargs):
# Set key in Consul
ch = ConsulHandle("http://{0}:8500".format(CONSUL_HOST), None, None, ctx.logger)
- ch.add_to_entry("{0}:dmaap".format(ctx.source.instance.runtime_properties['service_component_name']), target_feed, ctx.source.instance.runtime_properties[target_feed])
+ cpy = dict(ctx.source.instance.runtime_properties[target_feed])
+ # cpy["password"] = pkcrypto.encrypt_string(cpy["password"]) # can't encrypt until collectors can decrypt
+ ch.add_to_entry("{0}:dmaap".format(ctx.source.instance.runtime_properties['service_component_name']), target_feed, cpy)
except Exception as e:
ctx.logger.error("Error adding publisher to feed: {er}".format(er=e))
@@ -173,7 +175,9 @@ def add_dr_subscriber(**kwargs):
# Set key in Consul
ch = ConsulHandle("http://{0}:8500".format(CONSUL_HOST), None, None, ctx.logger)
- ch.add_to_entry("{0}:dmaap".format(ctx.source.instance.runtime_properties['service_component_name']), target_feed, ctx.source.instance.runtime_properties[target_feed])
+ cpy = dict(ctx.source.instance.runtime_properties[target_feed])
+ # cpy["password"] = pkcrypto.encrypt_string(cpy["password"]) # can't encrypt until collectors can decrypt
+ ch.add_to_entry("{0}:dmaap".format(ctx.source.instance.runtime_properties['service_component_name']), target_feed, cpy)
except Exception as e:
ctx.logger.error("Error adding subscriber to feed: {er}".format(er=e))