diff --git a/muranoapi/db/services/sessions.py b/muranoapi/db/services/sessions.py index 1a73b32ed..2face7f82 100644 --- a/muranoapi/db/services/sessions.py +++ b/muranoapi/db/services/sessions.py @@ -16,6 +16,7 @@ from collections import namedtuple from muranoapi.common import config from muranoapi.db.models import Session, Environment, Deployment, Status from muranoapi.db.session import get_session +from muranocommon.helpers.token_sanitizer import TokenSanitizer from muranocommon.messaging import MqClient, Message @@ -26,6 +27,11 @@ SessionState = namedtuple('SessionState', ['open', 'deploying', 'deployed'])( ) +def secure_description(description): + sanitizer = TokenSanitizer() + return sanitizer.sanitize(description) + + class SessionServices(object): @staticmethod def get_sessions(environment_id, state=None): @@ -125,9 +131,7 @@ class SessionServices(object): session.state = SessionState.deploying deployment = Deployment() deployment.environment_id = environment['id'] - deployment.description = dict(session.description) - if 'token' in deployment.description: - del deployment.description['token'] + deployment.description = secure_description(dict(session.description)) status = Status() status.text = "Deployment scheduled" status.level = "info" diff --git a/requirements.txt b/requirements.txt index 1b4acfc55..2bbe8f638 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,4 +31,4 @@ passlib jsonschema==2.0.0 python-keystoneclient>=0.2.0 oslo.config -http://github.com/sergmelikyan/murano-common/releases/download/0.2.1/muranocommon-0.2.1.tar.gz#egg=muranocommon-0.2.1 \ No newline at end of file +http://tarballs.openstack.org/murano-common/murano-common-release-0.2.tar.gz#egg=muranocommon-dev \ No newline at end of file