Method, decrypt_data, uses internal Barbican endpoint

The yaql function, decrypt_data, in the file, yaql_functions.py,
sets the config option, barbican_endpoint_type, to internal.
This allows Murano to work when TLS is enabled.

Change-Id: Id9d82d7bbedcef87bdc9865ec55511d4e1f65507
Closes-Bug: #1775035
This commit is contained in:
Ellen Batbouta 2018-06-04 14:18:12 -04:00
parent 21b2c357fd
commit 80b4e029bd
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import time
import jsonpatch
import jsonpointer
from oslo_config import cfg as oslo_cfg
from oslo_log import log as logging
from oslo_serialization import base64
import six
@ -37,6 +38,7 @@ from murano.dsl import yaql_integration
from castellan.common import exception as castellan_exception
from castellan.common import utils as castellan_utils
from castellan import key_manager
from castellan import options
LOG = logging.getLogger(__name__)
@ -212,6 +214,8 @@ def logger(context, logger_name):
@specs.parameter('value', yaqltypes.String())
@specs.extension_method
def decrypt_data(value):
options.set_defaults(oslo_cfg.CONF,
barbican_endpoint_type='internal')
manager = key_manager.API()
try:
context = castellan_utils.credential_factory(conf=cfg.CONF)