Beispiel #1
0
def step_uc_mongo_latest_user_write_access(context):
    context.analytical_test_data_s3_location["path"] = "data/uc_mongo_latest/"
    analytical_env_helper.assume_role_for_test(
        context.aws_acc,
        context.analytical_test_e2e_role,
        context.aws_session_timeout_seconds,
    )
Beispiel #2
0
def step_non_sc_role_assumed(context):
    team_databases = [
        "uc_ris_redacted",
        "uc_ris_unredacted",
        "ucs_opsmi_redacted",
        "ucs_opsmi_unredacted",
    ]
    team_paths = [f"data/{db}/" for db in team_databases]
    context.analytical_test_data_s3_location["paths"] = team_paths

    for db in team_databases:
        tag_map = {"pii": "false", "db": db, "table": "test_table"}
        context.analytical_test_data_s3_location["path"] = f"data/{db}/"
        analytical_env_helper.setup_test_file_in_s3(
            context.analytical_test_data_s3_location["file_name"],
            context.analytical_test_data_s3_location["path"],
            context.published_bucket,
            context.timeout,
            tag_map,
        )
        del context.analytical_test_data_s3_location["path"]

    analytical_env_helper.assume_role_for_test(
        context.aws_acc,
        context.analytical_test_e2e_role,
        context.aws_session_timeout_seconds,
    )
Beispiel #3
0
def step_uc_mongo_latest_assumed(context):
    context.analytical_test_data_s3_location["path"] = "data/uc_mongo_latest/"

    tag_map = {"pii": "true", "db": "uc_mongo_latest", "table": "test_table"}
    analytical_env_helper.setup_test_file_in_s3(
        context.analytical_test_data_s3_location["file_name"],
        context.analytical_test_data_s3_location["path"],
        context.published_bucket,
        context.timeout,
        tag_map,
    )
    analytical_env_helper.assume_role_for_test(
        context.aws_acc,
        context.analytical_test_e2e_role,
        context.aws_session_timeout_seconds,
    )
Beispiel #4
0
def step_ucs_opsmi_unredacted_upload(context):
    context.analytical_test_data_s3_location["path"] = "data/uc_ris_redacted/"

    tag_map = {"pii": "false", "db": "uc_ris_redacted", "table": "test_table"}
    analytical_env_helper.setup_test_file_in_s3(
        context.analytical_test_data_s3_location["file_name"],
        context.analytical_test_data_s3_location["path"],
        context.published_bucket,
        context.timeout,
        tag_map,
    )

    analytical_env_helper.assume_role_for_test(
        context.aws_acc,
        context.analytical_test_e2e_role,
        context.aws_session_timeout_seconds,
    )
Beispiel #5
0
def step_auditlog_unred_v_upload(context):
    context.analytical_test_data_s3_location[
        "path"] = "data/uc/auditlog_unred_v/"

    tag_map = {"pii": "true", "db": "uc", "table": "auditlog_unred_v"}
    analytical_env_helper.setup_test_file_in_s3(
        context.analytical_test_data_s3_location["file_name"],
        context.analytical_test_data_s3_location["path"],
        context.published_bucket,
        context.timeout,
        tag_map,
    )

    analytical_env_helper.assume_role_for_test(
        context.aws_acc,
        context.analytical_test_e2e_role,
        context.aws_session_timeout_seconds,
    )
Beispiel #6
0
def step_non_sc_role_assumed(context):
    restricted_tables = [
        "auditlog_red_v", "auditlog_unred_v", "auditlog_sec_v"
    ]
    restricted_paths = [f"data/uc/{table}/" for table in restricted_tables]
    context.analytical_test_data_s3_location["paths"] = restricted_paths

    for table in restricted_tables:
        tag_map = {"pii": "true", "db": "uc", "table": table}
        context.analytical_test_data_s3_location["path"] = f"data/uc/{table}/"
        analytical_env_helper.setup_test_file_in_s3(
            context.analytical_test_data_s3_location["file_name"],
            context.analytical_test_data_s3_location["path"],
            context.published_bucket,
            context.timeout,
            tag_map,
        )
        del context.analytical_test_data_s3_location["path"]

    analytical_env_helper.assume_role_for_test(
        context.aws_acc,
        context.analytical_test_e2e_role,
        context.aws_session_timeout_seconds,
    )