def test_validate_persistence_ldap_mapping():
    from pygluu.containerlib.validators import validate_persistence_ldap_mapping
    from pygluu.containerlib.validators import ValidationError

    type_ = "hybrid"
    mapping = "random"

    with pytest.raises(ValidationError):
        validate_persistence_ldap_mapping(type_, mapping)
Esempio n. 2
0
def main():
    persistence_type = os.environ.get("GLUU_PERSISTENCE_TYPE", "ldap")
    validate_persistence_type(persistence_type)

    ldap_mapping = os.environ.get("GLUU_PERSISTENCE_LDAP_MAPPING", "default")
    validate_persistence_ldap_mapping(persistence_type, ldap_mapping)

    manager = get_manager()
    deps = ["config", "secret"]

    if persistence_type == "hybrid":
        deps += ["ldap", "couchbase"]
    else:
        deps.append(persistence_type)

    wait_for(manager, deps)
Esempio n. 3
0
def main():
    persistence_type = os.environ.get("GLUU_PERSISTENCE_TYPE", "ldap")
    validate_persistence_type(persistence_type)

    ldap_mapping = os.environ.get("GLUU_PERSISTENCE_LDAP_MAPPING", "default")
    validate_persistence_ldap_mapping(persistence_type, ldap_mapping)

    meta = os.environ.get("GLUU_CONTAINER_METADATA")
    if meta not in CONTAINER_META_OPTS:
        logger.error(
            "Invalid value for GLUU_CONTAINER_METADATA environment variable; "
            "please choose one of {}".format(", ".join(CONTAINER_META_OPTS)))
        sys.exit(1)

    manager = get_manager()
    deps = ["config", "secret"]

    if persistence_type == "hybrid":
        deps += ["ldap", "couchbase"]
    else:
        deps.append(persistence_type)
    wait_for(manager, deps)