import json


def store_barbican_secret_for_coriolis(
        barbican, secret_info, name='Coriolis Secret'):
    """ Stores secret connection info in Barbican for Coriolis.

    :param barbican: barbican_client.Client instance
    :param secret_info: secret info to store
    :return: the HREF (URL) of the newly-created Barbican secret
    """
    payload = json.dumps(secret_info)

    secret = barbican.secrets.create(
        name=name, payload=payload,
        payload_content_type='application/json')
    secret_ref = secret.store()

    return secret_ref