Пример #1
0
def kerberos(configure_security):
    try:
        principals = auth.get_service_principals(foldered_name, sdk_auth.REALM)

        kerberos_env = sdk_auth.KerberosEnvironment()
        kerberos_env.add_principals(principals)
        kerberos_env.finalize()

        yield kerberos_env

    finally:
        kerberos_env.cleanup()
def kerberos(configure_security):
    try:
        principals = auth.get_service_principals(config.SERVICE_NAME, sdk_auth.REALM)

        kerberos_env = sdk_auth.KerberosEnvironment()
        kerberos_env.add_principals(principals)
        kerberos_env.finalize()

        yield kerberos_env

    finally:
        kerberos_env.cleanup()
Пример #3
0
def kerberos(configure_security):
    try:
        principals = auth.get_service_principals(config.FOLDERED_SERVICE_NAME, sdk_auth.REALM)

        kerberos_env = sdk_auth.KerberosEnvironment()
        kerberos_env.add_principals(principals)
        kerberos_env.finalize()

        yield kerberos_env

    finally:
        kerberos_env.cleanup()
Пример #4
0
def kerberos(configure_security):
    try:
        kerberos_env = sdk_auth.KerberosEnvironment()

        principals = auth.get_service_principals(config.SERVICE_NAME, kerberos_env.get_realm())
        kerberos_env.add_principals(principals)
        kerberos_env.finalize()

        yield kerberos_env

    finally:
        kerberos_env.cleanup()
def kerberos(configure_security):
    try:
        principals = auth.get_service_principals(
            config.SERVICE_NAME, sdk_auth.REALM, sdk_hosts.get_crypto_id_domain()
        )

        kerberos_env = sdk_auth.KerberosEnvironment()
        kerberos_env.add_principals(principals)
        kerberos_env.finalize()

        yield kerberos_env

    finally:
        kerberos_env.cleanup()
def kerberos(configure_security):
    try:
        kerberos_env = sdk_auth.KerberosEnvironment()

        principals = auth.get_service_principals(config.SERVICE_NAME,
                                                 kerberos_env.get_realm(),
                                                 sdk_hosts.get_crypto_id_domain())
        kerberos_env.add_principals(principals)
        kerberos_env.finalize()

        yield kerberos_env

    finally:
        kerberos_env.cleanup()
def kerberos(configure_security):
    try:
        kerberos_env = sdk_auth.KerberosEnvironment()

        principals = auth.get_service_principals(config.SERVICE_NAME,
                                                 kerberos_env.get_realm())
        principals.extend(get_zookeeper_principals(config.ZOOKEEPER_SERVICE_NAME,
                                                   kerberos_env.get_realm()))

        kerberos_env.add_principals(principals)
        kerberos_env.finalize()

        yield kerberos_env

    finally:
        kerberos_env.cleanup()
def kerberos():
    """
    A pytest fixture that installs and configures a KDC used for testing.

    On teardown, the KDC application is removed.
    """
    try:
        kerberos_env = sdk_auth.KerberosEnvironment()

        principals = auth.get_service_principals(config.SERVICE_NAME, kerberos_env.get_realm())
        kerberos_env.add_principals(principals)
        kerberos_env.finalize()

        yield kerberos_env

    finally:
        kerberos_env.cleanup()
def kerberos():
    """
    A pytest fixture that installs and configures a KDC used for testing.

    On teardown, the KDC application is removed.
    """
    try:
        kerberos_env = sdk_auth.KerberosEnvironment()

        principals = auth.get_service_principals(config.SERVICE_NAME,
                                                 kerberos_env.get_realm())
        kerberos_env.add_principals(principals)
        kerberos_env.finalize()

        yield kerberos_env

    finally:
        kerberos_env.cleanup()
Пример #10
0
def kerberos(configure_security):
    try:
        kerberos_env = sdk_auth.KerberosEnvironment()

        principals = auth.get_service_principals(config.FOLDERED_SERVICE_NAME,
                                                 kerberos_env.get_realm())
        kerberos_env.add_principals(principals)
        kerberos_env.finalize()
        service_kerberos_options = {
            "service": {
                "name": config.FOLDERED_SERVICE_NAME,
                "security": {
                    "kerberos": {
                        "enabled": True,
                        "kdc": {
                            "hostname": kerberos_env.get_host(),
                            "port": int(kerberos_env.get_port())
                        },
                        "keytab_secret": kerberos_env.get_keytab_path(),
                        "realm": kerberos.get_realm()
                    }
                }
            },
            "hdfs": {
                "security_auth_to_local": auth.get_principal_to_user_mapping()
            }
        }

        sdk_install.uninstall(config.PACKAGE_NAME, config.SERVICE_NAME)
        sdk_install.install(config.PACKAGE_NAME,
                            config.FOLDERED_SERVICE_NAME,
                            config.DEFAULT_TASK_COUNT,
                            additional_options=service_kerberos_options,
                            timeout_seconds=30 * 60)

        yield kerberos_env

    finally:
        sdk_install.uninstall(config.PACKAGE_NAME,
                              config.FOLDERED_SERVICE_NAME)
        if kerberos_env:
            kerberos_env.cleanup()