From 9a26ca13e54557c0119d00b2153f571613608e1c Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 18 May 2023 16:21:23 +0800 Subject: [PATCH] Unnest `ops` API code (#3318) --- CHANGELOG.md | 1 + MANIFEST.in | 2 +- .../test_new_task.jinja | 2 +- .../docs/development/development_tips.md | 8 +- noxfiles/ci_nox.py | 2 +- scripts/create_test_data.py | 22 +-- scripts/quickstart.py | 8 +- src/fides/api/{ops => }/analytics.py | 2 +- src/fides/api/{ops => api}/__init__.py | 0 src/fides/api/{ops => }/api/deps.py | 6 +- src/fides/api/{ops/api => api/v1}/__init__.py | 0 src/fides/api/{ops => }/api/v1/api.py | 4 +- .../api/v1 => api/v1/endpoints}/__init__.py | 0 .../api/v1/endpoints/config_endpoints.py | 14 +- .../api/v1/endpoints/connection_endpoints.py | 29 ++- .../v1/endpoints/connection_type_endpoints.py | 16 +- .../v1/endpoints/consent_request_endpoints.py | 38 ++-- .../api/v1/endpoints/dataset_endpoints.py | 30 +-- .../api/v1/endpoints/drp_endpoints.py | 36 ++-- .../api/v1/endpoints/encryption_endpoints.py | 21 +-- .../identity_verification_endpoints.py | 12 +- .../v1/endpoints/manual_webhook_endpoints.py | 20 +- .../api/v1/endpoints/masking_endpoints.py | 21 +-- .../api/v1/endpoints/messaging_endpoints.py | 26 +-- .../api/v1/endpoints/oauth_endpoints.py | 30 +-- .../api/v1/endpoints/policy_endpoints.py | 26 +-- .../v1/endpoints/policy_webhook_endpoints.py | 27 ++- .../privacy_experience_config_endpoints.py | 20 +- .../endpoints/privacy_experience_endpoints.py | 20 +- .../v1/endpoints/privacy_notice_endpoints.py | 20 +- .../endpoints/privacy_preference_endpoints.py | 36 ++-- .../v1/endpoints/privacy_request_endpoints.py | 79 ++++---- .../v1/endpoints/registration_endpoints.py | 12 +- .../api/v1/endpoints/saas_config_endpoints.py | 30 +-- .../api/v1/endpoints/storage_endpoints.py | 40 ++-- .../api/v1/endpoints/user_endpoints.py | 36 ++-- .../v1/endpoints/user_permission_endpoints.py | 24 +-- .../api/{ops => }/api/v1/endpoints/utils.py | 0 .../{ops => }/api/v1/exception_handlers.py | 2 +- .../api/{ops => }/api/v1/scope_registry.py | 0 .../api/{ops => }/api/v1/urn_registry.py | 0 src/fides/api/app_setup.py | 23 +-- src/fides/api/{ops => }/common_exceptions.py | 2 +- .../v1/endpoints => cryptography}/__init__.py | 0 .../cryptography/cryptographic_util.py | 0 .../schemas}/__init__.py | 0 .../api/{ops => }/cryptography/schemas/jwt.py | 0 src/fides/api/ctl/database/crud.py | 2 +- src/fides/api/ctl/database/database.py | 2 +- src/fides/api/ctl/database/samples.py | 2 +- src/fides/api/ctl/database/seed.py | 34 ++-- src/fides/api/ctl/database/session.py | 2 +- ...8b7082_update_fideslang_data_categories.py | 4 +- ...a_add_config_set_column_to_application_.py | 2 +- src/fides/api/ctl/routes/admin.py | 4 +- src/fides/api/ctl/routes/generate.py | 4 +- src/fides/api/ctl/routes/health.py | 10 +- src/fides/api/ctl/routes/router_factory.py | 6 +- src/fides/api/ctl/routes/system.py | 30 +-- src/fides/api/ctl/routes/util.py | 14 +- src/fides/api/ctl/routes/validate.py | 4 +- src/fides/api/ctl/sql_models.py | 12 +- src/fides/api/ctl/view.py | 4 +- .../cryptography/schemas => db}/__init__.py | 0 src/fides/api/db/base.py | 31 +++ src/fides/api/{ops => }/db/base_class.py | 4 +- src/fides/api/{ops => }/db/session.py | 2 +- .../api/{ops => }/email_templates/__init__.py | 0 .../email_templates/get_email_template.py | 6 +- .../email_templates/template_names.py | 0 .../consent_request_email_fulfillment.html | 0 .../consent_request_verification.html | 0 .../message_request_email_fulfillment.html | 0 .../privacy_request_complete_access.html | 0 .../privacy_request_complete_deletion.html | 0 .../privacy_request_error_notification.html | 0 .../templates/privacy_request_receipt.html | 0 .../privacy_request_review_approve.html | 0 .../privacy_request_review_deny.html | 0 .../subject_identity_verification.html | 0 .../templates/test_message.html | 0 src/fides/api/{ops/db => graph}/__init__.py | 0 .../api/{ops => }/graph/analytics_events.py | 16 +- src/fides/api/{ops => }/graph/config.py | 8 +- src/fides/api/{ops => }/graph/data_type.py | 0 src/fides/api/{ops => }/graph/graph.py | 4 +- .../api/{ops => }/graph/graph_differences.py | 8 +- src/fides/api/{ops => }/graph/traversal.py | 10 +- src/fides/api/main.py | 18 +- .../api/{ops/graph => models}/__init__.py | 0 .../{ops => }/models/application_config.py | 2 +- src/fides/api/{ops => }/models/audit_log.py | 2 +- .../models/authentication_request.py | 2 +- src/fides/api/{ops => }/models/client.py | 10 +- .../api/{ops => }/models/connectionconfig.py | 11 +- .../models/custom_connector_template.py | 2 +- .../api/{ops => }/models/datasetconfig.py | 12 +- src/fides/api/{ops => }/models/fides_user.py | 12 +- .../models/fides_user_permissions.py | 6 +- .../api/{ops => }/models/manual_webhook.py | 6 +- src/fides/api/{ops => }/models/messaging.py | 10 +- src/fides/api/{ops => }/models/policy.py | 19 +- .../{ops => }/models/privacy_experience.py | 8 +- .../api/{ops => }/models/privacy_notice.py | 4 +- .../{ops => }/models/privacy_preference.py | 8 +- .../api/{ops => }/models/privacy_request.py | 48 ++--- .../api/{ops => }/models/registration.py | 2 +- src/fides/api/{ops => }/models/storage.py | 12 +- .../api/{ops => }/models/system_manager.py | 2 +- .../api/{ops/models => oauth}/__init__.py | 0 src/fides/api/{ops => }/oauth/jwt.py | 0 src/fides/api/{ops => }/oauth/roles.py | 2 +- .../api/{ops => }/oauth/system_manager.py | 2 +- src/fides/api/{ops => }/oauth/utils.py | 20 +- src/fides/api/ops/db/base.py | 31 --- src/fides/api/ops/util/encryption/__init__.py | 0 src/fides/api/{ops => }/schemas/__init__.py | 0 src/fides/api/{ops => }/schemas/analytics.py | 0 src/fides/api/{ops => }/schemas/api.py | 0 .../{ops => }/schemas/application_config.py | 4 +- src/fides/api/{ops => }/schemas/base_class.py | 0 src/fides/api/{ops => }/schemas/client.py | 2 +- .../connection_configuration/__init__.py | 66 +++---- .../connection_config.py | 8 +- .../connection_secrets.py | 4 +- .../connection_secrets_attentive.py | 4 +- .../connection_secrets_bigquery.py | 4 +- .../connection_secrets_dynamodb.py | 4 +- .../connection_secrets_email.py | 2 +- .../connection_secrets_fides.py | 4 +- .../connection_secrets_manual_webhook.py | 2 +- .../connection_secrets_mariadb.py | 4 +- .../connection_secrets_mongodb.py | 4 +- .../connection_secrets_mssql.py | 4 +- .../connection_secrets_mysql.py | 4 +- .../connection_secrets_postgres.py | 4 +- .../connection_secrets_redshift.py | 4 +- .../connection_secrets_saas.py | 8 +- .../connection_secrets_snowflake.py | 4 +- .../connection_secrets_sovrn.py | 4 +- .../connection_secrets_timescale.py | 4 +- .../connections_secrets_https.py | 4 +- src/fides/api/{ops => }/schemas/dataset.py | 10 +- .../{ops => }/schemas/drp_privacy_request.py | 4 +- .../{ops => }/schemas/encryption_request.py | 4 +- .../api/{ops => }/schemas/external_https.py | 2 +- .../schemas/identity_verification.py | 2 +- .../oauth => schemas/limiter}/__init__.py | 0 .../schemas/limiter/rate_limit_config.py | 0 .../schemas/manual_webhook_schemas.py | 6 +- .../limiter => schemas/masking}/__init__.py | 0 .../{ops => }/schemas/masking/masking_api.py | 2 +- .../schemas/masking/masking_configuration.py | 0 .../schemas/masking/masking_secrets.py | 0 .../masking/masking_strategy_description.py | 0 .../masking => schemas/messaging}/__init__.py | 0 .../{ops => }/schemas/messaging/messaging.py | 8 +- .../messaging/messaging_secrets_docs_only.py | 4 +- src/fides/api/{ops => }/schemas/msg.py | 0 src/fides/api/{ops => }/schemas/oauth.py | 2 +- src/fides/api/{ops => }/schemas/policy.py | 8 +- .../api/{ops => }/schemas/policy_webhooks.py | 6 +- .../{ops => }/schemas/privacy_experience.py | 10 +- .../api/{ops => }/schemas/privacy_notice.py | 4 +- .../{ops => }/schemas/privacy_preference.py | 20 +- .../api/{ops => }/schemas/privacy_request.py | 20 +- .../api/{ops => }/schemas/redis_cache.py | 2 +- .../api/{ops => }/schemas/registration.py | 2 +- .../messaging => schemas/saas}/__init__.py | 0 .../schemas/saas/connector_template.py | 7 +- .../api/{ops => }/schemas/saas/saas_config.py | 12 +- .../{ops => }/schemas/saas/shared_schemas.py | 0 .../schemas/saas/strategy_configuration.py | 7 +- .../saas => schemas/storage}/__init__.py | 0 .../storage/data_upload_location_response.py | 0 .../api/{ops => }/schemas/storage/storage.py | 2 +- .../storage/storage_secrets_docs_only.py | 4 +- .../third_party}/__init__.py | 0 src/fides/api/{ops => }/schemas/user.py | 6 +- .../api/{ops => }/schemas/user_permission.py | 6 +- .../third_party => service}/__init__.py | 0 .../api/{ops => }/service/_verification.py | 10 +- .../service/authentication/__init__.py | 2 +- .../authentication/authentication_strategy.py | 4 +- .../authentication_strategy_api_key.py | 14 +- .../authentication_strategy_basic.py | 8 +- .../authentication_strategy_bearer.py | 8 +- .../authentication_strategy_factory.py | 18 +- ...tion_strategy_oauth2_authorization_code.py | 12 +- .../authentication_strategy_oauth2_base.py | 18 +- ...tion_strategy_oauth2_client_credentials.py | 6 +- .../authentication_strategy_query_param.py | 10 +- .../{ops => }/service/connectors/__init__.py | 50 ++--- .../service/connectors/base_connector.py | 20 +- .../connectors/base_email_connector.py | 12 +- .../connectors/consent_email_connector.py | 32 ++-- .../service/connectors/dynamodb_connector.py | 23 +-- .../connectors/email}/__init__.py | 0 .../connectors/email/attentive_connector.py | 2 +- .../connectors/email/sovrn_connector.py | 4 +- .../connectors/erasure_email_connector.py | 20 +- .../connectors/fides}/__init__.py | 0 .../service/connectors/fides/fides_client.py | 18 +- .../service/connectors/fides_connector.py | 20 +- .../service/connectors/http_connector.py | 18 +- .../connectors/limiter}/__init__.py | 0 .../connectors/limiter/rate_limiter.py | 4 +- .../service/connectors/manual_connector.py | 14 +- .../connectors/manual_webhook_connector.py | 12 +- .../service/connectors/mongodb_connector.py | 20 +- .../service/connectors/query_config.py | 22 +-- .../connectors/saas}/__init__.py | 0 .../connectors/saas/authenticated_client.py | 14 +- .../saas/connector_registry_service.py | 20 +- .../service/connectors/saas_connector.py | 36 ++-- .../service/connectors/saas_query_config.py | 22 +-- .../service/connectors/sql_connector.py | 24 +-- .../service/connectors/timescale_connector.py | 2 +- .../saas => service/drp}/__init__.py | 0 .../service/drp/drp_fidesops_mapper.py | 11 +- .../api/{ops => }/service/masking/__init__.py | 2 +- .../masking/strategy}/__init__.py | 0 .../masking/strategy/format_preservation.py | 2 +- .../masking/strategy/masking_strategy.py | 6 +- .../strategy/masking_strategy_aes_encrypt.py | 20 +- .../strategy/masking_strategy_factory.py | 8 +- .../masking/strategy/masking_strategy_hash.py | 14 +- .../masking/strategy/masking_strategy_hmac.py | 16 +- .../strategy/masking_strategy_nullify.py | 6 +- .../masking_strategy_random_string_rewrite.py | 10 +- .../masking_strategy_string_rewrite.py | 10 +- .../messaging}/__init__.py | 0 .../messaging/message_dispatch_service.py | 16 +- .../messaging/messaging_crud_service.py | 6 +- .../service/outbound_urn_registry.py | 0 .../{ops => }/service/pagination/__init__.py | 2 +- .../service/pagination/pagination_strategy.py | 6 +- .../pagination/pagination_strategy_cursor.py | 8 +- .../pagination/pagination_strategy_factory.py | 16 +- .../pagination/pagination_strategy_link.py | 8 +- .../pagination/pagination_strategy_offset.py | 13 +- .../privacy_request}/__init__.py | 0 .../privacy_request/email_batch_service.py | 14 +- .../privacy_request/request_runner_service.py | 62 +++--- .../privacy_request/request_service.py | 18 +- .../processors}/__init__.py | 0 .../post_processor_strategy/__init__.py | 2 +- .../post_processor_strategy.py | 2 +- .../post_processor_strategy_factory.py | 12 +- .../post_processor_strategy_filter.py | 8 +- .../post_processor_strategy_unwrap.py | 4 +- .../saas_request}/__init__.py | 0 .../override_implementations/__init__.py | 0 .../authentication_strategy_adobe_campaign.py | 10 +- .../authentication_strategy_doordash.py | 8 +- ...thentication_strategy_friendbuy_nextgen.py | 10 +- .../authentication_strategy_yotpo_reviews.py | 10 +- .../domo_request_overrides.py | 14 +- .../firebase_auth_request_overrides.py | 20 +- .../friendbuy_nextgen_request_overrides.py | 12 +- .../mailchimp_request_overrides.py | 16 +- .../twilio_request_overrides.py | 14 +- .../saas_request_override_factory.py | 4 +- .../storage}/__init__.py | 0 .../storage/storage_authenticator_service.py | 4 +- .../storage/storage_uploader_service.py | 8 +- src/fides/api/{ops => }/service/strategy.py | 6 +- .../{ops/service/storage => task}/__init__.py | 0 .../task/consolidate_query_matches.py | 4 +- .../{ops => }/task/filter_element_match.py | 6 +- .../api/{ops => }/task/filter_results.py | 4 +- src/fides/api/{ops => }/task/graph_task.py | 40 ++-- .../api/{ops => }/task/refine_target_path.py | 4 +- .../api/{ops => }/task/task_resources.py | 18 +- src/fides/api/{ops => }/tasks/__init__.py | 10 +- .../{ops/task => tasks/scheduled}/__init__.py | 0 .../{ops => }/tasks/scheduled/scheduler.py | 0 src/fides/api/{ops => }/tasks/storage.py | 10 +- .../{ops/tasks/scheduled => util}/__init__.py | 0 src/fides/api/{ops => }/util/api_router.py | 0 src/fides/api/{ops => }/util/cache.py | 4 +- .../api/{ops => }/util/collection_util.py | 0 .../api/{ops => }/util/connection_type.py | 20 +- .../api/{ops => }/util/connection_util.py | 24 +-- src/fides/api/{ops => }/util/consent_util.py | 10 +- src/fides/api/{ops => }/util/constants.py | 0 src/fides/api/{ops => }/util/data_category.py | 2 +- .../{ops/util => util/encryption}/__init__.py | 0 .../encryption/aes_gcm_encryption_scheme.py | 2 +- .../util/encryption/hmac_encryption_scheme.py | 2 +- .../{ops => }/util/encryption/secrets_util.py | 4 +- src/fides/api/{ops => }/util/enums.py | 0 .../{ops => }/util/identity_verification.py | 4 +- src/fides/api/{ops => }/util/logger.py | 0 .../api/{ops => }/util/matching_queue.py | 0 src/fides/api/{ops => }/util/querytoken.py | 0 src/fides/api/{ops => }/util/saas_util.py | 17 +- .../{ops => }/util/storage_authenticator.py | 4 +- src/fides/api/{ops => }/util/storage_util.py | 6 +- .../util/system_manager_oauth_util.py | 12 +- src/fides/api/{ops => }/util/text.py | 0 src/fides/api/{ops => }/util/url_util.py | 0 src/fides/api/{ops => }/util/wrappers.py | 0 src/fides/api/{ops => }/worker/__init__.py | 4 +- src/fides/cli/commands/util.py | 2 +- src/fides/cli/utils.py | 2 +- src/fides/core/config/config_proxy.py | 4 +- src/fides/core/config/security_settings.py | 6 +- src/fides/core/user.py | 2 +- tests/conftest.py | 22 +-- tests/ctl/api/test_seed.py | 8 +- tests/ctl/cli/test_cli.py | 6 +- tests/ctl/core/test_api.py | 16 +- tests/ctl/core/test_custom_field_models.py | 2 +- tests/ctl/core/test_dataset.py | 4 +- tests/fixtures/application_fixtures.py | 54 +++--- tests/fixtures/bigquery_fixtures.py | 8 +- tests/fixtures/dynamodb_fixtures.py | 6 +- tests/fixtures/email_fixtures.py | 8 +- .../fides_connector_example_fixtures.py | 6 +- tests/fixtures/integration_fixtures.py | 4 +- tests/fixtures/manual_fixtures.py | 4 +- tests/fixtures/manual_webhook_fixtures.py | 4 +- tests/fixtures/mariadb_fixtures.py | 8 +- tests/fixtures/mongodb_fixtures.py | 6 +- tests/fixtures/mssql_fixtures.py | 8 +- tests/fixtures/mysql_fixtures.py | 8 +- tests/fixtures/postgres_fixtures.py | 12 +- tests/fixtures/redshift_fixtures.py | 6 +- .../fixtures/saas/adobe_campaign_fixtures.py | 8 +- tests/fixtures/saas/aircall_fixtures.py | 8 +- tests/fixtures/saas/amplitude_fixtures.py | 8 +- tests/fixtures/saas/auth0_fixtures.py | 10 +- tests/fixtures/saas/braintree_fixtures.py | 8 +- tests/fixtures/saas/braze_fixtures.py | 10 +- .../saas/connection_template_fixtures.py | 10 +- tests/fixtures/saas/datadog_fixtures.py | 8 +- tests/fixtures/saas/delighted_fixtures.py | 8 +- tests/fixtures/saas/domo_fixtures.py | 10 +- tests/fixtures/saas/firebase_auth_fixtures.py | 12 +- tests/fixtures/saas/friendbuy_fixtures.py | 10 +- .../saas/friendbuy_nextgen_fixtures.py | 10 +- tests/fixtures/saas/fullstory_fixtures.py | 8 +- .../saas/google_analytics_fixtures.py | 8 +- tests/fixtures/saas/gorgias_fixtures.py | 8 +- tests/fixtures/saas/hubspot_fixtures.py | 8 +- tests/fixtures/saas/jira_fixtures.py | 8 +- tests/fixtures/saas/klaviyo_fixtures.py | 8 +- tests/fixtures/saas/kustomer_fixtures.py | 8 +- tests/fixtures/saas/mailchimp_fixtures.py | 14 +- .../saas/mailchimp_override_fixtures.py | 14 +- .../saas/mailchimp_transactional_fixtures.py | 14 +- tests/fixtures/saas/outreach_fixtures.py | 10 +- tests/fixtures/saas/recharge_fixtures.py | 8 +- tests/fixtures/saas/rollbar_fixtures.py | 10 +- tests/fixtures/saas/salesforce_fixtures.py | 10 +- tests/fixtures/saas/segment_fixtures.py | 8 +- tests/fixtures/saas/sendgrid_fixtures.py | 10 +- tests/fixtures/saas/sentry_fixtures.py | 8 +- tests/fixtures/saas/shippo_fixtures.py | 8 +- tests/fixtures/saas/shopify_fixtures.py | 10 +- .../saas/slack_enterprise_fixtures.py | 8 +- tests/fixtures/saas/square_fixtures.py | 10 +- tests/fixtures/saas/stripe_fixtures.py | 10 +- .../planet_express_functions.py | 22 +-- .../saas/twilio_conversations_fixtures.py | 10 +- tests/fixtures/saas/unbounce_fixtures.py | 8 +- .../saas/universal_analytics_fixtures.py | 8 +- tests/fixtures/saas/vend_fixtures.py | 8 +- tests/fixtures/saas/wunderkind_fixtures.py | 8 +- tests/fixtures/saas/yotpo_loyalty_fixtures.py | 8 +- tests/fixtures/saas/zendesk_fixtures.py | 2 +- tests/fixtures/saas_erasure_order_fixtures.py | 6 +- tests/fixtures/saas_example_fixtures.py | 22 +-- tests/fixtures/snowflake_fixtures.py | 6 +- tests/fixtures/timescale_fixtures.py | 6 +- tests/lib/conftest.py | 4 +- tests/lib/test_client_model.py | 12 +- tests/lib/test_cryptography_util.py | 2 +- tests/lib/test_db_base_class.py | 4 +- tests/lib/test_fides_user.py | 2 +- tests/lib/test_oauth_schemas_user.py | 4 +- tests/lib/test_oauth_util.py | 14 +- tests/lib/test_schema_base_class.py | 2 +- tests/lib/test_session.py | 2 +- tests/lib/test_system_oauth_util.py | 12 +- tests/ops/api/test_deps.py | 8 +- tests/ops/api/test_ratelimit.py | 2 +- .../api/v1/endpoints/test_config_endpoints.py | 10 +- .../test_connection_config_endpoints.py | 20 +- .../test_connection_template_endpoints.py | 18 +- .../test_consent_request_endpoints.py | 50 ++--- .../v1/endpoints/test_dataset_endpoints.py | 18 +- .../api/v1/endpoints/test_drp_endpoints.py | 23 +-- .../v1/endpoints/test_encryption_endpoints.py | 16 +- .../api/v1/endpoints/test_health_endpoints.py | 2 +- .../test_identity_verification_endpoints.py | 4 +- .../api/v1/endpoints/test_manual_webhooks.py | 6 +- .../v1/endpoints/test_masking_endpoints.py | 26 ++- .../v1/endpoints/test_messaging_endpoints.py | 18 +- .../api/v1/endpoints/test_oauth_endpoints.py | 22 +-- .../api/v1/endpoints/test_policy_endpoints.py | 23 +-- .../test_policy_webhook_endpoints.py | 8 +- ...est_privacy_experience_config_endpoints.py | 10 +- .../test_privacy_experience_endpoints.py | 4 +- .../test_privacy_notice_endpoints.py | 14 +- .../test_privacy_preference_endpoints.py | 40 ++-- .../test_privacy_request_endpoints.py | 178 +++++++++--------- .../endpoints/test_registration_endpoints.py | 16 +- .../endpoints/test_saas_config_endpoints.py | 10 +- .../v1/endpoints/test_storage_endpoints.py | 32 ++-- tests/ops/api/v1/endpoints/test_system.py | 4 +- .../api/v1/endpoints/test_user_endpoints.py | 22 +-- .../test_user_permission_endpoints.py | 12 +- tests/ops/api/v1/test_exception_handlers.py | 4 +- tests/ops/api/v1/test_main.py | 2 +- tests/ops/api/v1/test_utils.py | 4 +- tests/ops/conftest.py | 6 +- .../test_get_email_template.py | 6 +- tests/ops/generator/sql_data_generator.py | 6 +- tests/ops/generator/test_data_generator.py | 6 +- tests/ops/graph/graph_test_util.py | 24 +-- tests/ops/graph/test_config.py | 6 +- tests/ops/graph/test_data_types.py | 2 +- tests/ops/graph/test_edge.py | 4 +- tests/ops/graph/test_graph.py | 10 +- .../ops/graph/test_graph_analytics_events.py | 4 +- tests/ops/graph/test_graph_differences.py | 18 +- tests/ops/graph/test_graph_traversal.py | 2 +- tests/ops/graph/test_traversal_node.py | 2 +- .../limiter/test_rate_limiter.py | 18 +- .../saas/connector_runner.py | 28 +-- .../test_firebase_auth_task.py | 12 +- .../test_mailchimp_override_task.py | 10 +- .../saas/test_adobe_campaign_task.py | 12 +- .../saas/test_aircall_task.py | 12 +- .../saas/test_amplitude_task.py | 12 +- .../integration_tests/saas/test_auth0_task.py | 12 +- .../saas/test_braintree_task.py | 12 +- .../integration_tests/saas/test_braze_task.py | 12 +- .../saas/test_datadog_task.py | 10 +- .../saas/test_delighted_task.py | 12 +- .../integration_tests/saas/test_domo_task.py | 12 +- .../saas/test_doordash_task.py | 2 +- .../saas/test_friendbuy_nextgen_task.py | 12 +- .../saas/test_friendbuy_task.py | 12 +- .../saas/test_fullstory_task.py | 12 +- .../saas/test_google_analytics_task.py | 24 +-- .../saas/test_gorgias_task.py | 12 +- .../saas/test_hubspot_task.py | 14 +- .../integration_tests/saas/test_jira_task.py | 12 +- .../saas/test_klaviyo_task.py | 12 +- .../saas/test_kustomer_task.py | 12 +- .../saas/test_mailchimp_task.py | 12 +- .../saas/test_mailchimp_transactional_task.py | 24 +-- .../saas/test_onesignal_task.py | 2 +- .../saas/test_outreach_task.py | 14 +- .../saas/test_recharge_tasks.py | 12 +- .../saas/test_rollbar_task.py | 12 +- .../saas/test_salesforce_task.py | 12 +- .../saas/test_segment_task.py | 14 +- .../saas/test_sendgrid_task.py | 12 +- .../saas/test_sentry_task.py | 14 +- .../saas/test_shippo_task.py | 10 +- .../saas/test_shopify_task.py | 12 +- .../saas/test_slack_enterprise_task.py | 10 +- .../saas/test_square_task.py | 12 +- .../saas/test_stripe_task.py | 14 +- .../saas/test_twilio_conversations_task.py | 12 +- .../saas/test_unbounce_task.py | 12 +- .../saas/test_universal_analytics_task.py | 24 +-- .../integration_tests/saas/test_vend_task.py | 12 +- .../saas/test_wunderkind_task.py | 20 +- .../saas/test_yotpo_loyalty_task.py | 12 +- .../saas/test_yotpo_reviews_task.py | 2 +- .../saas/test_zendesk_task.py | 2 +- .../setup_scripts/mariadb_setup.py | 6 +- .../setup_scripts/postgres_setup.py | 6 +- .../setup_scripts/timescale_setup.py | 6 +- ...st_connection_configuration_integration.py | 18 +- tests/ops/integration_tests/test_execution.py | 30 ++- .../test_external_database_connections.py | 9 +- .../test_integration_email.py | 34 ++-- .../test_integration_erasure_order.py | 26 ++- .../ops/integration_tests/test_manual_task.py | 10 +- .../ops/integration_tests/test_mongo_task.py | 35 ++-- tests/ops/integration_tests/test_sql_task.py | 36 ++-- tests/ops/models/test_application_config.py | 2 +- tests/ops/models/test_base.py | 8 +- tests/ops/models/test_client.py | 6 +- tests/ops/models/test_connectionconfig.py | 8 +- tests/ops/models/test_consent_request.py | 20 +- .../models/test_custom_connector_template.py | 2 +- tests/ops/models/test_datasetconfig.py | 4 +- tests/ops/models/test_fidesopsuser.py | 2 +- tests/ops/models/test_fidesuserpermissions.py | 6 +- tests/ops/models/test_manual_webhook.py | 2 +- tests/ops/models/test_policy.py | 18 +- tests/ops/models/test_policy_webhooks.py | 4 +- tests/ops/models/test_privacy_experience.py | 6 +- tests/ops/models/test_privacy_notice.py | 4 +- tests/ops/models/test_privacy_preference.py | 10 +- tests/ops/models/test_privacy_request.py | 16 +- tests/ops/models/test_saasconfig.py | 8 +- tests/ops/models/test_storage.py | 8 +- tests/ops/models/test_systemmanager.py | 4 +- .../test_connection_secrets_saas.py | 4 +- .../test_email_schemas.py | 10 +- .../schemas/limiter/test_rate_limit_config.py | 2 +- tests/ops/schemas/messaging/messaging_test.py | 4 +- tests/ops/schemas/test_user_permission.py | 6 +- .../test_authentication_strategy_api_key.py | 8 +- .../test_authentication_strategy_basic.py | 8 +- .../test_authentication_strategy_bearer.py | 6 +- .../test_authentication_strategy_factory.py | 8 +- ...tion_strategy_oauth2_authorization_code.py | 32 ++-- ...tion_strategy_oauth2_client_credentials.py | 34 ++-- ...est_authentication_strategy_query_param.py | 6 +- .../connection_config/test_http_connector.py | 4 +- .../test_mariadb_connector.py | 2 +- .../connection_config/test_mysql_connector.py | 2 +- .../test_postgres_connector.py | 4 +- .../connectors/fides/test_fides_client.py | 4 +- .../saas/test_authenticated_client.py | 15 +- .../test_connector_registry_service.py | 20 +- .../test_connector_template_loaders.py | 50 +++-- .../test_consent_email_connector.py | 38 ++-- .../test_erasure_email_connector.py | 22 +-- .../connectors/test_fides_connector.py | 16 +- .../service/connectors/test_queryconfig.py | 22 +-- .../service/connectors/test_saas_connector.py | 36 ++-- .../connectors/test_saas_queryconfig.py | 22 +-- .../test_masking_strategy_aes_encrypt.py | 14 +- .../strategy/test_masking_strategy_factory.py | 12 +- .../strategy/test_masking_strategy_hash.py | 8 +- .../strategy/test_masking_strategy_hmac.py | 8 +- .../strategy/test_masking_strategy_null.py | 4 +- ..._masking_strategy_random_string_rewrite.py | 4 +- .../test_masking_strategy_string_rewrite.py | 4 +- .../message_dispatch_service_test.py | 50 +++-- .../test_pagination_strategy_cursor.py | 8 +- .../test_pagination_strategy_factory.py | 12 +- .../test_pagination_strategy_link.py | 10 +- .../test_pagination_strategy_offset.py | 12 +- .../privacy_request/test_email_batch_send.py | 88 +++++---- .../test_request_runner_service.py | 168 +++++++---------- .../privacy_request/test_request_service.py | 8 +- .../test_post_processor_strategy_factory.py | 8 +- .../test_post_processor_strategy_filter.py | 6 +- .../test_post_processor_strategy_unwrap.py | 4 +- .../test_saas_request_override_factory.py | 16 +- .../service/storage_uploader_service_test.py | 22 +-- tests/ops/service/test_strategy_retrieval.py | 6 +- .../task/test_consolidate_query_matches.py | 4 +- tests/ops/task/test_filter_element_match.py | 6 +- tests/ops/task/test_filter_results.py | 4 +- tests/ops/task/test_graph_task.py | 22 +-- tests/ops/task/test_refine_target_path.py | 6 +- tests/ops/task/test_task_resources.py | 2 +- tests/ops/task/traversal_data.py | 10 +- tests/ops/tasks/test_celery.py | 2 +- tests/ops/tasks/test_scheduled.py | 8 +- .../ops/test_helpers/cache_secrets_helper.py | 8 +- tests/ops/test_helpers/dataset_utils.py | 10 +- tests/ops/test_helpers/vault_client.py | 2 +- .../test_aes_gcm_encryption_scheme.py | 4 +- .../encryption/test_hmac_encryption_scheme.py | 4 +- .../ops/util/encryption/test_secrets_util.py | 10 +- tests/ops/util/test_api_router.py | 6 +- tests/ops/util/test_cache.py | 2 +- tests/ops/util/test_collection_util.py | 2 +- tests/ops/util/test_connection_type.py | 10 +- tests/ops/util/test_consent_util.py | 4 +- tests/ops/util/test_dataset_yaml.py | 6 +- tests/ops/util/test_jwt_util.py | 6 +- tests/ops/util/test_logger.py | 2 +- tests/ops/util/test_matching_queue.py | 2 +- tests/ops/util/test_oauth_util.py | 4 +- tests/ops/util/test_saas_util.py | 6 +- tests/ops/util/test_storage_authenticator.py | 10 +- tests/ops/util/test_storage_util.py | 4 +- 581 files changed, 2900 insertions(+), 3198 deletions(-) rename src/fides/api/{ops => }/analytics.py (96%) rename src/fides/api/{ops => api}/__init__.py (100%) rename src/fides/api/{ops => }/api/deps.py (87%) rename src/fides/api/{ops/api => api/v1}/__init__.py (100%) rename src/fides/api/{ops => }/api/v1/api.py (95%) rename src/fides/api/{ops/api/v1 => api/v1/endpoints}/__init__.py (100%) rename src/fides/api/{ops => }/api/v1/endpoints/config_endpoints.py (86%) rename src/fides/api/{ops => }/api/v1/endpoints/connection_endpoints.py (92%) rename src/fides/api/{ops => }/api/v1/endpoints/connection_type_endpoints.py (85%) rename src/fides/api/{ops => }/api/v1/endpoints/consent_request_endpoints.py (95%) rename src/fides/api/{ops => }/api/v1/endpoints/dataset_endpoints.py (96%) rename src/fides/api/{ops => }/api/v1/endpoints/drp_endpoints.py (86%) rename src/fides/api/{ops => }/api/v1/endpoints/encryption_endpoints.py (77%) rename src/fides/api/{ops => }/api/v1/endpoints/identity_verification_endpoints.py (74%) rename src/fides/api/{ops => }/api/v1/endpoints/manual_webhook_endpoints.py (91%) rename src/fides/api/{ops => }/api/v1/endpoints/masking_endpoints.py (78%) rename src/fides/api/{ops => }/api/v1/endpoints/messaging_endpoints.py (95%) rename src/fides/api/{ops => }/api/v1/endpoints/oauth_endpoints.py (88%) rename src/fides/api/{ops => }/api/v1/endpoints/policy_endpoints.py (96%) rename src/fides/api/{ops => }/api/v1/endpoints/policy_webhook_endpoints.py (95%) rename src/fides/api/{ops => }/api/v1/endpoints/privacy_experience_config_endpoints.py (95%) rename src/fides/api/{ops => }/api/v1/endpoints/privacy_experience_endpoints.py (89%) rename src/fides/api/{ops => }/api/v1/endpoints/privacy_notice_endpoints.py (96%) rename src/fides/api/{ops => }/api/v1/endpoints/privacy_preference_endpoints.py (95%) rename src/fides/api/{ops => }/api/v1/endpoints/privacy_request_endpoints.py (96%) rename src/fides/api/{ops => }/api/v1/endpoints/registration_endpoints.py (87%) rename src/fides/api/{ops => }/api/v1/endpoints/saas_config_endpoints.py (92%) rename src/fides/api/{ops => }/api/v1/endpoints/storage_endpoints.py (94%) rename src/fides/api/{ops => }/api/v1/endpoints/user_endpoints.py (95%) rename src/fides/api/{ops => }/api/v1/endpoints/user_permission_endpoints.py (89%) rename src/fides/api/{ops => }/api/v1/endpoints/utils.py (100%) rename src/fides/api/{ops => }/api/v1/exception_handlers.py (90%) rename src/fides/api/{ops => }/api/v1/scope_registry.py (100%) rename src/fides/api/{ops => }/api/v1/urn_registry.py (100%) rename src/fides/api/{ops => }/common_exceptions.py (99%) rename src/fides/api/{ops/api/v1/endpoints => cryptography}/__init__.py (100%) rename src/fides/api/{ops => }/cryptography/cryptographic_util.py (100%) rename src/fides/api/{ops/cryptography => cryptography/schemas}/__init__.py (100%) rename src/fides/api/{ops => }/cryptography/schemas/jwt.py (100%) rename src/fides/api/{ops/cryptography/schemas => db}/__init__.py (100%) create mode 100644 src/fides/api/db/base.py rename src/fides/api/{ops => }/db/base_class.py (98%) rename src/fides/api/{ops => }/db/session.py (97%) rename src/fides/api/{ops => }/email_templates/__init__.py (100%) rename src/fides/api/{ops => }/email_templates/get_email_template.py (93%) rename src/fides/api/{ops => }/email_templates/template_names.py (100%) rename src/fides/api/{ops => }/email_templates/templates/consent_request_email_fulfillment.html (100%) rename src/fides/api/{ops => }/email_templates/templates/consent_request_verification.html (100%) rename src/fides/api/{ops => }/email_templates/templates/message_request_email_fulfillment.html (100%) rename src/fides/api/{ops => }/email_templates/templates/privacy_request_complete_access.html (100%) rename src/fides/api/{ops => }/email_templates/templates/privacy_request_complete_deletion.html (100%) rename src/fides/api/{ops => }/email_templates/templates/privacy_request_error_notification.html (100%) rename src/fides/api/{ops => }/email_templates/templates/privacy_request_receipt.html (100%) rename src/fides/api/{ops => }/email_templates/templates/privacy_request_review_approve.html (100%) rename src/fides/api/{ops => }/email_templates/templates/privacy_request_review_deny.html (100%) rename src/fides/api/{ops => }/email_templates/templates/subject_identity_verification.html (100%) rename src/fides/api/{ops => }/email_templates/templates/test_message.html (100%) rename src/fides/api/{ops/db => graph}/__init__.py (100%) rename src/fides/api/{ops => }/graph/analytics_events.py (87%) rename src/fides/api/{ops => }/graph/config.py (98%) rename src/fides/api/{ops => }/graph/data_type.py (100%) rename src/fides/api/{ops => }/graph/graph.py (98%) rename src/fides/api/{ops => }/graph/graph_differences.py (97%) rename src/fides/api/{ops => }/graph/traversal.py (98%) rename src/fides/api/{ops/graph => models}/__init__.py (100%) rename src/fides/api/{ops => }/models/application_config.py (99%) rename src/fides/api/{ops => }/models/audit_log.py (93%) rename src/fides/api/{ops => }/models/authentication_request.py (96%) rename src/fides/api/{ops => }/models/client.py (95%) rename src/fides/api/{ops => }/models/connectionconfig.py (97%) rename src/fides/api/{ops => }/models/custom_connector_template.py (95%) rename src/fides/api/{ops => }/models/datasetconfig.py (97%) rename src/fides/api/{ops => }/models/fides_user.py (93%) rename src/fides/api/{ops => }/models/fides_user_permissions.py (83%) rename src/fides/api/{ops => }/models/manual_webhook.py (94%) rename src/fides/api/{ops => }/models/messaging.py (95%) rename src/fides/api/{ops => }/models/policy.py (98%) rename src/fides/api/{ops => }/models/privacy_experience.py (99%) rename src/fides/api/{ops => }/models/privacy_notice.py (99%) rename src/fides/api/{ops => }/models/privacy_preference.py (98%) rename src/fides/api/{ops => }/models/privacy_request.py (96%) rename src/fides/api/{ops => }/models/registration.py (97%) rename src/fides/api/{ops => }/models/storage.py (94%) rename src/fides/api/{ops => }/models/system_manager.py (91%) rename src/fides/api/{ops/models => oauth}/__init__.py (100%) rename src/fides/api/{ops => }/oauth/jwt.py (100%) rename src/fides/api/{ops => }/oauth/roles.py (98%) rename src/fides/api/{ops => }/oauth/system_manager.py (72%) rename src/fides/api/{ops => }/oauth/utils.py (94%) delete mode 100644 src/fides/api/ops/db/base.py delete mode 100644 src/fides/api/ops/util/encryption/__init__.py rename src/fides/api/{ops => }/schemas/__init__.py (100%) rename src/fides/api/{ops => }/schemas/analytics.py (100%) rename src/fides/api/{ops => }/schemas/api.py (100%) rename src/fides/api/{ops => }/schemas/application_config.py (95%) rename src/fides/api/{ops => }/schemas/base_class.py (100%) rename src/fides/api/{ops => }/schemas/client.py (70%) rename src/fides/api/{ops => }/schemas/connection_configuration/__init__.py (57%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_config.py (92%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets.py (94%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_attentive.py (85%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_bigquery.py (87%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_dynamodb.py (78%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_email.py (97%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_fides.py (78%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_manual_webhook.py (76%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_mariadb.py (80%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_mongodb.py (78%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_mssql.py (82%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_mysql.py (80%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_postgres.py (81%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_redshift.py (81%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_saas.py (96%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_snowflake.py (85%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_sovrn.py (89%) rename src/fides/api/{ops => }/schemas/connection_configuration/connection_secrets_timescale.py (68%) rename src/fides/api/{ops => }/schemas/connection_configuration/connections_secrets_https.py (73%) rename src/fides/api/{ops => }/schemas/dataset.py (93%) rename src/fides/api/{ops => }/schemas/drp_privacy_request.py (94%) rename src/fides/api/{ops => }/schemas/encryption_request.py (90%) rename src/fides/api/{ops => }/schemas/external_https.py (94%) rename src/fides/api/{ops => }/schemas/identity_verification.py (77%) rename src/fides/api/{ops/oauth => schemas/limiter}/__init__.py (100%) rename src/fides/api/{ops => }/schemas/limiter/rate_limit_config.py (100%) rename src/fides/api/{ops => }/schemas/manual_webhook_schemas.py (95%) rename src/fides/api/{ops/schemas/limiter => schemas/masking}/__init__.py (100%) rename src/fides/api/{ops => }/schemas/masking/masking_api.py (95%) rename src/fides/api/{ops => }/schemas/masking/masking_configuration.py (100%) rename src/fides/api/{ops => }/schemas/masking/masking_secrets.py (100%) rename src/fides/api/{ops => }/schemas/masking/masking_strategy_description.py (100%) rename src/fides/api/{ops/schemas/masking => schemas/messaging}/__init__.py (100%) rename src/fides/api/{ops => }/schemas/messaging/messaging.py (98%) rename src/fides/api/{ops => }/schemas/messaging/messaging_secrets_docs_only.py (90%) rename src/fides/api/{ops => }/schemas/msg.py (100%) rename src/fides/api/{ops => }/schemas/oauth.py (97%) rename src/fides/api/{ops => }/schemas/policy.py (93%) rename src/fides/api/{ops => }/schemas/policy_webhooks.py (91%) rename src/fides/api/{ops => }/schemas/privacy_experience.py (94%) rename src/fides/api/{ops => }/schemas/privacy_notice.py (97%) rename src/fides/api/{ops => }/schemas/privacy_preference.py (90%) rename src/fides/api/{ops => }/schemas/privacy_request.py (92%) rename src/fides/api/{ops => }/schemas/redis_cache.py (93%) rename src/fides/api/{ops => }/schemas/registration.py (90%) rename src/fides/api/{ops/schemas/messaging => schemas/saas}/__init__.py (100%) rename src/fides/api/{ops => }/schemas/saas/connector_template.py (88%) rename src/fides/api/{ops => }/schemas/saas/saas_config.py (97%) rename src/fides/api/{ops => }/schemas/saas/shared_schemas.py (100%) rename src/fides/api/{ops => }/schemas/saas/strategy_configuration.py (95%) rename src/fides/api/{ops/schemas/saas => schemas/storage}/__init__.py (100%) rename src/fides/api/{ops => }/schemas/storage/data_upload_location_response.py (100%) rename src/fides/api/{ops => }/schemas/storage/storage.py (98%) rename src/fides/api/{ops => }/schemas/storage/storage_secrets_docs_only.py (58%) rename src/fides/api/{ops/schemas/storage => schemas/third_party}/__init__.py (100%) rename src/fides/api/{ops => }/schemas/user.py (93%) rename src/fides/api/{ops => }/schemas/user_permission.py (87%) rename src/fides/api/{ops/schemas/third_party => service}/__init__.py (100%) rename src/fides/api/{ops => }/service/_verification.py (78%) rename src/fides/api/{ops => }/service/authentication/__init__.py (81%) rename src/fides/api/{ops => }/service/authentication/authentication_strategy.py (75%) rename src/fides/api/{ops => }/service/authentication/authentication_strategy_api_key.py (85%) rename src/fides/api/{ops => }/service/authentication/authentication_strategy_basic.py (80%) rename src/fides/api/{ops => }/service/authentication/authentication_strategy_bearer.py (77%) rename src/fides/api/{ops => }/service/authentication/authentication_strategy_factory.py (72%) rename src/fides/api/{ops => }/service/authentication/authentication_strategy_oauth2_authorization_code.py (91%) rename src/fides/api/{ops => }/service/authentication/authentication_strategy_oauth2_base.py (92%) rename src/fides/api/{ops => }/service/authentication/authentication_strategy_oauth2_client_credentials.py (82%) rename src/fides/api/{ops => }/service/authentication/authentication_strategy_query_param.py (77%) rename src/fides/api/{ops => }/service/connectors/__init__.py (59%) rename src/fides/api/{ops => }/service/connectors/base_connector.py (85%) rename src/fides/api/{ops => }/service/connectors/base_email_connector.py (88%) rename src/fides/api/{ops => }/service/connectors/consent_email_connector.py (93%) rename src/fides/api/{ops => }/service/connectors/dynamodb_connector.py (90%) rename src/fides/api/{ops/service => service/connectors/email}/__init__.py (100%) rename src/fides/api/{ops => }/service/connectors/email/attentive_connector.py (71%) rename src/fides/api/{ops => }/service/connectors/email/sovrn_connector.py (70%) rename src/fides/api/{ops => }/service/connectors/erasure_email_connector.py (92%) rename src/fides/api/{ops/service/connectors/email => service/connectors/fides}/__init__.py (100%) rename src/fides/api/{ops => }/service/connectors/fides/fides_client.py (95%) rename src/fides/api/{ops => }/service/connectors/fides_connector.py (90%) rename src/fides/api/{ops => }/service/connectors/http_connector.py (84%) rename src/fides/api/{ops/service/connectors/fides => service/connectors/limiter}/__init__.py (100%) rename src/fides/api/{ops => }/service/connectors/limiter/rate_limiter.py (97%) rename src/fides/api/{ops => }/service/connectors/manual_connector.py (88%) rename src/fides/api/{ops => }/service/connectors/manual_webhook_connector.py (82%) rename src/fides/api/{ops => }/service/connectors/mongodb_connector.py (88%) rename src/fides/api/{ops => }/service/connectors/query_config.py (97%) rename src/fides/api/{ops/service/connectors/limiter => service/connectors/saas}/__init__.py (100%) rename src/fides/api/{ops => }/service/connectors/saas/authenticated_client.py (94%) rename src/fides/api/{ops => }/service/connectors/saas/connector_registry_service.py (96%) rename src/fides/api/{ops => }/service/connectors/saas_connector.py (95%) rename src/fides/api/{ops => }/service/connectors/saas_query_config.py (96%) rename src/fides/api/{ops => }/service/connectors/sql_connector.py (94%) rename src/fides/api/{ops => }/service/connectors/timescale_connector.py (66%) rename src/fides/api/{ops/service/connectors/saas => service/drp}/__init__.py (100%) rename src/fides/api/{ops => }/service/drp/drp_fidesops_mapper.py (89%) rename src/fides/api/{ops => }/service/masking/__init__.py (79%) rename src/fides/api/{ops/service/drp => service/masking/strategy}/__init__.py (100%) rename src/fides/api/{ops => }/service/masking/strategy/format_preservation.py (75%) rename src/fides/api/{ops => }/service/masking/strategy/masking_strategy.py (85%) rename src/fides/api/{ops => }/service/masking/strategy/masking_strategy_aes_encrypt.py (89%) rename src/fides/api/{ops => }/service/masking/strategy/masking_strategy_factory.py (86%) rename src/fides/api/{ops => }/service/masking/strategy/masking_strategy_hash.py (90%) rename src/fides/api/{ops => }/service/masking/strategy/masking_strategy_hmac.py (87%) rename src/fides/api/{ops => }/service/masking/strategy/masking_strategy_nullify.py (84%) rename src/fides/api/{ops => }/service/masking/strategy/masking_strategy_random_string_rewrite.py (87%) rename src/fides/api/{ops => }/service/masking/strategy/masking_strategy_string_rewrite.py (87%) rename src/fides/api/{ops/service/masking/strategy => service/messaging}/__init__.py (100%) rename src/fides/api/{ops => }/service/messaging/message_dispatch_service.py (98%) rename src/fides/api/{ops => }/service/messaging/messaging_crud_service.py (92%) rename src/fides/api/{ops => }/service/outbound_urn_registry.py (100%) rename src/fides/api/{ops => }/service/pagination/__init__.py (67%) rename src/fides/api/{ops => }/service/pagination/pagination_strategy.py (79%) rename src/fides/api/{ops => }/service/pagination/pagination_strategy_cursor.py (86%) rename src/fides/api/{ops => }/service/pagination/pagination_strategy_factory.py (74%) rename src/fides/api/{ops => }/service/pagination/pagination_strategy_link.py (89%) rename src/fides/api/{ops => }/service/pagination/pagination_strategy_offset.py (90%) rename src/fides/api/{ops/service/messaging => service/privacy_request}/__init__.py (100%) rename src/fides/api/{ops => }/service/privacy_request/email_batch_service.py (91%) rename src/fides/api/{ops => }/service/privacy_request/request_runner_service.py (93%) rename src/fides/api/{ops => }/service/privacy_request/request_service.py (87%) rename src/fides/api/{ops/service/privacy_request => service/processors}/__init__.py (100%) rename src/fides/api/{ops => }/service/processors/post_processor_strategy/__init__.py (51%) rename src/fides/api/{ops => }/service/processors/post_processor_strategy/post_processor_strategy.py (87%) rename src/fides/api/{ops => }/service/processors/post_processor_strategy/post_processor_strategy_factory.py (75%) rename src/fides/api/{ops => }/service/processors/post_processor_strategy/post_processor_strategy_filter.py (94%) rename src/fides/api/{ops => }/service/processors/post_processor_strategy/post_processor_strategy_unwrap.py (93%) rename src/fides/api/{ops/service/processors => service/saas_request}/__init__.py (100%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/__init__.py (100%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/authentication_strategy_adobe_campaign.py (92%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/authentication_strategy_doordash.py (86%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/authentication_strategy_friendbuy_nextgen.py (90%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/authentication_strategy_yotpo_reviews.py (82%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/domo_request_overrides.py (76%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/firebase_auth_request_overrides.py (92%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/friendbuy_nextgen_request_overrides.py (76%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/mailchimp_request_overrides.py (86%) rename src/fides/api/{ops => }/service/saas_request/override_implementations/twilio_request_overrides.py (86%) rename src/fides/api/{ops => }/service/saas_request/saas_request_override_factory.py (98%) rename src/fides/api/{ops/service/saas_request => service/storage}/__init__.py (100%) rename src/fides/api/{ops => }/service/storage/storage_authenticator_service.py (91%) rename src/fides/api/{ops => }/service/storage/storage_uploader_service.py (92%) rename src/fides/api/{ops => }/service/strategy.py (89%) rename src/fides/api/{ops/service/storage => task}/__init__.py (100%) rename src/fides/api/{ops => }/task/consolidate_query_matches.py (93%) rename src/fides/api/{ops => }/task/filter_element_match.py (97%) rename src/fides/api/{ops => }/task/filter_results.py (98%) rename src/fides/api/{ops => }/task/graph_task.py (96%) rename src/fides/api/{ops => }/task/refine_target_path.py (98%) rename src/fides/api/{ops => }/task/task_resources.py (93%) rename src/fides/api/{ops => }/tasks/__init__.py (90%) rename src/fides/api/{ops/task => tasks/scheduled}/__init__.py (100%) rename src/fides/api/{ops => }/tasks/scheduled/scheduler.py (100%) rename src/fides/api/{ops => }/tasks/storage.py (94%) rename src/fides/api/{ops/tasks/scheduled => util}/__init__.py (100%) rename src/fides/api/{ops => }/util/api_router.py (100%) rename src/fides/api/{ops => }/util/cache.py (98%) rename src/fides/api/{ops => }/util/collection_util.py (100%) rename src/fides/api/{ops => }/util/connection_type.py (92%) rename src/fides/api/{ops => }/util/connection_util.py (90%) rename src/fides/api/{ops => }/util/consent_util.py (96%) rename src/fides/api/{ops => }/util/constants.py (100%) rename src/fides/api/{ops => }/util/data_category.py (96%) rename src/fides/api/{ops/util => util/encryption}/__init__.py (100%) rename src/fides/api/{ops => }/util/encryption/aes_gcm_encryption_scheme.py (97%) rename src/fides/api/{ops => }/util/encryption/hmac_encryption_scheme.py (95%) rename src/fides/api/{ops => }/util/encryption/secrets_util.py (94%) rename src/fides/api/{ops => }/util/enums.py (100%) rename src/fides/api/{ops => }/util/identity_verification.py (96%) rename src/fides/api/{ops => }/util/logger.py (100%) rename src/fides/api/{ops => }/util/matching_queue.py (100%) rename src/fides/api/{ops => }/util/querytoken.py (100%) rename src/fides/api/{ops => }/util/saas_util.py (96%) rename src/fides/api/{ops => }/util/storage_authenticator.py (89%) rename src/fides/api/{ops => }/util/storage_util.py (89%) rename src/fides/api/{ops => }/util/system_manager_oauth_util.py (95%) rename src/fides/api/{ops => }/util/text.py (100%) rename src/fides/api/{ops => }/util/url_util.py (100%) rename src/fides/api/{ops => }/util/wrappers.py (100%) rename src/fides/api/{ops => }/worker/__init__.py (76%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f6e029509..751cc73d35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The types of changes are: - Remove logging within the Celery creation function [#3303](https://github.com/ethyca/fides/pull/3303) - Update how generic endpoint generation works [#3304](https://github.com/ethyca/fides/pull/3304) - Restrict strack-trace logging when not in Dev mode [#3081](https://github.com/ethyca/fides/pull/3081) +- Moved all of the dirs from `fides.api.ops` into `fides.api` [#3318](https://github.com/ethyca/fides/pull/3318) ### Added diff --git a/MANIFEST.in b/MANIFEST.in index d3b6bad50b..edc1ae0ebb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -12,6 +12,6 @@ include src/fides/templates/fides_datamap_template.xlsx recursive-include src/fides/data * recursive-include src/fides/ui-build * -graft src/fides/api/ops/email_templates/templates +graft src/fides/api/email_templates/templates global-exclude *.pyc diff --git a/data/saas/saas_connector_scaffolding/test_new_task.jinja b/data/saas/saas_connector_scaffolding/test_new_task.jinja index 413d6af60c..657a21d93e 100644 --- a/data/saas/saas_connector_scaffolding/test_new_task.jinja +++ b/data/saas/saas_connector_scaffolding/test_new_task.jinja @@ -1,6 +1,6 @@ import pytest -from fides.api.ops.models.policy import Policy +from fides.api.models.policy import Policy from tests.ops.integration_tests.saas.connector_runner import ConnectorRunner diff --git a/docs/fides/docs/development/development_tips.md b/docs/fides/docs/development/development_tips.md index 2d83ecacd1..9719e06497 100644 --- a/docs/fides/docs/development/development_tips.md +++ b/docs/fides/docs/development/development_tips.md @@ -10,7 +10,7 @@ If you're looking for a general getting started guide, please see the [Overview] ### API URLs -We define API URLs for specific API versions as constants within `fides.api.ops.api.v1.urn_registry` (where `v1` can be substituted for that particular API version), then import those URLs into their specific API views. Since we are on the first version, there is no clear precedent set for overriding URLs between versions yet. The most likely change is that we'll override the `APIRouter` class instantiation with a different base path (ie. `/api/v2` instead of `/api/v1`). For example: +We define API URLs for specific API versions as constants within `fides.api.api.v1.urn_registry` (where `v1` can be substituted for that particular API version), then import those URLs into their specific API views. Since we are on the first version, there is no clear precedent set for overriding URLs between versions yet. The most likely change is that we'll override the `APIRouter` class instantiation with a different base path (ie. `/api/v2` instead of `/api/v1`). For example: ```sh PRIVACY_REQUEST = "/privacy-request" @@ -29,8 +29,8 @@ SQLAlchemy is an Object Relational Mapper, allowing us to avoid writing direct d ### Adding models -Database tables are defined with model classes. Model files should live in `src/fides/api/ops/models/`. Individual model classes must inherit from our custom base class at `fides.api.ops.db.base_class.Base` to ensure uniformity within the database. Multiple models per file are encouraged so long as they fit the same logical delineation within the project. An example model declaration is added below. For a comprehensive guide see: -You should also import your model in `src/fides/api/ops/db/base.py` so it is visible for alembic. +Database tables are defined with model classes. Model files should live in `src/fides/api/models/`. Individual model classes must inherit from our custom base class at `fides.api.db.base_class.Base` to ensure uniformity within the database. Multiple models per file are encouraged so long as they fit the same logical delineation within the project. An example model declaration is added below. For a comprehensive guide see: +You should also import your model in `src/fides/api/db/base.py` so it is visible for alembic. ```python class Book(Base): @@ -48,7 +48,7 @@ When models are added to the project, we must then add them to the database in a Once you've added database tables via project models, you're ready to read, write, and update them via Python code. Some examples of common use cases here are listed below. Official documentation is here: . -- Import our application's database session: `from fides.api.ops.db.session import get_db_session` +- Import our application's database session: `from fides.api.db.session import get_db_session` - Instantiate the database interaction object: ```python diff --git a/noxfiles/ci_nox.py b/noxfiles/ci_nox.py index cc535ad310..27390ce7a6 100644 --- a/noxfiles/ci_nox.py +++ b/noxfiles/ci_nox.py @@ -74,7 +74,7 @@ def mypy(session: nox.Session) -> None: def pylint(session: nox.Session) -> None: """Run the 'pylint' code linter.""" install_requirements(session) - command = ("pylint", "src", "noxfiles", "noxfile.py") + command = ("pylint", "src", "noxfiles", "noxfile.py", "--jobs", "0") session.run(*command) diff --git a/scripts/create_test_data.py b/scripts/create_test_data.py index ca4cf01876..a5d104db60 100644 --- a/scripts/create_test_data.py +++ b/scripts/create_test_data.py @@ -7,31 +7,31 @@ from sqlalchemy import orm from fides.api.ctl.database.database import init_db -from fides.api.ops.db.session import get_db_session -from fides.api.ops.models.audit_log import AuditLog, AuditLogAction -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_session +from fides.api.models.audit_log import AuditLog, AuditLogAction +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.policy import ActionType, Policy, Rule, RuleTarget -from fides.api.ops.models.privacy_request import ( +from fides.api.models.fides_user import FidesUser +from fides.api.models.policy import ActionType, Policy, Rule, RuleTarget +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, PrivacyRequestStatus, ) -from fides.api.ops.models.storage import StorageConfig -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.schemas.storage.storage import ( +from fides.api.models.storage import StorageConfig +from fides.api.schemas.redis_cache import Identity +from fides.api.schemas.storage.storage import ( FileNaming, ResponseFormat, StorageDetails, StorageType, ) -from fides.api.ops.util.data_category import DataCategory +from fides.api.util.data_category import DataCategory from fides.core.config import get_config CONFIG = get_config() diff --git a/scripts/quickstart.py b/scripts/quickstart.py index 4b300ecb14..ce3166c696 100644 --- a/scripts/quickstart.py +++ b/scripts/quickstart.py @@ -13,10 +13,10 @@ import yaml from loguru import logger -from fides.api.ops.api.v1 import urn_registry as ops_urls -from fides.api.ops.api.v1.scope_registry import SCOPE_REGISTRY -from fides.api.ops.models.connectionconfig import ConnectionType -from fides.api.ops.models.policy import ActionType +from fides.api.api.v1 import urn_registry as ops_urls +from fides.api.api.v1.scope_registry import SCOPE_REGISTRY +from fides.api.models.connectionconfig import ConnectionType +from fides.api.models.policy import ActionType from fides.core.config import get_config CONFIG = get_config() diff --git a/src/fides/api/ops/analytics.py b/src/fides/api/analytics.py similarity index 96% rename from src/fides/api/ops/analytics.py rename to src/fides/api/analytics.py index a07f79e2a9..eaa51cc585 100644 --- a/src/fides/api/ops/analytics.py +++ b/src/fides/api/analytics.py @@ -8,7 +8,7 @@ from loguru import logger as log from fides import __version__ as fides_version -from fides.api.ops.models.registration import UserRegistration +from fides.api.models.registration import UserRegistration from fides.core.config import CONFIG diff --git a/src/fides/api/ops/__init__.py b/src/fides/api/api/__init__.py similarity index 100% rename from src/fides/api/ops/__init__.py rename to src/fides/api/api/__init__.py diff --git a/src/fides/api/ops/api/deps.py b/src/fides/api/api/deps.py similarity index 87% rename from src/fides/api/ops/api/deps.py rename to src/fides/api/api/deps.py index d0c44e90ed..b2ff9deb8f 100644 --- a/src/fides/api/ops/api/deps.py +++ b/src/fides/api/api/deps.py @@ -3,9 +3,9 @@ from fastapi import Depends from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import FunctionalityNotConfigured -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.util.cache import get_cache as get_redis_connection +from fides.api.common_exceptions import FunctionalityNotConfigured +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.util.cache import get_cache as get_redis_connection from fides.core.config import CONFIG, FidesConfig from fides.core.config import get_config as get_app_config from fides.core.config.config_proxy import ConfigProxy diff --git a/src/fides/api/ops/api/__init__.py b/src/fides/api/api/v1/__init__.py similarity index 100% rename from src/fides/api/ops/api/__init__.py rename to src/fides/api/api/v1/__init__.py diff --git a/src/fides/api/ops/api/v1/api.py b/src/fides/api/api/v1/api.py similarity index 95% rename from src/fides/api/ops/api/v1/api.py rename to src/fides/api/api/v1/api.py index 9ace4f98d7..ed89579d88 100644 --- a/src/fides/api/ops/api/v1/api.py +++ b/src/fides/api/api/v1/api.py @@ -1,4 +1,4 @@ -from fides.api.ops.api.v1.endpoints import ( +from fides.api.api.v1.endpoints import ( config_endpoints, connection_endpoints, connection_type_endpoints, @@ -24,7 +24,7 @@ user_endpoints, user_permission_endpoints, ) -from fides.api.ops.util.api_router import APIRouter +from fides.api.util.api_router import APIRouter api_router = APIRouter() api_router.include_router(config_endpoints.router) diff --git a/src/fides/api/ops/api/v1/__init__.py b/src/fides/api/api/v1/endpoints/__init__.py similarity index 100% rename from src/fides/api/ops/api/v1/__init__.py rename to src/fides/api/api/v1/endpoints/__init__.py diff --git a/src/fides/api/ops/api/v1/endpoints/config_endpoints.py b/src/fides/api/api/v1/endpoints/config_endpoints.py similarity index 86% rename from src/fides/api/ops/api/v1/endpoints/config_endpoints.py rename to src/fides/api/api/v1/endpoints/config_endpoints.py index e058eec594..a4234b7386 100644 --- a/src/fides/api/ops/api/v1/endpoints/config_endpoints.py +++ b/src/fides/api/api/v1/endpoints/config_endpoints.py @@ -6,15 +6,15 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_200_OK -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import scope_registry as scopes -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.application_config import ( +from fides.api.api import deps +from fides.api.api.v1 import scope_registry as scopes +from fides.api.api.v1 import urn_registry as urls +from fides.api.models.application_config import ApplicationConfig +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.application_config import ( ApplicationConfig as ApplicationConfigSchema, ) -from fides.api.ops.util.api_router import APIRouter +from fides.api.util.api_router import APIRouter from fides.core.config import censor_config from fides.core.config import get_config as get_app_config diff --git a/src/fides/api/ops/api/v1/endpoints/connection_endpoints.py b/src/fides/api/api/v1/endpoints/connection_endpoints.py similarity index 92% rename from src/fides/api/ops/api/v1/endpoints/connection_endpoints.py rename to src/fides/api/api/v1/endpoints/connection_endpoints.py index eddd3ef1c6..2140515e91 100644 --- a/src/fides/api/ops/api/v1/endpoints/connection_endpoints.py +++ b/src/fides/api/api/v1/endpoints/connection_endpoints.py @@ -15,48 +15,45 @@ from sqlalchemy_utils import escape_like from starlette.status import HTTP_200_OK, HTTP_204_NO_CONTENT, HTTP_404_NOT_FOUND -from fides.api.ops.api import deps -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api import deps +from fides.api.api.v1.scope_registry import ( CONNECTION_CREATE_OR_UPDATE, CONNECTION_DELETE, CONNECTION_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( CONNECTION_BY_KEY, CONNECTION_SECRETS, CONNECTION_TEST, CONNECTIONS, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import ( - ClientUnsuccessfulException, - ConnectionException, -) -from fides.api.ops.models.connectionconfig import ( +from fides.api.common_exceptions import ClientUnsuccessfulException, ConnectionException +from fides.api.models.connectionconfig import ( ConnectionConfig, ConnectionTestStatus, ConnectionType, ) -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.connection_configuration import connection_secrets_schemas -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.connection_configuration import connection_secrets_schemas +from fides.api.schemas.connection_configuration.connection_config import ( BulkPutConnectionConfiguration, ConnectionConfigurationResponse, CreateConnectionConfigurationWithSecrets, SystemType, TestStatus, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.connection_configuration.connection_secrets import ( TestStatusMessage, ) -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.connection_util import ( +from fides.api.service.connectors import get_connector +from fides.api.util.api_router import APIRouter +from fides.api.util.connection_util import ( patch_connection_configs, requeue_requires_input_requests, validate_secrets, ) -from fides.api.ops.util.logger import Pii +from fides.api.util.logger import Pii router = APIRouter(tags=["Connections"], prefix=V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/connection_type_endpoints.py b/src/fides/api/api/v1/endpoints/connection_type_endpoints.py similarity index 85% rename from src/fides/api/ops/api/v1/endpoints/connection_type_endpoints.py rename to src/fides/api/api/v1/endpoints/connection_type_endpoints.py index 0af7ce9258..de375dc9c3 100644 --- a/src/fides/api/ops/api/v1/endpoints/connection_type_endpoints.py +++ b/src/fides/api/api/v1/endpoints/connection_type_endpoints.py @@ -6,21 +6,21 @@ from fastapi_pagination.bases import AbstractPage from starlette.status import HTTP_404_NOT_FOUND -from fides.api.ops.api.v1.scope_registry import CONNECTION_TYPE_READ -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.scope_registry import CONNECTION_TYPE_READ +from fides.api.api.v1.urn_registry import ( CONNECTION_TYPE_SECRETS, CONNECTION_TYPES, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import NoSuchConnectionTypeSecretSchemaError -from fides.api.ops.models.policy import ActionType -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.common_exceptions import NoSuchConnectionTypeSecretSchemaError +from fides.api.models.policy import ActionType +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.connection_configuration.connection_config import ( ConnectionSystemTypeMap, SystemType, ) -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.connection_type import ( +from fides.api.util.api_router import APIRouter +from fides.api.util.connection_type import ( connection_type_secret_schema, get_connection_types, ) diff --git a/src/fides/api/ops/api/v1/endpoints/consent_request_endpoints.py b/src/fides/api/api/v1/endpoints/consent_request_endpoints.py similarity index 95% rename from src/fides/api/ops/api/v1/endpoints/consent_request_endpoints.py rename to src/fides/api/api/v1/endpoints/consent_request_endpoints.py index 48172389b6..72c2b5ee0c 100644 --- a/src/fides/api/ops/api/v1/endpoints/consent_request_endpoints.py +++ b/src/fides/api/api/v1/endpoints/consent_request_endpoints.py @@ -21,37 +21,37 @@ HTTP_500_INTERNAL_SERVER_ERROR, ) -from fides.api.ctl.database.seed import DEFAULT_CONSENT_POLICY -from fides.api.ops.api.deps import get_config_proxy, get_db -from fides.api.ops.api.v1.endpoints.privacy_request_endpoints import ( +from fides.api.api.deps import get_config_proxy, get_db +from fides.api.api.v1.endpoints.privacy_request_endpoints import ( create_privacy_request_func, ) -from fides.api.ops.api.v1.endpoints.utils import validate_start_and_end_filters -from fides.api.ops.api.v1.scope_registry import CONSENT_READ -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.endpoints.utils import validate_start_and_end_filters +from fides.api.api.v1.scope_registry import CONSENT_READ +from fides.api.api.v1.urn_registry import ( CONSENT_REQUEST, CONSENT_REQUEST_PREFERENCES, CONSENT_REQUEST_PREFERENCES_WITH_ID, CONSENT_REQUEST_VERIFY, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( FunctionalityNotConfigured, IdentityVerificationException, MessageDispatchException, ) -from fides.api.ops.models.messaging import get_messaging_method -from fides.api.ops.models.privacy_request import ( +from fides.api.ctl.database.seed import DEFAULT_CONSENT_POLICY +from fides.api.models.messaging import get_messaging_method +from fides.api.models.privacy_request import ( Consent, ConsentRequest, ProvidedIdentity, ProvidedIdentityType, ) -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.messaging.messaging import MessagingMethod -from fides.api.ops.schemas.privacy_request import BulkPostPrivacyRequests -from fides.api.ops.schemas.privacy_request import Consent as ConsentSchema -from fides.api.ops.schemas.privacy_request import ( +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.messaging.messaging import MessagingMethod +from fides.api.schemas.privacy_request import BulkPostPrivacyRequests +from fides.api.schemas.privacy_request import Consent as ConsentSchema +from fides.api.schemas.privacy_request import ( ConsentPreferences, ConsentPreferencesWithVerificationCode, ConsentReport, @@ -60,13 +60,13 @@ PrivacyRequestCreate, VerificationCode, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service._verification import send_verification_code_to_user -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.consent_util import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.service._verification import send_verification_code_to_user +from fides.api.util.api_router import APIRouter +from fides.api.util.consent_util import ( get_or_create_fides_user_device_id_provided_identity, ) -from fides.api.ops.util.logger import Pii +from fides.api.util.logger import Pii from fides.core.config import CONFIG from fides.core.config.config_proxy import ConfigProxy diff --git a/src/fides/api/ops/api/v1/endpoints/dataset_endpoints.py b/src/fides/api/api/v1/endpoints/dataset_endpoints.py similarity index 96% rename from src/fides/api/ops/api/v1/endpoints/dataset_endpoints.py rename to src/fides/api/api/v1/endpoints/dataset_endpoints.py index 2ac86609d7..19e32dcd21 100644 --- a/src/fides/api/ops/api/v1/endpoints/dataset_endpoints.py +++ b/src/fides/api/api/v1/endpoints/dataset_endpoints.py @@ -22,14 +22,13 @@ HTTP_422_UNPROCESSABLE_ENTITY, ) -from fides.api.ctl.sql_models import Dataset as CtlDataset # type: ignore[attr-defined] -from fides.api.ops.api import deps -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api import deps +from fides.api.api.v1.scope_registry import ( DATASET_CREATE_OR_UPDATE, DATASET_DELETE, DATASET_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( DATASET_BY_KEY, DATASET_CONFIGS, DATASET_VALIDATE, @@ -38,22 +37,23 @@ V1_URL_PREFIX, YAML_DATASETS, ) -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( SaaSConfigNotFoundException, TraversalError, ValidationError, ) -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.graph.traversal import Traversal -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.models.datasetconfig import ( +from fides.api.ctl.sql_models import Dataset as CtlDataset # type: ignore[attr-defined] +from fides.api.graph.graph import DatasetGraph +from fides.api.graph.traversal import Traversal +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.models.datasetconfig import ( DatasetConfig, convert_dataset_to_graph, to_graph_field, ) -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.api import BulkUpdateFailed -from fides.api.ops.schemas.dataset import ( +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.api import BulkUpdateFailed +from fides.api.schemas.dataset import ( BulkPutDataset, DatasetConfigCtlDataset, DatasetConfigSchema, @@ -61,9 +61,9 @@ ValidateDatasetResponse, validate_data_categories_against_db, ) -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.data_category import get_data_categories_from_db -from fides.api.ops.util.saas_util import merge_datasets +from fides.api.util.api_router import APIRouter +from fides.api.util.data_category import get_data_categories_from_db +from fides.api.util.saas_util import merge_datasets X_YAML = "application/x-yaml" diff --git a/src/fides/api/ops/api/v1/endpoints/drp_endpoints.py b/src/fides/api/api/v1/endpoints/drp_endpoints.py similarity index 86% rename from src/fides/api/ops/api/v1/endpoints/drp_endpoints.py rename to src/fides/api/api/v1/endpoints/drp_endpoints.py index 8a1ca5b0e1..396efd49e2 100644 --- a/src/fides/api/ops/api/v1/endpoints/drp_endpoints.py +++ b/src/fides/api/api/v1/endpoints/drp_endpoints.py @@ -13,39 +13,39 @@ HTTP_500_INTERNAL_SERVER_ERROR, ) -from fides.api.ops import common_exceptions -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import scope_registry as scopes -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.api.v1.endpoints.privacy_request_endpoints import ( +from fides.api import common_exceptions +from fides.api.api import deps +from fides.api.api.v1 import scope_registry as scopes +from fides.api.api.v1 import urn_registry as urls +from fides.api.api.v1.endpoints.privacy_request_endpoints import ( get_privacy_request_or_error, ) -from fides.api.ops.models.policy import DrpAction, Policy -from fides.api.ops.models.privacy_request import PrivacyRequest, PrivacyRequestStatus -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.drp_privacy_request import ( +from fides.api.models.policy import DrpAction, Policy +from fides.api.models.privacy_request import PrivacyRequest, PrivacyRequestStatus +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.drp_privacy_request import ( DRP_VERSION, DrpDataRightsResponse, DrpIdentity, DrpPrivacyRequestCreate, DrpRevokeRequest, ) -from fides.api.ops.schemas.privacy_request import PrivacyRequestDRPStatusResponse -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.drp.drp_fidesops_mapper import DrpFidesopsMapper -from fides.api.ops.service.messaging.message_dispatch_service import ( +from fides.api.schemas.privacy_request import PrivacyRequestDRPStatusResponse +from fides.api.schemas.redis_cache import Identity +from fides.api.service.drp.drp_fidesops_mapper import DrpFidesopsMapper +from fides.api.service.messaging.message_dispatch_service import ( check_and_dispatch_error_notifications, ) -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.service.privacy_request.request_runner_service import ( queue_privacy_request, ) -from fides.api.ops.service.privacy_request.request_service import ( +from fides.api.service.privacy_request.request_service import ( build_required_privacy_request_kwargs, cache_data, ) -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.cache import FidesopsRedis -from fides.api.ops.util.logger import Pii +from fides.api.util.api_router import APIRouter +from fides.api.util.cache import FidesopsRedis +from fides.api.util.logger import Pii from fides.core.config import CONFIG from fides.core.config.config_proxy import ConfigProxy diff --git a/src/fides/api/ops/api/v1/endpoints/encryption_endpoints.py b/src/fides/api/api/v1/endpoints/encryption_endpoints.py similarity index 77% rename from src/fides/api/ops/api/v1/endpoints/encryption_endpoints.py rename to src/fides/api/api/v1/endpoints/encryption_endpoints.py index 7f4dd35be4..ca3b7d33af 100644 --- a/src/fides/api/ops/api/v1/endpoints/encryption_endpoints.py +++ b/src/fides/api/api/v1/endpoints/encryption_endpoints.py @@ -3,30 +3,27 @@ from fastapi import Security from loguru import logger -from fides.api.ops.api.v1.scope_registry import ENCRYPTION_EXEC -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.scope_registry import ENCRYPTION_EXEC +from fides.api.api.v1.urn_registry import ( DECRYPT_AES, ENCRYPT_AES, ENCRYPTION_KEY, V1_URL_PREFIX, ) -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.cryptography.cryptographic_util import ( - b64_str_to_bytes, - bytes_to_b64_str, -) -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.encryption_request import ( +from fides.api.cryptography import cryptographic_util +from fides.api.cryptography.cryptographic_util import b64_str_to_bytes, bytes_to_b64_str +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.encryption_request import ( AesDecryptionRequest, AesDecryptionResponse, AesEncryptionRequest, AesEncryptionResponse, ) -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.encryption.aes_gcm_encryption_scheme import ( +from fides.api.util.api_router import APIRouter +from fides.api.util.encryption.aes_gcm_encryption_scheme import ( decrypt as aes_gcm_decrypt, ) -from fides.api.ops.util.encryption.aes_gcm_encryption_scheme import ( +from fides.api.util.encryption.aes_gcm_encryption_scheme import ( encrypt_verify_secret_length as aes_gcm_encrypt, ) from fides.core.config import CONFIG diff --git a/src/fides/api/ops/api/v1/endpoints/identity_verification_endpoints.py b/src/fides/api/api/v1/endpoints/identity_verification_endpoints.py similarity index 74% rename from src/fides/api/ops/api/v1/endpoints/identity_verification_endpoints.py rename to src/fides/api/api/v1/endpoints/identity_verification_endpoints.py index a4920d94c3..57be4c0bf2 100644 --- a/src/fides/api/ops/api/v1/endpoints/identity_verification_endpoints.py +++ b/src/fides/api/api/v1/endpoints/identity_verification_endpoints.py @@ -3,13 +3,11 @@ from fastapi import Depends from sqlalchemy.orm import Session -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.models.messaging import MessagingConfig -from fides.api.ops.schemas.identity_verification import ( - IdentityVerificationConfigResponse, -) -from fides.api.ops.util.api_router import APIRouter +from fides.api.api import deps +from fides.api.api.v1 import urn_registry as urls +from fides.api.models.messaging import MessagingConfig +from fides.api.schemas.identity_verification import IdentityVerificationConfigResponse +from fides.api.util.api_router import APIRouter from fides.core.config.config_proxy import ConfigProxy router = APIRouter(tags=["Identity Verification"], prefix=urls.V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/manual_webhook_endpoints.py b/src/fides/api/api/v1/endpoints/manual_webhook_endpoints.py similarity index 91% rename from src/fides/api/ops/api/v1/endpoints/manual_webhook_endpoints.py rename to src/fides/api/api/v1/endpoints/manual_webhook_endpoints.py index d39aaea164..87254e463d 100644 --- a/src/fides/api/ops/api/v1/endpoints/manual_webhook_endpoints.py +++ b/src/fides/api/api/v1/endpoints/manual_webhook_endpoints.py @@ -14,27 +14,27 @@ HTTP_404_NOT_FOUND, ) -from fides.api.ops.api import deps -from fides.api.ops.api.v1.endpoints.dataset_endpoints import _get_connection_config -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api import deps +from fides.api.api.v1.endpoints.dataset_endpoints import _get_connection_config +from fides.api.api.v1.scope_registry import ( WEBHOOK_CREATE_OR_UPDATE, WEBHOOK_DELETE, WEBHOOK_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( ACCESS_MANUAL_WEBHOOK, ACCESS_MANUAL_WEBHOOKS, V1_URL_PREFIX, ) -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.models.manual_webhook import AccessManualWebhook -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.manual_webhook_schemas import ( +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.models.manual_webhook import AccessManualWebhook +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.manual_webhook_schemas import ( AccessManualWebhookResponse, AccessManualWebhooks, ) -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.logger import Pii +from fides.api.util.api_router import APIRouter +from fides.api.util.logger import Pii router = APIRouter(tags=["Manual Webhooks"], prefix=V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/masking_endpoints.py b/src/fides/api/api/v1/endpoints/masking_endpoints.py similarity index 78% rename from src/fides/api/ops/api/v1/endpoints/masking_endpoints.py rename to src/fides/api/api/v1/endpoints/masking_endpoints.py index 82df8196f4..46f3a236f4 100644 --- a/src/fides/api/ops/api/v1/endpoints/masking_endpoints.py +++ b/src/fides/api/api/v1/endpoints/masking_endpoints.py @@ -4,20 +4,17 @@ from loguru import logger from starlette.status import HTTP_400_BAD_REQUEST, HTTP_404_NOT_FOUND -from fides.api.ops.api.v1.scope_registry import MASKING_EXEC, MASKING_READ -from fides.api.ops.api.v1.urn_registry import MASKING, MASKING_STRATEGY, V1_URL_PREFIX -from fides.api.ops.common_exceptions import NoSuchStrategyException, ValidationError -from fides.api.ops.oauth.utils import verify_oauth_client_prod -from fides.api.ops.schemas.masking.masking_api import ( - MaskingAPIRequest, - MaskingAPIResponse, -) -from fides.api.ops.schemas.masking.masking_strategy_description import ( +from fides.api.api.v1.scope_registry import MASKING_EXEC, MASKING_READ +from fides.api.api.v1.urn_registry import MASKING, MASKING_STRATEGY, V1_URL_PREFIX +from fides.api.common_exceptions import NoSuchStrategyException, ValidationError +from fides.api.oauth.utils import verify_oauth_client_prod +from fides.api.schemas.masking.masking_api import MaskingAPIRequest, MaskingAPIResponse +from fides.api.schemas.masking.masking_strategy_description import ( MaskingStrategyDescription, ) -from fides.api.ops.schemas.policy import PolicyMaskingSpec -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy -from fides.api.ops.util.api_router import APIRouter +from fides.api.schemas.policy import PolicyMaskingSpec +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.util.api_router import APIRouter router = APIRouter(tags=["Masking"], prefix=V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/messaging_endpoints.py b/src/fides/api/api/v1/endpoints/messaging_endpoints.py similarity index 95% rename from src/fides/api/ops/api/v1/endpoints/messaging_endpoints.py rename to src/fides/api/api/v1/endpoints/messaging_endpoints.py index 277fcf60ce..b8215c5837 100644 --- a/src/fides/api/ops/api/v1/endpoints/messaging_endpoints.py +++ b/src/fides/api/api/v1/endpoints/messaging_endpoints.py @@ -17,13 +17,13 @@ HTTP_500_INTERNAL_SERVER_ERROR, ) -from fides.api.ops.api import deps -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api import deps +from fides.api.api.v1.scope_registry import ( MESSAGING_CREATE_OR_UPDATE, MESSAGING_DELETE, MESSAGING_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( MESSAGING_ACTIVE_DEFAULT, MESSAGING_BY_KEY, MESSAGING_CONFIG, @@ -35,18 +35,18 @@ MESSAGING_TEST, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( MessageDispatchException, MessagingConfigNotFoundException, ) -from fides.api.ops.models.messaging import ( +from fides.api.models.messaging import ( MessagingConfig, default_messaging_config_key, default_messaging_config_name, get_schema_for_secrets, ) -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.messaging.messaging import ( MessagingActionType, MessagingConfigRequest, MessagingConfigRequestBase, @@ -56,19 +56,19 @@ MessagingServiceType, TestMessagingStatusMessage, ) -from fides.api.ops.schemas.messaging.messaging_secrets_docs_only import ( +from fides.api.schemas.messaging.messaging_secrets_docs_only import ( possible_messaging_secrets, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.messaging.message_dispatch_service import dispatch_message -from fides.api.ops.service.messaging.messaging_crud_service import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.service.messaging.message_dispatch_service import dispatch_message +from fides.api.service.messaging.messaging_crud_service import ( create_or_update_messaging_config, delete_messaging_config, get_messaging_config_by_key, update_messaging_config, ) -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.logger import Pii +from fides.api.util.api_router import APIRouter +from fides.api.util.logger import Pii from fides.core.config.config_proxy import ConfigProxy router = APIRouter(tags=["Messaging"], prefix=V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/oauth_endpoints.py b/src/fides/api/api/v1/endpoints/oauth_endpoints.py similarity index 88% rename from src/fides/api/ops/api/v1/endpoints/oauth_endpoints.py rename to src/fides/api/api/v1/endpoints/oauth_endpoints.py index 679f9e6786..c7810e241d 100644 --- a/src/fides/api/ops/api/v1/endpoints/oauth_endpoints.py +++ b/src/fides/api/api/v1/endpoints/oauth_endpoints.py @@ -10,11 +10,11 @@ HTTP_422_UNPROCESSABLE_ENTITY, ) -from fides.api.ops.api.deps import get_db -from fides.api.ops.api.v1.endpoints.saas_config_endpoints import ( +from fides.api.api.deps import get_db +from fides.api.api.v1.endpoints.saas_config_endpoints import ( verify_oauth_connection_config, ) -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CLIENT_CREATE, CLIENT_DELETE, CLIENT_READ, @@ -23,7 +23,7 @@ SCOPE_REGISTRY, ScopeRegistryEnum, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( CLIENT, CLIENT_BY_ID, CLIENT_SCOPE, @@ -33,25 +33,25 @@ TOKEN, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( AuthenticationFailure, FidesopsException, OAuth2TokenException, ) -from fides.api.ops.models.authentication_request import AuthenticationRequest -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.oauth.roles import ROLES_TO_SCOPES_MAPPING -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.client import ClientCreatedResponse -from fides.api.ops.schemas.oauth import AccessToken, OAuth2ClientCredentialsRequestForm -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.models.authentication_request import AuthenticationRequest +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.oauth.roles import ROLES_TO_SCOPES_MAPPING +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.client import ClientCreatedResponse +from fides.api.schemas.oauth import AccessToken, OAuth2ClientCredentialsRequestForm +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_oauth2_authorization_code import ( +from fides.api.service.authentication.authentication_strategy_oauth2_authorization_code import ( OAuth2AuthorizationCodeAuthenticationStrategy, ) -from fides.api.ops.util.api_router import APIRouter +from fides.api.util.api_router import APIRouter from fides.core.config import CONFIG router = APIRouter(tags=["OAuth"], prefix=V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/policy_endpoints.py b/src/fides/api/api/v1/endpoints/policy_endpoints.py similarity index 96% rename from src/fides/api/ops/api/v1/endpoints/policy_endpoints.py rename to src/fides/api/api/v1/endpoints/policy_endpoints.py index b4d682d72f..c30c647b87 100644 --- a/src/fides/api/ops/api/v1/endpoints/policy_endpoints.py +++ b/src/fides/api/api/v1/endpoints/policy_endpoints.py @@ -17,11 +17,10 @@ HTTP_422_UNPROCESSABLE_ENTITY, ) -from fides.api.ctl.sql_models import DataCategory # type: ignore -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import scope_registry -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.common_exceptions import ( +from fides.api.api import deps +from fides.api.api.v1 import scope_registry +from fides.api.api.v1 import urn_registry as urls +from fides.api.common_exceptions import ( DataCategoryNotSupported, DrpActionValidationError, KeyOrNameAlreadyExists, @@ -29,14 +28,15 @@ RuleTargetValidationError, RuleValidationError, ) -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.policy import ActionType, Policy, Rule, RuleTarget -from fides.api.ops.models.storage import StorageConfig -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas import policy as schemas -from fides.api.ops.schemas.api import BulkUpdateFailed -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.logger import Pii +from fides.api.ctl.sql_models import DataCategory # type: ignore +from fides.api.models.client import ClientDetail +from fides.api.models.policy import ActionType, Policy, Rule, RuleTarget +from fides.api.models.storage import StorageConfig +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas import policy as schemas +from fides.api.schemas.api import BulkUpdateFailed +from fides.api.util.api_router import APIRouter +from fides.api.util.logger import Pii router = APIRouter(tags=["DSR Policy"], prefix=urls.V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/policy_webhook_endpoints.py b/src/fides/api/api/v1/endpoints/policy_webhook_endpoints.py similarity index 95% rename from src/fides/api/ops/api/v1/endpoints/policy_webhook_endpoints.py rename to src/fides/api/api/v1/endpoints/policy_webhook_endpoints.py index 383a863b20..84919f3f80 100644 --- a/src/fides/api/ops/api/v1/endpoints/policy_webhook_endpoints.py +++ b/src/fides/api/api/v1/endpoints/policy_webhook_endpoints.py @@ -11,28 +11,25 @@ from starlette.exceptions import HTTPException from starlette.status import HTTP_200_OK, HTTP_400_BAD_REQUEST, HTTP_404_NOT_FOUND -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import scope_registry as scopes -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.api.v1.endpoints.connection_endpoints import ( +from fides.api.api import deps +from fides.api.api.v1 import scope_registry as scopes +from fides.api.api.v1 import urn_registry as urls +from fides.api.api.v1.endpoints.connection_endpoints import ( get_connection_config_or_error, ) -from fides.api.ops.api.v1.endpoints.policy_endpoints import get_policy_or_error -from fides.api.ops.common_exceptions import ( - KeyOrNameAlreadyExists, - WebhookOrderException, -) -from fides.api.ops.db.base_class import get_key_from_data -from fides.api.ops.models.policy import ( +from fides.api.api.v1.endpoints.policy_endpoints import get_policy_or_error +from fides.api.common_exceptions import KeyOrNameAlreadyExists, WebhookOrderException +from fides.api.db.base_class import get_key_from_data +from fides.api.models.policy import ( Policy, PolicyPostWebhook, PolicyPreWebhook, WebhookTypes, ) -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas import policy_webhooks as schemas -from fides.api.ops.schemas.policy_webhooks import PolicyWebhookDeleteResponse -from fides.api.ops.util.api_router import APIRouter +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas import policy_webhooks as schemas +from fides.api.schemas.policy_webhooks import PolicyWebhookDeleteResponse +from fides.api.util.api_router import APIRouter router = APIRouter(tags=["DSR Policy Webhooks"], prefix=urls.V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/privacy_experience_config_endpoints.py b/src/fides/api/api/v1/endpoints/privacy_experience_config_endpoints.py similarity index 95% rename from src/fides/api/ops/api/v1/endpoints/privacy_experience_config_endpoints.py rename to src/fides/api/api/v1/endpoints/privacy_experience_config_endpoints.py index 1bcad820f3..08e1376d72 100644 --- a/src/fides/api/ops/api/v1/endpoints/privacy_experience_config_endpoints.py +++ b/src/fides/api/api/v1/endpoints/privacy_experience_config_endpoints.py @@ -13,12 +13,12 @@ HTTP_422_UNPROCESSABLE_ENTITY, ) -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import scope_registry -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.api.v1.endpoints.utils import human_friendly_list -from fides.api.ops.api.v1.scope_registry import PRIVACY_EXPERIENCE_UPDATE -from fides.api.ops.models.privacy_experience import ( +from fides.api.api import deps +from fides.api.api.v1 import scope_registry +from fides.api.api.v1 import urn_registry as urls +from fides.api.api.v1.endpoints.utils import human_friendly_list +from fides.api.api.v1.scope_registry import PRIVACY_EXPERIENCE_UPDATE +from fides.api.models.privacy_experience import ( ComponentType, DeliveryMechanism, PrivacyExperience, @@ -26,15 +26,15 @@ config_incompatible_with_region, upsert_privacy_experiences_after_config_update, ) -from fides.api.ops.models.privacy_notice import PrivacyNoticeRegion -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.privacy_experience import ( +from fides.api.models.privacy_notice import PrivacyNoticeRegion +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.privacy_experience import ( ExperienceConfigCreate, ExperienceConfigCreateOrUpdateResponse, ExperienceConfigResponse, ExperienceConfigUpdate, ) -from fides.api.ops.util.api_router import APIRouter +from fides.api.util.api_router import APIRouter router = APIRouter(tags=["Privacy Experience Config"], prefix=urls.V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/privacy_experience_endpoints.py b/src/fides/api/api/v1/endpoints/privacy_experience_endpoints.py similarity index 89% rename from src/fides/api/ops/api/v1/endpoints/privacy_experience_endpoints.py rename to src/fides/api/api/v1/endpoints/privacy_experience_endpoints.py index 61470b5d8a..6b03561190 100644 --- a/src/fides/api/ops/api/v1/endpoints/privacy_experience_endpoints.py +++ b/src/fides/api/api/v1/endpoints/privacy_experience_endpoints.py @@ -8,16 +8,16 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_200_OK, HTTP_400_BAD_REQUEST, HTTP_404_NOT_FOUND -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import scope_registry -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.models.privacy_experience import ComponentType, PrivacyExperience -from fides.api.ops.models.privacy_notice import PrivacyNotice, PrivacyNoticeRegion -from fides.api.ops.models.privacy_request import ProvidedIdentity -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.privacy_experience import PrivacyExperienceResponse -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.consent_util import get_fides_user_device_id_provided_identity +from fides.api.api import deps +from fides.api.api.v1 import scope_registry +from fides.api.api.v1 import urn_registry as urls +from fides.api.models.privacy_experience import ComponentType, PrivacyExperience +from fides.api.models.privacy_notice import PrivacyNotice, PrivacyNoticeRegion +from fides.api.models.privacy_request import ProvidedIdentity +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.privacy_experience import PrivacyExperienceResponse +from fides.api.util.api_router import APIRouter +from fides.api.util.consent_util import get_fides_user_device_id_provided_identity router = APIRouter(tags=["Privacy Experience"], prefix=urls.V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/privacy_notice_endpoints.py b/src/fides/api/api/v1/endpoints/privacy_notice_endpoints.py similarity index 96% rename from src/fides/api/ops/api/v1/endpoints/privacy_notice_endpoints.py rename to src/fides/api/api/v1/endpoints/privacy_notice_endpoints.py index c6b527381c..9f11f1b972 100644 --- a/src/fides/api/ops/api/v1/endpoints/privacy_notice_endpoints.py +++ b/src/fides/api/api/v1/endpoints/privacy_notice_endpoints.py @@ -15,23 +15,23 @@ HTTP_422_UNPROCESSABLE_ENTITY, ) +from fides.api.api import deps +from fides.api.api.v1 import scope_registry +from fides.api.api.v1 import urn_registry as urls +from fides.api.api.v1.endpoints.utils import transform_fields +from fides.api.common_exceptions import ValidationError from fides.api.ctl.sql_models import DataUse, System # type: ignore -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import scope_registry -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.api.v1.endpoints.utils import transform_fields -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.models.privacy_experience import ( +from fides.api.models.privacy_experience import ( upsert_privacy_experiences_after_notice_update, ) -from fides.api.ops.models.privacy_notice import ( +from fides.api.models.privacy_notice import ( PrivacyNotice, PrivacyNoticeRegion, check_conflicting_data_uses, ) -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas import privacy_notice as schemas -from fides.api.ops.util.api_router import APIRouter +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas import privacy_notice as schemas +from fides.api.util.api_router import APIRouter router = APIRouter(tags=["Privacy Notice"], prefix=urls.V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/privacy_preference_endpoints.py b/src/fides/api/api/v1/endpoints/privacy_preference_endpoints.py similarity index 95% rename from src/fides/api/ops/api/v1/endpoints/privacy_preference_endpoints.py rename to src/fides/api/api/v1/endpoints/privacy_preference_endpoints.py index fb1ee89587..d20fd54ecb 100644 --- a/src/fides/api/ops/api/v1/endpoints/privacy_preference_endpoints.py +++ b/src/fides/api/api/v1/endpoints/privacy_preference_endpoints.py @@ -14,20 +14,19 @@ from sqlalchemy.orm import Query, Session from starlette.status import HTTP_200_OK, HTTP_400_BAD_REQUEST, HTTP_404_NOT_FOUND -from fides.api.ctl.database.seed import DEFAULT_CONSENT_POLICY -from fides.api.ops.api.deps import get_db -from fides.api.ops.api.v1.endpoints.consent_request_endpoints import ( +from fides.api.api.deps import get_db +from fides.api.api.v1.endpoints.consent_request_endpoints import ( _get_consent_request_and_provided_identity, ) -from fides.api.ops.api.v1.endpoints.privacy_request_endpoints import ( +from fides.api.api.v1.endpoints.privacy_request_endpoints import ( create_privacy_request_func, ) -from fides.api.ops.api.v1.endpoints.utils import validate_start_and_end_filters -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.endpoints.utils import validate_start_and_end_filters +from fides.api.api.v1.scope_registry import ( CURRENT_PRIVACY_PREFERENCE_READ, PRIVACY_PREFERENCE_HISTORY_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( CONSENT_REQUEST_PRIVACY_PREFERENCES_VERIFY, CONSENT_REQUEST_PRIVACY_PREFERENCES_WITH_ID, CURRENT_PRIVACY_PREFERENCES_REPORT, @@ -35,35 +34,36 @@ PRIVACY_PREFERENCES, V1_URL_PREFIX, ) -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.privacy_experience import PrivacyExperienceHistory -from fides.api.ops.models.privacy_notice import PrivacyNotice, PrivacyNoticeHistory -from fides.api.ops.models.privacy_preference import ( +from fides.api.ctl.database.seed import DEFAULT_CONSENT_POLICY +from fides.api.models.fides_user import FidesUser +from fides.api.models.privacy_experience import PrivacyExperienceHistory +from fides.api.models.privacy_notice import PrivacyNotice, PrivacyNoticeHistory +from fides.api.models.privacy_preference import ( CurrentPrivacyPreference, PrivacyPreferenceHistory, ) -from fides.api.ops.models.privacy_request import ( +from fides.api.models.privacy_request import ( ConsentRequest, PrivacyRequest, ProvidedIdentity, ProvidedIdentityType, ) -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.privacy_preference import ( +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.privacy_preference import ( ConsentReportingSchema, CurrentPrivacyPreferenceReportingSchema, CurrentPrivacyPreferenceSchema, PrivacyPreferencesCreate, PrivacyPreferencesRequest, ) -from fides.api.ops.schemas.privacy_request import ( +from fides.api.schemas.privacy_request import ( BulkPostPrivacyRequests, PrivacyRequestCreate, VerificationCode, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.consent_util import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.util.api_router import APIRouter +from fides.api.util.consent_util import ( get_or_create_fides_user_device_id_provided_identity, ) from fides.core.config.config_proxy import ConfigProxy diff --git a/src/fides/api/ops/api/v1/endpoints/privacy_request_endpoints.py b/src/fides/api/api/v1/endpoints/privacy_request_endpoints.py similarity index 96% rename from src/fides/api/ops/api/v1/endpoints/privacy_request_endpoints.py rename to src/fides/api/api/v1/endpoints/privacy_request_endpoints.py index a58954f366..3ebbda96ee 100644 --- a/src/fides/api/ops/api/v1/endpoints/privacy_request_endpoints.py +++ b/src/fides/api/api/v1/endpoints/privacy_request_endpoints.py @@ -28,14 +28,14 @@ HTTP_424_FAILED_DEPENDENCY, ) -from fides.api.ops import common_exceptions -from fides.api.ops.api import deps -from fides.api.ops.api.v1.endpoints.dataset_endpoints import _get_connection_config -from fides.api.ops.api.v1.endpoints.manual_webhook_endpoints import ( +from fides.api import common_exceptions +from fides.api.api import deps +from fides.api.api.v1.endpoints.dataset_endpoints import _get_connection_config +from fides.api.api.v1.endpoints.manual_webhook_endpoints import ( get_access_manual_webhook_or_404, ) -from fides.api.ops.api.v1.endpoints.utils import validate_start_and_end_filters -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.endpoints.utils import validate_start_and_end_filters +from fides.api.api.v1.scope_registry import ( PRIVACY_REQUEST_CALLBACK_RESUME, PRIVACY_REQUEST_CREATE, PRIVACY_REQUEST_NOTIFICATIONS_CREATE_OR_UPDATE, @@ -46,7 +46,7 @@ PRIVACY_REQUEST_UPLOAD_DATA, PRIVACY_REQUEST_VIEW_DATA, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( PRIVACY_REQUEST_ACCESS_MANUAL_WEBHOOK_INPUT, PRIVACY_REQUEST_APPROVE, PRIVACY_REQUEST_AUTHENTICATED, @@ -65,7 +65,7 @@ REQUEST_STATUS_LOGS, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( FunctionalityNotConfigured, IdentityNotFoundException, IdentityVerificationException, @@ -76,23 +76,23 @@ TraversalError, ValidationError, ) -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.graph.graph import DatasetGraph, Node -from fides.api.ops.graph.traversal import Traversal -from fides.api.ops.models.audit_log import AuditLog, AuditLogAction -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.manual_webhook import AccessManualWebhook -from fides.api.ops.models.policy import ( +from fides.api.graph.config import CollectionAddress +from fides.api.graph.graph import DatasetGraph, Node +from fides.api.graph.traversal import Traversal +from fides.api.models.audit_log import AuditLog, AuditLogAction +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.manual_webhook import AccessManualWebhook +from fides.api.models.policy import ( ActionType, CurrentStep, Policy, PolicyPreWebhook, Rule, ) -from fides.api.ops.models.privacy_preference import PrivacyPreferenceHistory -from fides.api.ops.models.privacy_request import ( +from fides.api.models.privacy_preference import PrivacyPreferenceHistory +from fides.api.models.privacy_request import ( CheckpointActionRequired, ExecutionLog, PrivacyRequest, @@ -101,19 +101,16 @@ ProvidedIdentity, ProvidedIdentityType, ) -from fides.api.ops.oauth.utils import verify_callback_oauth, verify_oauth_client -from fides.api.ops.schemas.dataset import ( - CollectionAddressResponse, - DryRunDatasetResponse, -) -from fides.api.ops.schemas.external_https import PrivacyRequestResumeFormat -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.oauth.utils import verify_callback_oauth, verify_oauth_client +from fides.api.schemas.dataset import CollectionAddressResponse, DryRunDatasetResponse +from fides.api.schemas.external_https import PrivacyRequestResumeFormat +from fides.api.schemas.messaging.messaging import ( FidesopsMessage, MessagingActionType, RequestReceiptBodyParams, RequestReviewDenyBodyParams, ) -from fides.api.ops.schemas.privacy_request import ( +from fides.api.schemas.privacy_request import ( BulkPostPrivacyRequests, BulkReviewResponse, DenyPrivacyRequests, @@ -127,29 +124,29 @@ RowCountRequest, VerificationCode, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service._verification import send_verification_code_to_user -from fides.api.ops.service.messaging.message_dispatch_service import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.service._verification import send_verification_code_to_user +from fides.api.service.messaging.message_dispatch_service import ( EMAIL_JOIN_STRING, check_and_dispatch_error_notifications, dispatch_message_task, ) -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.service.privacy_request.request_runner_service import ( queue_privacy_request, ) -from fides.api.ops.service.privacy_request.request_service import ( +from fides.api.service.privacy_request.request_service import ( build_required_privacy_request_kwargs, cache_data, ) -from fides.api.ops.task.filter_results import filter_data_categories -from fides.api.ops.task.graph_task import EMPTY_REQUEST, collect_queries -from fides.api.ops.task.task_resources import TaskResources -from fides.api.ops.tasks import MESSAGING_QUEUE_NAME -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.cache import FidesopsRedis -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.enums import ColumnSort -from fides.api.ops.util.logger import Pii +from fides.api.task.filter_results import filter_data_categories +from fides.api.task.graph_task import EMPTY_REQUEST, collect_queries +from fides.api.task.task_resources import TaskResources +from fides.api.tasks import MESSAGING_QUEUE_NAME +from fides.api.util.api_router import APIRouter +from fides.api.util.cache import FidesopsRedis +from fides.api.util.collection_util import Row +from fides.api.util.enums import ColumnSort +from fides.api.util.logger import Pii from fides.core.config import CONFIG from fides.core.config.config_proxy import ConfigProxy diff --git a/src/fides/api/ops/api/v1/endpoints/registration_endpoints.py b/src/fides/api/api/v1/endpoints/registration_endpoints.py similarity index 87% rename from src/fides/api/ops/api/v1/endpoints/registration_endpoints.py rename to src/fides/api/api/v1/endpoints/registration_endpoints.py index c28c92e2a6..8a61d49a04 100644 --- a/src/fides/api/ops/api/v1/endpoints/registration_endpoints.py +++ b/src/fides/api/api/v1/endpoints/registration_endpoints.py @@ -3,12 +3,12 @@ from sqlalchemy.orm import Session from starlette.exceptions import HTTPException -from fides.api.ops.analytics import send_registration -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.models.registration import UserRegistration -from fides.api.ops.schemas import registration as schemas -from fides.api.ops.util.api_router import APIRouter +from fides.api.analytics import send_registration +from fides.api.api import deps +from fides.api.api.v1 import urn_registry as urls +from fides.api.models.registration import UserRegistration +from fides.api.schemas import registration as schemas +from fides.api.util.api_router import APIRouter router = APIRouter( tags=["Registration"], diff --git a/src/fides/api/ops/api/v1/endpoints/saas_config_endpoints.py b/src/fides/api/api/v1/endpoints/saas_config_endpoints.py similarity index 92% rename from src/fides/api/ops/api/v1/endpoints/saas_config_endpoints.py rename to src/fides/api/api/v1/endpoints/saas_config_endpoints.py index cc1bb4f3c3..de01a64abf 100644 --- a/src/fides/api/ops/api/v1/endpoints/saas_config_endpoints.py +++ b/src/fides/api/api/v1/endpoints/saas_config_endpoints.py @@ -17,8 +17,8 @@ HTTP_500_INTERNAL_SERVER_ERROR, ) -from fides.api.ops.api import deps -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api import deps +from fides.api.api.v1.scope_registry import ( CONNECTION_AUTHORIZE, CONNECTOR_TEMPLATE_REGISTER, SAAS_CONFIG_CREATE_OR_UPDATE, @@ -26,7 +26,7 @@ SAAS_CONFIG_READ, SAAS_CONNECTION_INSTANTIATE, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( AUTHORIZE, CONNECTION_TYPES, REGISTER_CONNECTOR_TEMPLATE, @@ -35,34 +35,34 @@ SAAS_CONNECTOR_FROM_TEMPLATE, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import FidesopsException, KeyOrNameAlreadyExists -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.common_exceptions import FidesopsException, KeyOrNameAlreadyExists +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.connection_configuration.connection_config import ( SaasConnectionTemplateResponse, SaasConnectionTemplateValues, ) -from fides.api.ops.schemas.saas.connector_template import ConnectorTemplate -from fides.api.ops.schemas.saas.saas_config import ( +from fides.api.schemas.saas.connector_template import ConnectorTemplate +from fides.api.schemas.saas.saas_config import ( SaaSConfig, SaaSConfigValidationDetails, ValidateSaaSConfigResponse, ) -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_oauth2_authorization_code import ( +from fides.api.service.authentication.authentication_strategy_oauth2_authorization_code import ( OAuth2AuthorizationCodeAuthenticationStrategy, ) -from fides.api.ops.service.connectors.saas.connector_registry_service import ( +from fides.api.service.connectors.saas.connector_registry_service import ( ConnectorRegistry, CustomConnectorTemplateLoader, create_connection_config_from_template_no_save, upsert_dataset_config_from_template, ) -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.connection_util import validate_secrets +from fides.api.util.api_router import APIRouter +from fides.api.util.connection_util import validate_secrets router = APIRouter(tags=["SaaS Configs"], prefix=V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/storage_endpoints.py b/src/fides/api/api/v1/endpoints/storage_endpoints.py similarity index 94% rename from src/fides/api/ops/api/v1/endpoints/storage_endpoints.py rename to src/fides/api/api/v1/endpoints/storage_endpoints.py index 844aa0897d..1ea027a0d8 100644 --- a/src/fides/api/ops/api/v1/endpoints/storage_endpoints.py +++ b/src/fides/api/api/v1/endpoints/storage_endpoints.py @@ -20,13 +20,13 @@ HTTP_500_INTERNAL_SERVER_ERROR, ) -from fides.api.ops.api import deps -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api import deps +from fides.api.api.v1.scope_registry import ( STORAGE_CREATE_OR_UPDATE, STORAGE_DELETE, STORAGE_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( STORAGE_ACTIVE_DEFAULT, STORAGE_BY_KEY, STORAGE_CONFIG, @@ -38,22 +38,22 @@ STORAGE_UPLOAD, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import KeyOrNameAlreadyExists, StorageUploadError -from fides.api.ops.models.connectionconfig import ConnectionTestStatus -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.models.storage import ( +from fides.api.common_exceptions import KeyOrNameAlreadyExists, StorageUploadError +from fides.api.models.connectionconfig import ConnectionTestStatus +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.models.storage import ( StorageConfig, default_storage_config_name, get_active_default_storage_config, get_default_storage_config_by_type, ) -from fides.api.ops.oauth.utils import verify_oauth_client -from fides.api.ops.schemas.api import BulkUpdateFailed -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.oauth.utils import verify_oauth_client +from fides.api.schemas.api import BulkUpdateFailed +from fides.api.schemas.connection_configuration.connection_secrets import ( TestStatusMessage, ) -from fides.api.ops.schemas.storage.data_upload_location_response import DataUpload -from fides.api.ops.schemas.storage.storage import ( +from fides.api.schemas.storage.data_upload_location_response import DataUpload +from fides.api.schemas.storage.storage import ( FULLY_CONFIGURED_STORAGE_TYPES, BulkPutStorageConfigResponse, S3AuthMethod, @@ -65,16 +65,12 @@ StorageDetails, StorageType, ) -from fides.api.ops.schemas.storage.storage_secrets_docs_only import ( - possible_storage_secrets, -) -from fides.api.ops.service.storage.storage_authenticator_service import ( - secrets_are_valid, -) -from fides.api.ops.service.storage.storage_uploader_service import upload -from fides.api.ops.util.api_router import APIRouter -from fides.api.ops.util.logger import Pii -from fides.api.ops.util.storage_util import get_schema_for_secrets +from fides.api.schemas.storage.storage_secrets_docs_only import possible_storage_secrets +from fides.api.service.storage.storage_authenticator_service import secrets_are_valid +from fides.api.service.storage.storage_uploader_service import upload +from fides.api.util.api_router import APIRouter +from fides.api.util.logger import Pii +from fides.api.util.storage_util import get_schema_for_secrets router = APIRouter(tags=["Storage"], prefix=V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/user_endpoints.py b/src/fides/api/api/v1/endpoints/user_endpoints.py similarity index 95% rename from src/fides/api/ops/api/v1/endpoints/user_endpoints.py rename to src/fides/api/api/v1/endpoints/user_endpoints.py index f871aa8e9f..3d52a7eecd 100644 --- a/src/fides/api/ops/api/v1/endpoints/user_endpoints.py +++ b/src/fides/api/api/v1/endpoints/user_endpoints.py @@ -22,12 +22,11 @@ HTTP_404_NOT_FOUND, ) -from fides.api.ctl.sql_models import System # type: ignore[attr-defined] -from fides.api.ops.api import deps -from fides.api.ops.api.deps import get_db -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.api.v1.endpoints.user_permission_endpoints import validate_user_id -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api import deps +from fides.api.api.deps import get_db +from fides.api.api.v1 import urn_registry as urls +from fides.api.api.v1.endpoints.user_permission_endpoints import validate_user_id +from fides.api.api.v1.scope_registry import ( SCOPE_REGISTRY, SYSTEM_MANAGER_DELETE, SYSTEM_MANAGER_READ, @@ -38,22 +37,23 @@ USER_READ, USER_UPDATE, ) -from fides.api.ops.api.v1.urn_registry import V1_URL_PREFIX -from fides.api.ops.common_exceptions import AuthenticationError, AuthorizationError -from fides.api.ops.cryptography.cryptographic_util import b64_str_to_str -from fides.api.ops.cryptography.schemas.jwt import JWE_PAYLOAD_CLIENT_ID -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.fides_user_permissions import FidesUserPermissions -from fides.api.ops.oauth.roles import APPROVER, VIEWER -from fides.api.ops.oauth.utils import ( +from fides.api.api.v1.urn_registry import V1_URL_PREFIX +from fides.api.common_exceptions import AuthenticationError, AuthorizationError +from fides.api.cryptography.cryptographic_util import b64_str_to_str +from fides.api.cryptography.schemas.jwt import JWE_PAYLOAD_CLIENT_ID +from fides.api.ctl.sql_models import System # type: ignore[attr-defined] +from fides.api.models.client import ClientDetail +from fides.api.models.fides_user import FidesUser +from fides.api.models.fides_user_permissions import FidesUserPermissions +from fides.api.oauth.roles import APPROVER, VIEWER +from fides.api.oauth.utils import ( extract_payload, get_current_user, oauth2_scheme, verify_oauth_client, ) -from fides.api.ops.schemas.oauth import AccessToken -from fides.api.ops.schemas.user import ( +from fides.api.schemas.oauth import AccessToken +from fides.api.schemas.user import ( UserCreate, UserCreateResponse, UserForcePasswordReset, @@ -63,7 +63,7 @@ UserResponse, UserUpdate, ) -from fides.api.ops.util.api_router import APIRouter +from fides.api.util.api_router import APIRouter from fides.core.config import CONFIG, FidesConfig, get_config router = APIRouter(tags=["Users"], prefix=V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/user_permission_endpoints.py b/src/fides/api/api/v1/endpoints/user_permission_endpoints.py similarity index 89% rename from src/fides/api/ops/api/v1/endpoints/user_permission_endpoints.py rename to src/fides/api/api/v1/endpoints/user_permission_endpoints.py index 3d31f38dfd..d6da1e1530 100644 --- a/src/fides/api/ops/api/v1/endpoints/user_permission_endpoints.py +++ b/src/fides/api/api/v1/endpoints/user_permission_endpoints.py @@ -6,29 +6,25 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_201_CREATED, HTTP_400_BAD_REQUEST, HTTP_404_NOT_FOUND -from fides.api.ops.api import deps -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api import deps +from fides.api.api.v1 import urn_registry as urls +from fides.api.api.v1.scope_registry import ( USER_PERMISSION_ASSIGN_OWNERS, USER_PERMISSION_CREATE, USER_PERMISSION_READ, USER_PERMISSION_UPDATE, ) -from fides.api.ops.api.v1.urn_registry import V1_URL_PREFIX -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.fides_user_permissions import FidesUserPermissions -from fides.api.ops.oauth.roles import APPROVER, OWNER, RoleRegistryEnum -from fides.api.ops.oauth.utils import ( - get_current_user, - oauth2_scheme, - verify_oauth_client, -) -from fides.api.ops.schemas.user_permission import ( +from fides.api.api.v1.urn_registry import V1_URL_PREFIX +from fides.api.models.fides_user import FidesUser +from fides.api.models.fides_user_permissions import FidesUserPermissions +from fides.api.oauth.roles import APPROVER, OWNER, RoleRegistryEnum +from fides.api.oauth.utils import get_current_user, oauth2_scheme, verify_oauth_client +from fides.api.schemas.user_permission import ( UserPermissionsCreate, UserPermissionsEdit, UserPermissionsResponse, ) -from fides.api.ops.util.api_router import APIRouter +from fides.api.util.api_router import APIRouter from fides.core.config import CONFIG router = APIRouter(tags=["User Permissions"], prefix=V1_URL_PREFIX) diff --git a/src/fides/api/ops/api/v1/endpoints/utils.py b/src/fides/api/api/v1/endpoints/utils.py similarity index 100% rename from src/fides/api/ops/api/v1/endpoints/utils.py rename to src/fides/api/api/v1/endpoints/utils.py diff --git a/src/fides/api/ops/api/v1/exception_handlers.py b/src/fides/api/api/v1/exception_handlers.py similarity index 90% rename from src/fides/api/ops/api/v1/exception_handlers.py rename to src/fides/api/api/v1/exception_handlers.py index 79923900a4..36e4a56d1d 100644 --- a/src/fides/api/ops/api/v1/exception_handlers.py +++ b/src/fides/api/api/v1/exception_handlers.py @@ -4,7 +4,7 @@ from fastapi.responses import JSONResponse from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR -from fides.api.ops.common_exceptions import FunctionalityNotConfigured +from fides.api.common_exceptions import FunctionalityNotConfigured class ExceptionHandlers: diff --git a/src/fides/api/ops/api/v1/scope_registry.py b/src/fides/api/api/v1/scope_registry.py similarity index 100% rename from src/fides/api/ops/api/v1/scope_registry.py rename to src/fides/api/api/v1/scope_registry.py diff --git a/src/fides/api/ops/api/v1/urn_registry.py b/src/fides/api/api/v1/urn_registry.py similarity index 100% rename from src/fides/api/ops/api/v1/urn_registry.py rename to src/fides/api/api/v1/urn_registry.py diff --git a/src/fides/api/app_setup.py b/src/fides/api/app_setup.py index 0c923514ba..9e90799f5f 100644 --- a/src/fides/api/app_setup.py +++ b/src/fides/api/app_setup.py @@ -14,28 +14,25 @@ from starlette.middleware.cors import CORSMiddleware import fides +from fides.api.api.deps import get_api_session +from fides.api.api.v1.api import api_router +from fides.api.api.v1.exception_handlers import ExceptionHandlers +from fides.api.common_exceptions import FunctionalityNotConfigured, RedisConnectionError from fides.api.ctl.database.database import configure_db from fides.api.ctl.database.seed import create_or_update_parent_user from fides.api.ctl.routes import CTL_ROUTER from fides.api.ctl.utils.errors import FidesError from fides.api.ctl.utils.logger import setup as setup_logging -from fides.api.ops.api.deps import get_api_session -from fides.api.ops.api.v1.api import api_router -from fides.api.ops.api.v1.exception_handlers import ExceptionHandlers -from fides.api.ops.common_exceptions import ( - FunctionalityNotConfigured, - RedisConnectionError, -) -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.oauth.utils import get_root_client, verify_oauth_client_prod -from fides.api.ops.service.connectors.saas.connector_registry_service import ( +from fides.api.models.application_config import ApplicationConfig +from fides.api.oauth.utils import get_root_client, verify_oauth_client_prod +from fides.api.service.connectors.saas.connector_registry_service import ( update_saas_configs, ) # pylint: disable=wildcard-import, unused-wildcard-import -from fides.api.ops.service.saas_request.override_implementations import * -from fides.api.ops.util.cache import get_cache -from fides.api.ops.util.system_manager_oauth_util import ( +from fides.api.service.saas_request.override_implementations import * +from fides.api.util.cache import get_cache +from fides.api.util.system_manager_oauth_util import ( get_system_fides_key, get_system_schema, verify_oauth_client_for_system_from_fides_key_cli, diff --git a/src/fides/api/ops/common_exceptions.py b/src/fides/api/common_exceptions.py similarity index 99% rename from src/fides/api/ops/common_exceptions.py rename to src/fides/api/common_exceptions.py index fbe329ad90..c6067b8c08 100644 --- a/src/fides/api/ops/common_exceptions.py +++ b/src/fides/api/common_exceptions.py @@ -9,7 +9,7 @@ HTTP_404_NOT_FOUND, ) -from fides.api.ops.api.v1.scope_registry import SCOPE_REGISTRY as SCOPES +from fides.api.api.v1.scope_registry import SCOPE_REGISTRY as SCOPES class FidesopsException(Exception): diff --git a/src/fides/api/ops/api/v1/endpoints/__init__.py b/src/fides/api/cryptography/__init__.py similarity index 100% rename from src/fides/api/ops/api/v1/endpoints/__init__.py rename to src/fides/api/cryptography/__init__.py diff --git a/src/fides/api/ops/cryptography/cryptographic_util.py b/src/fides/api/cryptography/cryptographic_util.py similarity index 100% rename from src/fides/api/ops/cryptography/cryptographic_util.py rename to src/fides/api/cryptography/cryptographic_util.py diff --git a/src/fides/api/ops/cryptography/__init__.py b/src/fides/api/cryptography/schemas/__init__.py similarity index 100% rename from src/fides/api/ops/cryptography/__init__.py rename to src/fides/api/cryptography/schemas/__init__.py diff --git a/src/fides/api/ops/cryptography/schemas/jwt.py b/src/fides/api/cryptography/schemas/jwt.py similarity index 100% rename from src/fides/api/ops/cryptography/schemas/jwt.py rename to src/fides/api/cryptography/schemas/jwt.py diff --git a/src/fides/api/ctl/database/crud.py b/src/fides/api/ctl/database/crud.py index c48b591bb0..50ac2cf60b 100644 --- a/src/fides/api/ctl/database/crud.py +++ b/src/fides/api/ctl/database/crud.py @@ -21,7 +21,7 @@ ResourceTypes, ) from fides.api.ctl.utils import errors -from fides.api.ops.db.base import Base # type: ignore[attr-defined] +from fides.api.db.base import Base # type: ignore[attr-defined] # CRUD Functions diff --git a/src/fides/api/ctl/database/database.py b/src/fides/api/ctl/database/database.py index 3bb1ec2950..3f469713d0 100644 --- a/src/fides/api/ctl/database/database.py +++ b/src/fides/api/ctl/database/database.py @@ -15,7 +15,7 @@ from fides.api.ctl.database.seed import load_default_resources, load_samples from fides.api.ctl.database.session import async_session from fides.api.ctl.utils.errors import get_full_exception_name -from fides.api.ops.db.base import Base # type: ignore[attr-defined] +from fides.api.db.base import Base # type: ignore[attr-defined] from fides.core.utils import get_db_engine DatabaseHealth = Literal["healthy", "unhealthy", "needs migration"] diff --git a/src/fides/api/ctl/database/samples.py b/src/fides/api/ctl/database/samples.py index 3b9604b0b3..af2282a06b 100644 --- a/src/fides/api/ctl/database/samples.py +++ b/src/fides/api/ctl/database/samples.py @@ -14,7 +14,7 @@ # DEFER: This can be changed to importlib.resources once we drop support for Python 3.8 from importlib_resources import files -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.schemas.connection_configuration.connection_config import ( CreateConnectionConfigurationWithSecrets, ) from fides.core.parse import parse diff --git a/src/fides/api/ctl/database/seed.py b/src/fides/api/ctl/database/seed.py index f94fc63259..8d35b70a2a 100644 --- a/src/fides/api/ctl/database/seed.py +++ b/src/fides/api/ctl/database/seed.py @@ -8,6 +8,11 @@ from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.orm import Session +from fides.api.api.v1.endpoints.dataset_endpoints import patch_dataset_configs +from fides.api.api.v1.endpoints.saas_config_endpoints import ( + instantiate_connection_from_template, +) +from fides.api.common_exceptions import KeyOrNameAlreadyExists from fides.api.ctl.database.session import sync_session from fides.api.ctl.database.system import upsert_system from fides.api.ctl.sql_models import ( # type: ignore[attr-defined] @@ -15,26 +20,21 @@ sql_model_map, ) from fides.api.ctl.utils.errors import AlreadyExistsError, QueryError -from fides.api.ops.api.v1.endpoints.dataset_endpoints import patch_dataset_configs -from fides.api.ops.api.v1.endpoints.saas_config_endpoints import ( - instantiate_connection_from_template, -) -from fides.api.ops.common_exceptions import KeyOrNameAlreadyExists -from fides.api.ops.db.base_class import FidesBase -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.fides_user_permissions import FidesUserPermissions -from fides.api.ops.models.policy import ActionType, DrpAction, Policy, Rule, RuleTarget -from fides.api.ops.oauth.roles import OWNER -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.db.base_class import FidesBase +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.fides_user import FidesUser +from fides.api.models.fides_user_permissions import FidesUserPermissions +from fides.api.models.policy import ActionType, DrpAction, Policy, Rule, RuleTarget +from fides.api.oauth.roles import OWNER +from fides.api.schemas.connection_configuration.connection_config import ( CreateConnectionConfigurationWithSecrets, SaasConnectionTemplateValues, ) -from fides.api.ops.schemas.dataset import DatasetConfigCtlDataset -from fides.api.ops.util.connection_util import patch_connection_configs -from fides.api.ops.util.text import to_snake_case +from fides.api.schemas.dataset import DatasetConfigCtlDataset +from fides.api.util.connection_util import patch_connection_configs +from fides.api.util.text import to_snake_case from fides.core.config import CONFIG from .crud import create_resource, get_resource, list_resource, upsert_resources diff --git a/src/fides/api/ctl/database/session.py b/src/fides/api/ctl/database/session.py index e22b353d67..d34b47487c 100644 --- a/src/fides/api/ctl/database/session.py +++ b/src/fides/api/ctl/database/session.py @@ -4,7 +4,7 @@ from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine from sqlalchemy.orm import sessionmaker -from fides.api.ops.db.session import ExtendedSession +from fides.api.db.session import ExtendedSession from fides.core.config import CONFIG # Parameters are hidden for security diff --git a/src/fides/api/ctl/migrations/versions/7abe778b7082_update_fideslang_data_categories.py b/src/fides/api/ctl/migrations/versions/7abe778b7082_update_fideslang_data_categories.py index bf044682a3..1ad336aadc 100644 --- a/src/fides/api/ctl/migrations/versions/7abe778b7082_update_fideslang_data_categories.py +++ b/src/fides/api/ctl/migrations/versions/7abe778b7082_update_fideslang_data_categories.py @@ -11,8 +11,8 @@ from sqlalchemy.exc import ProgrammingError -from fides.api.ops.db.base import DatasetConfig -from fides.api.ops.db.session import get_db_session +from fides.api.db.base import DatasetConfig +from fides.api.db.session import get_db_session from fides.core.config import CONFIG logger = logging.getLogger(__name__) diff --git a/src/fides/api/ctl/migrations/versions/c9ee230fa6da_add_config_set_column_to_application_.py b/src/fides/api/ctl/migrations/versions/c9ee230fa6da_add_config_set_column_to_application_.py index 780992436d..4d22b011dc 100644 --- a/src/fides/api/ctl/migrations/versions/c9ee230fa6da_add_config_set_column_to_application_.py +++ b/src/fides/api/ctl/migrations/versions/c9ee230fa6da_add_config_set_column_to_application_.py @@ -16,7 +16,7 @@ StringEncryptedType, ) -from fides.api.ops.db.base_class import JSONTypeOverride +from fides.api.db.base_class import JSONTypeOverride from fides.core.config import CONFIG # revision identifiers, used by Alembic. diff --git a/src/fides/api/ctl/routes/admin.py b/src/fides/api/ctl/routes/admin.py index 83e88cd3a8..94985e5eb0 100644 --- a/src/fides/api/ctl/routes/admin.py +++ b/src/fides/api/ctl/routes/admin.py @@ -3,12 +3,12 @@ from fastapi import Security +from fides.api.api.v1 import scope_registry from fides.api.ctl.database import database from fides.api.ctl.routes.util import API_PREFIX from fides.api.ctl.utils import errors from fides.api.ctl.utils.api_router import APIRouter -from fides.api.ops.api.v1 import scope_registry -from fides.api.ops.oauth.utils import verify_oauth_client_prod +from fides.api.oauth.utils import verify_oauth_client_prod from fides.core.config import CONFIG ADMIN_ROUTER = APIRouter(prefix=API_PREFIX, tags=["Admin"]) diff --git a/src/fides/api/ctl/routes/generate.py b/src/fides/api/ctl/routes/generate.py index c8db4db216..1f5dedd949 100644 --- a/src/fides/api/ctl/routes/generate.py +++ b/src/fides/api/ctl/routes/generate.py @@ -10,13 +10,13 @@ from pydantic import BaseModel, root_validator from sqlalchemy.ext.asyncio import AsyncSession +from fides.api.api.v1 import scope_registry from fides.api.ctl.database.crud import get_resource from fides.api.ctl.database.session import get_async_db from fides.api.ctl.routes.util import API_PREFIX from fides.api.ctl.sql_models import sql_model_map # type: ignore[attr-defined] from fides.api.ctl.utils.api_router import APIRouter -from fides.api.ops.api.v1 import scope_registry -from fides.api.ops.oauth.utils import verify_oauth_client_prod +from fides.api.oauth.utils import verify_oauth_client_prod from fides.connectors.models import ( AWSConfig, BigQueryConfig, diff --git a/src/fides/api/ctl/routes/health.py b/src/fides/api/ctl/routes/health.py index 7ece4a3058..abe7483022 100644 --- a/src/fides/api/ctl/routes/health.py +++ b/src/fides/api/ctl/routes/health.py @@ -7,13 +7,13 @@ from sqlalchemy.orm import Session import fides +from fides.api.api.deps import get_db +from fides.api.common_exceptions import RedisConnectionError from fides.api.ctl.database.database import DatabaseHealth, get_db_health from fides.api.ctl.utils.api_router import APIRouter -from fides.api.ops.api.deps import get_db -from fides.api.ops.common_exceptions import RedisConnectionError -from fides.api.ops.tasks import celery_app, get_worker_ids -from fides.api.ops.util.cache import get_cache -from fides.api.ops.util.logger import Pii +from fides.api.tasks import celery_app, get_worker_ids +from fides.api.util.cache import get_cache +from fides.api.util.logger import Pii from fides.core.config import CONFIG CacheHealth = Literal["healthy", "unhealthy", "no cache configured"] diff --git a/src/fides/api/ctl/routes/router_factory.py b/src/fides/api/ctl/routes/router_factory.py index a4b4b09387..67a007cf50 100644 --- a/src/fides/api/ctl/routes/router_factory.py +++ b/src/fides/api/ctl/routes/router_factory.py @@ -14,6 +14,7 @@ from sqlalchemy.ext.asyncio import AsyncSession from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY +from fides.api.api.v1.scope_registry import CREATE, DELETE, READ, UPDATE from fides.api.ctl.database.crud import ( create_resource, delete_resource, @@ -37,9 +38,8 @@ ) from fides.api.ctl.utils import errors from fides.api.ctl.utils.api_router import APIRouter -from fides.api.ops.api.v1.scope_registry import CREATE, DELETE, READ, UPDATE -from fides.api.ops.oauth.utils import verify_oauth_client_prod -from fides.api.ops.schemas.dataset import validate_data_categories_against_db +from fides.api.oauth.utils import verify_oauth_client_prod +from fides.api.schemas.dataset import validate_data_categories_against_db async def get_data_categories_from_db(async_session: AsyncSession) -> List[FidesKey]: diff --git a/src/fides/api/ctl/routes/system.py b/src/fides/api/ctl/routes/system.py index 12ec8a1763..a135987d8e 100644 --- a/src/fides/api/ctl/routes/system.py +++ b/src/fides/api/ctl/routes/system.py @@ -11,6 +11,16 @@ from starlette import status from starlette.status import HTTP_200_OK +from fides.api.api import deps +from fides.api.api.v1.scope_registry import ( + CONNECTION_CREATE_OR_UPDATE, + CONNECTION_READ, + SYSTEM_CREATE, + SYSTEM_DELETE, + SYSTEM_READ, + SYSTEM_UPDATE, +) +from fides.api.api.v1.urn_registry import SYSTEM_CONNECTIONS, V1_URL_PREFIX from fides.api.ctl.database.crud import ( get_resource, get_resource_with_custom_fields, @@ -27,25 +37,15 @@ from fides.api.ctl.schemas.system import SystemResponse from fides.api.ctl.sql_models import System # type: ignore[attr-defined] from fides.api.ctl.utils.api_router import APIRouter -from fides.api.ops.api import deps -from fides.api.ops.api.v1.scope_registry import ( - CONNECTION_CREATE_OR_UPDATE, - CONNECTION_READ, - SYSTEM_CREATE, - SYSTEM_DELETE, - SYSTEM_READ, - SYSTEM_UPDATE, -) -from fides.api.ops.api.v1.urn_registry import SYSTEM_CONNECTIONS, V1_URL_PREFIX -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.oauth.utils import verify_oauth_client, verify_oauth_client_prod -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.oauth.utils import verify_oauth_client, verify_oauth_client_prod +from fides.api.schemas.connection_configuration.connection_config import ( BulkPutConnectionConfiguration, ConnectionConfigurationResponse, CreateConnectionConfigurationWithSecrets, ) -from fides.api.ops.util.connection_util import patch_connection_configs -from fides.api.ops.util.system_manager_oauth_util import ( +from fides.api.util.connection_util import patch_connection_configs +from fides.api.util.system_manager_oauth_util import ( verify_oauth_client_for_system_from_fides_key_cli, verify_oauth_client_for_system_from_request_body_cli, ) diff --git a/src/fides/api/ctl/routes/util.py b/src/fides/api/ctl/routes/util.py index 8392152b39..8e6f2670e0 100644 --- a/src/fides/api/ctl/routes/util.py +++ b/src/fides/api/ctl/routes/util.py @@ -3,12 +3,7 @@ from fideslang import FidesModelType from sqlalchemy.ext.asyncio import AsyncSession -from fides.api.ctl.database.crud import get_resource, list_resource -from fides.api.ctl.sql_models import ( # type: ignore[attr-defined] - models_with_default_field, -) -from fides.api.ctl.utils import errors -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CTL_DATASET, CTL_POLICY, DATA_CATEGORY, @@ -20,7 +15,12 @@ REGISTRY, SYSTEM, ) -from fides.api.ops.db.base import Base # type: ignore[attr-defined] +from fides.api.ctl.database.crud import get_resource, list_resource +from fides.api.ctl.sql_models import ( # type: ignore[attr-defined] + models_with_default_field, +) +from fides.api.ctl.utils import errors +from fides.api.db.base import Base # type: ignore[attr-defined] API_PREFIX = "/api/v1" diff --git a/src/fides/api/ctl/routes/validate.py b/src/fides/api/ctl/routes/validate.py index 1fad0211f9..86ee7316dc 100644 --- a/src/fides/api/ctl/routes/validate.py +++ b/src/fides/api/ctl/routes/validate.py @@ -7,10 +7,10 @@ from fastapi import Response, Security, status from pydantic import BaseModel +from fides.api.api.v1 import scope_registry from fides.api.ctl.routes.util import API_PREFIX from fides.api.ctl.utils.api_router import APIRouter -from fides.api.ops.api.v1 import scope_registry -from fides.api.ops.oauth.utils import verify_oauth_client_prod +from fides.api.oauth.utils import verify_oauth_client_prod from fides.connectors.models import ( AWSConfig, BigQueryConfig, diff --git a/src/fides/api/ctl/sql_models.py b/src/fides/api/ctl/sql_models.py index 8b49d3c89b..0ed2bb09c5 100644 --- a/src/fides/api/ctl/sql_models.py +++ b/src/fides/api/ctl/sql_models.py @@ -31,12 +31,12 @@ from sqlalchemy.sql import func from sqlalchemy.sql.sqltypes import DateTime -from fides.api.ops.common_exceptions import KeyOrNameAlreadyExists -from fides.api.ops.db.base_class import Base -from fides.api.ops.db.base_class import FidesBase as FideslibBase -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.fides_user_permissions import FidesUserPermissions +from fides.api.common_exceptions import KeyOrNameAlreadyExists +from fides.api.db.base_class import Base +from fides.api.db.base_class import FidesBase as FideslibBase +from fides.api.models.client import ClientDetail +from fides.api.models.fides_user import FidesUser +from fides.api.models.fides_user_permissions import FidesUserPermissions from fides.core.config import CONFIG diff --git a/src/fides/api/ctl/view.py b/src/fides/api/ctl/view.py index 8ba5a10f10..9012522e93 100644 --- a/src/fides/api/ctl/view.py +++ b/src/fides/api/ctl/view.py @@ -5,12 +5,12 @@ from fastapi.responses import HTMLResponse from sqlalchemy.ext.asyncio import AsyncSession +from fides.api.api.v1 import scope_registry from fides.api.ctl.database.crud import list_resource from fides.api.ctl.database.session import get_async_db from fides.api.ctl.sql_models import Evaluation # type: ignore[attr-defined] from fides.api.ctl.utils.api_router import APIRouter -from fides.api.ops.api.v1 import scope_registry -from fides.api.ops.oauth.utils import verify_oauth_client_prod +from fides.api.oauth.utils import verify_oauth_client_prod router = APIRouter( tags=["View"], diff --git a/src/fides/api/ops/cryptography/schemas/__init__.py b/src/fides/api/db/__init__.py similarity index 100% rename from src/fides/api/ops/cryptography/schemas/__init__.py rename to src/fides/api/db/__init__.py diff --git a/src/fides/api/db/base.py b/src/fides/api/db/base.py new file mode 100644 index 0000000000..02619f3141 --- /dev/null +++ b/src/fides/api/db/base.py @@ -0,0 +1,31 @@ +# pylint: disable=W0611 +# Import all the models, so that Base has them before being +# imported by Alembic +from fides.api.db.base_class import Base +from fides.api.models.application_config import ApplicationConfig +from fides.api.models.audit_log import AuditLog +from fides.api.models.authentication_request import AuthenticationRequest +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.custom_connector_template import CustomConnectorTemplate +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.fides_user import FidesUser +from fides.api.models.fides_user_permissions import FidesUserPermissions +from fides.api.models.manual_webhook import AccessManualWebhook +from fides.api.models.messaging import MessagingConfig +from fides.api.models.policy import Policy, Rule, RuleTarget +from fides.api.models.privacy_experience import ( + PrivacyExperience, + PrivacyExperienceConfig, + PrivacyExperienceConfigHistory, + PrivacyExperienceHistory, +) +from fides.api.models.privacy_notice import PrivacyNotice, PrivacyNoticeHistory +from fides.api.models.privacy_preference import ( + CurrentPrivacyPreference, + PrivacyPreferenceHistory, +) +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.models.registration import UserRegistration +from fides.api.models.storage import StorageConfig +from fides.api.models.system_manager import SystemManager diff --git a/src/fides/api/ops/db/base_class.py b/src/fides/api/db/base_class.py similarity index 98% rename from src/fides/api/ops/db/base_class.py rename to src/fides/api/db/base_class.py index d203a9bf8b..93bc63e25b 100644 --- a/src/fides/api/ops/db/base_class.py +++ b/src/fides/api/db/base_class.py @@ -16,8 +16,8 @@ from sqlalchemy.sql.expression import BinaryExpression, BooleanClauseList from sqlalchemy_utils import JSONType -from fides.api.ops.common_exceptions import KeyOrNameAlreadyExists, KeyValidationError -from fides.api.ops.util.text import to_snake_case +from fides.api.common_exceptions import KeyOrNameAlreadyExists, KeyValidationError +from fides.api.util.text import to_snake_case T = TypeVar("T", bound="OrmWrappedFidesBase") ALLOWED_CHARS = re.compile(r"[A-z0-9\-_]") diff --git a/src/fides/api/ops/db/session.py b/src/fides/api/db/session.py similarity index 97% rename from src/fides/api/ops/db/session.py rename to src/fides/api/db/session.py index 172ff1079b..5f8ec57491 100644 --- a/src/fides/api/ops/db/session.py +++ b/src/fides/api/db/session.py @@ -6,7 +6,7 @@ from sqlalchemy.engine.url import URL from sqlalchemy.orm import Session, sessionmaker -from fides.api.ops.common_exceptions import MissingConfig +from fides.api.common_exceptions import MissingConfig from fides.core.config import FidesConfig diff --git a/src/fides/api/ops/email_templates/__init__.py b/src/fides/api/email_templates/__init__.py similarity index 100% rename from src/fides/api/ops/email_templates/__init__.py rename to src/fides/api/email_templates/__init__.py diff --git a/src/fides/api/ops/email_templates/get_email_template.py b/src/fides/api/email_templates/get_email_template.py similarity index 93% rename from src/fides/api/ops/email_templates/get_email_template.py rename to src/fides/api/email_templates/get_email_template.py index 0adff7ecb6..87606a292a 100644 --- a/src/fides/api/ops/email_templates/get_email_template.py +++ b/src/fides/api/email_templates/get_email_template.py @@ -3,8 +3,8 @@ from jinja2 import Environment, FileSystemLoader, Template, select_autoescape from loguru import logger -from fides.api.ops.common_exceptions import EmailTemplateUnhandledActionType -from fides.api.ops.email_templates.template_names import ( +from fides.api.common_exceptions import EmailTemplateUnhandledActionType +from fides.api.email_templates.template_names import ( CONSENT_REQUEST_EMAIL_FULFILLMENT, CONSENT_REQUEST_VERIFICATION_TEMPLATE, EMAIL_ERASURE_REQUEST_FULFILLMENT, @@ -17,7 +17,7 @@ SUBJECT_IDENTITY_VERIFICATION_TEMPLATE, TEST_MESSAGE_TEMPLATE, ) -from fides.api.ops.schemas.messaging.messaging import MessagingActionType +from fides.api.schemas.messaging.messaging import MessagingActionType pathlib.Path(__file__).parent.resolve() diff --git a/src/fides/api/ops/email_templates/template_names.py b/src/fides/api/email_templates/template_names.py similarity index 100% rename from src/fides/api/ops/email_templates/template_names.py rename to src/fides/api/email_templates/template_names.py diff --git a/src/fides/api/ops/email_templates/templates/consent_request_email_fulfillment.html b/src/fides/api/email_templates/templates/consent_request_email_fulfillment.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/consent_request_email_fulfillment.html rename to src/fides/api/email_templates/templates/consent_request_email_fulfillment.html diff --git a/src/fides/api/ops/email_templates/templates/consent_request_verification.html b/src/fides/api/email_templates/templates/consent_request_verification.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/consent_request_verification.html rename to src/fides/api/email_templates/templates/consent_request_verification.html diff --git a/src/fides/api/ops/email_templates/templates/message_request_email_fulfillment.html b/src/fides/api/email_templates/templates/message_request_email_fulfillment.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/message_request_email_fulfillment.html rename to src/fides/api/email_templates/templates/message_request_email_fulfillment.html diff --git a/src/fides/api/ops/email_templates/templates/privacy_request_complete_access.html b/src/fides/api/email_templates/templates/privacy_request_complete_access.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/privacy_request_complete_access.html rename to src/fides/api/email_templates/templates/privacy_request_complete_access.html diff --git a/src/fides/api/ops/email_templates/templates/privacy_request_complete_deletion.html b/src/fides/api/email_templates/templates/privacy_request_complete_deletion.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/privacy_request_complete_deletion.html rename to src/fides/api/email_templates/templates/privacy_request_complete_deletion.html diff --git a/src/fides/api/ops/email_templates/templates/privacy_request_error_notification.html b/src/fides/api/email_templates/templates/privacy_request_error_notification.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/privacy_request_error_notification.html rename to src/fides/api/email_templates/templates/privacy_request_error_notification.html diff --git a/src/fides/api/ops/email_templates/templates/privacy_request_receipt.html b/src/fides/api/email_templates/templates/privacy_request_receipt.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/privacy_request_receipt.html rename to src/fides/api/email_templates/templates/privacy_request_receipt.html diff --git a/src/fides/api/ops/email_templates/templates/privacy_request_review_approve.html b/src/fides/api/email_templates/templates/privacy_request_review_approve.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/privacy_request_review_approve.html rename to src/fides/api/email_templates/templates/privacy_request_review_approve.html diff --git a/src/fides/api/ops/email_templates/templates/privacy_request_review_deny.html b/src/fides/api/email_templates/templates/privacy_request_review_deny.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/privacy_request_review_deny.html rename to src/fides/api/email_templates/templates/privacy_request_review_deny.html diff --git a/src/fides/api/ops/email_templates/templates/subject_identity_verification.html b/src/fides/api/email_templates/templates/subject_identity_verification.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/subject_identity_verification.html rename to src/fides/api/email_templates/templates/subject_identity_verification.html diff --git a/src/fides/api/ops/email_templates/templates/test_message.html b/src/fides/api/email_templates/templates/test_message.html similarity index 100% rename from src/fides/api/ops/email_templates/templates/test_message.html rename to src/fides/api/email_templates/templates/test_message.html diff --git a/src/fides/api/ops/db/__init__.py b/src/fides/api/graph/__init__.py similarity index 100% rename from src/fides/api/ops/db/__init__.py rename to src/fides/api/graph/__init__.py diff --git a/src/fides/api/ops/graph/analytics_events.py b/src/fides/api/graph/analytics_events.py similarity index 87% rename from src/fides/api/ops/graph/analytics_events.py rename to src/fides/api/graph/analytics_events.py index de719fc74c..8c82584c89 100644 --- a/src/fides/api/ops/graph/analytics_events.py +++ b/src/fides/api/graph/analytics_events.py @@ -3,22 +3,22 @@ from fideslog.sdk.python.event import AnalyticsEvent -from fides.api.ops.analytics import in_docker_container, send_analytics_event -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.graph.graph_differences import ( +from fides.api.analytics import in_docker_container, send_analytics_event +from fides.api.graph.config import CollectionAddress +from fides.api.graph.graph_differences import ( GraphDiffSummary, GraphRepr, find_graph_differences_summary, format_graph_for_caching, ) -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.task.task_resources import TaskResources -from fides.api.ops.util.collection_util import Row +from fides.api.models.policy import ActionType +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.task.task_resources import TaskResources +from fides.api.util.collection_util import Row from fides.core.config import CONFIG if TYPE_CHECKING: - from fides.api.ops.task.graph_task import GraphTask + from fides.api.task.graph_task import GraphTask async def fideslog_graph_failure(event: Optional[AnalyticsEvent]) -> None: diff --git a/src/fides/api/ops/graph/config.py b/src/fides/api/graph/config.py similarity index 98% rename from src/fides/api/ops/graph/config.py rename to src/fides/api/graph/config.py index ffd4ef77eb..c504d06fa3 100644 --- a/src/fides/api/ops/graph/config.py +++ b/src/fides/api/graph/config.py @@ -85,14 +85,14 @@ from fideslang.validation import FidesKey from pydantic import BaseModel, validator -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.graph.data_type import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.graph.data_type import ( DataType, DataTypeConverter, get_data_type_converter, ) -from fides.api.ops.util.collection_util import merge_dicts -from fides.api.ops.util.querytoken import QueryToken +from fides.api.util.collection_util import merge_dicts +from fides.api.util.querytoken import QueryToken DatasetAddress = str SeedAddress = str diff --git a/src/fides/api/ops/graph/data_type.py b/src/fides/api/graph/data_type.py similarity index 100% rename from src/fides/api/ops/graph/data_type.py rename to src/fides/api/graph/data_type.py diff --git a/src/fides/api/ops/graph/graph.py b/src/fides/api/graph/graph.py similarity index 98% rename from src/fides/api/ops/graph/graph.py rename to src/fides/api/graph/graph.py index a9a49ac653..7b62ee4d95 100644 --- a/src/fides/api/ops/graph/graph.py +++ b/src/fides/api/graph/graph.py @@ -6,8 +6,8 @@ from fideslang.validation import FidesKey from loguru import logger -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.graph.config import ( +from fides.api.common_exceptions import ValidationError +from fides.api.graph.config import ( Collection, CollectionAddress, EdgeDirection, diff --git a/src/fides/api/ops/graph/graph_differences.py b/src/fides/api/graph/graph_differences.py similarity index 97% rename from src/fides/api/ops/graph/graph_differences.py rename to src/fides/api/graph/graph_differences.py index 8d1a707456..9a0899a28f 100644 --- a/src/fides/api/ops/graph/graph_differences.py +++ b/src/fides/api/graph/graph_differences.py @@ -1,15 +1,15 @@ from typing import TYPE_CHECKING, Dict, List, Optional, Set -from fides.api.ops.graph.config import ( +from fides.api.graph.config import ( ROOT_COLLECTION_ADDRESS, TERMINATOR_ADDRESS, CollectionAddress, ) -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.util.collection_util import Row +from fides.api.schemas.base_class import FidesSchema +from fides.api.util.collection_util import Row if TYPE_CHECKING: - from fides.api.ops.task.graph_task import GraphTask + from fides.api.task.graph_task import GraphTask GraphRepr = Dict[str, Dict[str, List[str]]] diff --git a/src/fides/api/ops/graph/traversal.py b/src/fides/api/graph/traversal.py similarity index 98% rename from src/fides/api/ops/graph/traversal.py rename to src/fides/api/graph/traversal.py index 533ae7d3df..7d99520376 100644 --- a/src/fides/api/ops/graph/traversal.py +++ b/src/fides/api/graph/traversal.py @@ -5,8 +5,8 @@ import pydash.collections from loguru import logger -from fides.api.ops.common_exceptions import TraversalError -from fides.api.ops.graph.config import ( +from fides.api.common_exceptions import TraversalError +from fides.api.graph.config import ( ROOT_COLLECTION_ADDRESS, Collection, CollectionAddress, @@ -15,9 +15,9 @@ FieldPath, GraphDataset, ) -from fides.api.ops.graph.graph import DatasetGraph, Edge, Node -from fides.api.ops.util.collection_util import Row, append -from fides.api.ops.util.matching_queue import MatchingQueue +from fides.api.graph.graph import DatasetGraph, Edge, Node +from fides.api.util.collection_util import Row, append +from fides.api.util.matching_queue import MatchingQueue Datastore = Dict[CollectionAddress, List[Row]] """A type expressing retrieved rows of data from a specified collection""" diff --git a/src/fides/api/main.py b/src/fides/api/main.py index 37df2cf1c5..5aa9c1308f 100644 --- a/src/fides/api/main.py +++ b/src/fides/api/main.py @@ -14,6 +14,11 @@ from uvicorn import Config, Server import fides +from fides.api.analytics import ( + accessed_through_local_host, + in_docker_container, + send_analytics_event, +) from fides.api.app_setup import ( check_redis, create_fides_app, @@ -28,19 +33,14 @@ match_route, path_is_in_ui_directory, ) -from fides.api.ops.analytics import ( - accessed_through_local_host, - in_docker_container, - send_analytics_event, -) -from fides.api.ops.schemas.analytics import Event, ExtraData +from fides.api.schemas.analytics import Event, ExtraData # pylint: disable=wildcard-import, unused-wildcard-import -from fides.api.ops.service.privacy_request.email_batch_service import ( +from fides.api.service.privacy_request.email_batch_service import ( initiate_scheduled_batch_email_send, ) -from fides.api.ops.tasks.scheduled.scheduler import scheduler -from fides.api.ops.util.logger import _log_exception +from fides.api.tasks.scheduled.scheduler import scheduler +from fides.api.util.logger import _log_exception from fides.cli.utils import FIDES_ASCII_ART from fides.core.config import CONFIG, check_required_webserver_config_values diff --git a/src/fides/api/ops/graph/__init__.py b/src/fides/api/models/__init__.py similarity index 100% rename from src/fides/api/ops/graph/__init__.py rename to src/fides/api/models/__init__.py diff --git a/src/fides/api/ops/models/application_config.py b/src/fides/api/models/application_config.py similarity index 99% rename from src/fides/api/ops/models/application_config.py rename to src/fides/api/models/application_config.py index b810e4221c..f4022726a9 100644 --- a/src/fides/api/ops/models/application_config.py +++ b/src/fides/api/models/application_config.py @@ -14,7 +14,7 @@ StringEncryptedType, ) -from fides.api.ops.db.base_class import Base, JSONTypeOverride +from fides.api.db.base_class import Base, JSONTypeOverride from fides.core.config import CONFIG, FidesConfig diff --git a/src/fides/api/ops/models/audit_log.py b/src/fides/api/models/audit_log.py similarity index 93% rename from src/fides/api/ops/models/audit_log.py rename to src/fides/api/models/audit_log.py index d710880a76..3dd056a3e8 100644 --- a/src/fides/api/ops/models/audit_log.py +++ b/src/fides/api/models/audit_log.py @@ -4,7 +4,7 @@ from sqlalchemy import Enum as EnumColumn from sqlalchemy import String -from fides.api.ops.db.base_class import Base +from fides.api.db.base_class import Base class AuditLogAction(str, EnumType): diff --git a/src/fides/api/ops/models/authentication_request.py b/src/fides/api/models/authentication_request.py similarity index 96% rename from src/fides/api/ops/models/authentication_request.py rename to src/fides/api/models/authentication_request.py index aa66433ae3..0d85297ddd 100644 --- a/src/fides/api/ops/models/authentication_request.py +++ b/src/fides/api/models/authentication_request.py @@ -3,7 +3,7 @@ from sqlalchemy import Column, String from sqlalchemy.orm import Session -from fides.api.ops.db.base_class import Base +from fides.api.db.base_class import Base class AuthenticationRequest(Base): diff --git a/src/fides/api/ops/models/client.py b/src/fides/api/models/client.py similarity index 95% rename from src/fides/api/ops/models/client.py rename to src/fides/api/models/client.py index 34d6f5adf0..1926cd8f6d 100644 --- a/src/fides/api/ops/models/client.py +++ b/src/fides/api/models/client.py @@ -8,21 +8,21 @@ from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import Session -from fides.api.ops.cryptography.cryptographic_util import ( +from fides.api.cryptography.cryptographic_util import ( generate_salt, generate_secure_random_string, hash_with_salt, ) -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_ROLES, JWE_PAYLOAD_SCOPES, JWE_PAYLOAD_SYSTEMS, ) -from fides.api.ops.db.base_class import Base -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.oauth.jwt import generate_jwe +from fides.api.db.base_class import Base +from fides.api.models.fides_user import FidesUser +from fides.api.oauth.jwt import generate_jwe from fides.core.config import FidesConfig DEFAULT_SCOPES: list[str] = [] diff --git a/src/fides/api/ops/models/connectionconfig.py b/src/fides/api/models/connectionconfig.py similarity index 97% rename from src/fides/api/ops/models/connectionconfig.py rename to src/fides/api/models/connectionconfig.py index 23706a58e4..39ca4d44d9 100644 --- a/src/fides/api/ops/models/connectionconfig.py +++ b/src/fides/api/models/connectionconfig.py @@ -13,15 +13,10 @@ StringEncryptedType, ) +from fides.api.common_exceptions import KeyOrNameAlreadyExists from fides.api.ctl.sql_models import System # type: ignore[attr-defined] -from fides.api.ops.common_exceptions import KeyOrNameAlreadyExists -from fides.api.ops.db.base_class import ( - Base, - FidesBase, - JSONTypeOverride, - get_key_from_data, -) -from fides.api.ops.schemas.saas.saas_config import SaaSConfig +from fides.api.db.base_class import Base, FidesBase, JSONTypeOverride, get_key_from_data +from fides.api.schemas.saas.saas_config import SaaSConfig from fides.core.config import CONFIG diff --git a/src/fides/api/ops/models/custom_connector_template.py b/src/fides/api/models/custom_connector_template.py similarity index 95% rename from src/fides/api/ops/models/custom_connector_template.py rename to src/fides/api/models/custom_connector_template.py index 9334d770e1..25f3cd4d76 100644 --- a/src/fides/api/ops/models/custom_connector_template.py +++ b/src/fides/api/models/custom_connector_template.py @@ -1,7 +1,7 @@ from sqlalchemy import Boolean, Column, String from sqlalchemy.ext.declarative import declared_attr -from fides.api.ops.db.base_class import Base +from fides.api.db.base_class import Base class CustomConnectorTemplate(Base): diff --git a/src/fides/api/ops/models/datasetconfig.py b/src/fides/api/models/datasetconfig.py similarity index 97% rename from src/fides/api/ops/models/datasetconfig.py rename to src/fides/api/models/datasetconfig.py index 4c7fa906b2..e3649452cb 100644 --- a/src/fides/api/ops/models/datasetconfig.py +++ b/src/fides/api/models/datasetconfig.py @@ -6,10 +6,10 @@ from sqlalchemy import Column, ForeignKey, String from sqlalchemy.orm import Session, relationship +from fides.api.common_exceptions import ValidationError from fides.api.ctl.sql_models import Dataset as CtlDataset # type: ignore[attr-defined] -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.db.base_class import Base -from fides.api.ops.graph.config import ( +from fides.api.db.base_class import Base +from fides.api.graph.config import ( Collection, CollectionAddress, Field, @@ -18,9 +18,9 @@ GraphDataset, generate_field, ) -from fides.api.ops.graph.data_type import parse_data_type_string -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.util.saas_util import merge_datasets +from fides.api.graph.data_type import parse_data_type_string +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.util.saas_util import merge_datasets class DatasetConfig(Base): diff --git a/src/fides/api/ops/models/fides_user.py b/src/fides/api/models/fides_user.py similarity index 93% rename from src/fides/api/ops/models/fides_user.py rename to src/fides/api/models/fides_user.py index 5cb41e9b28..dc8e049762 100644 --- a/src/fides/api/ops/models/fides_user.py +++ b/src/fides/api/models/fides_user.py @@ -8,15 +8,13 @@ from sqlalchemy import Column, DateTime, String from sqlalchemy.orm import Session, relationship -from fides.api.ops.common_exceptions import SystemManagerException -from fides.api.ops.cryptography.cryptographic_util import generate_salt, hash_with_salt -from fides.api.ops.db.base_class import Base -from fides.api.ops.models.audit_log import AuditLog +from fides.api.common_exceptions import SystemManagerException +from fides.api.cryptography.cryptographic_util import generate_salt, hash_with_salt +from fides.api.db.base_class import Base +from fides.api.models.audit_log import AuditLog # Intentionally importing SystemManager here to build the FidesUser.systems relationship -from fides.api.ops.models.system_manager import ( # type: ignore[unused-import] - SystemManager, -) +from fides.api.models.system_manager import SystemManager # type: ignore[unused-import] if TYPE_CHECKING: from fides.api.ctl.sql_models import System # type: ignore[attr-defined] diff --git a/src/fides/api/ops/models/fides_user_permissions.py b/src/fides/api/models/fides_user_permissions.py similarity index 83% rename from src/fides/api/ops/models/fides_user_permissions.py rename to src/fides/api/models/fides_user_permissions.py index edbf4dab73..bff15aa2c6 100644 --- a/src/fides/api/ops/models/fides_user_permissions.py +++ b/src/fides/api/models/fides_user_permissions.py @@ -3,9 +3,9 @@ from sqlalchemy import ARRAY, Column, ForeignKey, String from sqlalchemy.orm import backref, relationship -from fides.api.ops.db.base_class import Base -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.oauth.roles import ROLES_TO_SCOPES_MAPPING +from fides.api.db.base_class import Base +from fides.api.models.fides_user import FidesUser +from fides.api.oauth.roles import ROLES_TO_SCOPES_MAPPING class FidesUserPermissions(Base): diff --git a/src/fides/api/ops/models/manual_webhook.py b/src/fides/api/models/manual_webhook.py similarity index 94% rename from src/fides/api/ops/models/manual_webhook.py rename to src/fides/api/models/manual_webhook.py index a342347817..2fe536b2a4 100644 --- a/src/fides/api/ops/models/manual_webhook.py +++ b/src/fides/api/models/manual_webhook.py @@ -6,9 +6,9 @@ from sqlalchemy.ext.mutable import MutableList from sqlalchemy.orm import Session, relationship -from fides.api.ops.db.base_class import Base -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.base_class import FidesSchema +from fides.api.db.base_class import Base +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.base_class import FidesSchema class AccessManualWebhook(Base): diff --git a/src/fides/api/ops/models/messaging.py b/src/fides/api/models/messaging.py similarity index 95% rename from src/fides/api/ops/models/messaging.py rename to src/fides/api/models/messaging.py index f907771309..7e4a12945a 100644 --- a/src/fides/api/ops/models/messaging.py +++ b/src/fides/api/models/messaging.py @@ -13,9 +13,9 @@ StringEncryptedType, ) -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.db.base_class import Base, JSONTypeOverride -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.common_exceptions import MessageDispatchException +from fides.api.db.base_class import Base, JSONTypeOverride +from fides.api.schemas.messaging.messaging import ( EMAIL_MESSAGING_SERVICES, SMS_MESSAGING_SERVICES, SUPPORTED_MESSAGING_SERVICE_SECRETS, @@ -26,10 +26,10 @@ MessagingServiceSecretsTwilioSMS, MessagingServiceType, ) -from fides.api.ops.schemas.messaging.messaging_secrets_docs_only import ( +from fides.api.schemas.messaging.messaging_secrets_docs_only import ( possible_messaging_secrets, ) -from fides.api.ops.util.logger import Pii +from fides.api.util.logger import Pii from fides.core.config import CONFIG from fides.core.config.config_proxy import ConfigProxy diff --git a/src/fides/api/ops/models/policy.py b/src/fides/api/models/policy.py similarity index 98% rename from src/fides/api/ops/models/policy.py rename to src/fides/api/models/policy.py index d0ff304f92..4a6e46d067 100644 --- a/src/fides/api/ops/models/policy.py +++ b/src/fides/api/models/policy.py @@ -15,20 +15,17 @@ StringEncryptedType, ) -from fides.api.ctl.sql_models import DataCategory # type: ignore -from fides.api.ops import common_exceptions -from fides.api.ops.common_exceptions import ( +from fides.api import common_exceptions +from fides.api.common_exceptions import ( StorageConfigNotFoundException, WebhookOrderException, ) -from fides.api.ops.db.base_class import Base, FidesBase, JSONTypeOverride -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.storage import ( - StorageConfig, - get_active_default_storage_config, -) -from fides.api.ops.util.data_category import _validate_data_category +from fides.api.ctl.sql_models import DataCategory # type: ignore +from fides.api.db.base_class import Base, FidesBase, JSONTypeOverride +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.storage import StorageConfig, get_active_default_storage_config +from fides.api.util.data_category import _validate_data_category from fides.core.config import CONFIG diff --git a/src/fides/api/ops/models/privacy_experience.py b/src/fides/api/models/privacy_experience.py similarity index 99% rename from src/fides/api/ops/models/privacy_experience.py rename to src/fides/api/models/privacy_experience.py index b3e3f67fe1..a5575912e0 100644 --- a/src/fides/api/ops/models/privacy_experience.py +++ b/src/fides/api/models/privacy_experience.py @@ -9,14 +9,14 @@ from sqlalchemy.orm import Query, Session, relationship from sqlalchemy.util import hybridproperty -from fides.api.ops.db.base_class import Base -from fides.api.ops.models.privacy_notice import ( +from fides.api.db.base_class import Base +from fides.api.models.privacy_notice import ( ConsentMechanism, PrivacyNotice, PrivacyNoticeRegion, ) -from fides.api.ops.models.privacy_preference import CurrentPrivacyPreference -from fides.api.ops.models.privacy_request import ProvidedIdentity +from fides.api.models.privacy_preference import CurrentPrivacyPreference +from fides.api.models.privacy_request import ProvidedIdentity class ComponentType(Enum): diff --git a/src/fides/api/ops/models/privacy_notice.py b/src/fides/api/models/privacy_notice.py similarity index 99% rename from src/fides/api/ops/models/privacy_notice.py rename to src/fides/api/models/privacy_notice.py index 6a3c435ec0..fa28932996 100644 --- a/src/fides/api/ops/models/privacy_notice.py +++ b/src/fides/api/models/privacy_notice.py @@ -12,9 +12,9 @@ from sqlalchemy.orm import Session, relationship from sqlalchemy.util import hybridproperty +from fides.api.common_exceptions import ValidationError from fides.api.ctl.sql_models import System # type: ignore[attr-defined] -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.db.base_class import Base, FidesBase +from fides.api.db.base_class import Base, FidesBase class UserConsentPreference(Enum): diff --git a/src/fides/api/ops/models/privacy_preference.py b/src/fides/api/models/privacy_preference.py similarity index 98% rename from src/fides/api/ops/models/privacy_preference.py rename to src/fides/api/models/privacy_preference.py index 962e449cba..c70917faa3 100644 --- a/src/fides/api/ops/models/privacy_preference.py +++ b/src/fides/api/models/privacy_preference.py @@ -14,18 +14,18 @@ from sqlalchemy_utils import StringEncryptedType from sqlalchemy_utils.types.encrypted.encrypted_type import AesGcmEngine -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( IdentityNotFoundException, PrivacyNoticeHistoryNotFound, ) -from fides.api.ops.db.base_class import Base, JSONTypeOverride -from fides.api.ops.models.privacy_notice import ( +from fides.api.db.base_class import Base, JSONTypeOverride +from fides.api.models.privacy_notice import ( PrivacyNotice, PrivacyNoticeHistory, PrivacyNoticeRegion, UserConsentPreference, ) -from fides.api.ops.models.privacy_request import ( +from fides.api.models.privacy_request import ( ExecutionLogStatus, PrivacyRequest, ProvidedIdentity, diff --git a/src/fides/api/ops/models/privacy_request.py b/src/fides/api/models/privacy_request.py similarity index 96% rename from src/fides/api/ops/models/privacy_request.py rename to src/fides/api/models/privacy_request.py index 878562bbff..ca1529f23e 100644 --- a/src/fides/api/ops/models/privacy_request.py +++ b/src/fides/api/models/privacy_request.py @@ -21,23 +21,23 @@ StringEncryptedType, ) -from fides.api.ops.api.v1.scope_registry import PRIVACY_REQUEST_CALLBACK_RESUME -from fides.api.ops.common_exceptions import ( +from fides.api.api.v1.scope_registry import PRIVACY_REQUEST_CALLBACK_RESUME +from fides.api.common_exceptions import ( IdentityVerificationException, ManualWebhookFieldsUnset, NoCachedManualWebhookEntry, PrivacyRequestPaused, ) -from fides.api.ops.cryptography.cryptographic_util import hash_with_salt -from fides.api.ops.db.base_class import Base # type: ignore[attr-defined] -from fides.api.ops.db.base_class import JSONTypeOverride -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.graph.graph_differences import GraphRepr -from fides.api.ops.models.audit_log import AuditLog -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.manual_webhook import AccessManualWebhook -from fides.api.ops.models.policy import ( +from fides.api.cryptography.cryptographic_util import hash_with_salt +from fides.api.db.base_class import Base # type: ignore[attr-defined] +from fides.api.db.base_class import JSONTypeOverride +from fides.api.graph.config import CollectionAddress +from fides.api.graph.graph_differences import GraphRepr +from fides.api.models.audit_log import AuditLog +from fides.api.models.client import ClientDetail +from fides.api.models.fides_user import FidesUser +from fides.api.models.manual_webhook import AccessManualWebhook +from fides.api.models.policy import ( ActionType, CurrentStep, Policy, @@ -45,14 +45,14 @@ WebhookDirection, WebhookTypes, ) -from fides.api.ops.oauth.jwt import generate_jwe -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.drp_privacy_request import DrpPrivacyRequestCreate -from fides.api.ops.schemas.external_https import SecondPartyResponseFormat, WebhookJWE -from fides.api.ops.schemas.masking.masking_secrets import MaskingSecretCache -from fides.api.ops.schemas.redis_cache import Identity, IdentityBase -from fides.api.ops.tasks import celery_app -from fides.api.ops.util.cache import ( +from fides.api.oauth.jwt import generate_jwe +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.drp_privacy_request import DrpPrivacyRequestCreate +from fides.api.schemas.external_https import SecondPartyResponseFormat, WebhookJWE +from fides.api.schemas.masking.masking_secrets import MaskingSecretCache +from fides.api.schemas.redis_cache import Identity, IdentityBase +from fides.api.tasks import celery_app +from fides.api.util.cache import ( FidesopsRedis, get_all_cache_keys_for_privacy_request, get_async_task_tracking_cache_key, @@ -62,9 +62,9 @@ get_identity_cache_key, get_masking_secret_cache_key, ) -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.constants import API_DATE_FORMAT -from fides.api.ops.util.identity_verification import IdentityVerificationMixin +from fides.api.util.collection_util import Row +from fides.api.util.constants import API_DATE_FORMAT +from fides.api.util.identity_verification import IdentityVerificationMixin from fides.core.config import CONFIG # Locations from which privacy request execution can be resumed, in order. @@ -660,7 +660,7 @@ def trigger_policy_webhook( to halt. To resume, they use send a request to the reply-to URL with the reply-to-token. """ # temp fix for circular dependency - from fides.api.ops.service.connectors import HTTPSConnector, get_connector + from fides.api.service.connectors import HTTPSConnector, get_connector https_connector: HTTPSConnector = get_connector(webhook.connection_config) # type: ignore request_body = SecondPartyRequestFormat( diff --git a/src/fides/api/ops/models/registration.py b/src/fides/api/models/registration.py similarity index 97% rename from src/fides/api/ops/models/registration.py rename to src/fides/api/models/registration.py index 6efd1e1291..0c39dddb8e 100644 --- a/src/fides/api/ops/models/registration.py +++ b/src/fides/api/models/registration.py @@ -6,7 +6,7 @@ from sqlalchemy_utils import StringEncryptedType from sqlalchemy_utils.types.encrypted.encrypted_type import AesEngine -from fides.api.ops.db.base_class import Base, FidesBase +from fides.api.db.base_class import Base, FidesBase from fides.core.config import CONFIG diff --git a/src/fides/api/ops/models/storage.py b/src/fides/api/models/storage.py similarity index 94% rename from src/fides/api/ops/models/storage.py rename to src/fides/api/models/storage.py index 0fd02bef96..a0f76fe2b2 100644 --- a/src/fides/api/ops/models/storage.py +++ b/src/fides/api/models/storage.py @@ -13,13 +13,11 @@ StringEncryptedType, ) -from fides.api.ops.db.base_class import Base, JSONTypeOverride -from fides.api.ops.schemas.storage.storage import ResponseFormat, StorageType -from fides.api.ops.schemas.storage.storage_secrets_docs_only import ( - possible_storage_secrets, -) -from fides.api.ops.util.logger import Pii -from fides.api.ops.util.storage_util import get_schema_for_secrets +from fides.api.db.base_class import Base, JSONTypeOverride +from fides.api.schemas.storage.storage import ResponseFormat, StorageType +from fides.api.schemas.storage.storage_secrets_docs_only import possible_storage_secrets +from fides.api.util.logger import Pii +from fides.api.util.storage_util import get_schema_for_secrets from fides.core.config import CONFIG from fides.core.config.config_proxy import ConfigProxy diff --git a/src/fides/api/ops/models/system_manager.py b/src/fides/api/models/system_manager.py similarity index 91% rename from src/fides/api/ops/models/system_manager.py rename to src/fides/api/models/system_manager.py index ba8aa1654c..8948ba30c7 100644 --- a/src/fides/api/ops/models/system_manager.py +++ b/src/fides/api/models/system_manager.py @@ -1,6 +1,6 @@ from sqlalchemy import Column, ForeignKey, String -from fides.api.ops.db.base_class import Base +from fides.api.db.base_class import Base class SystemManager(Base): diff --git a/src/fides/api/ops/models/__init__.py b/src/fides/api/oauth/__init__.py similarity index 100% rename from src/fides/api/ops/models/__init__.py rename to src/fides/api/oauth/__init__.py diff --git a/src/fides/api/ops/oauth/jwt.py b/src/fides/api/oauth/jwt.py similarity index 100% rename from src/fides/api/ops/oauth/jwt.py rename to src/fides/api/oauth/jwt.py diff --git a/src/fides/api/ops/oauth/roles.py b/src/fides/api/oauth/roles.py similarity index 98% rename from src/fides/api/ops/oauth/roles.py rename to src/fides/api/oauth/roles.py index 6b671cbeb4..d403ba6c13 100644 --- a/src/fides/api/ops/oauth/roles.py +++ b/src/fides/api/oauth/roles.py @@ -1,7 +1,7 @@ from enum import Enum from typing import Dict, List, Optional -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CLI_OBJECTS_READ, CLIENT_READ, CONFIG_READ, diff --git a/src/fides/api/ops/oauth/system_manager.py b/src/fides/api/oauth/system_manager.py similarity index 72% rename from src/fides/api/ops/oauth/system_manager.py rename to src/fides/api/oauth/system_manager.py index 22b4cf3409..834ae76d10 100644 --- a/src/fides/api/ops/oauth/system_manager.py +++ b/src/fides/api/oauth/system_manager.py @@ -1,4 +1,4 @@ -from fides.api.ops.api.v1.scope_registry import SYSTEM_DELETE, SYSTEM_UPDATE +from fides.api.api.v1.scope_registry import SYSTEM_DELETE, SYSTEM_UPDATE # System managers are separate from roles, because you are just granted these # permissions to specific system(s) not to all resources of a given type diff --git a/src/fides/api/ops/oauth/utils.py b/src/fides/api/oauth/utils.py similarity index 94% rename from src/fides/api/ops/oauth/utils.py rename to src/fides/api/oauth/utils.py index 8d518f8c3c..ca09fde0f0 100644 --- a/src/fides/api/ops/oauth/utils.py +++ b/src/fides/api/oauth/utils.py @@ -15,21 +15,21 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_404_NOT_FOUND -from fides.api.ops.api.deps import get_db -from fides.api.ops.api.v1.urn_registry import TOKEN, V1_URL_PREFIX -from fides.api.ops.common_exceptions import AuthenticationError, AuthorizationError -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.api.deps import get_db +from fides.api.api.v1.urn_registry import TOKEN, V1_URL_PREFIX +from fides.api.common_exceptions import AuthenticationError, AuthorizationError +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_ROLES, JWE_PAYLOAD_SCOPES, ) -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.policy import PolicyPreWebhook -from fides.api.ops.oauth.roles import get_scopes_from_roles -from fides.api.ops.schemas.external_https import WebhookJWE -from fides.api.ops.schemas.oauth import OAuth2ClientCredentialsBearer +from fides.api.models.client import ClientDetail +from fides.api.models.fides_user import FidesUser +from fides.api.models.policy import PolicyPreWebhook +from fides.api.oauth.roles import get_scopes_from_roles +from fides.api.schemas.external_https import WebhookJWE +from fides.api.schemas.oauth import OAuth2ClientCredentialsBearer from fides.core.config import CONFIG JWT_ENCRYPTION_ALGORITHM = ALGORITHMS.A256GCM diff --git a/src/fides/api/ops/db/base.py b/src/fides/api/ops/db/base.py deleted file mode 100644 index afbf5774a7..0000000000 --- a/src/fides/api/ops/db/base.py +++ /dev/null @@ -1,31 +0,0 @@ -# pylint: disable=W0611 -# Import all the models, so that Base has them before being -# imported by Alembic -from fides.api.ops.db.base_class import Base -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.models.audit_log import AuditLog -from fides.api.ops.models.authentication_request import AuthenticationRequest -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.custom_connector_template import CustomConnectorTemplate -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.fides_user_permissions import FidesUserPermissions -from fides.api.ops.models.manual_webhook import AccessManualWebhook -from fides.api.ops.models.messaging import MessagingConfig -from fides.api.ops.models.policy import Policy, Rule, RuleTarget -from fides.api.ops.models.privacy_experience import ( - PrivacyExperience, - PrivacyExperienceConfig, - PrivacyExperienceConfigHistory, - PrivacyExperienceHistory, -) -from fides.api.ops.models.privacy_notice import PrivacyNotice, PrivacyNoticeHistory -from fides.api.ops.models.privacy_preference import ( - CurrentPrivacyPreference, - PrivacyPreferenceHistory, -) -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.models.registration import UserRegistration -from fides.api.ops.models.storage import StorageConfig -from fides.api.ops.models.system_manager import SystemManager diff --git a/src/fides/api/ops/util/encryption/__init__.py b/src/fides/api/ops/util/encryption/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/fides/api/ops/schemas/__init__.py b/src/fides/api/schemas/__init__.py similarity index 100% rename from src/fides/api/ops/schemas/__init__.py rename to src/fides/api/schemas/__init__.py diff --git a/src/fides/api/ops/schemas/analytics.py b/src/fides/api/schemas/analytics.py similarity index 100% rename from src/fides/api/ops/schemas/analytics.py rename to src/fides/api/schemas/analytics.py diff --git a/src/fides/api/ops/schemas/api.py b/src/fides/api/schemas/api.py similarity index 100% rename from src/fides/api/ops/schemas/api.py rename to src/fides/api/schemas/api.py diff --git a/src/fides/api/ops/schemas/application_config.py b/src/fides/api/schemas/application_config.py similarity index 95% rename from src/fides/api/ops/schemas/application_config.py rename to src/fides/api/schemas/application_config.py index ac2cd44641..1152b456b9 100644 --- a/src/fides/api/ops/schemas/application_config.py +++ b/src/fides/api/schemas/application_config.py @@ -5,8 +5,8 @@ from pydantic import Extra, root_validator, validator -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.messaging.messaging import MessagingServiceType +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.messaging.messaging import MessagingServiceType class StorageTypeApiAccepted(Enum): diff --git a/src/fides/api/ops/schemas/base_class.py b/src/fides/api/schemas/base_class.py similarity index 100% rename from src/fides/api/ops/schemas/base_class.py rename to src/fides/api/schemas/base_class.py diff --git a/src/fides/api/ops/schemas/client.py b/src/fides/api/schemas/client.py similarity index 70% rename from src/fides/api/ops/schemas/client.py rename to src/fides/api/schemas/client.py index c44cca044a..4f33fad0d6 100644 --- a/src/fides/api/ops/schemas/client.py +++ b/src/fides/api/schemas/client.py @@ -1,4 +1,4 @@ -from fides.api.ops.schemas.base_class import FidesSchema +from fides.api.schemas.base_class import FidesSchema class ClientCreatedResponse(FidesSchema): diff --git a/src/fides/api/ops/schemas/connection_configuration/__init__.py b/src/fides/api/schemas/connection_configuration/__init__.py similarity index 57% rename from src/fides/api/ops/schemas/connection_configuration/__init__.py rename to src/fides/api/schemas/connection_configuration/__init__.py index 282934d598..f38d6abff2 100644 --- a/src/fides/api/ops/schemas/connection_configuration/__init__.py +++ b/src/fides/api/schemas/connection_configuration/__init__.py @@ -6,103 +6,103 @@ from typing import Any, Dict, Optional, Union -from fides.api.ops.models.connectionconfig import ConnectionType -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.models.connectionconfig import ConnectionType +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema as ConnectionConfigSecretsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_attentive import ( +from fides.api.schemas.connection_configuration.connection_secrets_attentive import ( AttentiveSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_bigquery import ( +from fides.api.schemas.connection_configuration.connection_secrets_bigquery import ( BigQueryDocsSchema as BigQueryDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_bigquery import ( +from fides.api.schemas.connection_configuration.connection_secrets_bigquery import ( BigQuerySchema as BigQuerySchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_dynamodb import ( +from fides.api.schemas.connection_configuration.connection_secrets_dynamodb import ( DynamoDBDocsSchema as DynamoDBDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_dynamodb import ( +from fides.api.schemas.connection_configuration.connection_secrets_dynamodb import ( DynamoDBSchema as DynamoDBSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_email import ( +from fides.api.schemas.connection_configuration.connection_secrets_email import ( EmailDocsSchema as EmailDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_email import ( +from fides.api.schemas.connection_configuration.connection_secrets_email import ( EmailSchema as EmailSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_fides import ( +from fides.api.schemas.connection_configuration.connection_secrets_fides import ( FidesConnectorSchema, FidesDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_manual_webhook import ( +from fides.api.schemas.connection_configuration.connection_secrets_manual_webhook import ( ManualWebhookSchema as ManualWebhookSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_manual_webhook import ( +from fides.api.schemas.connection_configuration.connection_secrets_manual_webhook import ( ManualWebhookSchemaforDocs as ManualWebhookSchemaforDocs, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mariadb import ( +from fides.api.schemas.connection_configuration.connection_secrets_mariadb import ( MariaDBDocsSchema as MariaDBDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mariadb import ( +from fides.api.schemas.connection_configuration.connection_secrets_mariadb import ( MariaDBSchema as MariaDBSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mongodb import ( +from fides.api.schemas.connection_configuration.connection_secrets_mongodb import ( MongoDBDocsSchema as MongoDBDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mongodb import ( +from fides.api.schemas.connection_configuration.connection_secrets_mongodb import ( MongoDBSchema as MongoDBSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mssql import ( +from fides.api.schemas.connection_configuration.connection_secrets_mssql import ( MicrosoftSQLServerSchema as MicrosoftSQLServerSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mssql import ( +from fides.api.schemas.connection_configuration.connection_secrets_mssql import ( MSSQLDocsSchema as MSSQLDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mysql import ( +from fides.api.schemas.connection_configuration.connection_secrets_mysql import ( MySQLDocsSchema as MySQLDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mysql import ( +from fides.api.schemas.connection_configuration.connection_secrets_mysql import ( MySQLSchema as MySQLSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_postgres import ( +from fides.api.schemas.connection_configuration.connection_secrets_postgres import ( PostgreSQLDocsSchema as PostgreSQLDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_postgres import ( +from fides.api.schemas.connection_configuration.connection_secrets_postgres import ( PostgreSQLSchema as PostgreSQLSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_redshift import ( +from fides.api.schemas.connection_configuration.connection_secrets_redshift import ( RedshiftDocsSchema as RedshiftDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_redshift import ( +from fides.api.schemas.connection_configuration.connection_secrets_redshift import ( RedshiftSchema as RedshiftSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_saas import ( +from fides.api.schemas.connection_configuration.connection_secrets_saas import ( SaaSSchema as SaaSSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_saas import ( +from fides.api.schemas.connection_configuration.connection_secrets_saas import ( SaaSSchemaFactory as SaaSSchemaFactory, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_snowflake import ( +from fides.api.schemas.connection_configuration.connection_secrets_snowflake import ( SnowflakeDocsSchema as SnowflakeDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_snowflake import ( +from fides.api.schemas.connection_configuration.connection_secrets_snowflake import ( SnowflakeSchema as SnowflakeSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_sovrn import ( +from fides.api.schemas.connection_configuration.connection_secrets_sovrn import ( SovrnDocsSchema, SovrnSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_timescale import ( +from fides.api.schemas.connection_configuration.connection_secrets_timescale import ( TimescaleDocsSchema as TimescaleDocsSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_timescale import ( +from fides.api.schemas.connection_configuration.connection_secrets_timescale import ( TimescaleSchema as TimescaleSchema, ) -from fides.api.ops.schemas.connection_configuration.connections_secrets_https import ( +from fides.api.schemas.connection_configuration.connections_secrets_https import ( HttpsSchema as HttpsSchema, ) -from fides.api.ops.schemas.saas.saas_config import SaaSConfig as SaaSConfig +from fides.api.schemas.saas.saas_config import SaaSConfig as SaaSConfig secrets_schemas: Dict[str, Any] = { ConnectionType.attentive.value: AttentiveSchema, diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_config.py b/src/fides/api/schemas/connection_configuration/connection_config.py similarity index 92% rename from src/fides/api/ops/schemas/connection_configuration/connection_config.py rename to src/fides/api/schemas/connection_configuration/connection_config.py index c54c5e5a5e..73cabd8657 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_config.py +++ b/src/fides/api/schemas/connection_configuration/connection_config.py @@ -6,10 +6,10 @@ from fideslang.validation import FidesKey from pydantic import BaseModel, Extra -from fides.api.ops.models.connectionconfig import AccessLevel, ConnectionType -from fides.api.ops.schemas.api import BulkResponse, BulkUpdateFailed -from fides.api.ops.schemas.connection_configuration import connection_secrets_schemas -from fides.api.ops.schemas.saas.saas_config import SaaSConfigBase +from fides.api.models.connectionconfig import AccessLevel, ConnectionType +from fides.api.schemas.api import BulkResponse, BulkUpdateFailed +from fides.api.schemas.connection_configuration import connection_secrets_schemas +from fides.api.schemas.saas.saas_config import SaaSConfigBase class CreateConnectionConfiguration(BaseModel): diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets.py b/src/fides/api/schemas/connection_configuration/connection_secrets.py similarity index 94% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets.py rename to src/fides/api/schemas/connection_configuration/connection_secrets.py index d12bf0b764..cc2c517617 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets.py @@ -5,8 +5,8 @@ from pydantic import BaseModel, Extra, root_validator -from fides.api.ops.models.connectionconfig import ConnectionTestStatus -from fides.api.ops.schemas import Msg +from fides.api.models.connectionconfig import ConnectionTestStatus +from fides.api.schemas import Msg class ConnectionConfigSecretsSchema(BaseModel, abc.ABC): diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_attentive.py b/src/fides/api/schemas/connection_configuration/connection_secrets_attentive.py similarity index 85% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_attentive.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_attentive.py index d168cd678d..3d92d3fed2 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_attentive.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_attentive.py @@ -2,8 +2,8 @@ from pydantic import EmailStr, root_validator -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets_email import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets_email import ( AdvancedSettings, EmailSchema, IdentityTypes, diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_bigquery.py b/src/fides/api/schemas/connection_configuration/connection_secrets_bigquery.py similarity index 87% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_bigquery.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_bigquery.py index f7a0b61e67..aec985a59d 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_bigquery.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_bigquery.py @@ -3,8 +3,8 @@ from pydantic import EmailStr from pydantic.main import BaseModel -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_dynamodb.py b/src/fides/api/schemas/connection_configuration/connection_secrets_dynamodb.py similarity index 78% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_dynamodb.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_dynamodb.py index c7de1d6e33..9ae8d484ca 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_dynamodb.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_dynamodb.py @@ -1,7 +1,7 @@ from typing import List -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_email.py b/src/fides/api/schemas/connection_configuration/connection_secrets_email.py similarity index 97% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_email.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_email.py index 12dceddd90..0b3a8e00ca 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_email.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_email.py @@ -2,7 +2,7 @@ from pydantic import BaseModel, EmailStr, Extra, root_validator -from fides.api.ops.schemas.base_class import NoValidationSchema +from fides.api.schemas.base_class import NoValidationSchema class IdentityTypes(BaseModel): diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_fides.py b/src/fides/api/schemas/connection_configuration/connection_secrets_fides.py similarity index 78% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_fides.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_fides.py index 0c2a47371f..a2c6195b73 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_fides.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_fides.py @@ -1,7 +1,7 @@ from typing import List, Optional -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_manual_webhook.py b/src/fides/api/schemas/connection_configuration/connection_secrets_manual_webhook.py similarity index 76% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_manual_webhook.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_manual_webhook.py index 163ce8ea6e..9bab7a32fa 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_manual_webhook.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_manual_webhook.py @@ -1,4 +1,4 @@ -from fides.api.ops.schemas.base_class import FidesSchema, NoValidationSchema +from fides.api.schemas.base_class import FidesSchema, NoValidationSchema class ManualWebhookSchema(FidesSchema): diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_mariadb.py b/src/fides/api/schemas/connection_configuration/connection_secrets_mariadb.py similarity index 80% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_mariadb.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_mariadb.py index 583d832f17..e12bdbbc55 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_mariadb.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_mariadb.py @@ -1,7 +1,7 @@ from typing import List, Optional -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_mongodb.py b/src/fides/api/schemas/connection_configuration/connection_secrets_mongodb.py similarity index 78% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_mongodb.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_mongodb.py index a3f3649ece..837eef4fe9 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_mongodb.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_mongodb.py @@ -1,7 +1,7 @@ from typing import List, Optional -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_mssql.py b/src/fides/api/schemas/connection_configuration/connection_secrets_mssql.py similarity index 82% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_mssql.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_mssql.py index 825c65f764..bfa231dd4c 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_mssql.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_mssql.py @@ -1,7 +1,7 @@ from typing import List, Optional -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_mysql.py b/src/fides/api/schemas/connection_configuration/connection_secrets_mysql.py similarity index 80% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_mysql.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_mysql.py index b324732dd4..b70b17f4ad 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_mysql.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_mysql.py @@ -1,7 +1,7 @@ from typing import List, Optional -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_postgres.py b/src/fides/api/schemas/connection_configuration/connection_secrets_postgres.py similarity index 81% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_postgres.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_postgres.py index 75c4bf56d3..da61afe101 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_postgres.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_postgres.py @@ -1,7 +1,7 @@ from typing import List, Optional -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_redshift.py b/src/fides/api/schemas/connection_configuration/connection_secrets_redshift.py similarity index 81% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_redshift.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_redshift.py index cf38be17e6..1d97d4801e 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_redshift.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_redshift.py @@ -1,7 +1,7 @@ from typing import List, Optional -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_saas.py b/src/fides/api/schemas/connection_configuration/connection_secrets_saas.py similarity index 96% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_saas.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_saas.py index b8c26f3929..78df082fc7 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_saas.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_saas.py @@ -6,12 +6,12 @@ from pydantic.fields import FieldInfo from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.models.datasetconfig import validate_dataset_reference -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.common_exceptions import ValidationError +from fides.api.models.datasetconfig import validate_dataset_reference +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) -from fides.api.ops.schemas.saas.saas_config import SaaSConfig +from fides.api.schemas.saas.saas_config import SaaSConfig class SaaSSchema(BaseModel, abc.ABC): diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_snowflake.py b/src/fides/api/schemas/connection_configuration/connection_secrets_snowflake.py similarity index 85% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_snowflake.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_snowflake.py index 37ef706864..2755132c49 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_snowflake.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_snowflake.py @@ -1,7 +1,7 @@ from typing import List, Optional -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_sovrn.py b/src/fides/api/schemas/connection_configuration/connection_secrets_sovrn.py similarity index 89% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_sovrn.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_sovrn.py index 63494ae4ca..c4b9c53af3 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_sovrn.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_sovrn.py @@ -2,8 +2,8 @@ from pydantic import EmailStr, root_validator -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets_email import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets_email import ( AdvancedSettingsWithExtendedIdentityTypes, ExtendedEmailSchema, ExtendedIdentityTypes, diff --git a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_timescale.py b/src/fides/api/schemas/connection_configuration/connection_secrets_timescale.py similarity index 68% rename from src/fides/api/ops/schemas/connection_configuration/connection_secrets_timescale.py rename to src/fides/api/schemas/connection_configuration/connection_secrets_timescale.py index 88cc1575e9..058afea25b 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connection_secrets_timescale.py +++ b/src/fides/api/schemas/connection_configuration/connection_secrets_timescale.py @@ -1,5 +1,5 @@ -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets_postgres import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets_postgres import ( PostgreSQLSchema, ) diff --git a/src/fides/api/ops/schemas/connection_configuration/connections_secrets_https.py b/src/fides/api/schemas/connection_configuration/connections_secrets_https.py similarity index 73% rename from src/fides/api/ops/schemas/connection_configuration/connections_secrets_https.py rename to src/fides/api/schemas/connection_configuration/connections_secrets_https.py index 0b3ad09bfd..9b5d4491b0 100644 --- a/src/fides/api/ops/schemas/connection_configuration/connections_secrets_https.py +++ b/src/fides/api/schemas/connection_configuration/connections_secrets_https.py @@ -1,7 +1,7 @@ from typing import List -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.connection_configuration.connection_secrets import ( ConnectionConfigSecretsSchema, ) diff --git a/src/fides/api/ops/schemas/dataset.py b/src/fides/api/schemas/dataset.py similarity index 93% rename from src/fides/api/ops/schemas/dataset.py rename to src/fides/api/schemas/dataset.py index d5417c5571..bc00dd5d56 100644 --- a/src/fides/api/ops/schemas/dataset.py +++ b/src/fides/api/schemas/dataset.py @@ -5,12 +5,10 @@ from loguru import logger from pydantic import BaseModel, validator -from fides.api.ops import common_exceptions -from fides.api.ops.schemas.api import BulkResponse, BulkUpdateFailed -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.util.data_category import ( - DataCategory as DefaultTaxonomyDataCategories, -) +from fides.api import common_exceptions +from fides.api.schemas.api import BulkResponse, BulkUpdateFailed +from fides.api.schemas.base_class import FidesSchema +from fides.api.util.data_category import DataCategory as DefaultTaxonomyDataCategories def validate_data_categories_against_db( diff --git a/src/fides/api/ops/schemas/drp_privacy_request.py b/src/fides/api/schemas/drp_privacy_request.py similarity index 94% rename from src/fides/api/ops/schemas/drp_privacy_request.py rename to src/fides/api/schemas/drp_privacy_request.py index ea621cdd48..55b32f65c2 100644 --- a/src/fides/api/ops/schemas/drp_privacy_request.py +++ b/src/fides/api/schemas/drp_privacy_request.py @@ -4,8 +4,8 @@ from pydantic import EmailStr, validator from fides.api.custom_types import PhoneNumber -from fides.api.ops.models.policy import DrpAction -from fides.api.ops.schemas.base_class import FidesSchema +from fides.api.models.policy import DrpAction +from fides.api.schemas.base_class import FidesSchema DRP_VERSION = "0.5" diff --git a/src/fides/api/ops/schemas/encryption_request.py b/src/fides/api/schemas/encryption_request.py similarity index 90% rename from src/fides/api/ops/schemas/encryption_request.py rename to src/fides/api/schemas/encryption_request.py index 41741b5e4a..b13ed5a287 100644 --- a/src/fides/api/ops/schemas/encryption_request.py +++ b/src/fides/api/schemas/encryption_request.py @@ -1,8 +1,6 @@ from pydantic import BaseModel, validator -from fides.api.ops.util.encryption.aes_gcm_encryption_scheme import ( - verify_encryption_key, -) +from fides.api.util.encryption.aes_gcm_encryption_scheme import verify_encryption_key from fides.core.config import CONFIG diff --git a/src/fides/api/ops/schemas/external_https.py b/src/fides/api/schemas/external_https.py similarity index 94% rename from src/fides/api/ops/schemas/external_https.py rename to src/fides/api/schemas/external_https.py index fb11cc140c..49f99b2228 100644 --- a/src/fides/api/ops/schemas/external_https.py +++ b/src/fides/api/schemas/external_https.py @@ -2,7 +2,7 @@ from pydantic import BaseModel -from fides.api.ops.schemas.redis_cache import Identity +from fides.api.schemas.redis_cache import Identity class SecondPartyResponseFormat(BaseModel): diff --git a/src/fides/api/ops/schemas/identity_verification.py b/src/fides/api/schemas/identity_verification.py similarity index 77% rename from src/fides/api/ops/schemas/identity_verification.py rename to src/fides/api/schemas/identity_verification.py index b22013870b..59281f6e27 100644 --- a/src/fides/api/ops/schemas/identity_verification.py +++ b/src/fides/api/schemas/identity_verification.py @@ -1,4 +1,4 @@ -from fides.api.ops.schemas.base_class import FidesSchema +from fides.api.schemas.base_class import FidesSchema class IdentityVerificationConfigResponse(FidesSchema): diff --git a/src/fides/api/ops/oauth/__init__.py b/src/fides/api/schemas/limiter/__init__.py similarity index 100% rename from src/fides/api/ops/oauth/__init__.py rename to src/fides/api/schemas/limiter/__init__.py diff --git a/src/fides/api/ops/schemas/limiter/rate_limit_config.py b/src/fides/api/schemas/limiter/rate_limit_config.py similarity index 100% rename from src/fides/api/ops/schemas/limiter/rate_limit_config.py rename to src/fides/api/schemas/limiter/rate_limit_config.py diff --git a/src/fides/api/ops/schemas/manual_webhook_schemas.py b/src/fides/api/schemas/manual_webhook_schemas.py similarity index 95% rename from src/fides/api/ops/schemas/manual_webhook_schemas.py rename to src/fides/api/schemas/manual_webhook_schemas.py index ad97719f9a..0e980f4180 100644 --- a/src/fides/api/ops/schemas/manual_webhook_schemas.py +++ b/src/fides/api/schemas/manual_webhook_schemas.py @@ -2,11 +2,11 @@ from pydantic import ConstrainedStr, conlist, validator -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.connection_configuration.connection_config import ( ConnectionConfigurationResponse, ) -from fides.api.ops.util.text import to_snake_case +from fides.api.util.text import to_snake_case class PIIFieldType(ConstrainedStr): diff --git a/src/fides/api/ops/schemas/limiter/__init__.py b/src/fides/api/schemas/masking/__init__.py similarity index 100% rename from src/fides/api/ops/schemas/limiter/__init__.py rename to src/fides/api/schemas/masking/__init__.py diff --git a/src/fides/api/ops/schemas/masking/masking_api.py b/src/fides/api/schemas/masking/masking_api.py similarity index 95% rename from src/fides/api/ops/schemas/masking/masking_api.py rename to src/fides/api/schemas/masking/masking_api.py index 4e10c378e2..3fe25f5aa3 100644 --- a/src/fides/api/ops/schemas/masking/masking_api.py +++ b/src/fides/api/schemas/masking/masking_api.py @@ -2,7 +2,7 @@ from pydantic import BaseModel, root_validator -from fides.api.ops.schemas.policy import PolicyMaskingSpec +from fides.api.schemas.policy import PolicyMaskingSpec class MaskingAPIRequest(BaseModel): diff --git a/src/fides/api/ops/schemas/masking/masking_configuration.py b/src/fides/api/schemas/masking/masking_configuration.py similarity index 100% rename from src/fides/api/ops/schemas/masking/masking_configuration.py rename to src/fides/api/schemas/masking/masking_configuration.py diff --git a/src/fides/api/ops/schemas/masking/masking_secrets.py b/src/fides/api/schemas/masking/masking_secrets.py similarity index 100% rename from src/fides/api/ops/schemas/masking/masking_secrets.py rename to src/fides/api/schemas/masking/masking_secrets.py diff --git a/src/fides/api/ops/schemas/masking/masking_strategy_description.py b/src/fides/api/schemas/masking/masking_strategy_description.py similarity index 100% rename from src/fides/api/ops/schemas/masking/masking_strategy_description.py rename to src/fides/api/schemas/masking/masking_strategy_description.py diff --git a/src/fides/api/ops/schemas/masking/__init__.py b/src/fides/api/schemas/messaging/__init__.py similarity index 100% rename from src/fides/api/ops/schemas/masking/__init__.py rename to src/fides/api/schemas/messaging/__init__.py diff --git a/src/fides/api/ops/schemas/messaging/messaging.py b/src/fides/api/schemas/messaging/messaging.py similarity index 98% rename from src/fides/api/ops/schemas/messaging/messaging.py rename to src/fides/api/schemas/messaging/messaging.py index 0edc9044f2..753cb0d32b 100644 --- a/src/fides/api/ops/schemas/messaging/messaging.py +++ b/src/fides/api/schemas/messaging/messaging.py @@ -8,11 +8,9 @@ from pydantic import BaseModel, Extra, root_validator from fides.api.custom_types import PhoneNumber, SafeStr -from fides.api.ops.schemas import Msg -from fides.api.ops.schemas.privacy_preference import ( - MinimalPrivacyPreferenceHistorySchema, -) -from fides.api.ops.schemas.privacy_request import Consent +from fides.api.schemas import Msg +from fides.api.schemas.privacy_preference import MinimalPrivacyPreferenceHistorySchema +from fides.api.schemas.privacy_request import Consent class MessagingMethod(Enum): diff --git a/src/fides/api/ops/schemas/messaging/messaging_secrets_docs_only.py b/src/fides/api/schemas/messaging/messaging_secrets_docs_only.py similarity index 90% rename from src/fides/api/ops/schemas/messaging/messaging_secrets_docs_only.py rename to src/fides/api/schemas/messaging/messaging_secrets_docs_only.py index 1d3c1bbf1e..6dcbb5f350 100644 --- a/src/fides/api/ops/schemas/messaging/messaging_secrets_docs_only.py +++ b/src/fides/api/schemas/messaging/messaging_secrets_docs_only.py @@ -1,7 +1,7 @@ from typing import Union -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.messaging.messaging import ( MessagingServiceSecretsMailchimpTransactional, MessagingServiceSecretsMailgun, MessagingServiceSecretsTwilioEmail, diff --git a/src/fides/api/ops/schemas/msg.py b/src/fides/api/schemas/msg.py similarity index 100% rename from src/fides/api/ops/schemas/msg.py rename to src/fides/api/schemas/msg.py diff --git a/src/fides/api/ops/schemas/oauth.py b/src/fides/api/schemas/oauth.py similarity index 97% rename from src/fides/api/ops/schemas/oauth.py rename to src/fides/api/schemas/oauth.py index 3420f2ab83..636824946f 100644 --- a/src/fides/api/ops/schemas/oauth.py +++ b/src/fides/api/schemas/oauth.py @@ -7,7 +7,7 @@ from pydantic import BaseModel from starlette.requests import Request -from fides.api.ops.common_exceptions import InvalidAuthorizationSchemeError +from fides.api.common_exceptions import InvalidAuthorizationSchemeError class AccessToken(BaseModel): diff --git a/src/fides/api/ops/schemas/policy.py b/src/fides/api/schemas/policy.py similarity index 93% rename from src/fides/api/ops/schemas/policy.py rename to src/fides/api/schemas/policy.py index 3c678f42fa..11068815e1 100644 --- a/src/fides/api/ops/schemas/policy.py +++ b/src/fides/api/schemas/policy.py @@ -2,10 +2,10 @@ from fideslang.validation import FidesKey -from fides.api.ops.models.policy import ActionType, DrpAction -from fides.api.ops.schemas.api import BulkResponse, BulkUpdateFailed -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.storage.storage import StorageDestinationResponse +from fides.api.models.policy import ActionType, DrpAction +from fides.api.schemas.api import BulkResponse, BulkUpdateFailed +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.storage.storage import StorageDestinationResponse class PolicyMaskingSpec(FidesSchema): diff --git a/src/fides/api/ops/schemas/policy_webhooks.py b/src/fides/api/schemas/policy_webhooks.py similarity index 91% rename from src/fides/api/ops/schemas/policy_webhooks.py rename to src/fides/api/schemas/policy_webhooks.py index 53f1cc68a3..c827bce0b8 100644 --- a/src/fides/api/ops/schemas/policy_webhooks.py +++ b/src/fides/api/schemas/policy_webhooks.py @@ -2,9 +2,9 @@ from fideslang.validation import FidesKey -from fides.api.ops.models.policy import WebhookDirection -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.models.policy import WebhookDirection +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.connection_configuration.connection_config import ( ConnectionConfigurationResponse, ) diff --git a/src/fides/api/ops/schemas/privacy_experience.py b/src/fides/api/schemas/privacy_experience.py similarity index 94% rename from src/fides/api/ops/schemas/privacy_experience.py rename to src/fides/api/schemas/privacy_experience.py index 24c5ab43a4..b486152ee0 100644 --- a/src/fides/api/ops/schemas/privacy_experience.py +++ b/src/fides/api/schemas/privacy_experience.py @@ -6,12 +6,10 @@ from pydantic import Extra, root_validator, validator from fides.api.custom_types import SafeStr -from fides.api.ops.models.privacy_experience import ComponentType, DeliveryMechanism -from fides.api.ops.models.privacy_notice import PrivacyNoticeRegion -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.privacy_notice import ( - PrivacyNoticeResponseWithUserPreferences, -) +from fides.api.models.privacy_experience import ComponentType, DeliveryMechanism +from fides.api.models.privacy_notice import PrivacyNoticeRegion +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.privacy_notice import PrivacyNoticeResponseWithUserPreferences class ExperienceConfigSchema(FidesSchema): diff --git a/src/fides/api/ops/schemas/privacy_notice.py b/src/fides/api/schemas/privacy_notice.py similarity index 97% rename from src/fides/api/ops/schemas/privacy_notice.py rename to src/fides/api/schemas/privacy_notice.py index 9247dea4d4..ff8c083124 100644 --- a/src/fides/api/ops/schemas/privacy_notice.py +++ b/src/fides/api/schemas/privacy_notice.py @@ -5,13 +5,13 @@ from pydantic import Extra, conlist, root_validator, validator -from fides.api.ops.models.privacy_notice import ( +from fides.api.models.privacy_notice import ( ConsentMechanism, EnforcementLevel, PrivacyNoticeRegion, UserConsentPreference, ) -from fides.api.ops.schemas.base_class import FidesSchema +from fides.api.schemas.base_class import FidesSchema class PrivacyNotice(FidesSchema): diff --git a/src/fides/api/ops/schemas/privacy_preference.py b/src/fides/api/schemas/privacy_preference.py similarity index 90% rename from src/fides/api/ops/schemas/privacy_preference.py rename to src/fides/api/schemas/privacy_preference.py index 89ef65c201..aa2c2b8cd3 100644 --- a/src/fides/api/ops/schemas/privacy_preference.py +++ b/src/fides/api/schemas/privacy_preference.py @@ -5,19 +5,13 @@ from pydantic import Field, conlist from fides.api.custom_types import SafeStr -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_notice import ( - PrivacyNoticeRegion, - UserConsentPreference, -) -from fides.api.ops.models.privacy_preference import ConsentMethod, RequestOrigin -from fides.api.ops.models.privacy_request import ( - ExecutionLogStatus, - PrivacyRequestStatus, -) -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.privacy_notice import PrivacyNoticeHistorySchema -from fides.api.ops.schemas.redis_cache import Identity +from fides.api.models.policy import ActionType +from fides.api.models.privacy_notice import PrivacyNoticeRegion, UserConsentPreference +from fides.api.models.privacy_preference import ConsentMethod, RequestOrigin +from fides.api.models.privacy_request import ExecutionLogStatus, PrivacyRequestStatus +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.privacy_notice import PrivacyNoticeHistorySchema +from fides.api.schemas.redis_cache import Identity class ConsentOptionCreate(FidesSchema): diff --git a/src/fides/api/ops/schemas/privacy_request.py b/src/fides/api/schemas/privacy_request.py similarity index 92% rename from src/fides/api/ops/schemas/privacy_request.py rename to src/fides/api/schemas/privacy_request.py index e13ea44283..4d54a8a9f7 100644 --- a/src/fides/api/ops/schemas/privacy_request.py +++ b/src/fides/api/schemas/privacy_request.py @@ -6,21 +6,19 @@ from pydantic import Field, validator from fides.api.custom_types import SafeStr -from fides.api.ops.models.audit_log import AuditLogAction -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_request import ( +from fides.api.models.audit_log import AuditLogAction +from fides.api.models.policy import ActionType +from fides.api.models.privacy_request import ( CheckpointActionRequired, ExecutionLogStatus, PrivacyRequestStatus, ) -from fides.api.ops.schemas.api import BulkResponse, BulkUpdateFailed -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.policy import PolicyResponse as PolicySchema -from fides.api.ops.schemas.redis_cache import Identity, IdentityBase -from fides.api.ops.schemas.user import PrivacyRequestReviewer -from fides.api.ops.util.encryption.aes_gcm_encryption_scheme import ( - verify_encryption_key, -) +from fides.api.schemas.api import BulkResponse, BulkUpdateFailed +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.policy import PolicyResponse as PolicySchema +from fides.api.schemas.redis_cache import Identity, IdentityBase +from fides.api.schemas.user import PrivacyRequestReviewer +from fides.api.util.encryption.aes_gcm_encryption_scheme import verify_encryption_key from fides.core.config import CONFIG diff --git a/src/fides/api/ops/schemas/redis_cache.py b/src/fides/api/schemas/redis_cache.py similarity index 93% rename from src/fides/api/ops/schemas/redis_cache.py rename to src/fides/api/schemas/redis_cache.py index d57f3358c0..f4580ebf11 100644 --- a/src/fides/api/ops/schemas/redis_cache.py +++ b/src/fides/api/schemas/redis_cache.py @@ -3,7 +3,7 @@ from pydantic import EmailStr, Extra from fides.api.custom_types import PhoneNumber -from fides.api.ops.schemas.base_class import FidesSchema +from fides.api.schemas.base_class import FidesSchema class IdentityBase(FidesSchema): diff --git a/src/fides/api/ops/schemas/registration.py b/src/fides/api/schemas/registration.py similarity index 90% rename from src/fides/api/ops/schemas/registration.py rename to src/fides/api/schemas/registration.py index 61fe728d7d..c43710cf9d 100644 --- a/src/fides/api/ops/schemas/registration.py +++ b/src/fides/api/schemas/registration.py @@ -2,7 +2,7 @@ from pydantic import EmailStr, Extra -from fides.api.ops.schemas.base_class import FidesSchema +from fides.api.schemas.base_class import FidesSchema class GetRegistrationStatusResponse(FidesSchema): diff --git a/src/fides/api/ops/schemas/messaging/__init__.py b/src/fides/api/schemas/saas/__init__.py similarity index 100% rename from src/fides/api/ops/schemas/messaging/__init__.py rename to src/fides/api/schemas/saas/__init__.py diff --git a/src/fides/api/ops/schemas/saas/connector_template.py b/src/fides/api/schemas/saas/connector_template.py similarity index 88% rename from src/fides/api/ops/schemas/saas/connector_template.py rename to src/fides/api/schemas/saas/connector_template.py index 15d662a27f..e2ada63590 100644 --- a/src/fides/api/ops/schemas/saas/connector_template.py +++ b/src/fides/api/schemas/saas/connector_template.py @@ -3,11 +3,8 @@ from fideslang.models import Dataset from pydantic import BaseModel, validator -from fides.api.ops.schemas.saas.saas_config import SaaSConfig -from fides.api.ops.util.saas_util import ( - load_config_from_string, - load_dataset_from_string, -) +from fides.api.schemas.saas.saas_config import SaaSConfig +from fides.api.util.saas_util import load_config_from_string, load_dataset_from_string class ConnectorTemplate(BaseModel): diff --git a/src/fides/api/ops/schemas/saas/saas_config.py b/src/fides/api/schemas/saas/saas_config.py similarity index 97% rename from src/fides/api/ops/schemas/saas/saas_config.py rename to src/fides/api/schemas/saas/saas_config.py index 5ca28232f0..bd0a65ae04 100644 --- a/src/fides/api/ops/schemas/saas/saas_config.py +++ b/src/fides/api/schemas/saas/saas_config.py @@ -4,8 +4,8 @@ from fideslang.validation import FidesKey from pydantic import BaseModel, Extra, root_validator, validator -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.graph.config import ( +from fides.api.common_exceptions import ValidationError +from fides.api.graph.config import ( Collection, CollectionAddress, Field, @@ -13,9 +13,9 @@ GraphDataset, ScalarField, ) -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.limiter.rate_limit_config import RateLimitConfig -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.limiter.rate_limit_config import RateLimitConfig +from fides.api.schemas.saas.shared_schemas import HTTPMethod class ParamValue(BaseModel): @@ -124,7 +124,7 @@ def validate_request_for_pagination(cls, values: Dict[str, Any]) -> Dict[str, An """ # delay import to avoid cyclic-dependency error - We still ignore the pylint error - from fides.api.ops.service.pagination.pagination_strategy import ( # pylint: disable=R0401 + from fides.api.service.pagination.pagination_strategy import ( # pylint: disable=R0401 PaginationStrategy, ) diff --git a/src/fides/api/ops/schemas/saas/shared_schemas.py b/src/fides/api/schemas/saas/shared_schemas.py similarity index 100% rename from src/fides/api/ops/schemas/saas/shared_schemas.py rename to src/fides/api/schemas/saas/shared_schemas.py diff --git a/src/fides/api/ops/schemas/saas/strategy_configuration.py b/src/fides/api/schemas/saas/strategy_configuration.py similarity index 95% rename from src/fides/api/ops/schemas/saas/strategy_configuration.py rename to src/fides/api/schemas/saas/strategy_configuration.py index 26d143f8fa..1595a7dcad 100644 --- a/src/fides/api/ops/schemas/saas/strategy_configuration.py +++ b/src/fides/api/schemas/saas/strategy_configuration.py @@ -3,11 +3,8 @@ from pydantic import BaseModel, root_validator, validator -from fides.api.ops.schemas.saas.saas_config import Header, QueryParam, SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import ( - ConnectorParamRef, - IdentityParamRef, -) +from fides.api.schemas.saas.saas_config import Header, QueryParam, SaaSRequest +from fides.api.schemas.saas.shared_schemas import ConnectorParamRef, IdentityParamRef class StrategyConfiguration(BaseModel): diff --git a/src/fides/api/ops/schemas/saas/__init__.py b/src/fides/api/schemas/storage/__init__.py similarity index 100% rename from src/fides/api/ops/schemas/saas/__init__.py rename to src/fides/api/schemas/storage/__init__.py diff --git a/src/fides/api/ops/schemas/storage/data_upload_location_response.py b/src/fides/api/schemas/storage/data_upload_location_response.py similarity index 100% rename from src/fides/api/ops/schemas/storage/data_upload_location_response.py rename to src/fides/api/schemas/storage/data_upload_location_response.py diff --git a/src/fides/api/ops/schemas/storage/storage.py b/src/fides/api/schemas/storage/storage.py similarity index 98% rename from src/fides/api/ops/schemas/storage/storage.py rename to src/fides/api/schemas/storage/storage.py index d2161c28cf..0708252b9b 100644 --- a/src/fides/api/ops/schemas/storage/storage.py +++ b/src/fides/api/schemas/storage/storage.py @@ -5,7 +5,7 @@ from pydantic import Extra, ValidationError, root_validator, validator from pydantic.main import BaseModel -from fides.api.ops.schemas.api import BulkResponse, BulkUpdateFailed +from fides.api.schemas.api import BulkResponse, BulkUpdateFailed class ResponseFormat(Enum): diff --git a/src/fides/api/ops/schemas/storage/storage_secrets_docs_only.py b/src/fides/api/schemas/storage/storage_secrets_docs_only.py similarity index 58% rename from src/fides/api/ops/schemas/storage/storage_secrets_docs_only.py rename to src/fides/api/schemas/storage/storage_secrets_docs_only.py index 7112784ac6..8ef5149a4f 100644 --- a/src/fides/api/ops/schemas/storage/storage_secrets_docs_only.py +++ b/src/fides/api/schemas/storage/storage_secrets_docs_only.py @@ -1,5 +1,5 @@ -from fides.api.ops.schemas.base_class import NoValidationSchema -from fides.api.ops.schemas.storage.storage import StorageSecretsS3 +from fides.api.schemas.base_class import NoValidationSchema +from fides.api.schemas.storage.storage import StorageSecretsS3 class StorageSecretsS3Docs(StorageSecretsS3, NoValidationSchema): diff --git a/src/fides/api/ops/schemas/storage/__init__.py b/src/fides/api/schemas/third_party/__init__.py similarity index 100% rename from src/fides/api/ops/schemas/storage/__init__.py rename to src/fides/api/schemas/third_party/__init__.py diff --git a/src/fides/api/ops/schemas/user.py b/src/fides/api/schemas/user.py similarity index 93% rename from src/fides/api/ops/schemas/user.py rename to src/fides/api/schemas/user.py index 2736eb53de..de5b37a035 100644 --- a/src/fides/api/ops/schemas/user.py +++ b/src/fides/api/schemas/user.py @@ -4,9 +4,9 @@ from pydantic import validator -from fides.api.ops.cryptography.cryptographic_util import decode_password -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.oauth import AccessToken +from fides.api.cryptography.cryptographic_util import decode_password +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.oauth import AccessToken class PrivacyRequestReviewer(FidesSchema): diff --git a/src/fides/api/ops/schemas/user_permission.py b/src/fides/api/schemas/user_permission.py similarity index 87% rename from src/fides/api/ops/schemas/user_permission.py rename to src/fides/api/schemas/user_permission.py index 5313bb5079..3ff3e79c5f 100644 --- a/src/fides/api/ops/schemas/user_permission.py +++ b/src/fides/api/schemas/user_permission.py @@ -2,9 +2,9 @@ from pydantic import validator -from fides.api.ops.api.v1.scope_registry import SCOPE_REGISTRY, ScopeRegistryEnum -from fides.api.ops.oauth.roles import RoleRegistryEnum -from fides.api.ops.schemas.base_class import FidesSchema +from fides.api.api.v1.scope_registry import SCOPE_REGISTRY, ScopeRegistryEnum +from fides.api.oauth.roles import RoleRegistryEnum +from fides.api.schemas.base_class import FidesSchema class UserPermissionsCreate(FidesSchema): diff --git a/src/fides/api/ops/schemas/third_party/__init__.py b/src/fides/api/service/__init__.py similarity index 100% rename from src/fides/api/ops/schemas/third_party/__init__.py rename to src/fides/api/service/__init__.py diff --git a/src/fides/api/ops/service/_verification.py b/src/fides/api/service/_verification.py similarity index 78% rename from src/fides/api/ops/service/_verification.py rename to src/fides/api/service/_verification.py index cd2ff77eba..18f707328d 100644 --- a/src/fides/api/ops/service/_verification.py +++ b/src/fides/api/service/_verification.py @@ -2,14 +2,14 @@ from sqlalchemy.orm import Session -from fides.api.ops.models.privacy_request import ConsentRequest, PrivacyRequest -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.models.privacy_request import ConsentRequest, PrivacyRequest +from fides.api.schemas.messaging.messaging import ( MessagingActionType, SubjectIdentityVerificationBodyParams, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.messaging.message_dispatch_service import dispatch_message -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.service.messaging.message_dispatch_service import dispatch_message +from fides.api.service.privacy_request.request_runner_service import ( generate_id_verification_code, ) from fides.core.config import CONFIG diff --git a/src/fides/api/ops/service/authentication/__init__.py b/src/fides/api/service/authentication/__init__.py similarity index 81% rename from src/fides/api/ops/service/authentication/__init__.py rename to src/fides/api/service/authentication/__init__.py index efe51b55c2..cbca69f044 100644 --- a/src/fides/api/ops/service/authentication/__init__.py +++ b/src/fides/api/service/authentication/__init__.py @@ -1,4 +1,4 @@ -from fides.api.ops.service.authentication import ( +from fides.api.service.authentication import ( authentication_strategy_api_key, authentication_strategy_basic, authentication_strategy_bearer, diff --git a/src/fides/api/ops/service/authentication/authentication_strategy.py b/src/fides/api/service/authentication/authentication_strategy.py similarity index 75% rename from src/fides/api/ops/service/authentication/authentication_strategy.py rename to src/fides/api/service/authentication/authentication_strategy.py index ee91ab2d0f..96cb8995e2 100644 --- a/src/fides/api/ops/service/authentication/authentication_strategy.py +++ b/src/fides/api/service/authentication/authentication_strategy.py @@ -2,8 +2,8 @@ from requests import PreparedRequest -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.service.strategy import Strategy +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.service.strategy import Strategy class AuthenticationStrategy(Strategy): diff --git a/src/fides/api/ops/service/authentication/authentication_strategy_api_key.py b/src/fides/api/service/authentication/authentication_strategy_api_key.py similarity index 85% rename from src/fides/api/ops/service/authentication/authentication_strategy_api_key.py rename to src/fides/api/service/authentication/authentication_strategy_api_key.py index d840a8f0cb..0b83592f98 100644 --- a/src/fides/api/ops/service/authentication/authentication_strategy_api_key.py +++ b/src/fides/api/service/authentication/authentication_strategy_api_key.py @@ -3,17 +3,17 @@ from requests import PreparedRequest -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.saas_config import Header, QueryParam -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.saas_config import Header, QueryParam +from fides.api.schemas.saas.strategy_configuration import ( ApiKeyAuthenticationConfiguration, ) -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.util.saas_util import assign_placeholders -from fides.api.ops.util.url_util import set_query_parameter +from fides.api.util.saas_util import assign_placeholders +from fides.api.util.url_util import set_query_parameter class ApiKeyAuthenticationStrategy(AuthenticationStrategy): diff --git a/src/fides/api/ops/service/authentication/authentication_strategy_basic.py b/src/fides/api/service/authentication/authentication_strategy_basic.py similarity index 80% rename from src/fides/api/ops/service/authentication/authentication_strategy_basic.py rename to src/fides/api/service/authentication/authentication_strategy_basic.py index 317db44d9f..6c32047560 100644 --- a/src/fides/api/ops/service/authentication/authentication_strategy_basic.py +++ b/src/fides/api/service/authentication/authentication_strategy_basic.py @@ -1,13 +1,13 @@ from requests import PreparedRequest -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.strategy_configuration import ( BasicAuthenticationConfiguration, ) -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.util.saas_util import assign_placeholders +from fides.api.util.saas_util import assign_placeholders class BasicAuthenticationStrategy(AuthenticationStrategy): diff --git a/src/fides/api/ops/service/authentication/authentication_strategy_bearer.py b/src/fides/api/service/authentication/authentication_strategy_bearer.py similarity index 77% rename from src/fides/api/ops/service/authentication/authentication_strategy_bearer.py rename to src/fides/api/service/authentication/authentication_strategy_bearer.py index 9ac2ac229a..133432675b 100644 --- a/src/fides/api/ops/service/authentication/authentication_strategy_bearer.py +++ b/src/fides/api/service/authentication/authentication_strategy_bearer.py @@ -1,13 +1,13 @@ from requests import PreparedRequest -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.strategy_configuration import ( BearerAuthenticationConfiguration, ) -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.util.saas_util import assign_placeholders +from fides.api.util.saas_util import assign_placeholders class BearerAuthenticationStrategy(AuthenticationStrategy): diff --git a/src/fides/api/ops/service/authentication/authentication_strategy_factory.py b/src/fides/api/service/authentication/authentication_strategy_factory.py similarity index 72% rename from src/fides/api/ops/service/authentication/authentication_strategy_factory.py rename to src/fides/api/service/authentication/authentication_strategy_factory.py index 20573948f9..e1b3f0fed2 100644 --- a/src/fides/api/ops/service/authentication/authentication_strategy_factory.py +++ b/src/fides/api/service/authentication/authentication_strategy_factory.py @@ -3,25 +3,25 @@ from pydantic import ValidationError -from fides.api.ops.common_exceptions import NoSuchStrategyException -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import NoSuchStrategyException +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_basic import ( +from fides.api.service.authentication.authentication_strategy_basic import ( BasicAuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_bearer import ( +from fides.api.service.authentication.authentication_strategy_bearer import ( BearerAuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_oauth2_authorization_code import ( +from fides.api.service.authentication.authentication_strategy_oauth2_authorization_code import ( OAuth2AuthorizationCodeAuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_oauth2_client_credentials import ( +from fides.api.service.authentication.authentication_strategy_oauth2_client_credentials import ( OAuth2ClientCredentialsAuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_query_param import ( +from fides.api.service.authentication.authentication_strategy_query_param import ( QueryParamAuthenticationStrategy, ) diff --git a/src/fides/api/ops/service/authentication/authentication_strategy_oauth2_authorization_code.py b/src/fides/api/service/authentication/authentication_strategy_oauth2_authorization_code.py similarity index 91% rename from src/fides/api/ops/service/authentication/authentication_strategy_oauth2_authorization_code.py rename to src/fides/api/service/authentication/authentication_strategy_oauth2_authorization_code.py index 2cbdb61b61..b1eeeb9438 100644 --- a/src/fides/api/ops/service/authentication/authentication_strategy_oauth2_authorization_code.py +++ b/src/fides/api/service/authentication/authentication_strategy_oauth2_authorization_code.py @@ -5,16 +5,16 @@ from requests import PreparedRequest from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.models.authentication_request import AuthenticationRequest -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.models.authentication_request import AuthenticationRequest +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.strategy_configuration import ( OAuth2AuthorizationCodeConfiguration, ) -from fides.api.ops.service.authentication.authentication_strategy_oauth2_base import ( +from fides.api.service.authentication.authentication_strategy_oauth2_base import ( OAuth2AuthenticationStrategyBase, ) -from fides.api.ops.util.saas_util import assign_placeholders, map_param_values +from fides.api.util.saas_util import assign_placeholders, map_param_values from fides.core.config import CONFIG diff --git a/src/fides/api/ops/service/authentication/authentication_strategy_oauth2_base.py b/src/fides/api/service/authentication/authentication_strategy_oauth2_base.py similarity index 92% rename from src/fides/api/ops/service/authentication/authentication_strategy_oauth2_base.py rename to src/fides/api/service/authentication/authentication_strategy_oauth2_base.py index 57a22e3253..cc950fa5d6 100644 --- a/src/fides/api/ops/service/authentication/authentication_strategy_oauth2_base.py +++ b/src/fides/api/service/authentication/authentication_strategy_oauth2_base.py @@ -4,18 +4,16 @@ from loguru import logger from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import FidesopsException, OAuth2TokenException -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.saas_config import ClientConfig, SaaSRequest -from fides.api.ops.schemas.saas.strategy_configuration import OAuth2BaseConfiguration -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import FidesopsException, OAuth2TokenException +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.saas_config import ClientConfig, SaaSRequest +from fides.api.schemas.saas.strategy_configuration import OAuth2BaseConfiguration +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.util.logger import Pii -from fides.api.ops.util.saas_util import assign_placeholders, map_param_values +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.util.logger import Pii +from fides.api.util.saas_util import assign_placeholders, map_param_values class OAuth2AuthenticationStrategyBase(AuthenticationStrategy): diff --git a/src/fides/api/ops/service/authentication/authentication_strategy_oauth2_client_credentials.py b/src/fides/api/service/authentication/authentication_strategy_oauth2_client_credentials.py similarity index 82% rename from src/fides/api/ops/service/authentication/authentication_strategy_oauth2_client_credentials.py rename to src/fides/api/service/authentication/authentication_strategy_oauth2_client_credentials.py index 59781094cc..70034b6901 100644 --- a/src/fides/api/ops/service/authentication/authentication_strategy_oauth2_client_credentials.py +++ b/src/fides/api/service/authentication/authentication_strategy_oauth2_client_credentials.py @@ -1,8 +1,8 @@ from requests import PreparedRequest -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.strategy_configuration import OAuth2BaseConfiguration -from fides.api.ops.service.authentication.authentication_strategy_oauth2_base import ( +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.strategy_configuration import OAuth2BaseConfiguration +from fides.api.service.authentication.authentication_strategy_oauth2_base import ( OAuth2AuthenticationStrategyBase, ) diff --git a/src/fides/api/ops/service/authentication/authentication_strategy_query_param.py b/src/fides/api/service/authentication/authentication_strategy_query_param.py similarity index 77% rename from src/fides/api/ops/service/authentication/authentication_strategy_query_param.py rename to src/fides/api/service/authentication/authentication_strategy_query_param.py index 11614e7222..a32b9d20c7 100644 --- a/src/fides/api/ops/service/authentication/authentication_strategy_query_param.py +++ b/src/fides/api/service/authentication/authentication_strategy_query_param.py @@ -1,15 +1,15 @@ from requests import PreparedRequest -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.strategy_configuration import ( QueryParamAuthenticationConfiguration, StrategyConfiguration, ) -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.util.saas_util import assign_placeholders -from fides.api.ops.util.url_util import set_query_parameter +from fides.api.util.saas_util import assign_placeholders +from fides.api.util.url_util import set_query_parameter class QueryParamAuthenticationStrategy(AuthenticationStrategy): diff --git a/src/fides/api/ops/service/connectors/__init__.py b/src/fides/api/service/connectors/__init__.py similarity index 59% rename from src/fides/api/ops/service/connectors/__init__.py rename to src/fides/api/service/connectors/__init__.py index a79616a690..e56bb81963 100644 --- a/src/fides/api/ops/service/connectors/__init__.py +++ b/src/fides/api/service/connectors/__init__.py @@ -6,58 +6,48 @@ from typing import Any, Dict -from fides.api.ops.models.connectionconfig import ConnectionConfig as ConnectionConfig -from fides.api.ops.models.connectionconfig import ConnectionType as ConnectionType -from fides.api.ops.service.connectors.base_connector import ( - BaseConnector as BaseConnector, -) -from fides.api.ops.service.connectors.dynamodb_connector import ( +from fides.api.models.connectionconfig import ConnectionConfig as ConnectionConfig +from fides.api.models.connectionconfig import ConnectionType as ConnectionType +from fides.api.service.connectors.base_connector import BaseConnector as BaseConnector +from fides.api.service.connectors.dynamodb_connector import ( DynamoDBConnector as DynamoDBConnector, ) -from fides.api.ops.service.connectors.email.attentive_connector import ( - AttentiveConnector, -) -from fides.api.ops.service.connectors.email.sovrn_connector import SovrnConnector -from fides.api.ops.service.connectors.fides_connector import ( +from fides.api.service.connectors.email.attentive_connector import AttentiveConnector +from fides.api.service.connectors.email.sovrn_connector import SovrnConnector +from fides.api.service.connectors.fides_connector import ( FidesConnector as FidesConnector, ) -from fides.api.ops.service.connectors.http_connector import ( - HTTPSConnector as HTTPSConnector, -) -from fides.api.ops.service.connectors.manual_connector import ( +from fides.api.service.connectors.http_connector import HTTPSConnector as HTTPSConnector +from fides.api.service.connectors.manual_connector import ( ManualConnector as ManualConnector, ) -from fides.api.ops.service.connectors.manual_webhook_connector import ( +from fides.api.service.connectors.manual_webhook_connector import ( ManualWebhookConnector as ManualWebhookConnector, ) -from fides.api.ops.service.connectors.mongodb_connector import ( +from fides.api.service.connectors.mongodb_connector import ( MongoDBConnector as MongoDBConnector, ) -from fides.api.ops.service.connectors.saas_connector import ( - SaaSConnector as SaaSConnector, -) -from fides.api.ops.service.connectors.sql_connector import ( +from fides.api.service.connectors.saas_connector import SaaSConnector as SaaSConnector +from fides.api.service.connectors.sql_connector import ( BigQueryConnector as BigQueryConnector, ) -from fides.api.ops.service.connectors.sql_connector import ( +from fides.api.service.connectors.sql_connector import ( MariaDBConnector as MariaDBConnector, ) -from fides.api.ops.service.connectors.sql_connector import ( +from fides.api.service.connectors.sql_connector import ( MicrosoftSQLServerConnector as MicrosoftSQLServerConnector, ) -from fides.api.ops.service.connectors.sql_connector import ( - MySQLConnector as MySQLConnector, -) -from fides.api.ops.service.connectors.sql_connector import ( +from fides.api.service.connectors.sql_connector import MySQLConnector as MySQLConnector +from fides.api.service.connectors.sql_connector import ( PostgreSQLConnector as PostgreSQLConnector, ) -from fides.api.ops.service.connectors.sql_connector import ( +from fides.api.service.connectors.sql_connector import ( RedshiftConnector as RedshiftConnector, ) -from fides.api.ops.service.connectors.sql_connector import ( +from fides.api.service.connectors.sql_connector import ( SnowflakeConnector as SnowflakeConnector, ) -from fides.api.ops.service.connectors.timescale_connector import ( +from fides.api.service.connectors.timescale_connector import ( TimescaleConnector as TimescaleConnector, ) diff --git a/src/fides/api/ops/service/connectors/base_connector.py b/src/fides/api/service/connectors/base_connector.py similarity index 85% rename from src/fides/api/ops/service/connectors/base_connector.py rename to src/fides/api/service/connectors/base_connector.py index 6d28b23864..ba3579f28e 100644 --- a/src/fides/api/ops/service/connectors/base_connector.py +++ b/src/fides/api/service/connectors/base_connector.py @@ -3,13 +3,13 @@ from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import NotSupportedForCollection -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionTestStatus -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.service.connectors.query_config import QueryConfig -from fides.api.ops.util.collection_util import Row +from fides.api.common_exceptions import NotSupportedForCollection +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionTestStatus +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.service.connectors.query_config import QueryConfig +from fides.api.util.collection_util import Row from fides.core.config import CONFIG DB_CONNECTOR_TYPE = TypeVar("DB_CONNECTOR_TYPE") @@ -19,9 +19,9 @@ class BaseConnector(Generic[DB_CONNECTOR_TYPE], ABC): """Abstract BaseConnector class containing the methods to interact with your configured connection. How to use example: - from fides.api.ops.db.session import get_db_session - from fides.api.ops.models.connectionconfig import ConnectionConfig - from fides.api.ops.service.connectors import get_connector + from fides.api.db.session import get_db_session + from fides.api.models.connectionconfig import ConnectionConfig + from fides.api.service.connectors import get_connector SessionLocal = get_db_session(config) db = SessionLocal() diff --git a/src/fides/api/ops/service/connectors/base_email_connector.py b/src/fides/api/service/connectors/base_email_connector.py similarity index 88% rename from src/fides/api/ops/service/connectors/base_email_connector.py rename to src/fides/api/service/connectors/base_email_connector.py index b91655329d..a229884216 100644 --- a/src/fides/api/ops/service/connectors/base_email_connector.py +++ b/src/fides/api/service/connectors/base_email_connector.py @@ -3,13 +3,13 @@ from sqlalchemy.orm import Query, Session +from fides.api.common_exceptions import MessageDispatchException from fides.api.ctl.sql_models import Organization # type: ignore[attr-defined] -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionTestStatus -from fides.api.ops.models.messaging import MessagingConfig -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.messaging.messaging import MessagingServiceType -from fides.api.ops.service.connectors.base_connector import DB_CONNECTOR_TYPE +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionTestStatus +from fides.api.models.messaging import MessagingConfig +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.messaging.messaging import MessagingServiceType +from fides.api.service.connectors.base_connector import DB_CONNECTOR_TYPE from fides.core.config import CONFIG diff --git a/src/fides/api/ops/service/connectors/consent_email_connector.py b/src/fides/api/service/connectors/consent_email_connector.py similarity index 93% rename from src/fides/api/ops/service/connectors/consent_email_connector.py rename to src/fides/api/service/connectors/consent_email_connector.py index b01bbe236c..53f00b6b35 100644 --- a/src/fides/api/ops/service/connectors/consent_email_connector.py +++ b/src/fides/api/service/connectors/consent_email_connector.py @@ -3,47 +3,45 @@ from loguru import logger from sqlalchemy.orm import Query, Session -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.models.connectionconfig import ( +from fides.api.common_exceptions import MessageDispatchException +from fides.api.models.connectionconfig import ( ConnectionConfig, ConnectionTestStatus, ConnectionType, ) -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_notice import ( +from fides.api.models.policy import ActionType +from fides.api.models.privacy_notice import ( ConsentMechanism, EnforcementLevel, UserConsentPreference, ) -from fides.api.ops.models.privacy_preference import PrivacyPreferenceHistory -from fides.api.ops.models.privacy_request import ( +from fides.api.models.privacy_preference import PrivacyPreferenceHistory +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_email import ( +from fides.api.schemas.connection_configuration.connection_secrets_email import ( AdvancedSettingsWithExtendedIdentityTypes, ExtendedEmailSchema, ExtendedIdentityTypes, ) -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.schemas.messaging.messaging import ( ConsentEmailFulfillmentBodyParams, ConsentPreferencesByUser, MessagingActionType, ) -from fides.api.ops.schemas.privacy_notice import PrivacyNoticeHistorySchema -from fides.api.ops.schemas.privacy_preference import ( - MinimalPrivacyPreferenceHistorySchema, -) -from fides.api.ops.schemas.privacy_request import Consent -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors.base_email_connector import ( +from fides.api.schemas.privacy_notice import PrivacyNoticeHistorySchema +from fides.api.schemas.privacy_preference import MinimalPrivacyPreferenceHistorySchema +from fides.api.schemas.privacy_request import Consent +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors.base_email_connector import ( BaseEmailConnector, get_email_messaging_config_service_type, get_org_name, ) -from fides.api.ops.service.messaging.message_dispatch_service import dispatch_message -from fides.api.ops.util.consent_util import ( +from fides.api.service.messaging.message_dispatch_service import dispatch_message +from fides.api.util.consent_util import ( add_complete_system_status_for_consent_reporting, add_errored_system_status_for_consent_reporting, cache_initial_status_and_identities_for_consent_reporting, diff --git a/src/fides/api/ops/service/connectors/dynamodb_connector.py b/src/fides/api/service/connectors/dynamodb_connector.py similarity index 90% rename from src/fides/api/ops/service/connectors/dynamodb_connector.py rename to src/fides/api/service/connectors/dynamodb_connector.py index 72ec5f4745..f917188645 100644 --- a/src/fides/api/ops/service/connectors/dynamodb_connector.py +++ b/src/fides/api/service/connectors/dynamodb_connector.py @@ -6,21 +6,18 @@ from loguru import logger import fides.connectors.aws as aws_connector -from fides.api.ops.common_exceptions import ConnectionException -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionTestStatus -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.connection_configuration.connection_secrets_dynamodb import ( +from fides.api.common_exceptions import ConnectionException +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionTestStatus +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.connection_configuration.connection_secrets_dynamodb import ( DynamoDBSchema, ) -from fides.api.ops.service.connectors.base_connector import BaseConnector -from fides.api.ops.service.connectors.query_config import ( - DynamoDBQueryConfig, - QueryConfig, -) -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.logger import Pii +from fides.api.service.connectors.base_connector import BaseConnector +from fides.api.service.connectors.query_config import DynamoDBQueryConfig, QueryConfig +from fides.api.util.collection_util import Row +from fides.api.util.logger import Pii from fides.connectors.models import ( AWSConfig, ConnectorAuthFailureException, diff --git a/src/fides/api/ops/service/__init__.py b/src/fides/api/service/connectors/email/__init__.py similarity index 100% rename from src/fides/api/ops/service/__init__.py rename to src/fides/api/service/connectors/email/__init__.py diff --git a/src/fides/api/ops/service/connectors/email/attentive_connector.py b/src/fides/api/service/connectors/email/attentive_connector.py similarity index 71% rename from src/fides/api/ops/service/connectors/email/attentive_connector.py rename to src/fides/api/service/connectors/email/attentive_connector.py index 236e601c39..cd0ed78017 100644 --- a/src/fides/api/ops/service/connectors/email/attentive_connector.py +++ b/src/fides/api/service/connectors/email/attentive_connector.py @@ -1,4 +1,4 @@ -from fides.api.ops.service.connectors.erasure_email_connector import ( +from fides.api.service.connectors.erasure_email_connector import ( GenericErasureEmailConnector, ) diff --git a/src/fides/api/ops/service/connectors/email/sovrn_connector.py b/src/fides/api/service/connectors/email/sovrn_connector.py similarity index 70% rename from src/fides/api/ops/service/connectors/email/sovrn_connector.py rename to src/fides/api/service/connectors/email/sovrn_connector.py index af945e5ff0..272dc2d4fd 100644 --- a/src/fides/api/ops/service/connectors/email/sovrn_connector.py +++ b/src/fides/api/service/connectors/email/sovrn_connector.py @@ -1,9 +1,9 @@ from typing import Any, Dict -from fides.api.ops.schemas.connection_configuration.connection_secrets_sovrn import ( +from fides.api.schemas.connection_configuration.connection_secrets_sovrn import ( SOVRN_REQUIRED_IDENTITY, ) -from fides.api.ops.service.connectors.consent_email_connector import ( +from fides.api.service.connectors.consent_email_connector import ( GenericConsentEmailConnector, ) diff --git a/src/fides/api/ops/service/connectors/erasure_email_connector.py b/src/fides/api/service/connectors/erasure_email_connector.py similarity index 92% rename from src/fides/api/ops/service/connectors/erasure_email_connector.py rename to src/fides/api/service/connectors/erasure_email_connector.py index cb84e8a64b..c41b41b503 100644 --- a/src/fides/api/ops/service/connectors/erasure_email_connector.py +++ b/src/fides/api/service/connectors/erasure_email_connector.py @@ -3,34 +3,34 @@ from loguru import logger from sqlalchemy.orm import Query, Session -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.models.connectionconfig import ( +from fides.api.common_exceptions import MessageDispatchException +from fides.api.models.connectionconfig import ( ConnectionConfig, ConnectionTestStatus, ConnectionType, ) -from fides.api.ops.models.policy import ActionType, Rule -from fides.api.ops.models.privacy_request import ( +from fides.api.models.policy import ActionType, Rule +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, ) -from fides.api.ops.schemas.connection_configuration import EmailSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets_email import ( +from fides.api.schemas.connection_configuration import EmailSchema +from fides.api.schemas.connection_configuration.connection_secrets_email import ( AdvancedSettings, IdentityTypes, ) -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.schemas.messaging.messaging import ( ErasureRequestBodyParams, MessagingActionType, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors.base_email_connector import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors.base_email_connector import ( BaseEmailConnector, get_email_messaging_config_service_type, get_org_name, ) -from fides.api.ops.service.messaging.message_dispatch_service import dispatch_message +from fides.api.service.messaging.message_dispatch_service import dispatch_message from fides.core.config import get_config CONFIG = get_config() diff --git a/src/fides/api/ops/service/connectors/email/__init__.py b/src/fides/api/service/connectors/fides/__init__.py similarity index 100% rename from src/fides/api/ops/service/connectors/email/__init__.py rename to src/fides/api/service/connectors/fides/__init__.py diff --git a/src/fides/api/ops/service/connectors/fides/fides_client.py b/src/fides/api/service/connectors/fides/fides_client.py similarity index 95% rename from src/fides/api/ops/service/connectors/fides/fides_client.py rename to src/fides/api/service/connectors/fides/fides_client.py index 8707c96ea0..653f869d36 100644 --- a/src/fides/api/ops/service/connectors/fides/fides_client.py +++ b/src/fides/api/service/connectors/fides/fides_client.py @@ -6,20 +6,18 @@ from httpx import AsyncClient, Client, HTTPStatusError, Request, RequestError, Timeout from loguru import logger +from fides.api.api.v1 import urn_registry as urls from fides.api.ctl.utils.errors import FidesError -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.models.privacy_request import PrivacyRequestStatus -from fides.api.ops.schemas.privacy_request import ( +from fides.api.models.privacy_request import PrivacyRequestStatus +from fides.api.schemas.privacy_request import ( PrivacyRequestCreate, PrivacyRequestResponse, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.schemas.user import UserLogin -from fides.api.ops.service.privacy_request.request_service import ( - poll_server_for_completion, -) -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.wrappers import sync +from fides.api.schemas.redis_cache import Identity +from fides.api.schemas.user import UserLogin +from fides.api.service.privacy_request.request_service import poll_server_for_completion +from fides.api.util.collection_util import Row +from fides.api.util.wrappers import sync COMPLETION_STATUSES = [ PrivacyRequestStatus.complete, diff --git a/src/fides/api/ops/service/connectors/fides_connector.py b/src/fides/api/service/connectors/fides_connector.py similarity index 90% rename from src/fides/api/ops/service/connectors/fides_connector.py rename to src/fides/api/service/connectors/fides_connector.py index d07f0d7540..a8462ccd75 100644 --- a/src/fides/api/ops/service/connectors/fides_connector.py +++ b/src/fides/api/service/connectors/fides_connector.py @@ -3,22 +3,22 @@ from loguru import logger as log from fides.api.ctl.utils.errors import FidesError -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ( +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ( ConnectionConfig, ConnectionTestStatus, ConnectionType, ) -from fides.api.ops.models.policy import ActionType, Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.connection_configuration.connection_secrets_fides import ( +from fides.api.models.policy import ActionType, Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.connection_configuration.connection_secrets_fides import ( FidesConnectorSchema, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors.base_connector import BaseConnector -from fides.api.ops.service.connectors.fides.fides_client import FidesClient -from fides.api.ops.service.connectors.query_config import QueryConfig -from fides.api.ops.util.collection_util import Row +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors.base_connector import BaseConnector +from fides.api.service.connectors.fides.fides_client import FidesClient +from fides.api.service.connectors.query_config import QueryConfig +from fides.api.util.collection_util import Row DEFAULT_POLLING_TIMEOUT: int = 1800 DEFAULT_POLLING_INTERVAL: int = 30 diff --git a/src/fides/api/ops/service/connectors/http_connector.py b/src/fides/api/service/connectors/http_connector.py similarity index 84% rename from src/fides/api/ops/service/connectors/http_connector.py rename to src/fides/api/service/connectors/http_connector.py index 8dc72d3db0..a2e4ac3200 100644 --- a/src/fides/api/ops/service/connectors/http_connector.py +++ b/src/fides/api/service/connectors/http_connector.py @@ -5,15 +5,15 @@ from loguru import logger from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR -from fides.api.ops.common_exceptions import ClientUnsuccessfulException -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionTestStatus -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.connection_configuration import HttpsSchema -from fides.api.ops.service.connectors.base_connector import BaseConnector -from fides.api.ops.service.connectors.query_config import QueryConfig -from fides.api.ops.util.collection_util import Row +from fides.api.common_exceptions import ClientUnsuccessfulException +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionTestStatus +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.connection_configuration import HttpsSchema +from fides.api.service.connectors.base_connector import BaseConnector +from fides.api.service.connectors.query_config import QueryConfig +from fides.api.util.collection_util import Row class HTTPSConnector(BaseConnector[None]): diff --git a/src/fides/api/ops/service/connectors/fides/__init__.py b/src/fides/api/service/connectors/limiter/__init__.py similarity index 100% rename from src/fides/api/ops/service/connectors/fides/__init__.py rename to src/fides/api/service/connectors/limiter/__init__.py diff --git a/src/fides/api/ops/service/connectors/limiter/rate_limiter.py b/src/fides/api/service/connectors/limiter/rate_limiter.py similarity index 97% rename from src/fides/api/ops/service/connectors/limiter/rate_limiter.py rename to src/fides/api/service/connectors/limiter/rate_limiter.py index 86ead1385e..9c53159963 100644 --- a/src/fides/api/ops/service/connectors/limiter/rate_limiter.py +++ b/src/fides/api/service/connectors/limiter/rate_limiter.py @@ -4,8 +4,8 @@ from loguru import logger -from fides.api.ops.common_exceptions import RedisConnectionError -from fides.api.ops.util.cache import FidesopsRedis, get_cache +from fides.api.common_exceptions import RedisConnectionError +from fides.api.util.cache import FidesopsRedis, get_cache class RateLimiterPeriod(Enum): diff --git a/src/fides/api/ops/service/connectors/manual_connector.py b/src/fides/api/service/connectors/manual_connector.py similarity index 88% rename from src/fides/api/ops/service/connectors/manual_connector.py rename to src/fides/api/service/connectors/manual_connector.py index c6e45da72c..253c800f6c 100644 --- a/src/fides/api/ops/service/connectors/manual_connector.py +++ b/src/fides/api/service/connectors/manual_connector.py @@ -1,12 +1,12 @@ from typing import Any, Dict, List, Optional -from fides.api.ops.common_exceptions import PrivacyRequestPaused -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.policy import CurrentStep, Policy -from fides.api.ops.models.privacy_request import ManualAction, PrivacyRequest -from fides.api.ops.service.connectors.base_connector import BaseConnector -from fides.api.ops.service.connectors.query_config import ManualQueryConfig -from fides.api.ops.util.collection_util import Row +from fides.api.common_exceptions import PrivacyRequestPaused +from fides.api.graph.traversal import TraversalNode +from fides.api.models.policy import CurrentStep, Policy +from fides.api.models.privacy_request import ManualAction, PrivacyRequest +from fides.api.service.connectors.base_connector import BaseConnector +from fides.api.service.connectors.query_config import ManualQueryConfig +from fides.api.util.collection_util import Row class ManualConnector(BaseConnector[None]): diff --git a/src/fides/api/ops/service/connectors/manual_webhook_connector.py b/src/fides/api/service/connectors/manual_webhook_connector.py similarity index 82% rename from src/fides/api/ops/service/connectors/manual_webhook_connector.py rename to src/fides/api/service/connectors/manual_webhook_connector.py index 75a6e501d1..06efdda600 100644 --- a/src/fides/api/ops/service/connectors/manual_webhook_connector.py +++ b/src/fides/api/service/connectors/manual_webhook_connector.py @@ -1,11 +1,11 @@ from typing import Any, Dict, List -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionTestStatus -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.service.connectors.base_connector import BaseConnector -from fides.api.ops.util.collection_util import Row +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionTestStatus +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.service.connectors.base_connector import BaseConnector +from fides.api.util.collection_util import Row class ManualWebhookConnector(BaseConnector[None]): diff --git a/src/fides/api/ops/service/connectors/mongodb_connector.py b/src/fides/api/service/connectors/mongodb_connector.py similarity index 88% rename from src/fides/api/ops/service/connectors/mongodb_connector.py rename to src/fides/api/service/connectors/mongodb_connector.py index 2212cf176f..6942113820 100644 --- a/src/fides/api/ops/service/connectors/mongodb_connector.py +++ b/src/fides/api/service/connectors/mongodb_connector.py @@ -4,18 +4,18 @@ from pymongo import MongoClient from pymongo.errors import OperationFailure, ServerSelectionTimeoutError -from fides.api.ops.common_exceptions import ConnectionException -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionTestStatus -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.connection_configuration.connection_secrets_mongodb import ( +from fides.api.common_exceptions import ConnectionException +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionTestStatus +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.connection_configuration.connection_secrets_mongodb import ( MongoDBSchema, ) -from fides.api.ops.service.connectors.base_connector import BaseConnector -from fides.api.ops.service.connectors.query_config import MongoQueryConfig, QueryConfig -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.logger import Pii +from fides.api.service.connectors.base_connector import BaseConnector +from fides.api.service.connectors.query_config import MongoQueryConfig, QueryConfig +from fides.api.util.collection_util import Row +from fides.api.util.logger import Pii class MongoDBConnector(BaseConnector[MongoClient]): diff --git a/src/fides/api/ops/service/connectors/query_config.py b/src/fides/api/service/connectors/query_config.py similarity index 97% rename from src/fides/api/ops/service/connectors/query_config.py rename to src/fides/api/service/connectors/query_config.py index 3f8244ca54..9a535ed33d 100644 --- a/src/fides/api/ops/service/connectors/query_config.py +++ b/src/fides/api/service/connectors/query_config.py @@ -10,27 +10,27 @@ from sqlalchemy.sql import Executable, Update # type: ignore from sqlalchemy.sql.elements import ColumnElement, TextClause -from fides.api.ops.graph.config import ( +from fides.api.graph.config import ( ROOT_COLLECTION_ADDRESS, CollectionAddress, Field, FieldPath, MaskingOverride, ) -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.policy import ActionType, Policy, Rule -from fides.api.ops.models.privacy_request import ManualAction, PrivacyRequest -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy -from fides.api.ops.service.masking.strategy.masking_strategy_nullify import ( +from fides.api.graph.traversal import TraversalNode +from fides.api.models.policy import ActionType, Policy, Rule +from fides.api.models.privacy_request import ManualAction, PrivacyRequest +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.service.masking.strategy.masking_strategy_nullify import ( NullMaskingStrategy, ) -from fides.api.ops.task.refine_target_path import ( +from fides.api.task.refine_target_path import ( build_refined_target_paths, join_detailed_path, ) -from fides.api.ops.util.collection_util import Row, append, filter_nonempty_values -from fides.api.ops.util.logger import Pii -from fides.api.ops.util.querytoken import QueryToken +from fides.api.util.collection_util import Row, append, filter_nonempty_values +from fides.api.util.logger import Pii +from fides.api.util.querytoken import QueryToken T = TypeVar("T") @@ -56,7 +56,7 @@ def build_rule_target_field_paths( """ Return dictionary of rules mapped to update-able field paths on a given collection Example: - {: [FieldPath('name'), FieldPath('code'), FieldPath('ccn')]} + {: [FieldPath('name'), FieldPath('code'), FieldPath('ccn')]} """ rule_updates: Dict[Rule, List[FieldPath]] = {} for rule in policy.rules: # type: ignore[attr-defined] diff --git a/src/fides/api/ops/service/connectors/limiter/__init__.py b/src/fides/api/service/connectors/saas/__init__.py similarity index 100% rename from src/fides/api/ops/service/connectors/limiter/__init__.py rename to src/fides/api/service/connectors/saas/__init__.py diff --git a/src/fides/api/ops/service/connectors/saas/authenticated_client.py b/src/fides/api/service/connectors/saas/authenticated_client.py similarity index 94% rename from src/fides/api/ops/service/connectors/saas/authenticated_client.py rename to src/fides/api/service/connectors/saas/authenticated_client.py index 25fd96badf..fd29659e3d 100644 --- a/src/fides/api/ops/service/connectors/saas/authenticated_client.py +++ b/src/fides/api/service/connectors/saas/authenticated_client.py @@ -10,12 +10,12 @@ from loguru import logger from requests import PreparedRequest, Request, Response, Session -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( ClientUnsuccessfulException, ConnectionException, FidesopsException, ) -from fides.api.ops.service.connectors.limiter.rate_limiter import ( +from fides.api.service.connectors.limiter.rate_limiter import ( RateLimiter, RateLimiterPeriod, RateLimiterRequest, @@ -23,10 +23,10 @@ from fides.core.config import CONFIG if TYPE_CHECKING: - from fides.api.ops.models.connectionconfig import ConnectionConfig - from fides.api.ops.schemas.limiter.rate_limit_config import RateLimitConfig - from fides.api.ops.schemas.saas.saas_config import ClientConfig - from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams + from fides.api.models.connectionconfig import ConnectionConfig + from fides.api.schemas.limiter.rate_limit_config import RateLimitConfig + from fides.api.schemas.saas.saas_config import ClientConfig + from fides.api.schemas.saas.shared_schemas import SaaSRequestParams class AuthenticatedClient: @@ -56,7 +56,7 @@ def get_authenticated_request( incoming path, headers, query, and body params. """ - from fides.api.ops.service.authentication.authentication_strategy import ( # pylint: disable=R0401 + from fides.api.service.authentication.authentication_strategy import ( # pylint: disable=R0401 AuthenticationStrategy, ) diff --git a/src/fides/api/ops/service/connectors/saas/connector_registry_service.py b/src/fides/api/service/connectors/saas/connector_registry_service.py similarity index 96% rename from src/fides/api/ops/service/connectors/saas/connector_registry_service.py rename to src/fides/api/service/connectors/saas/connector_registry_service.py index 176f76d433..1795b0e861 100644 --- a/src/fides/api/ops/service/connectors/saas/connector_registry_service.py +++ b/src/fides/api/service/connectors/saas/connector_registry_service.py @@ -15,22 +15,22 @@ from RestrictedPython.transformer import RestrictingNodeTransformer from sqlalchemy.orm import Session -from fides.api.ops.api.deps import get_api_session -from fides.api.ops.common_exceptions import FidesopsException, ValidationError -from fides.api.ops.cryptography.cryptographic_util import str_to_b64_str -from fides.api.ops.models.connectionconfig import ( +from fides.api.api.deps import get_api_session +from fides.api.common_exceptions import FidesopsException, ValidationError +from fides.api.cryptography.cryptographic_util import str_to_b64_str +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.custom_connector_template import CustomConnectorTemplate -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.models.custom_connector_template import CustomConnectorTemplate +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.connection_configuration.connection_config import ( SaasConnectionTemplateValues, ) -from fides.api.ops.schemas.saas.connector_template import ConnectorTemplate -from fides.api.ops.schemas.saas.saas_config import SaaSConfig -from fides.api.ops.util.saas_util import ( +from fides.api.schemas.saas.connector_template import ConnectorTemplate +from fides.api.schemas.saas.saas_config import SaaSConfig +from fides.api.util.saas_util import ( encode_file_contents, load_config, load_config_from_string, diff --git a/src/fides/api/ops/service/connectors/saas_connector.py b/src/fides/api/service/connectors/saas_connector.py similarity index 95% rename from src/fides/api/ops/service/connectors/saas_connector.py rename to src/fides/api/service/connectors/saas_connector.py index 96de071a1c..fb705f37a4 100644 --- a/src/fides/api/ops/service/connectors/saas_connector.py +++ b/src/fides/api/service/connectors/saas_connector.py @@ -6,43 +6,41 @@ from requests import Response from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( FidesopsException, PostProcessingException, SkippingConsentPropagation, ) -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionTestStatus -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.limiter.rate_limit_config import RateLimitConfig -from fides.api.ops.schemas.saas.saas_config import ( +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionTestStatus +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.limiter.rate_limit_config import RateLimitConfig +from fides.api.schemas.saas.saas_config import ( ClientConfig, ConsentRequestMap, ParamValue, SaaSRequest, ) -from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams -from fides.api.ops.service.connectors.base_connector import BaseConnector -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.connectors.saas_query_config import SaaSQueryConfig -from fides.api.ops.service.pagination.pagination_strategy import PaginationStrategy -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy import ( +from fides.api.schemas.saas.shared_schemas import SaaSRequestParams +from fides.api.service.connectors.base_connector import BaseConnector +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.connectors.saas_query_config import SaaSQueryConfig +from fides.api.service.pagination.pagination_strategy import PaginationStrategy +from fides.api.service.processors.post_processor_strategy.post_processor_strategy import ( PostProcessorStrategy, ) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestOverrideFactory, SaaSRequestType, ) -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.consent_util import ( +from fides.api.util.collection_util import Row +from fides.api.util.consent_util import ( add_complete_system_status_for_consent_reporting, cache_initial_status_and_identities_for_consent_reporting, should_opt_in_to_service, ) -from fides.api.ops.util.saas_util import assign_placeholders, map_param_values +from fides.api.util.saas_util import assign_placeholders, map_param_values class SaaSConnector(BaseConnector[AuthenticatedClient]): diff --git a/src/fides/api/ops/service/connectors/saas_query_config.py b/src/fides/api/service/connectors/saas_query_config.py similarity index 96% rename from src/fides/api/ops/service/connectors/saas_query_config.py rename to src/fides/api/service/connectors/saas_query_config.py index 1924427012..6d4849143a 100644 --- a/src/fides/api/ops/service/connectors/saas_query_config.py +++ b/src/fides/api/service/connectors/saas_query_config.py @@ -8,17 +8,17 @@ from fideslang.models import FidesDatasetReference from loguru import logger -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.graph.config import ScalarField -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.saas.saas_config import Endpoint, SaaSConfig, SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams -from fides.api.ops.service.connectors.query_config import QueryConfig -from fides.api.ops.util import saas_util -from fides.api.ops.util.collection_util import Row, merge_dicts -from fides.api.ops.util.saas_util import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.graph.config import ScalarField +from fides.api.graph.traversal import TraversalNode +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.saas.saas_config import Endpoint, SaaSConfig, SaaSRequest +from fides.api.schemas.saas.shared_schemas import SaaSRequestParams +from fides.api.service.connectors.query_config import QueryConfig +from fides.api.util import saas_util +from fides.api.util.collection_util import Row, merge_dicts +from fides.api.util.saas_util import ( ALL_OBJECT_FIELDS, FIDESOPS_GROUPED_INPUTS, MASKED_OBJECT_FIELDS, diff --git a/src/fides/api/ops/service/connectors/sql_connector.py b/src/fides/api/service/connectors/sql_connector.py similarity index 94% rename from src/fides/api/ops/service/connectors/sql_connector.py rename to src/fides/api/service/connectors/sql_connector.py index 9dfc08f7bc..17bff0ff63 100644 --- a/src/fides/api/ops/service/connectors/sql_connector.py +++ b/src/fides/api/service/connectors/sql_connector.py @@ -16,36 +16,36 @@ from sqlalchemy.sql import Executable # type: ignore from sqlalchemy.sql.elements import TextClause -from fides.api.ops.common_exceptions import ConnectionException -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionTestStatus -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.connection_configuration import ( +from fides.api.common_exceptions import ConnectionException +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionTestStatus +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.connection_configuration import ( ConnectionConfigSecretsSchema, MicrosoftSQLServerSchema, PostgreSQLSchema, RedshiftSchema, SnowflakeSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_bigquery import ( +from fides.api.schemas.connection_configuration.connection_secrets_bigquery import ( BigQuerySchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mariadb import ( +from fides.api.schemas.connection_configuration.connection_secrets_mariadb import ( MariaDBSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_mysql import ( +from fides.api.schemas.connection_configuration.connection_secrets_mysql import ( MySQLSchema, ) -from fides.api.ops.service.connectors.base_connector import BaseConnector -from fides.api.ops.service.connectors.query_config import ( +from fides.api.service.connectors.base_connector import BaseConnector +from fides.api.service.connectors.query_config import ( BigQueryQueryConfig, MicrosoftSQLServerQueryConfig, RedshiftQueryConfig, SnowflakeQueryConfig, SQLQueryConfig, ) -from fides.api.ops.util.collection_util import Row +from fides.api.util.collection_util import Row class SQLConnector(BaseConnector[Engine]): diff --git a/src/fides/api/ops/service/connectors/timescale_connector.py b/src/fides/api/service/connectors/timescale_connector.py similarity index 66% rename from src/fides/api/ops/service/connectors/timescale_connector.py rename to src/fides/api/service/connectors/timescale_connector.py index 4cf8ab20f9..633e5347d7 100644 --- a/src/fides/api/ops/service/connectors/timescale_connector.py +++ b/src/fides/api/service/connectors/timescale_connector.py @@ -1,4 +1,4 @@ -from fides.api.ops.service.connectors.sql_connector import PostgreSQLConnector +from fides.api.service.connectors.sql_connector import PostgreSQLConnector class TimescaleConnector(PostgreSQLConnector): diff --git a/src/fides/api/ops/service/connectors/saas/__init__.py b/src/fides/api/service/drp/__init__.py similarity index 100% rename from src/fides/api/ops/service/connectors/saas/__init__.py rename to src/fides/api/service/drp/__init__.py diff --git a/src/fides/api/ops/service/drp/drp_fidesops_mapper.py b/src/fides/api/service/drp/drp_fidesops_mapper.py similarity index 89% rename from src/fides/api/ops/service/drp/drp_fidesops_mapper.py rename to src/fides/api/service/drp/drp_fidesops_mapper.py index 36203fb70d..1f1ed5c8e5 100644 --- a/src/fides/api/ops/service/drp/drp_fidesops_mapper.py +++ b/src/fides/api/service/drp/drp_fidesops_mapper.py @@ -2,13 +2,10 @@ from loguru import logger -from fides.api.ops.models.privacy_request import ( - PrivacyRequestStatus, - ProvidedIdentityType, -) -from fides.api.ops.schemas.drp_privacy_request import DrpIdentity -from fides.api.ops.schemas.privacy_request import PrivacyRequestDRPStatus -from fides.api.ops.schemas.redis_cache import Identity +from fides.api.models.privacy_request import PrivacyRequestStatus, ProvidedIdentityType +from fides.api.schemas.drp_privacy_request import DrpIdentity +from fides.api.schemas.privacy_request import PrivacyRequestDRPStatus +from fides.api.schemas.redis_cache import Identity class DrpFidesopsMapper: diff --git a/src/fides/api/ops/service/masking/__init__.py b/src/fides/api/service/masking/__init__.py similarity index 79% rename from src/fides/api/ops/service/masking/__init__.py rename to src/fides/api/service/masking/__init__.py index 1915fdbf3f..b72c2ba5a0 100644 --- a/src/fides/api/ops/service/masking/__init__.py +++ b/src/fides/api/service/masking/__init__.py @@ -1,4 +1,4 @@ -from fides.api.ops.service.masking.strategy import ( +from fides.api.service.masking.strategy import ( masking_strategy_aes_encrypt, masking_strategy_hash, masking_strategy_hmac, diff --git a/src/fides/api/ops/service/drp/__init__.py b/src/fides/api/service/masking/strategy/__init__.py similarity index 100% rename from src/fides/api/ops/service/drp/__init__.py rename to src/fides/api/service/masking/strategy/__init__.py diff --git a/src/fides/api/ops/service/masking/strategy/format_preservation.py b/src/fides/api/service/masking/strategy/format_preservation.py similarity index 75% rename from src/fides/api/ops/service/masking/strategy/format_preservation.py rename to src/fides/api/service/masking/strategy/format_preservation.py index dd365d14d7..d94482ca3c 100644 --- a/src/fides/api/ops/service/masking/strategy/format_preservation.py +++ b/src/fides/api/service/masking/strategy/format_preservation.py @@ -1,4 +1,4 @@ -from fides.api.ops.schemas.masking.masking_configuration import FormatPreservationConfig +from fides.api.schemas.masking.masking_configuration import FormatPreservationConfig class FormatPreservation: diff --git a/src/fides/api/ops/service/masking/strategy/masking_strategy.py b/src/fides/api/service/masking/strategy/masking_strategy.py similarity index 85% rename from src/fides/api/ops/service/masking/strategy/masking_strategy.py rename to src/fides/api/service/masking/strategy/masking_strategy.py index 4057ff507d..efc1bd7e0e 100644 --- a/src/fides/api/ops/service/masking/strategy/masking_strategy.py +++ b/src/fides/api/service/masking/strategy/masking_strategy.py @@ -4,11 +4,11 @@ from abc import abstractmethod from typing import Any, List, Optional, Type -from fides.api.ops.schemas.masking.masking_secrets import MaskingSecretCache -from fides.api.ops.schemas.masking.masking_strategy_description import ( +from fides.api.schemas.masking.masking_secrets import MaskingSecretCache +from fides.api.schemas.masking.masking_strategy_description import ( MaskingStrategyDescription, ) -from fides.api.ops.service.strategy import Strategy +from fides.api.service.strategy import Strategy class MaskingStrategy(Strategy): diff --git a/src/fides/api/ops/service/masking/strategy/masking_strategy_aes_encrypt.py b/src/fides/api/service/masking/strategy/masking_strategy_aes_encrypt.py similarity index 89% rename from src/fides/api/ops/service/masking/strategy/masking_strategy_aes_encrypt.py rename to src/fides/api/service/masking/strategy/masking_strategy_aes_encrypt.py index 009bd56513..936490c016 100644 --- a/src/fides/api/ops/service/masking/strategy/masking_strategy_aes_encrypt.py +++ b/src/fides/api/service/masking/strategy/masking_strategy_aes_encrypt.py @@ -2,28 +2,24 @@ from typing import Dict, List, Optional, Type -from fides.api.ops.schemas.masking.masking_configuration import ( +from fides.api.schemas.masking.masking_configuration import ( AesEncryptionMaskingConfiguration, HmacMaskingConfiguration, ) -from fides.api.ops.schemas.masking.masking_secrets import ( +from fides.api.schemas.masking.masking_secrets import ( MaskingSecretCache, MaskingSecretMeta, SecretType, ) -from fides.api.ops.schemas.masking.masking_strategy_description import ( +from fides.api.schemas.masking.masking_strategy_description import ( MaskingStrategyConfigurationDescription, MaskingStrategyDescription, ) -from fides.api.ops.service.masking.strategy.format_preservation import ( - FormatPreservation, -) -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy -from fides.api.ops.util.encryption.aes_gcm_encryption_scheme import encrypt -from fides.api.ops.util.encryption.hmac_encryption_scheme import ( - hmac_encrypt_return_bytes, -) -from fides.api.ops.util.encryption.secrets_util import SecretsUtil +from fides.api.service.masking.strategy.format_preservation import FormatPreservation +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.util.encryption.aes_gcm_encryption_scheme import encrypt +from fides.api.util.encryption.hmac_encryption_scheme import hmac_encrypt_return_bytes +from fides.api.util.encryption.secrets_util import SecretsUtil class AesEncryptionMaskingStrategy(MaskingStrategy): diff --git a/src/fides/api/ops/service/masking/strategy/masking_strategy_factory.py b/src/fides/api/service/masking/strategy/masking_strategy_factory.py similarity index 86% rename from src/fides/api/ops/service/masking/strategy/masking_strategy_factory.py rename to src/fides/api/service/masking/strategy/masking_strategy_factory.py index 9e036993f9..cd0030acb9 100644 --- a/src/fides/api/ops/service/masking/strategy/masking_strategy_factory.py +++ b/src/fides/api/service/masking/strategy/masking_strategy_factory.py @@ -3,10 +3,10 @@ from loguru import logger from pydantic import ValidationError -from fides.api.ops.common_exceptions import NoSuchStrategyException -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.schemas.masking.masking_configuration import FormatPreservationConfig -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.common_exceptions import NoSuchStrategyException +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.schemas.masking.masking_configuration import FormatPreservationConfig +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy class MaskingStrategyFactory: diff --git a/src/fides/api/ops/service/masking/strategy/masking_strategy_hash.py b/src/fides/api/service/masking/strategy/masking_strategy_hash.py similarity index 90% rename from src/fides/api/ops/service/masking/strategy/masking_strategy_hash.py rename to src/fides/api/service/masking/strategy/masking_strategy_hash.py index db2f9c5219..0f6fb45e82 100644 --- a/src/fides/api/ops/service/masking/strategy/masking_strategy_hash.py +++ b/src/fides/api/service/masking/strategy/masking_strategy_hash.py @@ -3,21 +3,19 @@ import hashlib from typing import Dict, List, Optional, Type -from fides.api.ops.schemas.masking.masking_configuration import HashMaskingConfiguration -from fides.api.ops.schemas.masking.masking_secrets import ( +from fides.api.schemas.masking.masking_configuration import HashMaskingConfiguration +from fides.api.schemas.masking.masking_secrets import ( MaskingSecretCache, MaskingSecretMeta, SecretType, ) -from fides.api.ops.schemas.masking.masking_strategy_description import ( +from fides.api.schemas.masking.masking_strategy_description import ( MaskingStrategyConfigurationDescription, MaskingStrategyDescription, ) -from fides.api.ops.service.masking.strategy.format_preservation import ( - FormatPreservation, -) -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy -from fides.api.ops.util.encryption.secrets_util import SecretsUtil +from fides.api.service.masking.strategy.format_preservation import FormatPreservation +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.util.encryption.secrets_util import SecretsUtil from fides.core.config import CONFIG diff --git a/src/fides/api/ops/service/masking/strategy/masking_strategy_hmac.py b/src/fides/api/service/masking/strategy/masking_strategy_hmac.py similarity index 87% rename from src/fides/api/ops/service/masking/strategy/masking_strategy_hmac.py rename to src/fides/api/service/masking/strategy/masking_strategy_hmac.py index 7b542d8c49..ce15aa6513 100644 --- a/src/fides/api/ops/service/masking/strategy/masking_strategy_hmac.py +++ b/src/fides/api/service/masking/strategy/masking_strategy_hmac.py @@ -2,22 +2,20 @@ from typing import Dict, List, Optional, Type -from fides.api.ops.schemas.masking.masking_configuration import HmacMaskingConfiguration -from fides.api.ops.schemas.masking.masking_secrets import ( +from fides.api.schemas.masking.masking_configuration import HmacMaskingConfiguration +from fides.api.schemas.masking.masking_secrets import ( MaskingSecretCache, MaskingSecretMeta, SecretType, ) -from fides.api.ops.schemas.masking.masking_strategy_description import ( +from fides.api.schemas.masking.masking_strategy_description import ( MaskingStrategyConfigurationDescription, MaskingStrategyDescription, ) -from fides.api.ops.service.masking.strategy.format_preservation import ( - FormatPreservation, -) -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy -from fides.api.ops.util.encryption.hmac_encryption_scheme import hmac_encrypt_return_str -from fides.api.ops.util.encryption.secrets_util import SecretsUtil +from fides.api.service.masking.strategy.format_preservation import FormatPreservation +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.util.encryption.hmac_encryption_scheme import hmac_encrypt_return_str +from fides.api.util.encryption.secrets_util import SecretsUtil class HmacMaskingStrategy(MaskingStrategy): diff --git a/src/fides/api/ops/service/masking/strategy/masking_strategy_nullify.py b/src/fides/api/service/masking/strategy/masking_strategy_nullify.py similarity index 84% rename from src/fides/api/ops/service/masking/strategy/masking_strategy_nullify.py rename to src/fides/api/service/masking/strategy/masking_strategy_nullify.py index 8ebb53df25..6a5e986fa1 100644 --- a/src/fides/api/ops/service/masking/strategy/masking_strategy_nullify.py +++ b/src/fides/api/service/masking/strategy/masking_strategy_nullify.py @@ -1,10 +1,10 @@ from typing import List, Optional, Type -from fides.api.ops.schemas.masking.masking_configuration import NullMaskingConfiguration -from fides.api.ops.schemas.masking.masking_strategy_description import ( +from fides.api.schemas.masking.masking_configuration import NullMaskingConfiguration +from fides.api.schemas.masking.masking_strategy_description import ( MaskingStrategyDescription, ) -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy class NullMaskingStrategy(MaskingStrategy): diff --git a/src/fides/api/ops/service/masking/strategy/masking_strategy_random_string_rewrite.py b/src/fides/api/service/masking/strategy/masking_strategy_random_string_rewrite.py similarity index 87% rename from src/fides/api/ops/service/masking/strategy/masking_strategy_random_string_rewrite.py rename to src/fides/api/service/masking/strategy/masking_strategy_random_string_rewrite.py index a0e5e6c6ec..8164a43331 100644 --- a/src/fides/api/ops/service/masking/strategy/masking_strategy_random_string_rewrite.py +++ b/src/fides/api/service/masking/strategy/masking_strategy_random_string_rewrite.py @@ -2,17 +2,15 @@ from secrets import choice from typing import List, Optional, Type -from fides.api.ops.schemas.masking.masking_configuration import ( +from fides.api.schemas.masking.masking_configuration import ( RandomStringMaskingConfiguration, ) -from fides.api.ops.schemas.masking.masking_strategy_description import ( +from fides.api.schemas.masking.masking_strategy_description import ( MaskingStrategyConfigurationDescription, MaskingStrategyDescription, ) -from fides.api.ops.service.masking.strategy.format_preservation import ( - FormatPreservation, -) -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.service.masking.strategy.format_preservation import FormatPreservation +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy class RandomStringRewriteMaskingStrategy(MaskingStrategy): diff --git a/src/fides/api/ops/service/masking/strategy/masking_strategy_string_rewrite.py b/src/fides/api/service/masking/strategy/masking_strategy_string_rewrite.py similarity index 87% rename from src/fides/api/ops/service/masking/strategy/masking_strategy_string_rewrite.py rename to src/fides/api/service/masking/strategy/masking_strategy_string_rewrite.py index 9f78ad003d..061bc0e047 100644 --- a/src/fides/api/ops/service/masking/strategy/masking_strategy_string_rewrite.py +++ b/src/fides/api/service/masking/strategy/masking_strategy_string_rewrite.py @@ -1,16 +1,14 @@ from typing import List, Optional, Type -from fides.api.ops.schemas.masking.masking_configuration import ( +from fides.api.schemas.masking.masking_configuration import ( StringRewriteMaskingConfiguration, ) -from fides.api.ops.schemas.masking.masking_strategy_description import ( +from fides.api.schemas.masking.masking_strategy_description import ( MaskingStrategyConfigurationDescription, MaskingStrategyDescription, ) -from fides.api.ops.service.masking.strategy.format_preservation import ( - FormatPreservation, -) -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.service.masking.strategy.format_preservation import FormatPreservation +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy class StringRewriteMaskingStrategy(MaskingStrategy): diff --git a/src/fides/api/ops/service/masking/strategy/__init__.py b/src/fides/api/service/messaging/__init__.py similarity index 100% rename from src/fides/api/ops/service/masking/strategy/__init__.py rename to src/fides/api/service/messaging/__init__.py diff --git a/src/fides/api/ops/service/messaging/message_dispatch_service.py b/src/fides/api/service/messaging/message_dispatch_service.py similarity index 98% rename from src/fides/api/ops/service/messaging/message_dispatch_service.py rename to src/fides/api/service/messaging/message_dispatch_service.py index 3e94979cc0..1c7861bd17 100644 --- a/src/fides/api/ops/service/messaging/message_dispatch_service.py +++ b/src/fides/api/service/messaging/message_dispatch_service.py @@ -11,18 +11,18 @@ from twilio.base.exceptions import TwilioRestException from twilio.rest import Client -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.email_templates.get_email_template import get_email_template -from fides.api.ops.models.messaging import ( # type: ignore[attr-defined] +from fides.api.common_exceptions import MessageDispatchException +from fides.api.email_templates.get_email_template import get_email_template +from fides.api.models.messaging import ( # type: ignore[attr-defined] EMAIL_MESSAGING_SERVICES, MessagingConfig, get_messaging_method, ) -from fides.api.ops.models.privacy_request import ( +from fides.api.models.privacy_request import ( PrivacyRequestError, PrivacyRequestNotifications, ) -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.schemas.messaging.messaging import ( AccessRequestCompleteBodyParams, ConsentEmailFulfillmentBodyParams, EmailForActionType, @@ -38,9 +38,9 @@ RequestReviewDenyBodyParams, SubjectIdentityVerificationBodyParams, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.tasks import MESSAGING_QUEUE_NAME, DatabaseTask, celery_app -from fides.api.ops.util.logger import Pii +from fides.api.schemas.redis_cache import Identity +from fides.api.tasks import MESSAGING_QUEUE_NAME, DatabaseTask, celery_app +from fides.api.util.logger import Pii from fides.core.config import CONFIG from fides.core.config.config_proxy import ConfigProxy diff --git a/src/fides/api/ops/service/messaging/messaging_crud_service.py b/src/fides/api/service/messaging/messaging_crud_service.py similarity index 92% rename from src/fides/api/ops/service/messaging/messaging_crud_service.py rename to src/fides/api/service/messaging/messaging_crud_service.py index 6bfe20f663..0e357df1c8 100644 --- a/src/fides/api/ops/service/messaging/messaging_crud_service.py +++ b/src/fides/api/service/messaging/messaging_crud_service.py @@ -4,9 +4,9 @@ from loguru import logger from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import MessagingConfigNotFoundException -from fides.api.ops.models.messaging import MessagingConfig -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.common_exceptions import MessagingConfigNotFoundException +from fides.api.models.messaging import MessagingConfig +from fides.api.schemas.messaging.messaging import ( MessagingConfigRequest, MessagingConfigResponse, ) diff --git a/src/fides/api/ops/service/outbound_urn_registry.py b/src/fides/api/service/outbound_urn_registry.py similarity index 100% rename from src/fides/api/ops/service/outbound_urn_registry.py rename to src/fides/api/service/outbound_urn_registry.py diff --git a/src/fides/api/ops/service/pagination/__init__.py b/src/fides/api/service/pagination/__init__.py similarity index 67% rename from src/fides/api/ops/service/pagination/__init__.py rename to src/fides/api/service/pagination/__init__.py index 651b214f12..c51775a5dd 100644 --- a/src/fides/api/ops/service/pagination/__init__.py +++ b/src/fides/api/service/pagination/__init__.py @@ -1,4 +1,4 @@ -from fides.api.ops.service.pagination import ( +from fides.api.service.pagination import ( pagination_strategy_cursor, pagination_strategy_link, pagination_strategy_offset, diff --git a/src/fides/api/ops/service/pagination/pagination_strategy.py b/src/fides/api/service/pagination/pagination_strategy.py similarity index 79% rename from src/fides/api/ops/service/pagination/pagination_strategy.py rename to src/fides/api/service/pagination/pagination_strategy.py index 5b967d45fe..dd94584d21 100644 --- a/src/fides/api/ops/service/pagination/pagination_strategy.py +++ b/src/fides/api/service/pagination/pagination_strategy.py @@ -5,11 +5,11 @@ from requests import Response -from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams -from fides.api.ops.service.strategy import Strategy +from fides.api.schemas.saas.shared_schemas import SaaSRequestParams +from fides.api.service.strategy import Strategy if TYPE_CHECKING: - from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration + from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration class PaginationStrategy(Strategy): diff --git a/src/fides/api/ops/service/pagination/pagination_strategy_cursor.py b/src/fides/api/service/pagination/pagination_strategy_cursor.py similarity index 86% rename from src/fides/api/ops/service/pagination/pagination_strategy_cursor.py rename to src/fides/api/service/pagination/pagination_strategy_cursor.py index 3bee8f6165..ad04af0eca 100644 --- a/src/fides/api/ops/service/pagination/pagination_strategy_cursor.py +++ b/src/fides/api/service/pagination/pagination_strategy_cursor.py @@ -3,11 +3,9 @@ import pydash from requests import Response -from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams -from fides.api.ops.schemas.saas.strategy_configuration import ( - CursorPaginationConfiguration, -) -from fides.api.ops.service.pagination.pagination_strategy import PaginationStrategy +from fides.api.schemas.saas.shared_schemas import SaaSRequestParams +from fides.api.schemas.saas.strategy_configuration import CursorPaginationConfiguration +from fides.api.service.pagination.pagination_strategy import PaginationStrategy class CursorPaginationStrategy(PaginationStrategy): diff --git a/src/fides/api/ops/service/pagination/pagination_strategy_factory.py b/src/fides/api/service/pagination/pagination_strategy_factory.py similarity index 74% rename from src/fides/api/ops/service/pagination/pagination_strategy_factory.py rename to src/fides/api/service/pagination/pagination_strategy_factory.py index 8c2c97b078..483c124c1b 100644 --- a/src/fides/api/ops/service/pagination/pagination_strategy_factory.py +++ b/src/fides/api/service/pagination/pagination_strategy_factory.py @@ -5,21 +5,19 @@ from pydantic import ValidationError -from fides.api.ops.common_exceptions import NoSuchStrategyException -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.service.pagination.pagination_strategy_cursor import ( +from fides.api.common_exceptions import NoSuchStrategyException +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.service.pagination.pagination_strategy_cursor import ( CursorPaginationStrategy, ) -from fides.api.ops.service.pagination.pagination_strategy_link import ( - LinkPaginationStrategy, -) -from fides.api.ops.service.pagination.pagination_strategy_offset import ( +from fides.api.service.pagination.pagination_strategy_link import LinkPaginationStrategy +from fides.api.service.pagination.pagination_strategy_offset import ( OffsetPaginationStrategy, ) if TYPE_CHECKING: - from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration - from fides.api.ops.service.pagination.pagination_strategy import PaginationStrategy + from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration + from fides.api.service.pagination.pagination_strategy import PaginationStrategy class SupportedPaginationStrategies(Enum): diff --git a/src/fides/api/ops/service/pagination/pagination_strategy_link.py b/src/fides/api/service/pagination/pagination_strategy_link.py similarity index 89% rename from src/fides/api/ops/service/pagination/pagination_strategy_link.py rename to src/fides/api/service/pagination/pagination_strategy_link.py index 85a837514a..7d706298be 100644 --- a/src/fides/api/ops/service/pagination/pagination_strategy_link.py +++ b/src/fides/api/service/pagination/pagination_strategy_link.py @@ -6,13 +6,13 @@ from loguru import logger from requests import Response -from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.schemas.saas.shared_schemas import SaaSRequestParams +from fides.api.schemas.saas.strategy_configuration import ( LinkPaginationConfiguration, LinkSource, ) -from fides.api.ops.service.pagination.pagination_strategy import PaginationStrategy -from fides.api.ops.util.logger import Pii +from fides.api.service.pagination.pagination_strategy import PaginationStrategy +from fides.api.util.logger import Pii class LinkPaginationStrategy(PaginationStrategy): diff --git a/src/fides/api/ops/service/pagination/pagination_strategy_offset.py b/src/fides/api/service/pagination/pagination_strategy_offset.py similarity index 90% rename from src/fides/api/ops/service/pagination/pagination_strategy_offset.py rename to src/fides/api/service/pagination/pagination_strategy_offset.py index a894767389..fa606d5bdd 100644 --- a/src/fides/api/ops/service/pagination/pagination_strategy_offset.py +++ b/src/fides/api/service/pagination/pagination_strategy_offset.py @@ -4,15 +4,10 @@ from loguru import logger from requests import Response -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.schemas.saas.shared_schemas import ( - ConnectorParamRef, - SaaSRequestParams, -) -from fides.api.ops.schemas.saas.strategy_configuration import ( - OffsetPaginationConfiguration, -) -from fides.api.ops.service.pagination.pagination_strategy import PaginationStrategy +from fides.api.common_exceptions import FidesopsException +from fides.api.schemas.saas.shared_schemas import ConnectorParamRef, SaaSRequestParams +from fides.api.schemas.saas.strategy_configuration import OffsetPaginationConfiguration +from fides.api.service.pagination.pagination_strategy import PaginationStrategy class OffsetPaginationStrategy(PaginationStrategy): diff --git a/src/fides/api/ops/service/messaging/__init__.py b/src/fides/api/service/privacy_request/__init__.py similarity index 100% rename from src/fides/api/ops/service/messaging/__init__.py rename to src/fides/api/service/privacy_request/__init__.py diff --git a/src/fides/api/ops/service/privacy_request/email_batch_service.py b/src/fides/api/service/privacy_request/email_batch_service.py similarity index 91% rename from src/fides/api/ops/service/privacy_request/email_batch_service.py rename to src/fides/api/service/privacy_request/email_batch_service.py index 13473486a2..eb4eb0cd71 100644 --- a/src/fides/api/ops/service/privacy_request/email_batch_service.py +++ b/src/fides/api/service/privacy_request/email_batch_service.py @@ -3,17 +3,17 @@ from loguru import logger from sqlalchemy.orm import Query, Session -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.models.policy import ActionType, CurrentStep, Policy, Rule -from fides.api.ops.models.privacy_request import PrivacyRequest, PrivacyRequestStatus -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.common_exceptions import MessageDispatchException +from fides.api.models.policy import ActionType, CurrentStep, Policy, Rule +from fides.api.models.privacy_request import PrivacyRequest, PrivacyRequestStatus +from fides.api.service.connectors import get_connector +from fides.api.service.privacy_request.request_runner_service import ( get_consent_email_connection_configs, get_erasure_email_connection_configs, queue_privacy_request, ) -from fides.api.ops.tasks import DatabaseTask, celery_app -from fides.api.ops.tasks.scheduled.scheduler import scheduler +from fides.api.tasks import DatabaseTask, celery_app +from fides.api.tasks.scheduled.scheduler import scheduler from fides.core.config import get_config CONFIG = get_config() diff --git a/src/fides/api/ops/service/privacy_request/request_runner_service.py b/src/fides/api/service/privacy_request/request_runner_service.py similarity index 93% rename from src/fides/api/ops/service/privacy_request/request_runner_service.py rename to src/fides/api/service/privacy_request/request_runner_service.py index be5f754e9a..d88e2de6ad 100644 --- a/src/fides/api/ops/service/privacy_request/request_runner_service.py +++ b/src/fides/api/service/privacy_request/request_runner_service.py @@ -8,12 +8,12 @@ from redis.exceptions import DataError from sqlalchemy.orm import Query, Session -from fides.api.ops import common_exceptions -from fides.api.ops.api.v1.urn_registry import ( +from fides.api import common_exceptions +from fides.api.api.v1.urn_registry import ( PRIVACY_REQUEST_TRANSFER_TO_PARENT, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( ClientUnsuccessfulException, IdentityNotFoundException, ManualWebhookFieldsUnset, @@ -21,22 +21,22 @@ NoCachedManualWebhookEntry, PrivacyRequestPaused, ) -from fides.api.ops.db.session import get_db_session -from fides.api.ops.graph.analytics_events import ( +from fides.api.db.session import get_db_session +from fides.api.graph.analytics_events import ( failed_graph_analytics_event, fideslog_graph_failure, ) -from fides.api.ops.graph.config import CollectionAddress, GraphDataset -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.audit_log import AuditLog, AuditLogAction -from fides.api.ops.models.connectionconfig import ( +from fides.api.graph.config import CollectionAddress, GraphDataset +from fides.api.graph.graph import DatasetGraph +from fides.api.models.audit_log import AuditLog, AuditLogAction +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.manual_webhook import AccessManualWebhook -from fides.api.ops.models.policy import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.manual_webhook import AccessManualWebhook +from fides.api.models.policy import ( ActionType, CurrentStep, Policy, @@ -44,47 +44,45 @@ PolicyPreWebhook, WebhookTypes, ) -from fides.api.ops.models.privacy_request import ( +from fides.api.models.privacy_request import ( PrivacyRequest, PrivacyRequestStatus, ProvidedIdentityType, can_run_checkpoint, ) -from fides.api.ops.schemas.base_class import FidesSchema -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.schemas.base_class import FidesSchema +from fides.api.schemas.messaging.messaging import ( AccessRequestCompleteBodyParams, MessagingActionType, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import FidesConnector, get_connector -from fides.api.ops.service.connectors.consent_email_connector import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import FidesConnector, get_connector +from fides.api.service.connectors.consent_email_connector import ( CONSENT_EMAIL_CONNECTOR_TYPES, ) -from fides.api.ops.service.connectors.erasure_email_connector import ( +from fides.api.service.connectors.erasure_email_connector import ( ERASURE_EMAIL_CONNECTOR_TYPES, ) -from fides.api.ops.service.connectors.fides_connector import ( - filter_fides_connector_datasets, -) -from fides.api.ops.service.messaging.message_dispatch_service import dispatch_message -from fides.api.ops.service.storage.storage_uploader_service import upload -from fides.api.ops.task.filter_results import filter_data_categories -from fides.api.ops.task.graph_task import ( +from fides.api.service.connectors.fides_connector import filter_fides_connector_datasets +from fides.api.service.messaging.message_dispatch_service import dispatch_message +from fides.api.service.storage.storage_uploader_service import upload +from fides.api.task.filter_results import filter_data_categories +from fides.api.task.graph_task import ( get_cached_data_for_erasures, run_access_request, run_consent_request, run_erasure, ) -from fides.api.ops.tasks import DatabaseTask, celery_app -from fides.api.ops.tasks.scheduled.scheduler import scheduler -from fides.api.ops.util.cache import ( +from fides.api.tasks import DatabaseTask, celery_app +from fides.api.tasks.scheduled.scheduler import scheduler +from fides.api.util.cache import ( FidesopsRedis, get_async_task_tracking_cache_key, get_cache, ) -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.logger import Pii, _log_exception, _log_warning -from fides.api.ops.util.wrappers import sync +from fides.api.util.collection_util import Row +from fides.api.util.logger import Pii, _log_exception, _log_warning +from fides.api.util.wrappers import sync from fides.core.config import CONFIG from fides.core.config.config_proxy import ConfigProxy diff --git a/src/fides/api/ops/service/privacy_request/request_service.py b/src/fides/api/service/privacy_request/request_service.py similarity index 87% rename from src/fides/api/ops/service/privacy_request/request_service.py rename to src/fides/api/service/privacy_request/request_service.py index cda7885776..88c5bbc69a 100644 --- a/src/fides/api/ops/service/privacy_request/request_service.py +++ b/src/fides/api/service/privacy_request/request_service.py @@ -7,15 +7,15 @@ from httpx import AsyncClient from loguru import logger -from fides.api.ops.api.v1.urn_registry import PRIVACY_REQUESTS, V1_URL_PREFIX -from fides.api.ops.common_exceptions import PrivacyRequestNotFound -from fides.api.ops.models.policy import ActionType, Policy -from fides.api.ops.models.privacy_request import PrivacyRequest, PrivacyRequestStatus -from fides.api.ops.schemas.drp_privacy_request import DrpPrivacyRequestCreate -from fides.api.ops.schemas.masking.masking_secrets import MaskingSecretCache -from fides.api.ops.schemas.privacy_request import PrivacyRequestResponse -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.api.v1.urn_registry import PRIVACY_REQUESTS, V1_URL_PREFIX +from fides.api.common_exceptions import PrivacyRequestNotFound +from fides.api.models.policy import ActionType, Policy +from fides.api.models.privacy_request import PrivacyRequest, PrivacyRequestStatus +from fides.api.schemas.drp_privacy_request import DrpPrivacyRequestCreate +from fides.api.schemas.masking.masking_secrets import MaskingSecretCache +from fides.api.schemas.privacy_request import PrivacyRequestResponse +from fides.api.schemas.redis_cache import Identity +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy def build_required_privacy_request_kwargs( diff --git a/src/fides/api/ops/service/privacy_request/__init__.py b/src/fides/api/service/processors/__init__.py similarity index 100% rename from src/fides/api/ops/service/privacy_request/__init__.py rename to src/fides/api/service/processors/__init__.py diff --git a/src/fides/api/ops/service/processors/post_processor_strategy/__init__.py b/src/fides/api/service/processors/post_processor_strategy/__init__.py similarity index 51% rename from src/fides/api/ops/service/processors/post_processor_strategy/__init__.py rename to src/fides/api/service/processors/post_processor_strategy/__init__.py index 3b626de3ed..2215398694 100644 --- a/src/fides/api/ops/service/processors/post_processor_strategy/__init__.py +++ b/src/fides/api/service/processors/post_processor_strategy/__init__.py @@ -1,4 +1,4 @@ -from fides.api.ops.service.processors.post_processor_strategy import ( +from fides.api.service.processors.post_processor_strategy import ( post_processor_strategy_filter, post_processor_strategy_unwrap, ) diff --git a/src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy.py b/src/fides/api/service/processors/post_processor_strategy/post_processor_strategy.py similarity index 87% rename from src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy.py rename to src/fides/api/service/processors/post_processor_strategy/post_processor_strategy.py index 52731dbac6..092044dc37 100644 --- a/src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy.py +++ b/src/fides/api/service/processors/post_processor_strategy/post_processor_strategy.py @@ -1,7 +1,7 @@ from abc import abstractmethod from typing import Any, Dict, List, Union -from fides.api.ops.service.strategy import Strategy +from fides.api.service.strategy import Strategy class PostProcessorStrategy(Strategy): diff --git a/src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy_factory.py b/src/fides/api/service/processors/post_processor_strategy/post_processor_strategy_factory.py similarity index 75% rename from src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy_factory.py rename to src/fides/api/service/processors/post_processor_strategy/post_processor_strategy_factory.py index 0a58b63ae8..e8c4b0e68c 100644 --- a/src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy_factory.py +++ b/src/fides/api/service/processors/post_processor_strategy/post_processor_strategy_factory.py @@ -3,16 +3,16 @@ from pydantic import ValidationError -from fides.api.ops.common_exceptions import NoSuchStrategyException -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy import ( +from fides.api.common_exceptions import NoSuchStrategyException +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration +from fides.api.service.processors.post_processor_strategy.post_processor_strategy import ( PostProcessorStrategy, ) -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy_filter import ( +from fides.api.service.processors.post_processor_strategy.post_processor_strategy_filter import ( FilterPostProcessorStrategy, ) -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy_unwrap import ( +from fides.api.service.processors.post_processor_strategy.post_processor_strategy_unwrap import ( UnwrapPostProcessorStrategy, ) diff --git a/src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy_filter.py b/src/fides/api/service/processors/post_processor_strategy/post_processor_strategy_filter.py similarity index 94% rename from src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy_filter.py rename to src/fides/api/service/processors/post_processor_strategy/post_processor_strategy_filter.py index 0374fc46ed..0d6f9d2a99 100644 --- a/src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy_filter.py +++ b/src/fides/api/service/processors/post_processor_strategy/post_processor_strategy_filter.py @@ -3,12 +3,12 @@ import pydash from loguru import logger -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.schemas.saas.shared_schemas import IdentityParamRef -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.schemas.saas.shared_schemas import IdentityParamRef +from fides.api.schemas.saas.strategy_configuration import ( FilterPostProcessorConfiguration, ) -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy import ( +from fides.api.service.processors.post_processor_strategy.post_processor_strategy import ( PostProcessorStrategy, ) diff --git a/src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy_unwrap.py b/src/fides/api/service/processors/post_processor_strategy/post_processor_strategy_unwrap.py similarity index 93% rename from src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy_unwrap.py rename to src/fides/api/service/processors/post_processor_strategy/post_processor_strategy_unwrap.py index 280c94be3e..a257e461ae 100644 --- a/src/fides/api/ops/service/processors/post_processor_strategy/post_processor_strategy_unwrap.py +++ b/src/fides/api/service/processors/post_processor_strategy/post_processor_strategy_unwrap.py @@ -3,10 +3,10 @@ import pydash from loguru import logger -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.schemas.saas.strategy_configuration import ( UnwrapPostProcessorConfiguration, ) -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy import ( +from fides.api.service.processors.post_processor_strategy.post_processor_strategy import ( PostProcessorStrategy, ) diff --git a/src/fides/api/ops/service/processors/__init__.py b/src/fides/api/service/saas_request/__init__.py similarity index 100% rename from src/fides/api/ops/service/processors/__init__.py rename to src/fides/api/service/saas_request/__init__.py diff --git a/src/fides/api/ops/service/saas_request/override_implementations/__init__.py b/src/fides/api/service/saas_request/override_implementations/__init__.py similarity index 100% rename from src/fides/api/ops/service/saas_request/override_implementations/__init__.py rename to src/fides/api/service/saas_request/override_implementations/__init__.py diff --git a/src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_adobe_campaign.py b/src/fides/api/service/saas_request/override_implementations/authentication_strategy_adobe_campaign.py similarity index 92% rename from src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_adobe_campaign.py rename to src/fides/api/service/saas_request/override_implementations/authentication_strategy_adobe_campaign.py index 60eb4a6c27..7909dbc278 100644 --- a/src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_adobe_campaign.py +++ b/src/fides/api/service/saas_request/override_implementations/authentication_strategy_adobe_campaign.py @@ -8,13 +8,13 @@ from requests import PreparedRequest, post from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.util.saas_util import assign_placeholders +from fides.api.util.saas_util import assign_placeholders class AdobeCampaignAuthenticationConfiguration(StrategyConfiguration): diff --git a/src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_doordash.py b/src/fides/api/service/saas_request/override_implementations/authentication_strategy_doordash.py similarity index 86% rename from src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_doordash.py rename to src/fides/api/service/saas_request/override_implementations/authentication_strategy_doordash.py index 7b9d13e5b6..2877c03e9f 100644 --- a/src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_doordash.py +++ b/src/fides/api/service/saas_request/override_implementations/authentication_strategy_doordash.py @@ -5,12 +5,12 @@ import jwt.utils from requests import PreparedRequest -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.util.saas_util import assign_placeholders +from fides.api.util.saas_util import assign_placeholders class DoordashAuthenticationConfiguration(StrategyConfiguration): diff --git a/src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_friendbuy_nextgen.py b/src/fides/api/service/saas_request/override_implementations/authentication_strategy_friendbuy_nextgen.py similarity index 90% rename from src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_friendbuy_nextgen.py rename to src/fides/api/service/saas_request/override_implementations/authentication_strategy_friendbuy_nextgen.py index 7c501a582a..146939dba3 100644 --- a/src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_friendbuy_nextgen.py +++ b/src/fides/api/service/saas_request/override_implementations/authentication_strategy_friendbuy_nextgen.py @@ -5,13 +5,13 @@ from requests import PreparedRequest, post from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.util.saas_util import assign_placeholders +from fides.api.util.saas_util import assign_placeholders class FriendbuyNextgenAuthenticationConfiguration(StrategyConfiguration): diff --git a/src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_yotpo_reviews.py b/src/fides/api/service/saas_request/override_implementations/authentication_strategy_yotpo_reviews.py similarity index 82% rename from src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_yotpo_reviews.py rename to src/fides/api/service/saas_request/override_implementations/authentication_strategy_yotpo_reviews.py index ad9278095a..e2174b48c8 100644 --- a/src/fides/api/ops/service/saas_request/override_implementations/authentication_strategy_yotpo_reviews.py +++ b/src/fides/api/service/saas_request/override_implementations/authentication_strategy_yotpo_reviews.py @@ -2,13 +2,13 @@ from requests import PreparedRequest, post -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.util.saas_util import assign_placeholders +from fides.api.util.saas_util import assign_placeholders class YotpoReviewsAuthenticationConfiguration(StrategyConfiguration): diff --git a/src/fides/api/ops/service/saas_request/override_implementations/domo_request_overrides.py b/src/fides/api/service/saas_request/override_implementations/domo_request_overrides.py similarity index 76% rename from src/fides/api/ops/service/saas_request/override_implementations/domo_request_overrides.py rename to src/fides/api/service/saas_request/override_implementations/domo_request_overrides.py index 12efecfed7..51063cd115 100644 --- a/src/fides/api/ops/service/saas_request/override_implementations/domo_request_overrides.py +++ b/src/fides/api/service/saas_request/override_implementations/domo_request_overrides.py @@ -1,17 +1,15 @@ from json import dumps from typing import Any, Dict, List -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestType, register, ) -from fides.api.ops.util.saas_util import PRIVACY_REQUEST_ID +from fides.api.util.saas_util import PRIVACY_REQUEST_ID @register("domo_user_update", [SaaSRequestType.UPDATE]) diff --git a/src/fides/api/ops/service/saas_request/override_implementations/firebase_auth_request_overrides.py b/src/fides/api/service/saas_request/override_implementations/firebase_auth_request_overrides.py similarity index 92% rename from src/fides/api/ops/service/saas_request/override_implementations/firebase_auth_request_overrides.py rename to src/fides/api/service/saas_request/override_implementations/firebase_auth_request_overrides.py index ca4b194e32..80801fb39f 100644 --- a/src/fides/api/ops/service/saas_request/override_implementations/firebase_auth_request_overrides.py +++ b/src/fides/api/service/saas_request/override_implementations/firebase_auth_request_overrides.py @@ -5,20 +5,18 @@ from firebase_admin.auth import UserNotFoundError, UserRecord from loguru import logger -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.graph.traversal import TraversalNode +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestType, register, ) -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.logger import Pii -from fides.api.ops.util.saas_util import get_identity +from fides.api.util.collection_util import Row +from fides.api.util.logger import Pii +from fides.api.util.saas_util import get_identity @register("firebase_auth_user_access", [SaaSRequestType.READ]) diff --git a/src/fides/api/ops/service/saas_request/override_implementations/friendbuy_nextgen_request_overrides.py b/src/fides/api/service/saas_request/override_implementations/friendbuy_nextgen_request_overrides.py similarity index 76% rename from src/fides/api/ops/service/saas_request/override_implementations/friendbuy_nextgen_request_overrides.py rename to src/fides/api/service/saas_request/override_implementations/friendbuy_nextgen_request_overrides.py index 34dca6effa..927b97bb42 100644 --- a/src/fides/api/ops/service/saas_request/override_implementations/friendbuy_nextgen_request_overrides.py +++ b/src/fides/api/service/saas_request/override_implementations/friendbuy_nextgen_request_overrides.py @@ -1,12 +1,10 @@ from typing import Any, Dict, List -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestType, register, ) diff --git a/src/fides/api/ops/service/saas_request/override_implementations/mailchimp_request_overrides.py b/src/fides/api/service/saas_request/override_implementations/mailchimp_request_overrides.py similarity index 86% rename from src/fides/api/ops/service/saas_request/override_implementations/mailchimp_request_overrides.py rename to src/fides/api/service/saas_request/override_implementations/mailchimp_request_overrides.py index 444634a4fa..9149096e5f 100644 --- a/src/fides/api/ops/service/saas_request/override_implementations/mailchimp_request_overrides.py +++ b/src/fides/api/service/saas_request/override_implementations/mailchimp_request_overrides.py @@ -3,18 +3,16 @@ import pydash -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.graph.traversal import TraversalNode +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestType, register, ) -from fides.api.ops.util.collection_util import Row +from fides.api.util.collection_util import Row @register("mailchimp_messages_access", [SaaSRequestType.READ]) diff --git a/src/fides/api/ops/service/saas_request/override_implementations/twilio_request_overrides.py b/src/fides/api/service/saas_request/override_implementations/twilio_request_overrides.py similarity index 86% rename from src/fides/api/ops/service/saas_request/override_implementations/twilio_request_overrides.py rename to src/fides/api/service/saas_request/override_implementations/twilio_request_overrides.py index 9a939b8f39..e670b9c99e 100644 --- a/src/fides/api/ops/service/saas_request/override_implementations/twilio_request_overrides.py +++ b/src/fides/api/service/saas_request/override_implementations/twilio_request_overrides.py @@ -2,17 +2,15 @@ from multidimensional_urlencode import urlencode as multidimensional_urlencode -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestType, register, ) -from fides.api.ops.util.saas_util import to_pascal_case +from fides.api.util.saas_util import to_pascal_case @register("twilio_user_update", [SaaSRequestType.UPDATE]) diff --git a/src/fides/api/ops/service/saas_request/saas_request_override_factory.py b/src/fides/api/service/saas_request/saas_request_override_factory.py similarity index 98% rename from src/fides/api/ops/service/saas_request/saas_request_override_factory.py rename to src/fides/api/service/saas_request/saas_request_override_factory.py index ed971e7490..10a5c2c77c 100644 --- a/src/fides/api/ops/service/saas_request/saas_request_override_factory.py +++ b/src/fides/api/service/saas_request/saas_request_override_factory.py @@ -4,11 +4,11 @@ from loguru import logger -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( InvalidSaaSRequestOverrideException, NoSuchSaaSRequestOverrideException, ) -from fides.api.ops.util.collection_util import Row +from fides.api.util.collection_util import Row # at some point this should likely be formalized more centrally... diff --git a/src/fides/api/ops/service/saas_request/__init__.py b/src/fides/api/service/storage/__init__.py similarity index 100% rename from src/fides/api/ops/service/saas_request/__init__.py rename to src/fides/api/service/storage/__init__.py diff --git a/src/fides/api/ops/service/storage/storage_authenticator_service.py b/src/fides/api/service/storage/storage_authenticator_service.py similarity index 91% rename from src/fides/api/ops/service/storage/storage_authenticator_service.py rename to src/fides/api/service/storage/storage_authenticator_service.py index 694a692861..b49e5568b2 100644 --- a/src/fides/api/ops/service/storage/storage_authenticator_service.py +++ b/src/fides/api/service/storage/storage_authenticator_service.py @@ -2,13 +2,13 @@ from botocore.exceptions import ClientError -from fides.api.ops.schemas.storage.storage import ( +from fides.api.schemas.storage.storage import ( SUPPORTED_STORAGE_SECRETS, S3AuthMethod, StorageSecrets, StorageType, ) -from fides.api.ops.util.storage_authenticator import get_s3_session +from fides.api.util.storage_authenticator import get_s3_session def secrets_are_valid( diff --git a/src/fides/api/ops/service/storage/storage_uploader_service.py b/src/fides/api/service/storage/storage_uploader_service.py similarity index 92% rename from src/fides/api/ops/service/storage/storage_uploader_service.py rename to src/fides/api/service/storage/storage_uploader_service.py index 56e1827760..f59b61fce7 100644 --- a/src/fides/api/ops/service/storage/storage_uploader_service.py +++ b/src/fides/api/service/storage/storage_uploader_service.py @@ -4,15 +4,15 @@ from loguru import logger from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import StorageUploadError -from fides.api.ops.models.storage import StorageConfig -from fides.api.ops.schemas.storage.storage import ( +from fides.api.common_exceptions import StorageUploadError +from fides.api.models.storage import StorageConfig +from fides.api.schemas.storage.storage import ( FileNaming, ResponseFormat, StorageDetails, StorageType, ) -from fides.api.ops.tasks.storage import upload_to_local, upload_to_s3 +from fides.api.tasks.storage import upload_to_local, upload_to_s3 def upload(db: Session, *, request_id: str, data: Dict, storage_key: FidesKey) -> str: diff --git a/src/fides/api/ops/service/strategy.py b/src/fides/api/service/strategy.py similarity index 89% rename from src/fides/api/ops/service/strategy.py rename to src/fides/api/service/strategy.py index 0ef4f27f15..b2e116231b 100644 --- a/src/fides/api/ops/service/strategy.py +++ b/src/fides/api/service/strategy.py @@ -5,9 +5,9 @@ from pydantic import ValidationError -from fides.api.ops.common_exceptions import NoSuchStrategyException -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration +from fides.api.common_exceptions import NoSuchStrategyException +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration T = TypeVar("T", bound="Strategy") C = TypeVar("C", bound=StrategyConfiguration) diff --git a/src/fides/api/ops/service/storage/__init__.py b/src/fides/api/task/__init__.py similarity index 100% rename from src/fides/api/ops/service/storage/__init__.py rename to src/fides/api/task/__init__.py diff --git a/src/fides/api/ops/task/consolidate_query_matches.py b/src/fides/api/task/consolidate_query_matches.py similarity index 93% rename from src/fides/api/ops/task/consolidate_query_matches.py rename to src/fides/api/task/consolidate_query_matches.py index a2e3c5cd2e..4b614e8f3d 100644 --- a/src/fides/api/ops/task/consolidate_query_matches.py +++ b/src/fides/api/task/consolidate_query_matches.py @@ -1,7 +1,7 @@ from typing import Any, List, Optional -from fides.api.ops.graph.config import FieldPath -from fides.api.ops.util.collection_util import Row +from fides.api.graph.config import FieldPath +from fides.api.util.collection_util import Row def consolidate_query_matches( diff --git a/src/fides/api/ops/task/filter_element_match.py b/src/fides/api/task/filter_element_match.py similarity index 97% rename from src/fides/api/ops/task/filter_element_match.py rename to src/fides/api/task/filter_element_match.py index 05dad77017..594eed3082 100644 --- a/src/fides/api/ops/task/filter_element_match.py +++ b/src/fides/api/task/filter_element_match.py @@ -5,14 +5,14 @@ import pydash from loguru import logger -from fides.api.ops.task.refine_target_path import ( +from fides.api.task.refine_target_path import ( DetailedPath, FieldPathNodeInput, build_refined_target_paths, join_detailed_path, ) -from fides.api.ops.util.collection_util import FIDESOPS_DO_NOT_MASK_INDEX, Row -from fides.api.ops.util.logger import Pii +from fides.api.util.collection_util import FIDESOPS_DO_NOT_MASK_INDEX, Row +from fides.api.util.logger import Pii def filter_element_match( diff --git a/src/fides/api/ops/task/filter_results.py b/src/fides/api/task/filter_results.py similarity index 98% rename from src/fides/api/ops/task/filter_results.py rename to src/fides/api/task/filter_results.py index 6167ea886c..adc26accca 100644 --- a/src/fides/api/ops/task/filter_results.py +++ b/src/fides/api/task/filter_results.py @@ -5,8 +5,8 @@ from fideslang.validation import FidesKey from loguru import logger -from fides.api.ops.graph.config import CollectionAddress, FieldPath -from fides.api.ops.util.collection_util import Row +from fides.api.graph.config import CollectionAddress, FieldPath +from fides.api.util.collection_util import Row def filter_data_categories( diff --git a/src/fides/api/ops/task/graph_task.py b/src/fides/api/task/graph_task.py similarity index 96% rename from src/fides/api/ops/task/graph_task.py rename to src/fides/api/task/graph_task.py index d72f9ce74c..82802e7c33 100644 --- a/src/fides/api/ops/task/graph_task.py +++ b/src/fides/api/task/graph_task.py @@ -12,7 +12,7 @@ from loguru import logger from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( CollectionDisabled, NotSupportedForCollection, PrivacyRequestErasureEmailSendRequired, @@ -20,11 +20,11 @@ SkippingConsentPropagation, TraversalError, ) -from fides.api.ops.graph.analytics_events import ( +from fides.api.graph.analytics_events import ( fideslog_graph_rerun, prepare_rerun_graph_analytics_event, ) -from fides.api.ops.graph.config import ( +from fides.api.graph.config import ( ROOT_COLLECTION_ADDRESS, TERMINATOR_ADDRESS, CollectionAddress, @@ -32,24 +32,22 @@ FieldAddress, FieldPath, ) -from fides.api.ops.graph.graph import DatasetGraph, Edge, Node -from fides.api.ops.graph.graph_differences import format_graph_for_caching -from fides.api.ops.graph.traversal import Traversal, TraversalNode -from fides.api.ops.models.connectionconfig import AccessLevel, ConnectionConfig -from fides.api.ops.models.policy import ActionType, Policy -from fides.api.ops.models.privacy_request import ExecutionLogStatus, PrivacyRequest -from fides.api.ops.service.connectors.base_connector import BaseConnector -from fides.api.ops.task.consolidate_query_matches import consolidate_query_matches -from fides.api.ops.task.filter_element_match import filter_element_match -from fides.api.ops.task.refine_target_path import FieldPathNodeInput -from fides.api.ops.task.task_resources import TaskResources -from fides.api.ops.util.cache import get_cache -from fides.api.ops.util.collection_util import NodeInput, Row, append, partition -from fides.api.ops.util.consent_util import ( - add_errored_system_status_for_consent_reporting, -) -from fides.api.ops.util.logger import Pii -from fides.api.ops.util.saas_util import FIDESOPS_GROUPED_INPUTS +from fides.api.graph.graph import DatasetGraph, Edge, Node +from fides.api.graph.graph_differences import format_graph_for_caching +from fides.api.graph.traversal import Traversal, TraversalNode +from fides.api.models.connectionconfig import AccessLevel, ConnectionConfig +from fides.api.models.policy import ActionType, Policy +from fides.api.models.privacy_request import ExecutionLogStatus, PrivacyRequest +from fides.api.service.connectors.base_connector import BaseConnector +from fides.api.task.consolidate_query_matches import consolidate_query_matches +from fides.api.task.filter_element_match import filter_element_match +from fides.api.task.refine_target_path import FieldPathNodeInput +from fides.api.task.task_resources import TaskResources +from fides.api.util.cache import get_cache +from fides.api.util.collection_util import NodeInput, Row, append, partition +from fides.api.util.consent_util import add_errored_system_status_for_consent_reporting +from fides.api.util.logger import Pii +from fides.api.util.saas_util import FIDESOPS_GROUPED_INPUTS from fides.core.config import CONFIG dask.config.set(scheduler="threads") diff --git a/src/fides/api/ops/task/refine_target_path.py b/src/fides/api/task/refine_target_path.py similarity index 98% rename from src/fides/api/ops/task/refine_target_path.py rename to src/fides/api/task/refine_target_path.py index 365d54b5c6..d20491cc83 100644 --- a/src/fides/api/ops/task/refine_target_path.py +++ b/src/fides/api/task/refine_target_path.py @@ -2,8 +2,8 @@ from loguru import logger -from fides.api.ops.graph.config import FieldPath -from fides.api.ops.util.collection_util import FIDESOPS_DO_NOT_MASK_INDEX, Row +from fides.api.graph.config import FieldPath +from fides.api.util.collection_util import FIDESOPS_DO_NOT_MASK_INDEX, Row Level = Union[ str, int diff --git a/src/fides/api/ops/task/task_resources.py b/src/fides/api/task/task_resources.py similarity index 93% rename from src/fides/api/ops/task/task_resources.py rename to src/fides/api/task/task_resources.py index 06c4d1e1a9..ab6fe63dd8 100644 --- a/src/fides/api/ops/task/task_resources.py +++ b/src/fides/api/task/task_resources.py @@ -4,16 +4,16 @@ from loguru import logger from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import ConnectorNotFoundException -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.models.policy import ActionType, Policy -from fides.api.ops.models.privacy_request import ( +from fides.api.common_exceptions import ConnectorNotFoundException +from fides.api.graph.config import CollectionAddress +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.models.policy import ActionType, Policy +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, ) -from fides.api.ops.service.connectors import ( +from fides.api.service.connectors import ( BaseConnector, BigQueryConnector, DynamoDBConnector, @@ -29,9 +29,9 @@ SnowflakeConnector, TimescaleConnector, ) -from fides.api.ops.service.connectors.base_email_connector import BaseEmailConnector -from fides.api.ops.util.cache import get_cache -from fides.api.ops.util.collection_util import Row +from fides.api.service.connectors.base_email_connector import BaseEmailConnector +from fides.api.util.cache import get_cache +from fides.api.util.collection_util import Row class Connections: diff --git a/src/fides/api/ops/tasks/__init__.py b/src/fides/api/tasks/__init__.py similarity index 90% rename from src/fides/api/ops/tasks/__init__.py rename to src/fides/api/tasks/__init__.py index f1d2cfb94a..fe71bca444 100644 --- a/src/fides/api/ops/tasks/__init__.py +++ b/src/fides/api/tasks/__init__.py @@ -4,7 +4,7 @@ from loguru import logger from sqlalchemy.orm import Session -from fides.api.ops.db.session import get_db_engine, get_db_session +from fides.api.db.session import get_db_engine, get_db_session from fides.core.config import CONFIG, FidesConfig MESSAGING_QUEUE_NAME = "fidesops.messaging" @@ -63,10 +63,10 @@ def _create_celery(config: FidesConfig = CONFIG) -> Celery: app.autodiscover_tasks( [ - "fides.api.ops.tasks", - "fides.api.ops.tasks.scheduled", - "fides.api.ops.service.privacy_request", - "fides.api.ops.service.privacy_request.request_runner_service", + "fides.api.tasks", + "fides.api.tasks.scheduled", + "fides.api.service.privacy_request", + "fides.api.service.privacy_request.request_runner_service", ] ) diff --git a/src/fides/api/ops/task/__init__.py b/src/fides/api/tasks/scheduled/__init__.py similarity index 100% rename from src/fides/api/ops/task/__init__.py rename to src/fides/api/tasks/scheduled/__init__.py diff --git a/src/fides/api/ops/tasks/scheduled/scheduler.py b/src/fides/api/tasks/scheduled/scheduler.py similarity index 100% rename from src/fides/api/ops/tasks/scheduled/scheduler.py rename to src/fides/api/tasks/scheduled/scheduler.py diff --git a/src/fides/api/ops/tasks/storage.py b/src/fides/api/tasks/storage.py similarity index 94% rename from src/fides/api/ops/tasks/storage.py rename to src/fides/api/tasks/storage.py index fedb15e915..f034b9b37c 100644 --- a/src/fides/api/ops/tasks/storage.py +++ b/src/fides/api/tasks/storage.py @@ -14,17 +14,17 @@ from bson import ObjectId from loguru import logger -from fides.api.ops.cryptography.cryptographic_util import bytes_to_b64_str -from fides.api.ops.schemas.storage.storage import ( +from fides.api.cryptography.cryptographic_util import bytes_to_b64_str +from fides.api.schemas.storage.storage import ( ResponseFormat, S3AuthMethod, StorageSecrets, ) -from fides.api.ops.util.cache import get_cache, get_encryption_cache_key -from fides.api.ops.util.encryption.aes_gcm_encryption_scheme import ( +from fides.api.util.cache import get_cache, get_encryption_cache_key +from fides.api.util.encryption.aes_gcm_encryption_scheme import ( encrypt_to_bytes_verify_secrets_length, ) -from fides.api.ops.util.storage_authenticator import get_s3_session +from fides.api.util.storage_authenticator import get_s3_session from fides.core.config import CONFIG LOCAL_FIDES_UPLOAD_DIRECTORY = "fides_uploads" diff --git a/src/fides/api/ops/tasks/scheduled/__init__.py b/src/fides/api/util/__init__.py similarity index 100% rename from src/fides/api/ops/tasks/scheduled/__init__.py rename to src/fides/api/util/__init__.py diff --git a/src/fides/api/ops/util/api_router.py b/src/fides/api/util/api_router.py similarity index 100% rename from src/fides/api/ops/util/api_router.py rename to src/fides/api/util/api_router.py diff --git a/src/fides/api/ops/util/cache.py b/src/fides/api/util/cache.py similarity index 98% rename from src/fides/api/ops/util/cache.py rename to src/fides/api/util/cache.py index 791ffc7b47..6c5cfb3e67 100644 --- a/src/fides/api/ops/util/cache.py +++ b/src/fides/api/util/cache.py @@ -10,8 +10,8 @@ from redis.client import Script # type: ignore from redis.exceptions import ConnectionError as ConnectionErrorFromRedis -from fides.api.ops import common_exceptions -from fides.api.ops.schemas.masking.masking_secrets import SecretType +from fides.api import common_exceptions +from fides.api.schemas.masking.masking_secrets import SecretType from fides.core.config import CONFIG # This constant represents every type a redis key may contain, and can be diff --git a/src/fides/api/ops/util/collection_util.py b/src/fides/api/util/collection_util.py similarity index 100% rename from src/fides/api/ops/util/collection_util.py rename to src/fides/api/util/collection_util.py diff --git a/src/fides/api/ops/util/connection_type.py b/src/fides/api/util/connection_type.py similarity index 92% rename from src/fides/api/ops/util/connection_type.py rename to src/fides/api/util/connection_type.py index 2ddfd70c6a..394d4945c5 100644 --- a/src/fides/api/ops/util/connection_type.py +++ b/src/fides/api/util/connection_type.py @@ -4,28 +4,28 @@ import yaml -from fides.api.ops.common_exceptions import NoSuchConnectionTypeSecretSchemaError -from fides.api.ops.models.connectionconfig import ConnectionType -from fides.api.ops.models.policy import SUPPORTED_ACTION_TYPES, ActionType -from fides.api.ops.schemas.connection_configuration import ( +from fides.api.common_exceptions import NoSuchConnectionTypeSecretSchemaError +from fides.api.models.connectionconfig import ConnectionType +from fides.api.models.policy import SUPPORTED_ACTION_TYPES, ActionType +from fides.api.schemas.connection_configuration import ( SaaSSchemaFactory, secrets_schemas, ) -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.schemas.connection_configuration.connection_config import ( ConnectionSystemTypeMap, SystemType, ) -from fides.api.ops.schemas.saas.saas_config import SaaSConfig -from fides.api.ops.service.connectors.consent_email_connector import ( +from fides.api.schemas.saas.saas_config import SaaSConfig +from fides.api.service.connectors.consent_email_connector import ( CONSENT_EMAIL_CONNECTOR_TYPES, ) -from fides.api.ops.service.connectors.erasure_email_connector import ( +from fides.api.service.connectors.erasure_email_connector import ( ERASURE_EMAIL_CONNECTOR_TYPES, ) -from fides.api.ops.service.connectors.saas.connector_registry_service import ( +from fides.api.service.connectors.saas.connector_registry_service import ( ConnectorRegistry, ) -from fides.api.ops.util.saas_util import load_config_from_string +from fides.api.util.saas_util import load_config_from_string def connection_type_secret_schema(*, connection_type: str) -> dict[str, Any]: diff --git a/src/fides/api/ops/util/connection_util.py b/src/fides/api/util/connection_util.py similarity index 90% rename from src/fides/api/ops/util/connection_util.py rename to src/fides/api/util/connection_util.py index e0492256d5..5ca0b54ab7 100644 --- a/src/fides/api/ops/util/connection_util.py +++ b/src/fides/api/util/connection_util.py @@ -11,33 +11,33 @@ HTTP_422_UNPROCESSABLE_ENTITY, ) +from fides.api.api.v1.urn_registry import CONNECTION_TYPES, SAAS_CONFIG +from fides.api.common_exceptions import KeyOrNameAlreadyExists +from fides.api.common_exceptions import ValidationError as FidesValidationError from fides.api.ctl.sql_models import System # type: ignore -from fides.api.ops.api.v1.urn_registry import CONNECTION_TYPES, SAAS_CONFIG -from fides.api.ops.common_exceptions import KeyOrNameAlreadyExists -from fides.api.ops.common_exceptions import ValidationError as FidesValidationError -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.models.manual_webhook import AccessManualWebhook -from fides.api.ops.models.privacy_request import PrivacyRequest, PrivacyRequestStatus -from fides.api.ops.schemas.api import BulkUpdateFailed -from fides.api.ops.schemas.connection_configuration import ( +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.models.manual_webhook import AccessManualWebhook +from fides.api.models.privacy_request import PrivacyRequest, PrivacyRequestStatus +from fides.api.schemas.api import BulkUpdateFailed +from fides.api.schemas.connection_configuration import ( ConnectionConfigSecretsSchema, connection_secrets_schemas, get_connection_secrets_schema, ) -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.schemas.connection_configuration.connection_config import ( BulkPutConnectionConfiguration, ConnectionConfigurationResponse, CreateConnectionConfigurationWithSecrets, SaasConnectionTemplateValues, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_saas import ( +from fides.api.schemas.connection_configuration.connection_secrets_saas import ( validate_saas_secrets_external_references, ) -from fides.api.ops.service.connectors.saas.connector_registry_service import ( +from fides.api.service.connectors.saas.connector_registry_service import ( ConnectorRegistry, create_connection_config_from_template_no_save, ) -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.service.privacy_request.request_runner_service import ( queue_privacy_request, ) diff --git a/src/fides/api/ops/util/consent_util.py b/src/fides/api/util/consent_util.py similarity index 96% rename from src/fides/api/ops/util/consent_util.py rename to src/fides/api/util/consent_util.py index 0e455362bd..a642a47fbf 100644 --- a/src/fides/api/ops/util/consent_util.py +++ b/src/fides/api/util/consent_util.py @@ -5,16 +5,16 @@ from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY from fides.api.ctl.sql_models import System # type: ignore[attr-defined] -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.privacy_notice import EnforcementLevel, UserConsentPreference -from fides.api.ops.models.privacy_preference import PrivacyPreferenceHistory -from fides.api.ops.models.privacy_request import ( +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.privacy_notice import EnforcementLevel, UserConsentPreference +from fides.api.models.privacy_preference import PrivacyPreferenceHistory +from fides.api.models.privacy_request import ( ExecutionLogStatus, PrivacyRequest, ProvidedIdentity, ProvidedIdentityType, ) -from fides.api.ops.schemas.redis_cache import Identity +from fides.api.schemas.redis_cache import Identity def filter_privacy_preferences_for_propagation( diff --git a/src/fides/api/ops/util/constants.py b/src/fides/api/util/constants.py similarity index 100% rename from src/fides/api/ops/util/constants.py rename to src/fides/api/util/constants.py diff --git a/src/fides/api/ops/util/data_category.py b/src/fides/api/util/data_category.py similarity index 96% rename from src/fides/api/ops/util/data_category.py rename to src/fides/api/util/data_category.py index 0969f83a87..c43f50e019 100644 --- a/src/fides/api/ops/util/data_category.py +++ b/src/fides/api/util/data_category.py @@ -5,8 +5,8 @@ from fideslang.validation import FidesKey from sqlalchemy.orm import Session +from fides.api import common_exceptions from fides.api.ctl.sql_models import DataCategory as DataCategoryDbModel # type: ignore -from fides.api.ops import common_exceptions def generate_fides_data_categories() -> Type[EnumType]: diff --git a/src/fides/api/ops/util/__init__.py b/src/fides/api/util/encryption/__init__.py similarity index 100% rename from src/fides/api/ops/util/__init__.py rename to src/fides/api/util/encryption/__init__.py diff --git a/src/fides/api/ops/util/encryption/aes_gcm_encryption_scheme.py b/src/fides/api/util/encryption/aes_gcm_encryption_scheme.py similarity index 97% rename from src/fides/api/ops/util/encryption/aes_gcm_encryption_scheme.py rename to src/fides/api/util/encryption/aes_gcm_encryption_scheme.py index 2792bbba90..22c5ab51f8 100644 --- a/src/fides/api/ops/util/encryption/aes_gcm_encryption_scheme.py +++ b/src/fides/api/util/encryption/aes_gcm_encryption_scheme.py @@ -3,7 +3,7 @@ from cryptography.hazmat.primitives.ciphers.aead import AESGCM -from fides.api.ops.cryptography.cryptographic_util import bytes_to_b64_str +from fides.api.cryptography.cryptographic_util import bytes_to_b64_str from fides.core.config import CONFIG diff --git a/src/fides/api/ops/util/encryption/hmac_encryption_scheme.py b/src/fides/api/util/encryption/hmac_encryption_scheme.py similarity index 95% rename from src/fides/api/ops/util/encryption/hmac_encryption_scheme.py rename to src/fides/api/util/encryption/hmac_encryption_scheme.py index 0eda2862a0..7f94b0b41c 100644 --- a/src/fides/api/ops/util/encryption/hmac_encryption_scheme.py +++ b/src/fides/api/util/encryption/hmac_encryption_scheme.py @@ -2,7 +2,7 @@ import hmac from typing import Callable -from fides.api.ops.schemas.masking.masking_configuration import HmacMaskingConfiguration +from fides.api.schemas.masking.masking_configuration import HmacMaskingConfiguration from fides.core.config import CONFIG diff --git a/src/fides/api/ops/util/encryption/secrets_util.py b/src/fides/api/util/encryption/secrets_util.py similarity index 94% rename from src/fides/api/ops/util/encryption/secrets_util.py rename to src/fides/api/util/encryption/secrets_util.py index 6b9bf28520..464a61ccba 100644 --- a/src/fides/api/ops/util/encryption/secrets_util.py +++ b/src/fides/api/util/encryption/secrets_util.py @@ -3,12 +3,12 @@ from loguru import logger -from fides.api.ops.schemas.masking.masking_secrets import ( +from fides.api.schemas.masking.masking_secrets import ( MaskingSecretCache, MaskingSecretMeta, SecretType, ) -from fides.api.ops.util.cache import get_cache, get_masking_secret_cache_key +from fides.api.util.cache import get_cache, get_masking_secret_cache_key T = TypeVar("T") diff --git a/src/fides/api/ops/util/enums.py b/src/fides/api/util/enums.py similarity index 100% rename from src/fides/api/ops/util/enums.py rename to src/fides/api/util/enums.py diff --git a/src/fides/api/ops/util/identity_verification.py b/src/fides/api/util/identity_verification.py similarity index 96% rename from src/fides/api/ops/util/identity_verification.py rename to src/fides/api/util/identity_verification.py index d54825506a..0362c9baba 100644 --- a/src/fides/api/ops/util/identity_verification.py +++ b/src/fides/api/util/identity_verification.py @@ -2,8 +2,8 @@ from loguru import logger -from fides.api.ops.common_exceptions import IdentityVerificationException -from fides.api.ops.util.cache import FidesopsRedis, get_cache +from fides.api.common_exceptions import IdentityVerificationException +from fides.api.util.cache import FidesopsRedis, get_cache from fides.core.config import CONFIG diff --git a/src/fides/api/ops/util/logger.py b/src/fides/api/util/logger.py similarity index 100% rename from src/fides/api/ops/util/logger.py rename to src/fides/api/util/logger.py diff --git a/src/fides/api/ops/util/matching_queue.py b/src/fides/api/util/matching_queue.py similarity index 100% rename from src/fides/api/ops/util/matching_queue.py rename to src/fides/api/util/matching_queue.py diff --git a/src/fides/api/ops/util/querytoken.py b/src/fides/api/util/querytoken.py similarity index 100% rename from src/fides/api/ops/util/querytoken.py rename to src/fides/api/util/querytoken.py diff --git a/src/fides/api/ops/util/saas_util.py b/src/fides/api/util/saas_util.py similarity index 96% rename from src/fides/api/ops/util/saas_util.py rename to src/fides/api/util/saas_util.py index 806fee4631..36035775b7 100644 --- a/src/fides/api/ops/util/saas_util.py +++ b/src/fides/api/util/saas_util.py @@ -9,17 +9,12 @@ import yaml from multidimensional_urlencode import urlencode as multidimensional_urlencode -from fides.api.ops.common_exceptions import FidesopsException, ValidationError -from fides.api.ops.cryptography.cryptographic_util import bytes_to_b64_str -from fides.api.ops.graph.config import ( - Collection, - CollectionAddress, - Field, - GraphDataset, -) -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.saas.saas_config import SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams +from fides.api.common_exceptions import FidesopsException, ValidationError +from fides.api.cryptography.cryptographic_util import bytes_to_b64_str +from fides.api.graph.config import Collection, CollectionAddress, Field, GraphDataset +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.saas.saas_config import SaaSRequest +from fides.api.schemas.saas.shared_schemas import SaaSRequestParams from fides.core.config.helpers import load_file FIDESOPS_GROUPED_INPUTS = "fidesops_grouped_inputs" diff --git a/src/fides/api/ops/util/storage_authenticator.py b/src/fides/api/util/storage_authenticator.py similarity index 89% rename from src/fides/api/ops/util/storage_authenticator.py rename to src/fides/api/util/storage_authenticator.py index f18e4c02d1..5d347aba45 100644 --- a/src/fides/api/ops/util/storage_authenticator.py +++ b/src/fides/api/util/storage_authenticator.py @@ -3,8 +3,8 @@ from boto3 import Session from loguru import logger -from fides.api.ops.common_exceptions import StorageUploadError -from fides.api.ops.schemas.storage.storage import S3AuthMethod, StorageSecrets +from fides.api.common_exceptions import StorageUploadError +from fides.api.schemas.storage.storage import S3AuthMethod, StorageSecrets def get_s3_session( diff --git a/src/fides/api/ops/util/storage_util.py b/src/fides/api/util/storage_util.py similarity index 89% rename from src/fides/api/ops/util/storage_util.py rename to src/fides/api/util/storage_util.py index 57e77a357e..e090d70f3a 100644 --- a/src/fides/api/ops/util/storage_util.py +++ b/src/fides/api/util/storage_util.py @@ -2,14 +2,12 @@ from pydantic import ValidationError -from fides.api.ops.schemas.storage.storage import ( +from fides.api.schemas.storage.storage import ( SUPPORTED_STORAGE_SECRETS, StorageSecretsS3, StorageType, ) -from fides.api.ops.schemas.storage.storage_secrets_docs_only import ( - possible_storage_secrets, -) +from fides.api.schemas.storage.storage_secrets_docs_only import possible_storage_secrets def get_schema_for_secrets( diff --git a/src/fides/api/ops/util/system_manager_oauth_util.py b/src/fides/api/util/system_manager_oauth_util.py similarity index 95% rename from src/fides/api/ops/util/system_manager_oauth_util.py rename to src/fides/api/util/system_manager_oauth_util.py index c90030ce59..41711e5291 100644 --- a/src/fides/api/ops/util/system_manager_oauth_util.py +++ b/src/fides/api/util/system_manager_oauth_util.py @@ -8,13 +8,13 @@ from loguru import logger from sqlalchemy.orm import Session +from fides.api.api.deps import get_db +from fides.api.common_exceptions import AuthorizationError +from fides.api.cryptography.schemas.jwt import JWE_PAYLOAD_SYSTEMS from fides.api.ctl.sql_models import System # type: ignore[attr-defined] -from fides.api.ops.api.deps import get_db -from fides.api.ops.common_exceptions import AuthorizationError -from fides.api.ops.cryptography.schemas.jwt import JWE_PAYLOAD_SYSTEMS -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.oauth.system_manager import SYSTEM_MANAGER_SCOPES -from fides.api.ops.oauth.utils import ( +from fides.api.models.client import ClientDetail +from fides.api.oauth.system_manager import SYSTEM_MANAGER_SCOPES +from fides.api.oauth.utils import ( copy_func, extract_token_and_load_client, has_permissions, diff --git a/src/fides/api/ops/util/text.py b/src/fides/api/util/text.py similarity index 100% rename from src/fides/api/ops/util/text.py rename to src/fides/api/util/text.py diff --git a/src/fides/api/ops/util/url_util.py b/src/fides/api/util/url_util.py similarity index 100% rename from src/fides/api/ops/util/url_util.py rename to src/fides/api/util/url_util.py diff --git a/src/fides/api/ops/util/wrappers.py b/src/fides/api/util/wrappers.py similarity index 100% rename from src/fides/api/ops/util/wrappers.py rename to src/fides/api/util/wrappers.py diff --git a/src/fides/api/ops/worker/__init__.py b/src/fides/api/worker/__init__.py similarity index 76% rename from src/fides/api/ops/worker/__init__.py rename to src/fides/api/worker/__init__.py index bb0b40a9f9..695856526a 100644 --- a/src/fides/api/ops/worker/__init__.py +++ b/src/fides/api/worker/__init__.py @@ -1,7 +1,7 @@ from loguru import logger -from fides.api.ops.service.saas_request.override_implementations import * -from fides.api.ops.tasks import MESSAGING_QUEUE_NAME, celery_app +from fides.api.service.saas_request.override_implementations import * +from fides.api.tasks import MESSAGING_QUEUE_NAME, celery_app def start_worker() -> None: diff --git a/src/fides/cli/commands/util.py b/src/fides/cli/commands/util.py index 61924de50e..d9ff0bbc10 100644 --- a/src/fides/cli/commands/util.py +++ b/src/fides/cli/commands/util.py @@ -95,7 +95,7 @@ def worker(ctx: click.Context) -> None: Start a Celery worker for the Fides webserver. """ # This has to be here to avoid a circular dependency - from fides.api.ops.worker import start_worker + from fides.api.worker import start_worker start_worker() diff --git a/src/fides/cli/utils.py b/src/fides/cli/utils.py index 9f316d24d6..b548500b98 100644 --- a/src/fides/cli/utils.py +++ b/src/fides/cli/utils.py @@ -24,7 +24,7 @@ from requests import get, put import fides -from fides.api.ops.api.v1.urn_registry import REGISTRATION, V1_URL_PREFIX +from fides.api.api.v1.urn_registry import REGISTRATION, V1_URL_PREFIX from fides.common.utils import check_response, echo_green, echo_red from fides.connectors.models import ( AWSConfig, diff --git a/src/fides/core/config/config_proxy.py b/src/fides/core/config/config_proxy.py index e30d4dc374..6593962f2a 100644 --- a/src/fides/core/config/config_proxy.py +++ b/src/fides/core/config/config_proxy.py @@ -4,8 +4,8 @@ from sqlalchemy.orm import Session -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.schemas.storage.storage import StorageType +from fides.api.models.application_config import ApplicationConfig +from fides.api.schemas.storage.storage import StorageType class ConfigProxyBase: diff --git a/src/fides/core/config/security_settings.py b/src/fides/core/config/security_settings.py index 90944fd32d..e621978c73 100644 --- a/src/fides/core/config/security_settings.py +++ b/src/fides/core/config/security_settings.py @@ -7,9 +7,9 @@ from pydantic import Field, validator from slowapi.wrappers import parse_many # type: ignore -from fides.api.ops.api.v1.scope_registry import SCOPE_REGISTRY -from fides.api.ops.cryptography.cryptographic_util import generate_salt, hash_with_salt -from fides.api.ops.oauth.roles import OWNER +from fides.api.api.v1.scope_registry import SCOPE_REGISTRY +from fides.api.cryptography.cryptographic_util import generate_salt, hash_with_salt +from fides.api.oauth.roles import OWNER from .fides_settings import FidesSettings diff --git a/src/fides/core/user.py b/src/fides/core/user.py index fb292ef8b9..8fddb6887f 100644 --- a/src/fides/core/user.py +++ b/src/fides/core/user.py @@ -5,7 +5,7 @@ import requests from fideslang.validation import FidesKey -from fides.api.ops.cryptography.cryptographic_util import str_to_b64_str +from fides.api.cryptography.cryptographic_util import str_to_b64_str from fides.common.utils import handle_cli_response from fides.core.config import CONFIG from fides.core.utils import ( diff --git a/tests/conftest.py b/tests/conftest.py index 7554cbed1a..7eb78d7619 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,28 +18,28 @@ from sqlalchemy.orm import sessionmaker from toml import load as load_toml -from fides.api.ctl.database.session import sync_engine -from fides.api.ctl.sql_models import DataUse, PrivacyDeclaration -from fides.api.main import app -from fides.api.ops.api.v1.scope_registry import SCOPE_REGISTRY -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.api.v1.scope_registry import SCOPE_REGISTRY +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_ROLES, JWE_PAYLOAD_SCOPES, JWE_PAYLOAD_SYSTEMS, ) -from fides.api.ops.models.privacy_request import generate_request_callback_jwe -from fides.api.ops.oauth.jwt import generate_jwe -from fides.api.ops.oauth.roles import ( +from fides.api.ctl.database.session import sync_engine +from fides.api.ctl.sql_models import DataUse, PrivacyDeclaration +from fides.api.main import app +from fides.api.models.privacy_request import generate_request_callback_jwe +from fides.api.oauth.jwt import generate_jwe +from fides.api.oauth.roles import ( APPROVER, CONTRIBUTOR, OWNER, VIEWER, VIEWER_AND_APPROVER, ) -from fides.api.ops.schemas.messaging.messaging import MessagingServiceType -from fides.api.ops.util.cache import get_cache +from fides.api.schemas.messaging.messaging import MessagingServiceType +from fides.api.util.cache import get_cache from fides.core.config import get_config from fides.core.config.config_proxy import ConfigProxy from tests.fixtures.application_fixtures import * @@ -557,7 +557,7 @@ def run_privacy_request_task(celery_session_app): registered to the `celery_app` fixture which uses the virtualised `celery_worker` """ yield celery_session_app.tasks[ - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request" ] diff --git a/tests/ctl/api/test_seed.py b/tests/ctl/api/test_seed.py index d7a2d5bfd8..836bd59148 100644 --- a/tests/ctl/api/test_seed.py +++ b/tests/ctl/api/test_seed.py @@ -11,10 +11,10 @@ from fides.api.ctl.database import samples, seed from fides.api.ctl.sql_models import Dataset, PolicyCtl, System -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.policy import ActionType, DrpAction, Policy, Rule, RuleTarget +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.fides_user import FidesUser +from fides.api.models.policy import ActionType, DrpAction, Policy, Rule, RuleTarget from fides.core import api as _api from fides.core.config import CONFIG, FidesConfig diff --git a/tests/ctl/cli/test_cli.py b/tests/ctl/cli/test_cli.py index 07efd6ff45..2581da5870 100644 --- a/tests/ctl/cli/test_cli.py +++ b/tests/ctl/cli/test_cli.py @@ -9,8 +9,8 @@ from git.repo import Repo from py._path.local import LocalPath -from fides.api.ops.api.v1.scope_registry import SCOPE_REGISTRY -from fides.api.ops.oauth.roles import OWNER, VIEWER +from fides.api.api.v1.scope_registry import SCOPE_REGISTRY +from fides.api.oauth.roles import OWNER, VIEWER from fides.cli import cli from fides.core.config import CONFIG from fides.core.user import get_systems_managed_by_user, get_user_permissions @@ -96,7 +96,7 @@ def test_worker() -> None: This is specifically meant to catch when the worker command breaks, without spinning up an additional instance. """ - from fides.api.ops.worker import start_worker # pylint: disable=unused-import + from fides.api.worker import start_worker # pylint: disable=unused-import assert True diff --git a/tests/ctl/core/test_api.py b/tests/ctl/core/test_api.py index 7c7fa88d95..9206427965 100644 --- a/tests/ctl/core/test_api.py +++ b/tests/ctl/core/test_api.py @@ -20,12 +20,7 @@ ) from starlette.testclient import TestClient -from fides.api.ctl.database.crud import get_resource -from fides.api.ctl.routes import health -from fides.api.ctl.routes.util import API_PREFIX, CLI_SCOPE_PREFIX_MAPPING -from fides.api.ctl.schemas.system import PrivacyDeclarationResponse -from fides.api.ctl.sql_models import Dataset, PrivacyDeclaration, System -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CREATE, DELETE, POLICY_CREATE_OR_UPDATE, @@ -38,8 +33,13 @@ SYSTEM_UPDATE, UPDATE, ) -from fides.api.ops.api.v1.urn_registry import V1_URL_PREFIX -from fides.api.ops.oauth.roles import OWNER, VIEWER +from fides.api.api.v1.urn_registry import V1_URL_PREFIX +from fides.api.ctl.database.crud import get_resource +from fides.api.ctl.routes import health +from fides.api.ctl.routes.util import API_PREFIX, CLI_SCOPE_PREFIX_MAPPING +from fides.api.ctl.schemas.system import PrivacyDeclarationResponse +from fides.api.ctl.sql_models import Dataset, PrivacyDeclaration, System +from fides.api.oauth.roles import OWNER, VIEWER from fides.core import api as _api from fides.core.config import FidesConfig, get_config diff --git a/tests/ctl/core/test_custom_field_models.py b/tests/ctl/core/test_custom_field_models.py index e80692b6d0..29c8199b45 100644 --- a/tests/ctl/core/test_custom_field_models.py +++ b/tests/ctl/core/test_custom_field_models.py @@ -3,8 +3,8 @@ import pytest from sqlalchemy.exc import IntegrityError +from fides.api.common_exceptions import KeyOrNameAlreadyExists from fides.api.ctl.sql_models import CustomFieldDefinition -from fides.api.ops.common_exceptions import KeyOrNameAlreadyExists @pytest.fixture(autouse=True) diff --git a/tests/ctl/core/test_dataset.py b/tests/ctl/core/test_dataset.py index 8a1faec23d..bed2bdcc2d 100644 --- a/tests/ctl/core/test_dataset.py +++ b/tests/ctl/core/test_dataset.py @@ -13,12 +13,12 @@ from fides.api.ctl.database.crud import get_resource from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig +from fides.api.models.datasetconfig import DatasetConfig from fides.core import api from fides.core import dataset as _dataset from fides.core.config import FidesConfig diff --git a/tests/fixtures/application_fixtures.py b/tests/fixtures/application_fixtures.py index 735a78cf35..32d6594118 100644 --- a/tests/fixtures/application_fixtures.py +++ b/tests/fixtures/application_fixtures.py @@ -14,23 +14,23 @@ from sqlalchemy.orm.exc import ObjectDeletedError, StaleDataError from toml import load as load_toml +from fides.api.common_exceptions import SystemManagerException from fides.api.ctl.sql_models import DataCategory as DataCategoryDbModel from fides.api.ctl.sql_models import Dataset as CtlDataset from fides.api.ctl.sql_models import System -from fides.api.ops.common_exceptions import SystemManagerException -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.models.audit_log import AuditLog, AuditLogAction -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.application_config import ApplicationConfig +from fides.api.models.audit_log import AuditLog, AuditLogAction +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.fides_user_permissions import FidesUserPermissions -from fides.api.ops.models.messaging import MessagingConfig -from fides.api.ops.models.policy import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.fides_user import FidesUser +from fides.api.models.fides_user_permissions import FidesUserPermissions +from fides.api.models.messaging import MessagingConfig +from fides.api.models.policy import ( ActionType, Policy, PolicyPostWebhook, @@ -38,58 +38,56 @@ Rule, RuleTarget, ) -from fides.api.ops.models.privacy_experience import ( +from fides.api.models.privacy_experience import ( ComponentType, DeliveryMechanism, PrivacyExperience, PrivacyExperienceConfig, ) -from fides.api.ops.models.privacy_notice import ( +from fides.api.models.privacy_notice import ( ConsentMechanism, EnforcementLevel, PrivacyNotice, PrivacyNoticeRegion, ) -from fides.api.ops.models.privacy_preference import PrivacyPreferenceHistory -from fides.api.ops.models.privacy_request import ( +from fides.api.models.privacy_preference import PrivacyPreferenceHistory +from fides.api.models.privacy_request import ( Consent, ConsentRequest, PrivacyRequest, PrivacyRequestStatus, ProvidedIdentity, ) -from fides.api.ops.models.registration import UserRegistration -from fides.api.ops.models.storage import ( +from fides.api.models.registration import UserRegistration +from fides.api.models.storage import ( ResponseFormat, StorageConfig, _create_local_default_storage, default_storage_config_name, ) -from fides.api.ops.oauth.roles import APPROVER, VIEWER -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.oauth.roles import APPROVER, VIEWER +from fides.api.schemas.messaging.messaging import ( MessagingServiceDetails, MessagingServiceSecrets, MessagingServiceType, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.schemas.storage.storage import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.schemas.storage.storage import ( FileNaming, S3AuthMethod, StorageDetails, StorageSecrets, StorageType, ) -from fides.api.ops.service.connectors.fides.fides_client import FidesClient -from fides.api.ops.service.masking.strategy.masking_strategy_hmac import ( - HmacMaskingStrategy, -) -from fides.api.ops.service.masking.strategy.masking_strategy_nullify import ( +from fides.api.service.connectors.fides.fides_client import FidesClient +from fides.api.service.masking.strategy.masking_strategy_hmac import HmacMaskingStrategy +from fides.api.service.masking.strategy.masking_strategy_nullify import ( NullMaskingStrategy, ) -from fides.api.ops.service.masking.strategy.masking_strategy_string_rewrite import ( +from fides.api.service.masking.strategy.masking_strategy_string_rewrite import ( StringRewriteMaskingStrategy, ) -from fides.api.ops.util.data_category import DataCategory +from fides.api.util.data_category import DataCategory from fides.core.config import CONFIG from fides.core.config.helpers import load_file @@ -166,7 +164,7 @@ @pytest.fixture(scope="session", autouse=True) def mock_upload_logic() -> Generator: with mock.patch( - "fides.api.ops.service.storage.storage_uploader_service.upload_to_s3" + "fides.api.service.storage.storage_uploader_service.upload_to_s3" ) as _fixture: yield _fixture diff --git a/tests/fixtures/bigquery_fixtures.py b/tests/fixtures/bigquery_fixtures.py index da9e5f412c..4b6eb10a40 100644 --- a/tests/fixtures/bigquery_fixtures.py +++ b/tests/fixtures/bigquery_fixtures.py @@ -7,14 +7,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.connection_configuration import BigQuerySchema -from fides.api.ops.service.connectors import BigQueryConnector, get_connector +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.connection_configuration import BigQuerySchema +from fides.api.service.connectors import BigQueryConnector, get_connector from .application_fixtures import integration_config diff --git a/tests/fixtures/dynamodb_fixtures.py b/tests/fixtures/dynamodb_fixtures.py index fb0d6ad527..64c4e6544e 100644 --- a/tests/fixtures/dynamodb_fixtures.py +++ b/tests/fixtures/dynamodb_fixtures.py @@ -6,13 +6,13 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.connection_configuration.connection_secrets_dynamodb import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.connection_configuration.connection_secrets_dynamodb import ( DynamoDBSchema, ) diff --git a/tests/fixtures/email_fixtures.py b/tests/fixtures/email_fixtures.py index dafe0844c3..1043ead416 100644 --- a/tests/fixtures/email_fixtures.py +++ b/tests/fixtures/email_fixtures.py @@ -5,15 +5,13 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Organization -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.service.connectors import SovrnConnector -from fides.api.ops.service.connectors.email.attentive_connector import ( - AttentiveConnector, -) +from fides.api.service.connectors import SovrnConnector +from fides.api.service.connectors.email.attentive_connector import AttentiveConnector @pytest.fixture(scope="function") diff --git a/tests/fixtures/fides_connector_example_fixtures.py b/tests/fixtures/fides_connector_example_fixtures.py index bd673394df..6cc3a1e3fb 100644 --- a/tests/fixtures/fides_connector_example_fixtures.py +++ b/tests/fixtures/fides_connector_example_fixtures.py @@ -5,13 +5,13 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.service.connectors import FidesConnector +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.service.connectors import FidesConnector from .application_fixtures import integration_secrets diff --git a/tests/fixtures/integration_fixtures.py b/tests/fixtures/integration_fixtures.py index ef05745bf9..2142eb4576 100644 --- a/tests/fixtures/integration_fixtures.py +++ b/tests/fixtures/integration_fixtures.py @@ -8,12 +8,12 @@ from sqlalchemy import text from sqlalchemy.engine import Engine -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.service.connectors import MongoDBConnector +from fides.api.service.connectors import MongoDBConnector from .application_fixtures import faker, integration_secrets diff --git a/tests/fixtures/manual_fixtures.py b/tests/fixtures/manual_fixtures.py index f70523ae3b..a2443d8f12 100644 --- a/tests/fixtures/manual_fixtures.py +++ b/tests/fixtures/manual_fixtures.py @@ -5,12 +5,12 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig +from fides.api.models.datasetconfig import DatasetConfig @pytest.fixture(scope="function") diff --git a/tests/fixtures/manual_webhook_fixtures.py b/tests/fixtures/manual_webhook_fixtures.py index d2c86089fa..422c4636ad 100644 --- a/tests/fixtures/manual_webhook_fixtures.py +++ b/tests/fixtures/manual_webhook_fixtures.py @@ -3,12 +3,12 @@ import pytest from sqlalchemy.orm.exc import ObjectDeletedError -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.manual_webhook import AccessManualWebhook +from fides.api.models.manual_webhook import AccessManualWebhook @pytest.fixture(scope="function") diff --git a/tests/fixtures/mariadb_fixtures.py b/tests/fixtures/mariadb_fixtures.py index f7fb083e17..a23e7dec78 100644 --- a/tests/fixtures/mariadb_fixtures.py +++ b/tests/fixtures/mariadb_fixtures.py @@ -6,14 +6,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.service.connectors import MariaDBConnector +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.service.connectors import MariaDBConnector from fides.core.config import CONFIG from .application_fixtures import integration_secrets diff --git a/tests/fixtures/mongodb_fixtures.py b/tests/fixtures/mongodb_fixtures.py index a71384c9c3..a3384b252b 100644 --- a/tests/fixtures/mongodb_fixtures.py +++ b/tests/fixtures/mongodb_fixtures.py @@ -4,13 +4,13 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_request import ( +from fides.api.models.policy import ActionType +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, diff --git a/tests/fixtures/mssql_fixtures.py b/tests/fixtures/mssql_fixtures.py index 7c6c07d893..65a0f24c67 100644 --- a/tests/fixtures/mssql_fixtures.py +++ b/tests/fixtures/mssql_fixtures.py @@ -5,14 +5,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.service.connectors import MicrosoftSQLServerConnector +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.service.connectors import MicrosoftSQLServerConnector from fides.core.config import CONFIG from .application_fixtures import integration_secrets diff --git a/tests/fixtures/mysql_fixtures.py b/tests/fixtures/mysql_fixtures.py index 3a3fe5eeb2..70a227baea 100644 --- a/tests/fixtures/mysql_fixtures.py +++ b/tests/fixtures/mysql_fixtures.py @@ -5,14 +5,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.service.connectors import MySQLConnector +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.service.connectors import MySQLConnector from fides.core.config import CONFIG from .application_fixtures import integration_secrets diff --git a/tests/fixtures/postgres_fixtures.py b/tests/fixtures/postgres_fixtures.py index efaf611e85..d915f771ad 100644 --- a/tests/fixtures/postgres_fixtures.py +++ b/tests/fixtures/postgres_fixtures.py @@ -6,20 +6,20 @@ from sqlalchemy_utils.functions import drop_database from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_request import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.policy import ActionType +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, ) -from fides.api.ops.service.connectors import PostgreSQLConnector +from fides.api.service.connectors import PostgreSQLConnector from fides.core.config import CONFIG from tests.ops.test_helpers.db_utils import seed_postgres_data diff --git a/tests/fixtures/redshift_fixtures.py b/tests/fixtures/redshift_fixtures.py index 5ca6d68b3e..b15399dc2b 100644 --- a/tests/fixtures/redshift_fixtures.py +++ b/tests/fixtures/redshift_fixtures.py @@ -6,13 +6,13 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.connection_configuration.connection_secrets_redshift import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.connection_configuration.connection_secrets_redshift import ( RedshiftSchema, ) diff --git a/tests/fixtures/saas/adobe_campaign_fixtures.py b/tests/fixtures/saas/adobe_campaign_fixtures.py index 1becf6bb19..11c6e0f27d 100644 --- a/tests/fixtures/saas/adobe_campaign_fixtures.py +++ b/tests/fixtures/saas/adobe_campaign_fixtures.py @@ -5,15 +5,15 @@ import requests from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/aircall_fixtures.py b/tests/fixtures/saas/aircall_fixtures.py index cd367f726c..c044ef1f06 100644 --- a/tests/fixtures/saas/aircall_fixtures.py +++ b/tests/fixtures/saas/aircall_fixtures.py @@ -6,15 +6,15 @@ from requests import Response from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/amplitude_fixtures.py b/tests/fixtures/saas/amplitude_fixtures.py index f8f60ec6be..502393f59a 100644 --- a/tests/fixtures/saas/amplitude_fixtures.py +++ b/tests/fixtures/saas/amplitude_fixtures.py @@ -8,15 +8,15 @@ from requests import Response from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/auth0_fixtures.py b/tests/fixtures/saas/auth0_fixtures.py index 6bcbf2bf77..bedea63c6f 100644 --- a/tests/fixtures/saas/auth0_fixtures.py +++ b/tests/fixtures/saas/auth0_fixtures.py @@ -6,16 +6,16 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_204_NO_CONTENT +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/braintree_fixtures.py b/tests/fixtures/saas/braintree_fixtures.py index a1ae309b2f..6985aa3b65 100644 --- a/tests/fixtures/saas/braintree_fixtures.py +++ b/tests/fixtures/saas/braintree_fixtures.py @@ -9,14 +9,14 @@ from sqlalchemy_utils.functions import create_database, database_exists, drop_database from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/braze_fixtures.py b/tests/fixtures/saas/braze_fixtures.py index a678bdcaf5..66db655ac3 100644 --- a/tests/fixtures/saas/braze_fixtures.py +++ b/tests/fixtures/saas/braze_fixtures.py @@ -7,16 +7,16 @@ import requests from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/connection_template_fixtures.py b/tests/fixtures/saas/connection_template_fixtures.py index 5a1d098323..dfa3d8a31c 100644 --- a/tests/fixtures/saas/connection_template_fixtures.py +++ b/tests/fixtures/saas/connection_template_fixtures.py @@ -4,18 +4,18 @@ import pytest -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.connection_configuration.connection_config import ( +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.connection_configuration.connection_config import ( SaasConnectionTemplateValues, ) -from fides.api.ops.service.connectors.saas.connector_registry_service import ( +from fides.api.service.connectors.saas.connector_registry_service import ( ConnectorRegistry, ConnectorTemplate, create_connection_config_from_template_no_save, upsert_dataset_config_from_template, ) -from fides.api.ops.util.connection_util import validate_secrets +from fides.api.util.connection_util import validate_secrets @pytest.fixture(scope="function") diff --git a/tests/fixtures/saas/datadog_fixtures.py b/tests/fixtures/saas/datadog_fixtures.py index 74bae02806..eca2db4537 100644 --- a/tests/fixtures/saas/datadog_fixtures.py +++ b/tests/fixtures/saas/datadog_fixtures.py @@ -6,14 +6,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/delighted_fixtures.py b/tests/fixtures/saas/delighted_fixtures.py index fbab2f2905..f1205afcec 100644 --- a/tests/fixtures/saas/delighted_fixtures.py +++ b/tests/fixtures/saas/delighted_fixtures.py @@ -6,15 +6,15 @@ from requests import Response from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/domo_fixtures.py b/tests/fixtures/saas/domo_fixtures.py index 590dcf61ce..724b4ce2c4 100644 --- a/tests/fixtures/saas/domo_fixtures.py +++ b/tests/fixtures/saas/domo_fixtures.py @@ -8,16 +8,16 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_204_NO_CONTENT +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/firebase_auth_fixtures.py b/tests/fixtures/saas/firebase_auth_fixtures.py index e94a42b453..40f9043e8a 100644 --- a/tests/fixtures/saas/firebase_auth_fixtures.py +++ b/tests/fixtures/saas/firebase_auth_fixtures.py @@ -8,18 +8,18 @@ from firebase_admin.exceptions import FirebaseError from sqlalchemy.orm import Session -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.cryptography import cryptographic_util +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.service.saas_request.override_implementations.firebase_auth_request_overrides import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.service.saas_request.override_implementations.firebase_auth_request_overrides import ( initialize_firebase, ) -from fides.api.ops.util.saas_util import ( +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/friendbuy_fixtures.py b/tests/fixtures/saas/friendbuy_fixtures.py index 2f5d7d61ce..2c3c77c1f0 100644 --- a/tests/fixtures/saas/friendbuy_fixtures.py +++ b/tests/fixtures/saas/friendbuy_fixtures.py @@ -7,16 +7,16 @@ from sqlalchemy.orm import Session from sqlalchemy_utils.functions import create_database, database_exists, drop_database +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/friendbuy_nextgen_fixtures.py b/tests/fixtures/saas/friendbuy_nextgen_fixtures.py index 85b4cfb05b..71559fee67 100644 --- a/tests/fixtures/saas/friendbuy_nextgen_fixtures.py +++ b/tests/fixtures/saas/friendbuy_nextgen_fixtures.py @@ -6,16 +6,16 @@ from requests import post from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/fullstory_fixtures.py b/tests/fixtures/saas/fullstory_fixtures.py index 85c08c891c..779ef64aaf 100644 --- a/tests/fixtures/saas/fullstory_fixtures.py +++ b/tests/fixtures/saas/fullstory_fixtures.py @@ -7,14 +7,14 @@ from sqlalchemy_utils.functions import create_database, database_exists, drop_database from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/google_analytics_fixtures.py b/tests/fixtures/saas/google_analytics_fixtures.py index 2aff01f057..06dc3498f3 100644 --- a/tests/fixtures/saas/google_analytics_fixtures.py +++ b/tests/fixtures/saas/google_analytics_fixtures.py @@ -5,14 +5,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/gorgias_fixtures.py b/tests/fixtures/saas/gorgias_fixtures.py index 2a8c3725ac..9aacfffcf0 100644 --- a/tests/fixtures/saas/gorgias_fixtures.py +++ b/tests/fixtures/saas/gorgias_fixtures.py @@ -6,15 +6,15 @@ import requests from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/hubspot_fixtures.py b/tests/fixtures/saas/hubspot_fixtures.py index 8a02f5505d..4ca686b0d7 100644 --- a/tests/fixtures/saas/hubspot_fixtures.py +++ b/tests/fixtures/saas/hubspot_fixtures.py @@ -5,15 +5,15 @@ import requests from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/jira_fixtures.py b/tests/fixtures/saas/jira_fixtures.py index 226a999346..15123272e3 100644 --- a/tests/fixtures/saas/jira_fixtures.py +++ b/tests/fixtures/saas/jira_fixtures.py @@ -7,15 +7,15 @@ from requests.auth import HTTPBasicAuth from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/klaviyo_fixtures.py b/tests/fixtures/saas/klaviyo_fixtures.py index 5610c4df13..1b9c79b65a 100644 --- a/tests/fixtures/saas/klaviyo_fixtures.py +++ b/tests/fixtures/saas/klaviyo_fixtures.py @@ -5,15 +5,15 @@ import requests from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/kustomer_fixtures.py b/tests/fixtures/saas/kustomer_fixtures.py index 4fb40eb754..8edce2aad5 100644 --- a/tests/fixtures/saas/kustomer_fixtures.py +++ b/tests/fixtures/saas/kustomer_fixtures.py @@ -5,15 +5,15 @@ import requests from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/mailchimp_fixtures.py b/tests/fixtures/saas/mailchimp_fixtures.py index 21b037cc32..abb5486fa8 100644 --- a/tests/fixtures/saas/mailchimp_fixtures.py +++ b/tests/fixtures/saas/mailchimp_fixtures.py @@ -6,17 +6,17 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.saas.saas_config import SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors.saas_connector import SaaSConnector -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.saas.saas_config import SaaSRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors.saas_connector import SaaSConnector +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/mailchimp_override_fixtures.py b/tests/fixtures/saas/mailchimp_override_fixtures.py index 989e7a73d9..e2f9f400e7 100644 --- a/tests/fixtures/saas/mailchimp_override_fixtures.py +++ b/tests/fixtures/saas/mailchimp_override_fixtures.py @@ -5,17 +5,17 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.saas.saas_config import SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors.saas_connector import SaaSConnector -from fides.api.ops.util.saas_util import load_config +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.saas.saas_config import SaaSRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors.saas_connector import SaaSConnector +from fides.api.util.saas_util import load_config from tests.fixtures.application_fixtures import load_dataset diff --git a/tests/fixtures/saas/mailchimp_transactional_fixtures.py b/tests/fixtures/saas/mailchimp_transactional_fixtures.py index 6ee5aef367..959261b1e7 100644 --- a/tests/fixtures/saas/mailchimp_transactional_fixtures.py +++ b/tests/fixtures/saas/mailchimp_transactional_fixtures.py @@ -6,17 +6,17 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.saas.saas_config import SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors import SaaSConnector -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.saas.saas_config import SaaSRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors import SaaSConnector +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/outreach_fixtures.py b/tests/fixtures/saas/outreach_fixtures.py index b940e1f705..c822cd1370 100644 --- a/tests/fixtures/saas/outreach_fixtures.py +++ b/tests/fixtures/saas/outreach_fixtures.py @@ -5,16 +5,16 @@ import requests from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/recharge_fixtures.py b/tests/fixtures/saas/recharge_fixtures.py index d7940132c3..629fb56f99 100644 --- a/tests/fixtures/saas/recharge_fixtures.py +++ b/tests/fixtures/saas/recharge_fixtures.py @@ -9,14 +9,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/rollbar_fixtures.py b/tests/fixtures/saas/rollbar_fixtures.py index 49fca0f567..3de5c38e33 100644 --- a/tests/fixtures/saas/rollbar_fixtures.py +++ b/tests/fixtures/saas/rollbar_fixtures.py @@ -7,16 +7,16 @@ from requests import Response from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/salesforce_fixtures.py b/tests/fixtures/saas/salesforce_fixtures.py index bc7941ca29..4684d3edcc 100644 --- a/tests/fixtures/saas/salesforce_fixtures.py +++ b/tests/fixtures/saas/salesforce_fixtures.py @@ -6,16 +6,16 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_204_NO_CONTENT, HTTP_404_NOT_FOUND +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/segment_fixtures.py b/tests/fixtures/saas/segment_fixtures.py index 6156807f75..01063594d7 100644 --- a/tests/fixtures/saas/segment_fixtures.py +++ b/tests/fixtures/saas/segment_fixtures.py @@ -9,14 +9,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/sendgrid_fixtures.py b/tests/fixtures/saas/sendgrid_fixtures.py index e80e18e2b6..6621b69d64 100644 --- a/tests/fixtures/saas/sendgrid_fixtures.py +++ b/tests/fixtures/saas/sendgrid_fixtures.py @@ -6,16 +6,16 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_202_ACCEPTED +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/sentry_fixtures.py b/tests/fixtures/saas/sentry_fixtures.py index f841f7adfb..e53dfd2f32 100644 --- a/tests/fixtures/saas/sentry_fixtures.py +++ b/tests/fixtures/saas/sentry_fixtures.py @@ -5,14 +5,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/shippo_fixtures.py b/tests/fixtures/saas/shippo_fixtures.py index f9ee638585..47a85e5b0a 100644 --- a/tests/fixtures/saas/shippo_fixtures.py +++ b/tests/fixtures/saas/shippo_fixtures.py @@ -5,15 +5,15 @@ import requests from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/shopify_fixtures.py b/tests/fixtures/saas/shopify_fixtures.py index 8eb2d6ec9d..075e58d37d 100644 --- a/tests/fixtures/saas/shopify_fixtures.py +++ b/tests/fixtures/saas/shopify_fixtures.py @@ -8,16 +8,16 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_204_NO_CONTENT +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/slack_enterprise_fixtures.py b/tests/fixtures/saas/slack_enterprise_fixtures.py index 039c37737e..69f66cef7f 100644 --- a/tests/fixtures/saas/slack_enterprise_fixtures.py +++ b/tests/fixtures/saas/slack_enterprise_fixtures.py @@ -7,14 +7,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/square_fixtures.py b/tests/fixtures/saas/square_fixtures.py index 705308f4d5..4cedb96128 100644 --- a/tests/fixtures/saas/square_fixtures.py +++ b/tests/fixtures/saas/square_fixtures.py @@ -11,16 +11,16 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_204_NO_CONTENT +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/stripe_fixtures.py b/tests/fixtures/saas/stripe_fixtures.py index 25d76ddc22..04e893490e 100644 --- a/tests/fixtures/saas/stripe_fixtures.py +++ b/tests/fixtures/saas/stripe_fixtures.py @@ -6,16 +6,16 @@ from multidimensional_urlencode import urlencode as multidimensional_urlencode from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/test_data/planet_express/planet_express_functions.py b/tests/fixtures/saas/test_data/planet_express/planet_express_functions.py index 78929f2d89..0ae242216e 100644 --- a/tests/fixtures/saas/test_data/planet_express/planet_express_functions.py +++ b/tests/fixtures/saas/test_data/planet_express/planet_express_functions.py @@ -2,23 +2,21 @@ from requests import PreparedRequest -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestType, register, ) -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.saas_util import assign_placeholders +from fides.api.util.collection_util import Row +from fides.api.util.saas_util import assign_placeholders @register("planet_express_user_access", [SaaSRequestType.READ]) diff --git a/tests/fixtures/saas/twilio_conversations_fixtures.py b/tests/fixtures/saas/twilio_conversations_fixtures.py index 67fdd7e65d..5beea92bbe 100644 --- a/tests/fixtures/saas/twilio_conversations_fixtures.py +++ b/tests/fixtures/saas/twilio_conversations_fixtures.py @@ -7,16 +7,16 @@ from sqlalchemy_utils.functions import create_database, database_exists, drop_database from starlette.status import HTTP_204_NO_CONTENT +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/unbounce_fixtures.py b/tests/fixtures/saas/unbounce_fixtures.py index 9922c9f1e5..2ee17e721d 100644 --- a/tests/fixtures/saas/unbounce_fixtures.py +++ b/tests/fixtures/saas/unbounce_fixtures.py @@ -6,15 +6,15 @@ from requests import Response from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/universal_analytics_fixtures.py b/tests/fixtures/saas/universal_analytics_fixtures.py index 00ac7918e4..577401f7db 100644 --- a/tests/fixtures/saas/universal_analytics_fixtures.py +++ b/tests/fixtures/saas/universal_analytics_fixtures.py @@ -5,14 +5,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/vend_fixtures.py b/tests/fixtures/saas/vend_fixtures.py index d934536f17..191a27e8d2 100644 --- a/tests/fixtures/saas/vend_fixtures.py +++ b/tests/fixtures/saas/vend_fixtures.py @@ -6,15 +6,15 @@ import requests from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/wunderkind_fixtures.py b/tests/fixtures/saas/wunderkind_fixtures.py index 45027821ff..020838b7c9 100644 --- a/tests/fixtures/saas/wunderkind_fixtures.py +++ b/tests/fixtures/saas/wunderkind_fixtures.py @@ -6,14 +6,14 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/yotpo_loyalty_fixtures.py b/tests/fixtures/saas/yotpo_loyalty_fixtures.py index a6dc6a2098..8859ff55fb 100644 --- a/tests/fixtures/saas/yotpo_loyalty_fixtures.py +++ b/tests/fixtures/saas/yotpo_loyalty_fixtures.py @@ -7,15 +7,15 @@ from requests import Response from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas/zendesk_fixtures.py b/tests/fixtures/saas/zendesk_fixtures.py index 9fa1fe0ce6..ddad82e968 100644 --- a/tests/fixtures/saas/zendesk_fixtures.py +++ b/tests/fixtures/saas/zendesk_fixtures.py @@ -4,7 +4,7 @@ import pytest import requests -from fides.api.ops.models.connectionconfig import ConnectionConfig +from fides.api.models.connectionconfig import ConnectionConfig from tests.ops.integration_tests.saas.connector_runner import ( ConnectorRunner, generate_random_email, diff --git a/tests/fixtures/saas_erasure_order_fixtures.py b/tests/fixtures/saas_erasure_order_fixtures.py index 56f299b4a0..de6adfaade 100644 --- a/tests/fixtures/saas_erasure_order_fixtures.py +++ b/tests/fixtures/saas_erasure_order_fixtures.py @@ -4,13 +4,13 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/fixtures/saas_example_fixtures.py b/tests/fixtures/saas_example_fixtures.py index 8054f3bf49..504f6af9d2 100644 --- a/tests/fixtures/saas_example_fixtures.py +++ b/tests/fixtures/saas_example_fixtures.py @@ -7,29 +7,29 @@ from toml import load as load_toml from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.policy import ActionType, Policy, Rule, RuleTarget -from fides.api.ops.schemas.saas.saas_config import ParamValue -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.policy import ActionType, Policy, Rule, RuleTarget +from fides.api.schemas.saas.saas_config import ParamValue +from fides.api.schemas.saas.strategy_configuration import ( OAuth2AuthorizationCodeConfiguration, ) -from fides.api.ops.service.masking.strategy.masking_strategy_nullify import ( +from fides.api.service.masking.strategy.masking_strategy_nullify import ( NullMaskingStrategy, ) -from fides.api.ops.service.masking.strategy.masking_strategy_random_string_rewrite import ( +from fides.api.service.masking.strategy.masking_strategy_random_string_rewrite import ( RandomStringRewriteMaskingStrategy, ) -from fides.api.ops.service.masking.strategy.masking_strategy_string_rewrite import ( +from fides.api.service.masking.strategy.masking_strategy_string_rewrite import ( StringRewriteMaskingStrategy, ) -from fides.api.ops.util.data_category import DataCategory -from fides.api.ops.util.saas_util import ( +from fides.api.util.data_category import DataCategory +from fides.api.util.saas_util import ( encode_file_contents, load_as_string, load_config, diff --git a/tests/fixtures/snowflake_fixtures.py b/tests/fixtures/snowflake_fixtures.py index b0be5526ca..67f8b3fa3c 100644 --- a/tests/fixtures/snowflake_fixtures.py +++ b/tests/fixtures/snowflake_fixtures.py @@ -6,13 +6,13 @@ from sqlalchemy.orm import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.connection_configuration.connection_secrets_snowflake import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.connection_configuration.connection_secrets_snowflake import ( SnowflakeSchema, ) diff --git a/tests/fixtures/timescale_fixtures.py b/tests/fixtures/timescale_fixtures.py index 3a78bef1d6..a23d8ea3c4 100644 --- a/tests/fixtures/timescale_fixtures.py +++ b/tests/fixtures/timescale_fixtures.py @@ -5,13 +5,13 @@ from sqlalchemy.orm import Session from sqlalchemy_utils import drop_database -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.service.connectors import TimescaleConnector +from fides.api.service.connectors import TimescaleConnector from fides.core.config import CONFIG from tests.ops.test_helpers.db_utils import seed_postgres_data diff --git a/tests/lib/conftest.py b/tests/lib/conftest.py index 508c6251a6..a81b86d8d3 100644 --- a/tests/lib/conftest.py +++ b/tests/lib/conftest.py @@ -6,8 +6,8 @@ import requests from sqlalchemy.exc import IntegrityError -from fides.api.ops.db.base import Base -from fides.api.ops.db.session import get_db_engine, get_db_session +from fides.api.db.base import Base +from fides.api.db.session import get_db_engine, get_db_session from tests.conftest import create_citext_extension diff --git a/tests/lib/test_client_model.py b/tests/lib/test_client_model.py index 15e8b50683..f2fbd932ba 100644 --- a/tests/lib/test_client_model.py +++ b/tests/lib/test_client_model.py @@ -4,22 +4,22 @@ import pytest -from fides.api.ops.api.v1.scope_registry import DATASET_CREATE_OR_UPDATE, SCOPE_REGISTRY -from fides.api.ops.cryptography.cryptographic_util import ( +from fides.api.api.v1.scope_registry import DATASET_CREATE_OR_UPDATE, SCOPE_REGISTRY +from fides.api.cryptography.cryptographic_util import ( generate_salt, generate_secure_random_string, hash_with_salt, ) -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_ROLES, JWE_PAYLOAD_SCOPES, JWE_PAYLOAD_SYSTEMS, ) -from fides.api.ops.models.client import ClientDetail, _get_root_client_detail -from fides.api.ops.oauth.roles import OWNER, VIEWER -from fides.api.ops.oauth.utils import extract_payload +from fides.api.models.client import ClientDetail, _get_root_client_detail +from fides.api.oauth.roles import OWNER, VIEWER +from fides.api.oauth.utils import extract_payload def test_create_client_and_secret(db, config): diff --git a/tests/lib/test_cryptography_util.py b/tests/lib/test_cryptography_util.py index de8ef7c742..aaf5bb1c17 100644 --- a/tests/lib/test_cryptography_util.py +++ b/tests/lib/test_cryptography_util.py @@ -2,7 +2,7 @@ import pytest -from fides.api.ops.cryptography.cryptographic_util import ( +from fides.api.cryptography.cryptographic_util import ( b64_str_to_bytes, b64_str_to_str, bytes_to_b64_str, diff --git a/tests/lib/test_db_base_class.py b/tests/lib/test_db_base_class.py index 8d660dc3c8..7e3e2586bb 100644 --- a/tests/lib/test_db_base_class.py +++ b/tests/lib/test_db_base_class.py @@ -3,8 +3,8 @@ import pytest from fideslang.validation import FidesValidationError # type: ignore -from fides.api.ops.common_exceptions import KeyValidationError -from fides.api.ops.db.base_class import get_key_from_data +from fides.api.common_exceptions import KeyValidationError +from fides.api.db.base_class import get_key_from_data def test_get_key_from_data(): diff --git a/tests/lib/test_fides_user.py b/tests/lib/test_fides_user.py index cc3a522a15..5752562f52 100644 --- a/tests/lib/test_fides_user.py +++ b/tests/lib/test_fides_user.py @@ -4,7 +4,7 @@ import pytest -from fides.api.ops.models.fides_user import FidesUser +from fides.api.models.fides_user import FidesUser def test_create_user(): diff --git a/tests/lib/test_oauth_schemas_user.py b/tests/lib/test_oauth_schemas_user.py index a0b063bb04..37ea08f752 100644 --- a/tests/lib/test_oauth_schemas_user.py +++ b/tests/lib/test_oauth_schemas_user.py @@ -2,8 +2,8 @@ import pytest -from fides.api.ops.cryptography.cryptographic_util import str_to_b64_str -from fides.api.ops.schemas.user import UserCreate, UserLogin +from fides.api.cryptography.cryptographic_util import str_to_b64_str +from fides.api.schemas.user import UserCreate, UserLogin @pytest.mark.parametrize( diff --git a/tests/lib/test_oauth_util.py b/tests/lib/test_oauth_util.py index e423147c91..03fb62f996 100644 --- a/tests/lib/test_oauth_util.py +++ b/tests/lib/test_oauth_util.py @@ -6,7 +6,7 @@ import pytest from fastapi.security import SecurityScopes -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( DATASET_CREATE_OR_UPDATE, PRIVACY_REQUEST_READ, PRIVACY_REQUEST_REVIEW, @@ -15,16 +15,16 @@ USER_PERMISSION_READ, USER_READ, ) -from fides.api.ops.common_exceptions import AuthorizationError -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.common_exceptions import AuthorizationError +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_ROLES, JWE_PAYLOAD_SCOPES, ) -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.oauth.jwt import generate_jwe -from fides.api.ops.oauth.roles import ( +from fides.api.models.client import ClientDetail +from fides.api.oauth.jwt import generate_jwe +from fides.api.oauth.roles import ( APPROVER, CONTRIBUTOR, OWNER, @@ -33,7 +33,7 @@ VIEWER_AND_APPROVER, not_contributor_scopes, ) -from fides.api.ops.oauth.utils import ( +from fides.api.oauth.utils import ( _has_direct_scopes, _has_scope_via_role, extract_payload, diff --git a/tests/lib/test_schema_base_class.py b/tests/lib/test_schema_base_class.py index c9ccc6d2cb..3644105706 100644 --- a/tests/lib/test_schema_base_class.py +++ b/tests/lib/test_schema_base_class.py @@ -1,6 +1,6 @@ # pylint: disable=missing-function-docstring -from fides.api.ops.schemas.base_class import FidesSchema, NoValidationSchema +from fides.api.schemas.base_class import FidesSchema, NoValidationSchema def test_get_field_names(): diff --git a/tests/lib/test_session.py b/tests/lib/test_session.py index 184a8f7fc5..1fb802adf1 100644 --- a/tests/lib/test_session.py +++ b/tests/lib/test_session.py @@ -1,6 +1,6 @@ import pytest -from fides.api.ops.db import session +from fides.api.db import session from fides.core.config import get_config diff --git a/tests/lib/test_system_oauth_util.py b/tests/lib/test_system_oauth_util.py index db80233bf4..c221714583 100644 --- a/tests/lib/test_system_oauth_util.py +++ b/tests/lib/test_system_oauth_util.py @@ -5,17 +5,17 @@ from fastapi.security import SecurityScopes from fideslang.models import System as SystemSchema -from fides.api.ops.api.v1.scope_registry import POLICY_CREATE_OR_UPDATE, SYSTEM_UPDATE -from fides.api.ops.common_exceptions import AuthorizationError -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.api.v1.scope_registry import POLICY_CREATE_OR_UPDATE, SYSTEM_UPDATE +from fides.api.common_exceptions import AuthorizationError +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_ROLES, JWE_PAYLOAD_SYSTEMS, ) -from fides.api.ops.oauth.jwt import generate_jwe -from fides.api.ops.oauth.roles import OWNER, VIEWER -from fides.api.ops.util.system_manager_oauth_util import ( +from fides.api.oauth.jwt import generate_jwe +from fides.api.oauth.roles import OWNER, VIEWER +from fides.api.util.system_manager_oauth_util import ( SystemAuthContainer, _get_system_from_fides_key, _get_system_from_request_body, diff --git a/tests/ops/api/test_deps.py b/tests/ops/api/test_deps.py index 467f5da7b5..67d0c5d093 100644 --- a/tests/ops/api/test_deps.py +++ b/tests/ops/api/test_deps.py @@ -5,9 +5,9 @@ from sqlalchemy.orm import Session from sqlalchemy.pool import QueuePool -import fides.api.ops.api.deps -from fides.api.ops.api.deps import get_api_session, get_cache -from fides.api.ops.common_exceptions import FunctionalityNotConfigured +import fides.api.api.deps +from fides.api.api.deps import get_api_session, get_cache +from fides.api.common_exceptions import FunctionalityNotConfigured from fides.core.config import CONFIG @@ -44,7 +44,7 @@ def test_get_api_session(config_fixture, request): request.getfixturevalue( config_fixture ) # used to invoke config fixture if provided - fides.api.ops.api.deps._engine = None + fides.api.api.deps._engine = None pool_size = CONFIG.database.api_engine_pool_size max_overflow = CONFIG.database.api_engine_max_overflow session: Session = get_api_session() diff --git a/tests/ops/api/test_ratelimit.py b/tests/ops/api/test_ratelimit.py index 52c07e77a1..04a86627f9 100644 --- a/tests/ops/api/test_ratelimit.py +++ b/tests/ops/api/test_ratelimit.py @@ -5,8 +5,8 @@ from slowapi.extension import Limiter from slowapi.util import get_remote_address +from fides.api.api.v1.urn_registry import HEALTH from fides.api.main import app -from fides.api.ops.api.v1.urn_registry import HEALTH from fides.core.config import CONFIG, SecuritySettings LIMIT = 2 diff --git a/tests/ops/api/v1/endpoints/test_config_endpoints.py b/tests/ops/api/v1/endpoints/test_config_endpoints.py index fb72c26bf3..be3f1451fd 100644 --- a/tests/ops/api/v1/endpoints/test_config_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_config_endpoints.py @@ -6,11 +6,11 @@ from sqlalchemy.orm import Session from starlette.testclient import TestClient -from fides.api.ops.api.v1 import scope_registry as scopes -from fides.api.ops.api.v1 import urn_registry as urls -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.oauth.roles import CONTRIBUTOR, OWNER, VIEWER -from fides.api.ops.schemas.storage.storage import StorageType +from fides.api.api.v1 import scope_registry as scopes +from fides.api.api.v1 import urn_registry as urls +from fides.api.models.application_config import ApplicationConfig +from fides.api.oauth.roles import CONTRIBUTOR, OWNER, VIEWER +from fides.api.schemas.storage.storage import StorageType class TestPatchApplicationConfig: diff --git a/tests/ops/api/v1/endpoints/test_connection_config_endpoints.py b/tests/ops/api/v1/endpoints/test_connection_config_endpoints.py index 841c6469bd..f4b2edfc6a 100644 --- a/tests/ops/api/v1/endpoints/test_connection_config_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_connection_config_endpoints.py @@ -10,22 +10,22 @@ from sqlalchemy.orm import Session from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CONNECTION_CREATE_OR_UPDATE, CONNECTION_DELETE, CONNECTION_READ, STORAGE_DELETE, ) -from fides.api.ops.api.v1.urn_registry import CONNECTIONS, SAAS_CONFIG, V1_URL_PREFIX -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ( +from fides.api.api.v1.urn_registry import CONNECTIONS, SAAS_CONFIG, V1_URL_PREFIX +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.manual_webhook import AccessManualWebhook -from fides.api.ops.models.privacy_request import PrivacyRequestStatus -from fides.api.ops.oauth.roles import APPROVER, OWNER, VIEWER +from fides.api.models.manual_webhook import AccessManualWebhook +from fides.api.models.privacy_request import PrivacyRequestStatus +from fides.api.oauth.roles import APPROVER, OWNER, VIEWER from tests.fixtures.application_fixtures import integration_secrets page_size = Params().size @@ -330,7 +330,7 @@ def test_patch_connections_bulk_create_limit_exceeded( == "ensure this value has at most 50 items" ) - @mock.patch("fides.api.ops.util.connection_util.queue_privacy_request") + @mock.patch("fides.api.util.connection_util.queue_privacy_request") def test_disable_manual_webhook( self, mock_queue, @@ -552,7 +552,7 @@ def test_patch_connections_bulk_update( bigquery_resource.delete(db) manual_webhook_resource.delete(db) - @mock.patch("fides.api.ops.db.base_class.OrmWrappedFidesBase.create_or_update") + @mock.patch("fides.api.db.base_class.OrmWrappedFidesBase.create_or_update") def test_patch_connections_failed_response( self, mock_create: Mock, api_client: TestClient, generate_auth_header, url ) -> None: @@ -1162,7 +1162,7 @@ def test_delete_connection_config( is None ) - @mock.patch("fides.api.ops.util.connection_util.queue_privacy_request") + @mock.patch("fides.api.util.connection_util.queue_privacy_request") def test_delete_manual_webhook_connection_config( self, mock_queue, diff --git a/tests/ops/api/v1/endpoints/test_connection_template_endpoints.py b/tests/ops/api/v1/endpoints/test_connection_template_endpoints.py index 28a19cc85d..5f09788333 100644 --- a/tests/ops/api/v1/endpoints/test_connection_template_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_connection_template_endpoints.py @@ -4,27 +4,27 @@ import pytest from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CONNECTION_READ, CONNECTION_TYPE_READ, SAAS_CONNECTION_INSTANTIATE, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( CONNECTION_TYPE_SECRETS, CONNECTION_TYPES, SAAS_CONNECTOR_FROM_TEMPLATE, V1_URL_PREFIX, ) -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.policy import ActionType -from fides.api.ops.schemas.connection_configuration.connection_config import SystemType -from fides.api.ops.service.connectors.saas.connector_registry_service import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.policy import ActionType +from fides.api.schemas.connection_configuration.connection_config import SystemType +from fides.api.service.connectors.saas.connector_registry_service import ( ConnectorRegistry, ) @@ -961,7 +961,7 @@ def test_invalid_instance_key(self, db, generate_auth_header, api_client, base_u } @mock.patch( - "fides.api.ops.api.v1.endpoints.saas_config_endpoints.upsert_dataset_config_from_template" + "fides.api.api.v1.endpoints.saas_config_endpoints.upsert_dataset_config_from_template" ) def test_dataset_config_saving_fails( self, mock_create_dataset, db, generate_auth_header, api_client, base_url diff --git a/tests/ops/api/v1/endpoints/test_consent_request_endpoints.py b/tests/ops/api/v1/endpoints/test_consent_request_endpoints.py index e622c38903..c7cf9bdd80 100644 --- a/tests/ops/api/v1/endpoints/test_consent_request_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_consent_request_endpoints.py @@ -8,23 +8,23 @@ import pytest from requests import Session -from fides.api.ops.api.v1.scope_registry import CONNECTION_READ, CONSENT_READ -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.scope_registry import CONNECTION_READ, CONSENT_READ +from fides.api.api.v1.urn_registry import ( CONSENT_REQUEST, CONSENT_REQUEST_PREFERENCES, CONSENT_REQUEST_PREFERENCES_WITH_ID, CONSENT_REQUEST_VERIFY, V1_URL_PREFIX, ) -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.models.privacy_request import ( +from fides.api.models.application_config import ApplicationConfig +from fides.api.models.privacy_request import ( Consent, ConsentRequest, PrivacyRequestStatus, ProvidedIdentity, ) -from fides.api.ops.schemas.messaging.messaging import MessagingServiceType -from fides.api.ops.util.consent_util import get_fides_user_device_id_provided_identity +from fides.api.schemas.messaging.messaging import MessagingServiceType +from fides.api.util.consent_util import get_fides_user_device_id_provided_identity from fides.core.config import CONFIG @@ -174,7 +174,7 @@ def set_notification_service_type_to_twilio_sms(self, db): "sovrn_email_connection_config", "subject_identity_verification_required", ) - @patch("fides.api.ops.service._verification.dispatch_message") + @patch("fides.api.service._verification.dispatch_message") def test_consent_request(self, mock_dispatch_message, api_client, url): data = {"email": "test@example.com"} response = api_client.post(url, json=data) @@ -186,7 +186,7 @@ def test_consent_request(self, mock_dispatch_message, api_client, url): "sovrn_email_connection_config", "subject_identity_verification_required", ) - @patch("fides.api.ops.service._verification.dispatch_message") + @patch("fides.api.service._verification.dispatch_message") def test_consent_request_identity_present( self, mock_dispatch_message, @@ -216,7 +216,7 @@ def test_consent_request_redis_disabled(self, api_client, url): "messaging_config", "sovrn_email_connection_config", ) - @patch("fides.api.ops.service._verification.dispatch_message") + @patch("fides.api.service._verification.dispatch_message") def test_consent_request_subject_verification_disabled_no_email( self, mock_dispatch_message, api_client, url ): @@ -230,7 +230,7 @@ def test_consent_request_subject_verification_disabled_no_email( "sovrn_email_connection_config", "subject_identity_verification_required", ) - @patch("fides.api.ops.service._verification.dispatch_message") + @patch("fides.api.service._verification.dispatch_message") def test_consent_request_phone_number(self, mock_dispatch_message, api_client, url): data = {"phone_number": "+3368675309"} response = api_client.post(url, json=data) @@ -242,7 +242,7 @@ def test_consent_request_phone_number(self, mock_dispatch_message, api_client, u "sovrn_email_connection_config", "subject_identity_verification_required", ) - @patch("fides.api.ops.service._verification.dispatch_message") + @patch("fides.api.service._verification.dispatch_message") def test_consent_request_email_and_phone_use_config( self, mock_dispatch_message, @@ -269,7 +269,7 @@ def test_consent_request_email_and_phone_use_config( "sovrn_email_connection_config", "subject_identity_verification_required", ) - @patch("fides.api.ops.service._verification.dispatch_message") + @patch("fides.api.service._verification.dispatch_message") def test_consent_request_email_and_phone_default_to_email( self, mock_dispatch_message, @@ -345,7 +345,7 @@ def test_consent_verify_invalid_code( @pytest.mark.usefixtures( "subject_identity_verification_required", ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_consent_verify_no_email_provided( self, mock_verify_identity: MagicMock, @@ -379,7 +379,7 @@ def test_consent_verify_no_email_provided( @pytest.mark.usefixtures( "subject_identity_verification_required", ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_consent_verify_no_consent_present( self, mock_verify_identity: MagicMock, @@ -401,7 +401,7 @@ def test_consent_verify_no_consent_present( @pytest.mark.usefixtures( "subject_identity_verification_required", ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_consent_verify_consent_preferences( self, mock_verify_identity: MagicMock, @@ -538,7 +538,7 @@ def test_consent_unverified_verification_error(self, api_client): assert response.status_code == 400 assert "turned off" in response.json()["detail"] - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_consent_unverified_no_email_provided( self, mock_verify_identity: MagicMock, @@ -566,7 +566,7 @@ def test_consent_unverified_no_email_provided( assert not mock_verify_identity.called assert "missing" in response.json()["detail"] - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_consent_unverified_no_consent_present( self, mock_verify_identity: MagicMock, @@ -582,7 +582,7 @@ def test_consent_unverified_no_consent_present( assert not mock_verify_identity.called assert response.json()["consent"] is None - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_consent_unverified_consent_preferences( self, mock_verify_identity: MagicMock, @@ -704,7 +704,7 @@ def test_set_consent_preferences_invalid_code( "subject_identity_verification_required", "automatically_approved" ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_verify_then_set_consent_preferences( self, @@ -802,7 +802,7 @@ def test_set_consent_preferences_invalid_code_respects_attempt_count( @pytest.mark.usefixtures( "subject_identity_verification_required", ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_set_consent_preferences_no_email_provided( self, mock_verify_identity: MagicMock, db, api_client, verification_code ): @@ -857,9 +857,9 @@ def test_set_consent_preferences_no_consent_present( @pytest.mark.usefixtures( "subject_identity_verification_required", "automatically_approved" ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_set_consent_consent_preferences( self, @@ -962,9 +962,9 @@ def test_set_consent_consent_preferences( @pytest.mark.usefixtures( "subject_identity_verification_required", "require_manual_request_approval" ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_set_consent_preferences_privacy_request_pending_when_id_verification_required( self, @@ -1016,7 +1016,7 @@ def test_set_consent_preferences_privacy_request_pending_when_id_verification_re assert consent_request.privacy_request.status == PrivacyRequestStatus.pending assert not mock_run_privacy_request.called - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_set_consent_consent_preferences_without_verification( self, mock_verify_identity: MagicMock, diff --git a/tests/ops/api/v1/endpoints/test_dataset_endpoints.py b/tests/ops/api/v1/endpoints/test_dataset_endpoints.py index 3a9c2102c8..54e56aef54 100644 --- a/tests/ops/api/v1/endpoints/test_dataset_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_dataset_endpoints.py @@ -14,12 +14,12 @@ from sqlalchemy.orm.attributes import flag_modified from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( DATASET_CREATE_OR_UPDATE, DATASET_DELETE, DATASET_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( DATASET_BY_KEY, DATASET_CONFIGS, DATASET_VALIDATE, @@ -28,8 +28,8 @@ V1_URL_PREFIX, YAML_DATASETS, ) -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import DatasetConfig +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import DatasetConfig def _reject_key(dict: Dict, key: str) -> Dict: @@ -832,7 +832,7 @@ def test_patch_dataset_configs_fides_key_mismatch( "'saas_connector_example' of the connection config" ) - @mock.patch("fides.api.ops.models.datasetconfig.DatasetConfig.create_or_update") + @mock.patch("fides.api.models.datasetconfig.DatasetConfig.create_or_update") def test_patch_dataset_configs_failed_response( self, mock_create: Mock, @@ -1326,9 +1326,7 @@ def test_patch_datasets_fides_key_mismatch( "'saas_connector_example' of the connection config" ) - @mock.patch( - "fides.api.ops.models.datasetconfig.DatasetConfig.upsert_with_ctl_dataset" - ) + @mock.patch("fides.api.models.datasetconfig.DatasetConfig.upsert_with_ctl_dataset") def test_patch_datasets_failed_response( self, mock_create: Mock, @@ -1422,9 +1420,7 @@ def test_patch_dataset_invalid_content( ) assert response.status_code == 400 - @mock.patch( - "fides.api.ops.models.datasetconfig.DatasetConfig.upsert_with_ctl_dataset" - ) + @mock.patch("fides.api.models.datasetconfig.DatasetConfig.upsert_with_ctl_dataset") def test_patch_datasets_failed_response( self, mock_create: Mock, diff --git a/tests/ops/api/v1/endpoints/test_drp_endpoints.py b/tests/ops/api/v1/endpoints/test_drp_endpoints.py index c3076abfd2..30dec65388 100644 --- a/tests/ops/api/v1/endpoints/test_drp_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_drp_endpoints.py @@ -8,31 +8,28 @@ from sqlalchemy.orm import Session from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( POLICY_READ, PRIVACY_REQUEST_READ, PRIVACY_REQUEST_REVIEW, STORAGE_CREATE_OR_UPDATE, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( DRP_DATA_RIGHTS, DRP_EXERCISE, DRP_REVOKE, DRP_STATUS, V1_URL_PREFIX, ) -from fides.api.ops.models.policy import DrpAction -from fides.api.ops.models.privacy_request import ( +from fides.api.models.policy import DrpAction +from fides.api.models.privacy_request import ( PrivacyRequest, PrivacyRequestError, PrivacyRequestNotifications, PrivacyRequestStatus, ) -from fides.api.ops.schemas.privacy_request import PrivacyRequestDRPStatus -from fides.api.ops.util.cache import ( - get_drp_request_body_cache_key, - get_identity_cache_key, -) +from fides.api.schemas.privacy_request import PrivacyRequestDRPStatus +from fides.api.util.cache import get_drp_request_body_cache_key, get_identity_cache_key from fides.core.config import CONFIG @@ -42,7 +39,7 @@ def url(self) -> str: return V1_URL_PREFIX + DRP_EXERCISE @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_drp_privacy_request( self, @@ -110,7 +107,7 @@ def test_create_drp_privacy_request( assert run_access_request_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_drp_privacy_request_unsupported_identity_props( self, @@ -256,10 +253,10 @@ def test_create_drp_privacy_request_no_associated_policy( @pytest.mark.usefixtures("messaging_config", "policy_drp_action") @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_drp_privacy_request_error_notification( self, diff --git a/tests/ops/api/v1/endpoints/test_encryption_endpoints.py b/tests/ops/api/v1/endpoints/test_encryption_endpoints.py index 82b5fcae5d..84f4a6ac1f 100644 --- a/tests/ops/api/v1/endpoints/test_encryption_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_encryption_endpoints.py @@ -5,21 +5,15 @@ import pytest from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( - ENCRYPTION_EXEC, - STORAGE_CREATE_OR_UPDATE, -) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.scope_registry import ENCRYPTION_EXEC, STORAGE_CREATE_OR_UPDATE +from fides.api.api.v1.urn_registry import ( DECRYPT_AES, ENCRYPT_AES, ENCRYPTION_KEY, V1_URL_PREFIX, ) -from fides.api.ops.cryptography.cryptographic_util import ( - b64_str_to_bytes, - bytes_to_b64_str, -) -from fides.api.ops.util.encryption.aes_gcm_encryption_scheme import ( +from fides.api.cryptography.cryptographic_util import b64_str_to_bytes, bytes_to_b64_str +from fides.api.util.encryption.aes_gcm_encryption_scheme import ( decrypt, encrypt_verify_secret_length, ) @@ -45,7 +39,7 @@ def test_get_encryption_key_wrong_scope( assert response.status_code == 403 @mock.patch( - "fides.api.ops.api.v1.endpoints.encryption_endpoints.cryptographic_util.generate_secure_random_string" + "fides.api.api.v1.endpoints.encryption_endpoints.cryptographic_util.generate_secure_random_string" ) def test_get_encryption_key( self, diff --git a/tests/ops/api/v1/endpoints/test_health_endpoints.py b/tests/ops/api/v1/endpoints/test_health_endpoints.py index 0dfdd0ed15..089b64625e 100644 --- a/tests/ops/api/v1/endpoints/test_health_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_health_endpoints.py @@ -1,7 +1,7 @@ from starlette.testclient import TestClient import fides -from fides.api.ops.api.v1.urn_registry import HEALTH +from fides.api.api.v1.urn_registry import HEALTH def test_health(api_client: TestClient) -> None: diff --git a/tests/ops/api/v1/endpoints/test_identity_verification_endpoints.py b/tests/ops/api/v1/endpoints/test_identity_verification_endpoints.py index 67dd9d3070..fd15ef4743 100644 --- a/tests/ops/api/v1/endpoints/test_identity_verification_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_identity_verification_endpoints.py @@ -1,8 +1,8 @@ import pytest from starlette.testclient import TestClient -from fides.api.ops.api.v1.urn_registry import ID_VERIFICATION_CONFIG, V1_URL_PREFIX -from fides.api.ops.models.application_config import ApplicationConfig +from fides.api.api.v1.urn_registry import ID_VERIFICATION_CONFIG, V1_URL_PREFIX +from fides.api.models.application_config import ApplicationConfig from fides.core.config import get_config diff --git a/tests/ops/api/v1/endpoints/test_manual_webhooks.py b/tests/ops/api/v1/endpoints/test_manual_webhooks.py index 76dea75019..81890fa6b1 100644 --- a/tests/ops/api/v1/endpoints/test_manual_webhooks.py +++ b/tests/ops/api/v1/endpoints/test_manual_webhooks.py @@ -2,20 +2,20 @@ from sqlalchemy.orm import Session from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CONNECTION_READ, STORAGE_READ, WEBHOOK_CREATE_OR_UPDATE, WEBHOOK_DELETE, WEBHOOK_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( ACCESS_MANUAL_WEBHOOK, ACCESS_MANUAL_WEBHOOKS, CONNECTION_TEST, V1_URL_PREFIX, ) -from fides.api.ops.models.manual_webhook import AccessManualWebhook +from fides.api.models.manual_webhook import AccessManualWebhook class TestGetAccessManualWebhook: diff --git a/tests/ops/api/v1/endpoints/test_masking_endpoints.py b/tests/ops/api/v1/endpoints/test_masking_endpoints.py index 60972b01f9..f0719c6370 100644 --- a/tests/ops/api/v1/endpoints/test_masking_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_masking_endpoints.py @@ -2,29 +2,25 @@ from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import MASKING_EXEC, MASKING_READ -from fides.api.ops.api.v1.urn_registry import MASKING, MASKING_STRATEGY, V1_URL_PREFIX -from fides.api.ops.schemas.masking.masking_api import MaskingAPIResponse -from fides.api.ops.schemas.masking.masking_configuration import ( +from fides.api.api.v1.scope_registry import MASKING_EXEC, MASKING_READ +from fides.api.api.v1.urn_registry import MASKING, MASKING_STRATEGY, V1_URL_PREFIX +from fides.api.schemas.masking.masking_api import MaskingAPIResponse +from fides.api.schemas.masking.masking_configuration import ( AesEncryptionMaskingConfiguration, ) -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy -from fides.api.ops.service.masking.strategy.masking_strategy_aes_encrypt import ( +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.service.masking.strategy.masking_strategy_aes_encrypt import ( AesEncryptionMaskingStrategy, ) -from fides.api.ops.service.masking.strategy.masking_strategy_hash import ( - HashMaskingStrategy, -) -from fides.api.ops.service.masking.strategy.masking_strategy_hmac import ( - HmacMaskingStrategy, -) -from fides.api.ops.service.masking.strategy.masking_strategy_nullify import ( +from fides.api.service.masking.strategy.masking_strategy_hash import HashMaskingStrategy +from fides.api.service.masking.strategy.masking_strategy_hmac import HmacMaskingStrategy +from fides.api.service.masking.strategy.masking_strategy_nullify import ( NullMaskingStrategy, ) -from fides.api.ops.service.masking.strategy.masking_strategy_random_string_rewrite import ( +from fides.api.service.masking.strategy.masking_strategy_random_string_rewrite import ( RandomStringRewriteMaskingStrategy, ) -from fides.api.ops.service.masking.strategy.masking_strategy_string_rewrite import ( +from fides.api.service.masking.strategy.masking_strategy_string_rewrite import ( StringRewriteMaskingStrategy, ) diff --git a/tests/ops/api/v1/endpoints/test_messaging_endpoints.py b/tests/ops/api/v1/endpoints/test_messaging_endpoints.py index 9be2e6d40b..7fa2869383 100644 --- a/tests/ops/api/v1/endpoints/test_messaging_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_messaging_endpoints.py @@ -7,12 +7,12 @@ from sqlalchemy.orm import Session from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( MESSAGING_CREATE_OR_UPDATE, MESSAGING_DELETE, MESSAGING_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( MESSAGING_ACTIVE_DEFAULT, MESSAGING_BY_KEY, MESSAGING_CONFIG, @@ -24,10 +24,10 @@ MESSAGING_TEST, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.models.messaging import MessagingConfig -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.common_exceptions import MessageDispatchException +from fides.api.models.application_config import ApplicationConfig +from fides.api.models.messaging import MessagingConfig +from fides.api.schemas.messaging.messaging import ( MessagingConfigStatus, MessagingConfigStatusMessage, MessagingServiceDetails, @@ -1286,7 +1286,7 @@ def test_update_default_with_invalid_secrets_key( assert "field required" in response.text assert "extra fields not permitted" in response.text - @mock.patch("fides.api.ops.models.messaging.MessagingConfig.set_secrets") + @mock.patch("fides.api.models.messaging.MessagingConfig.set_secrets") def test_update_default_set_secrets_error( self, set_secrets_mock: Mock, @@ -1833,7 +1833,7 @@ def url(self): "info", [{"phone_number": "+19198675309"}, {"email": "some@email.com"}], ) - @patch("fides.api.ops.api.v1.endpoints.messaging_endpoints.dispatch_message") + @patch("fides.api.api.v1.endpoints.messaging_endpoints.dispatch_message") def test_test_message( self, mock_dispatch_message, info, generate_auth_header, url, api_client ): @@ -1863,7 +1863,7 @@ def test_test_message_invalid(self, info, generate_auth_header, url, api_client) assert response.status_code == 400 @patch( - "fides.api.ops.api.v1.endpoints.messaging_endpoints.dispatch_message", + "fides.api.api.v1.endpoints.messaging_endpoints.dispatch_message", side_effect=MessageDispatchException("No service"), ) def test_test_message_dispatch_error( diff --git a/tests/ops/api/v1/endpoints/test_oauth_endpoints.py b/tests/ops/api/v1/endpoints/test_oauth_endpoints.py index ab4738bb89..17f9079359 100644 --- a/tests/ops/api/v1/endpoints/test_oauth_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_oauth_endpoints.py @@ -6,7 +6,7 @@ import pytest from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CLIENT_CREATE, CLIENT_DELETE, CLIENT_READ, @@ -15,7 +15,7 @@ SCOPE_REGISTRY, STORAGE_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( CLIENT, CLIENT_BY_ID, CLIENT_SCOPE, @@ -25,18 +25,18 @@ TOKEN, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import OAuth2TokenException -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.common_exceptions import OAuth2TokenException +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_ROLES, JWE_PAYLOAD_SCOPES, ) -from fides.api.ops.models.authentication_request import AuthenticationRequest -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.oauth.jwt import generate_jwe -from fides.api.ops.oauth.roles import OWNER -from fides.api.ops.oauth.utils import extract_payload +from fides.api.models.authentication_request import AuthenticationRequest +from fides.api.models.client import ClientDetail +from fides.api.oauth.jwt import generate_jwe +from fides.api.oauth.roles import OWNER +from fides.api.oauth.utils import extract_payload from fides.core.config import CONFIG @@ -480,7 +480,7 @@ def test_callback_for_missing_state(self, db, api_client: TestClient, callback_u } @mock.patch( - "fides.api.ops.api.v1.endpoints.saas_config_endpoints.OAuth2AuthorizationCodeAuthenticationStrategy.get_access_token" + "fides.api.api.v1.endpoints.saas_config_endpoints.OAuth2AuthorizationCodeAuthenticationStrategy.get_access_token" ) def test_callback_for_valid_state( self, @@ -507,7 +507,7 @@ def test_callback_for_valid_state( authentication_request.delete(db) @mock.patch( - "fides.api.ops.api.v1.endpoints.saas_config_endpoints.OAuth2AuthorizationCodeAuthenticationStrategy.get_access_token" + "fides.api.api.v1.endpoints.saas_config_endpoints.OAuth2AuthorizationCodeAuthenticationStrategy.get_access_token" ) def test_callback_for_valid_state_with_token_error( self, diff --git a/tests/ops/api/v1/endpoints/test_policy_endpoints.py b/tests/ops/api/v1/endpoints/test_policy_endpoints.py index 3cfe03eae0..b14e81be65 100644 --- a/tests/ops/api/v1/endpoints/test_policy_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_policy_endpoints.py @@ -5,25 +5,22 @@ import pytest from starlette.testclient import TestClient -from fides.api.ops.api.v1 import scope_registry as scopes -from fides.api.ops.api.v1.urn_registry import POLICY_DETAIL as POLICY_DETAIL_URI -from fides.api.ops.api.v1.urn_registry import POLICY_LIST as POLICY_CREATE_URI -from fides.api.ops.api.v1.urn_registry import RULE_DETAIL as RULE_DETAIL_URI -from fides.api.ops.api.v1.urn_registry import RULE_LIST as RULE_CREATE_URI -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1 import scope_registry as scopes +from fides.api.api.v1.urn_registry import POLICY_DETAIL as POLICY_DETAIL_URI +from fides.api.api.v1.urn_registry import POLICY_LIST as POLICY_CREATE_URI +from fides.api.api.v1.urn_registry import RULE_DETAIL as RULE_DETAIL_URI +from fides.api.api.v1.urn_registry import RULE_LIST as RULE_CREATE_URI +from fides.api.api.v1.urn_registry import ( RULE_TARGET_DETAIL, RULE_TARGET_LIST, V1_URL_PREFIX, ) -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.policy import ActionType, DrpAction, Policy, Rule, RuleTarget -from fides.api.ops.service.masking.strategy.masking_strategy_nullify import ( +from fides.api.models.client import ClientDetail +from fides.api.models.policy import ActionType, DrpAction, Policy, Rule, RuleTarget +from fides.api.service.masking.strategy.masking_strategy_nullify import ( NullMaskingStrategy, ) -from fides.api.ops.util.data_category import ( - DataCategory, - generate_fides_data_categories, -) +from fides.api.util.data_category import DataCategory, generate_fides_data_categories class TestGetPolicies: diff --git a/tests/ops/api/v1/endpoints/test_policy_webhook_endpoints.py b/tests/ops/api/v1/endpoints/test_policy_webhook_endpoints.py index 10b0268eea..f53857297e 100644 --- a/tests/ops/api/v1/endpoints/test_policy_webhook_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_policy_webhook_endpoints.py @@ -3,21 +3,21 @@ import pytest -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( POLICY_READ, WEBHOOK_CREATE_OR_UPDATE, WEBHOOK_DELETE, WEBHOOK_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( POLICY_POST_WEBHOOK_DETAIL, POLICY_PRE_WEBHOOK_DETAIL, POLICY_WEBHOOKS_POST, POLICY_WEBHOOKS_PRE, V1_URL_PREFIX, ) -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.policy import PolicyPostWebhook, PolicyPreWebhook +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.policy import PolicyPostWebhook, PolicyPreWebhook from tests.ops.api.v1.endpoints.test_privacy_request_endpoints import stringify_date diff --git a/tests/ops/api/v1/endpoints/test_privacy_experience_config_endpoints.py b/tests/ops/api/v1/endpoints/test_privacy_experience_config_endpoints.py index 52f29255a0..9e7296a586 100644 --- a/tests/ops/api/v1/endpoints/test_privacy_experience_config_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_privacy_experience_config_endpoints.py @@ -4,18 +4,18 @@ from starlette.status import HTTP_200_OK, HTTP_201_CREATED, HTTP_403_FORBIDDEN from starlette.testclient import TestClient -from fides.api.ops.api.v1 import scope_registry as scopes -from fides.api.ops.api.v1.endpoints.privacy_experience_config_endpoints import ( +from fides.api.api.v1 import scope_registry as scopes +from fides.api.api.v1.endpoints.privacy_experience_config_endpoints import ( get_experience_config_or_error, ) -from fides.api.ops.api.v1.urn_registry import EXPERIENCE_CONFIG, V1_URL_PREFIX -from fides.api.ops.models.privacy_experience import ( +from fides.api.api.v1.urn_registry import EXPERIENCE_CONFIG, V1_URL_PREFIX +from fides.api.models.privacy_experience import ( ComponentType, DeliveryMechanism, PrivacyExperience, PrivacyExperienceConfig, ) -from fides.api.ops.models.privacy_notice import ( +from fides.api.models.privacy_notice import ( ConsentMechanism, EnforcementLevel, PrivacyNotice, diff --git a/tests/ops/api/v1/endpoints/test_privacy_experience_endpoints.py b/tests/ops/api/v1/endpoints/test_privacy_experience_endpoints.py index 2d7481edb2..be480f02a5 100644 --- a/tests/ops/api/v1/endpoints/test_privacy_experience_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_privacy_experience_endpoints.py @@ -4,8 +4,8 @@ from starlette.status import HTTP_200_OK, HTTP_403_FORBIDDEN from starlette.testclient import TestClient -from fides.api.ops.api.v1 import scope_registry as scopes -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1 import scope_registry as scopes +from fides.api.api.v1.urn_registry import ( PRIVACY_EXPERIENCE, PRIVACY_EXPERIENCE_DETAIL, V1_URL_PREFIX, diff --git a/tests/ops/api/v1/endpoints/test_privacy_notice_endpoints.py b/tests/ops/api/v1/endpoints/test_privacy_notice_endpoints.py index c6178c4eed..08d9f9e4f6 100644 --- a/tests/ops/api/v1/endpoints/test_privacy_notice_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_privacy_notice_endpoints.py @@ -10,30 +10,30 @@ from starlette.exceptions import HTTPException from starlette.testclient import TestClient -from fides.api.ctl.sql_models import DataUse as sql_DataUse -from fides.api.ops.api.v1 import scope_registry as scopes -from fides.api.ops.api.v1.endpoints.privacy_notice_endpoints import ( +from fides.api.api.v1 import scope_registry as scopes +from fides.api.api.v1.endpoints.privacy_notice_endpoints import ( validate_notice_data_uses, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( PRIVACY_NOTICE, PRIVACY_NOTICE_BY_DATA_USE, PRIVACY_NOTICE_DETAIL, V1_URL_PREFIX, ) -from fides.api.ops.models.privacy_experience import ( +from fides.api.ctl.sql_models import DataUse as sql_DataUse +from fides.api.models.privacy_experience import ( ComponentType, DeliveryMechanism, PrivacyExperience, ) -from fides.api.ops.models.privacy_notice import ( +from fides.api.models.privacy_notice import ( ConsentMechanism, EnforcementLevel, PrivacyNotice, PrivacyNoticeHistory, PrivacyNoticeRegion, ) -from fides.api.ops.schemas.privacy_notice import ( +from fides.api.schemas.privacy_notice import ( PrivacyNoticeCreation, PrivacyNoticeResponse, ) diff --git a/tests/ops/api/v1/endpoints/test_privacy_preference_endpoints.py b/tests/ops/api/v1/endpoints/test_privacy_preference_endpoints.py index 6f7364e089..2418cf9d37 100644 --- a/tests/ops/api/v1/endpoints/test_privacy_preference_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_privacy_preference_endpoints.py @@ -7,12 +7,12 @@ from starlette.status import HTTP_200_OK, HTTP_403_FORBIDDEN from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CONSENT_READ, CURRENT_PRIVACY_PREFERENCE_READ, PRIVACY_PREFERENCE_HISTORY_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( CONSENT_REQUEST_PRIVACY_PREFERENCES_VERIFY, CONSENT_REQUEST_PRIVACY_PREFERENCES_WITH_ID, CURRENT_PRIVACY_PREFERENCES_REPORT, @@ -20,20 +20,20 @@ PRIVACY_PREFERENCES, V1_URL_PREFIX, ) -from fides.api.ops.models.privacy_preference import ( +from fides.api.models.privacy_preference import ( ConsentMethod, CurrentPrivacyPreference, PrivacyPreferenceHistory, RequestOrigin, UserConsentPreference, ) -from fides.api.ops.models.privacy_request import ( +from fides.api.models.privacy_request import ( ConsentRequest, ExecutionLogStatus, PrivacyRequestStatus, ProvidedIdentity, ) -from fides.api.ops.schemas.privacy_notice import PrivacyNoticeHistorySchema +from fides.api.schemas.privacy_notice import PrivacyNoticeHistorySchema from fides.core.config import CONFIG @@ -122,10 +122,10 @@ def test_set_privacy_preferences_invalid_code( "subject_identity_verification_required", "automatically_approved", "system" ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_preference_endpoints.anonymize_ip_address" + "fides.api.api.v1.endpoints.privacy_preference_endpoints.anonymize_ip_address" ) def test_verify_then_set_privacy_preferences( self, @@ -201,10 +201,10 @@ def test_verify_then_set_privacy_preferences( "subject_identity_verification_not_required", "automatically_approved" ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_preference_endpoints.anonymize_ip_address" + "fides.api.api.v1.endpoints.privacy_preference_endpoints.anonymize_ip_address" ) def test_set_privacy_preferences_privacy_center_fides_user_device_id_only( self, @@ -352,7 +352,7 @@ def test_set_privacy_preferences_invalid_code_respects_attempt_count( @pytest.mark.usefixtures( "subject_identity_verification_required", ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_set_privacy_preferences_no_email_provided( self, mock_verify_identity: MagicMock, @@ -463,9 +463,9 @@ def test_set_duplicate_preferences_for_the_same_notice_in_one_request( "consent_policy", "system", ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_set_privacy_preferences( self, @@ -584,9 +584,9 @@ def test_set_privacy_preferences( @pytest.mark.usefixtures( "subject_identity_verification_required", "automatically_approved" ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_set_privacy_preferences_bad_policy_key( self, @@ -645,9 +645,9 @@ def test_set_privacy_preferences_bad_policy_key( privacy_preference_history_created.delete(db) @pytest.mark.usefixtures("automatically_approved", "system") - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_set_privacy_preferences_without_verification_required( self, @@ -712,7 +712,7 @@ def test_set_privacy_preferences_without_verification_required( "subject_identity_verification_required", "automatically_approved", "system" ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_verify_then_set_privacy_preferences_with_additional_fides_user_device_id( self, @@ -866,7 +866,7 @@ def test_consent_verify_invalid_code( @pytest.mark.usefixtures( "subject_identity_verification_required", ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_consent_verify_no_email_provided( self, mock_verify_identity: MagicMock, @@ -900,7 +900,7 @@ def test_consent_verify_no_email_provided( @pytest.mark.usefixtures( "subject_identity_verification_required", ) - @patch("fides.api.ops.models.privacy_request.ConsentRequest.verify_identity") + @patch("fides.api.models.privacy_request.ConsentRequest.verify_identity") def test_consent_verify_no_privacy_preferences_present( self, mock_verify_identity: MagicMock, @@ -1029,7 +1029,7 @@ def test_save_privacy_preferences_bad_experience_id( ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_preference_endpoints.anonymize_ip_address" + "fides.api.api.v1.endpoints.privacy_preference_endpoints.anonymize_ip_address" ) def test_save_privacy_preferences_with_respect_to_fides_user_device_id( self, diff --git a/tests/ops/api/v1/endpoints/test_privacy_request_endpoints.py b/tests/ops/api/v1/endpoints/test_privacy_request_endpoints.py index 256a0ebe23..b05d9c6e1e 100644 --- a/tests/ops/api/v1/endpoints/test_privacy_request_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_privacy_request_endpoints.py @@ -14,11 +14,11 @@ from fastapi_pagination import Params from starlette.testclient import TestClient -from fides.api.ops.api.v1.endpoints.privacy_request_endpoints import ( +from fides.api.api.v1.endpoints.privacy_request_endpoints import ( EMBEDDED_EXECUTION_LOG_LIMIT, validate_manual_input, ) -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( DATASET_CREATE_OR_UPDATE, PRIVACY_REQUEST_CALLBACK_RESUME, PRIVACY_REQUEST_CREATE, @@ -31,7 +31,7 @@ PRIVACY_REQUEST_VIEW_DATA, STORAGE_CREATE_OR_UPDATE, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( DATASETS, PRIVACY_REQUEST_ACCESS_MANUAL_WEBHOOK_INPUT, PRIVACY_REQUEST_APPROVE, @@ -50,21 +50,21 @@ REQUEST_PREVIEW, V1_URL_PREFIX, ) -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_ROLES, JWE_PAYLOAD_SCOPES, ) -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.models.audit_log import AuditLog, AuditLogAction -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.policy import ActionType, CurrentStep, Policy -from fides.api.ops.models.privacy_request import ( +from fides.api.graph.config import CollectionAddress +from fides.api.graph.graph import DatasetGraph +from fides.api.models.application_config import ApplicationConfig +from fides.api.models.audit_log import AuditLog, AuditLogAction +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.policy import ActionType, CurrentStep, Policy +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, ManualAction, @@ -73,22 +73,22 @@ PrivacyRequestNotifications, PrivacyRequestStatus, ) -from fides.api.ops.oauth.jwt import generate_jwe -from fides.api.ops.oauth.roles import APPROVER, VIEWER -from fides.api.ops.schemas.dataset import DryRunDatasetResponse -from fides.api.ops.schemas.masking.masking_secrets import SecretType -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.oauth.jwt import generate_jwe +from fides.api.oauth.roles import APPROVER, VIEWER +from fides.api.schemas.dataset import DryRunDatasetResponse +from fides.api.schemas.masking.masking_secrets import SecretType +from fides.api.schemas.messaging.messaging import ( MessagingActionType, MessagingServiceType, RequestReceiptBodyParams, RequestReviewDenyBodyParams, SubjectIdentityVerificationBodyParams, ) -from fides.api.ops.schemas.policy import PolicyResponse -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.task import graph_task -from fides.api.ops.tasks import MESSAGING_QUEUE_NAME -from fides.api.ops.util.cache import ( +from fides.api.schemas.policy import PolicyResponse +from fides.api.schemas.redis_cache import Identity +from fides.api.task import graph_task +from fides.api.tasks import MESSAGING_QUEUE_NAME +from fides.api.util.cache import ( get_encryption_cache_key, get_identity_cache_key, get_masking_secret_cache_key, @@ -108,10 +108,10 @@ def url(self, oauth_client: ClientDetail, policy) -> str: return V1_URL_PREFIX + PRIVACY_REQUESTS @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_create_privacy_request( self, @@ -140,7 +140,7 @@ def test_create_privacy_request( assert not mock_dispatch_message.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_stores_identities( self, @@ -174,7 +174,7 @@ def test_create_privacy_request_stores_identities( assert run_access_request_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_require_manual_approval( self, @@ -202,7 +202,7 @@ def test_create_privacy_request_require_manual_approval( assert not run_access_request_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_with_masking_configuration( self, @@ -228,7 +228,7 @@ def test_create_privacy_request_with_masking_configuration( assert run_access_request_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_access_request" + "fides.api.service.privacy_request.request_runner_service.run_access_request" ) def test_create_privacy_request_limit_exceeded( self, @@ -257,7 +257,7 @@ def test_create_privacy_request_limit_exceeded( ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_starts_processing( self, @@ -282,7 +282,7 @@ def test_create_privacy_request_starts_processing( pr.delete(db=db) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_with_external_id( self, @@ -312,7 +312,7 @@ def test_create_privacy_request_with_external_id( assert run_access_request_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_caches_identity( self, @@ -345,7 +345,7 @@ def test_create_privacy_request_caches_identity( assert run_access_request_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_caches_masking_secrets( self, @@ -394,7 +394,7 @@ def test_create_privacy_request_invalid_encryption_values( assert resp.json()["detail"][0]["msg"] == "Encryption key must be 16 bytes long" @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_caches_encryption_keys( self, @@ -472,7 +472,7 @@ def test_create_privacy_request_registers_async_task( pr.delete(db=db) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_creates_system_audit_log( self, @@ -507,10 +507,10 @@ def test_create_privacy_request_creates_system_audit_log( @pytest.mark.usefixtures("messaging_config") @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_error_notification( self, @@ -1529,7 +1529,7 @@ def test_get_privacy_requests_sets_days_left( assert data["days_left"] == days_left @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_sort_privacy_request_by_due_date( self, @@ -1853,7 +1853,7 @@ def test_approve_privacy_request_viewer_role( assert response.status_code == 403 @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_approve_privacy_request_approver_role( self, _, url, api_client, generate_role_header, privacy_request, db @@ -1867,7 +1867,7 @@ def test_approve_privacy_request_approver_role( assert response.status_code == 200 @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_approve_privacy_request_does_not_exist( self, submit_mock, db, url, api_client, generate_auth_header, privacy_request @@ -1892,7 +1892,7 @@ def test_approve_privacy_request_does_not_exist( [PrivacyRequestStatus.complete, PrivacyRequestStatus.canceled], ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_approve_privacy_request_in_non_pending_state( self, @@ -1922,7 +1922,7 @@ def test_approve_privacy_request_in_non_pending_state( assert not submit_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_approve_privacy_request_no_user_on_client( self, @@ -1953,10 +1953,10 @@ def test_approve_privacy_request_no_user_on_client( assert submit_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_approve_privacy_request( self, @@ -2001,10 +2001,10 @@ def test_approve_privacy_request( privacy_request.delete(db) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_approve_privacy_request_creates_audit_log_and_sends_email( self, @@ -2086,7 +2086,7 @@ def test_deny_privacy_request_bad_scopes( assert response.status_code == 403 @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_deny_privacy_request_does_not_exist( self, submit_mock, db, url, api_client, generate_auth_header, privacy_request @@ -2107,7 +2107,7 @@ def test_deny_privacy_request_does_not_exist( assert not submit_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_deny_completed_privacy_request( self, submit_mock, db, url, api_client, generate_auth_header, privacy_request @@ -2128,10 +2128,10 @@ def test_deny_completed_privacy_request( assert not submit_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_deny_privacy_request_without_denial_reason( self, @@ -2199,10 +2199,10 @@ def test_deny_privacy_request_without_denial_reason( privacy_request.delete(db) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_deny_privacy_request_with_denial_reason( self, @@ -2375,7 +2375,7 @@ def test_resume_privacy_request_not_paused( privacy_request.delete(db) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_resume_privacy_request( self, @@ -2529,7 +2529,7 @@ def test_resume_with_manual_input_invalid_data( privacy_request.delete(db) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @pytest.mark.usefixtures( "postgres_example_test_dataset_config", "manual_dataset_config" @@ -2710,7 +2710,7 @@ def test_resume_still_paused_at_access_request( "postgres_example_test_dataset_config", "manual_dataset_config" ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_resume_with_manual_count( self, @@ -2799,7 +2799,7 @@ def test_restart_from_failure_no_stopped_step( assert privacy_requests[0].id in failed_ids @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_restart_from_failure_from_specific_collection( self, submit_mock, api_client, url, generate_auth_header, db, privacy_requests @@ -2832,7 +2832,7 @@ def test_restart_from_failure_from_specific_collection( ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_restart_from_failure_outside_graph( self, submit_mock, api_client, url, generate_auth_header, db, privacy_requests @@ -2865,7 +2865,7 @@ def test_restart_from_failure_outside_graph( ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_mixed_result( self, submit_mock, api_client, url, generate_auth_header, db, privacy_requests @@ -2952,7 +2952,7 @@ def test_restart_from_failure_no_stopped_step( privacy_request.delete(db) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_restart_from_failure_from_specific_collection( self, submit_mock, api_client, url, generate_auth_header, db, privacy_request @@ -2979,7 +2979,7 @@ def test_restart_from_failure_from_specific_collection( ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_restart_from_failure_outside_graph( self, submit_mock, api_client, url, generate_auth_header, db, privacy_request @@ -3035,7 +3035,7 @@ def test_incorrect_privacy_request_status(self, api_client, url, privacy_request ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_verification_code_expired( self, @@ -3059,7 +3059,7 @@ def test_verification_code_expired( assert not mock_dispatch_message.called @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_invalid_code( self, @@ -3084,7 +3084,7 @@ def test_invalid_code( assert not mock_dispatch_message.called @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_too_many_attempts( self, @@ -3124,10 +3124,10 @@ def test_too_many_attempts( assert privacy_request._get_cached_verification_code_attempt_count() == 0 @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_verify_identity_no_admin_approval_needed( self, @@ -3187,10 +3187,10 @@ def test_verify_identity_no_admin_approval_needed( assert queue == MESSAGING_QUEUE_NAME @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_verify_identity_no_admin_approval_needed_email_disabled( self, @@ -3232,10 +3232,10 @@ def test_verify_identity_no_admin_approval_needed_email_disabled( assert not mock_dispatch_message.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_verify_identity_admin_approval_needed( self, @@ -3340,9 +3340,9 @@ def test_create_privacy_request_no_email_config( pr.delete(db=db) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) - @mock.patch("fides.api.ops.service._verification.dispatch_message") + @mock.patch("fides.api.service._verification.dispatch_message") def test_create_privacy_request_with_email_config( self, mock_dispatch_message, @@ -3795,7 +3795,7 @@ def test_resume_from_requires_input_status_missing_cached_data( ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_resume_from_requires_input_status_data_empty_but_confirmed( self, @@ -3825,7 +3825,7 @@ def test_resume_from_requires_input_status_data_empty_but_confirmed( assert call_kwargs["from_step"] is None @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_resume_from_requires_input_status( self, @@ -3867,10 +3867,10 @@ def privacy_request_receipt_notification_enabled(self, db): ApplicationConfig.update_config_set(db, CONFIG) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_create_privacy_request_no_email_config( self, @@ -3918,10 +3918,10 @@ def test_create_privacy_request_no_email_config( pr.delete(db=db) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) @mock.patch( - "fides.api.ops.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" + "fides.api.api.v1.endpoints.privacy_request_endpoints.dispatch_message_task.apply_async" ) def test_create_privacy_request_with_email_config( self, @@ -3984,7 +3984,7 @@ def verification_config(self, db): ApplicationConfig.update_config_set(db, CONFIG) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request( self, @@ -4010,7 +4010,7 @@ def test_create_privacy_request( @pytest.mark.usefixtures("verification_config") @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_bypass_verification( self, @@ -4062,7 +4062,7 @@ def test_create_privacy_requests_wrong_scope( assert 403 == response.status_code @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_stores_identities( self, @@ -4098,7 +4098,7 @@ def test_create_privacy_request_stores_identities( @pytest.mark.usefixtures("require_manual_request_approval") @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_require_manual_approval( self, @@ -4124,7 +4124,7 @@ def test_create_privacy_request_require_manual_approval( assert not run_access_request_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_with_masking_configuration( self, @@ -4148,7 +4148,7 @@ def test_create_privacy_request_with_masking_configuration( assert len(response_data) == 1 @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_access_request" + "fides.api.service.privacy_request.request_runner_service.run_access_request" ) def test_create_privacy_request_limit_exceeded( self, @@ -4178,7 +4178,7 @@ def test_create_privacy_request_limit_exceeded( ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_starts_processing( self, @@ -4201,7 +4201,7 @@ def test_create_privacy_request_starts_processing( assert resp.status_code == 200 @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_with_external_id( self, @@ -4232,7 +4232,7 @@ def test_create_privacy_request_with_external_id( assert run_access_request_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_caches_identity( self, @@ -4266,7 +4266,7 @@ def test_create_privacy_request_caches_identity( assert run_access_request_mock.called @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_caches_masking_secrets( self, @@ -4317,7 +4317,7 @@ def test_create_privacy_request_invalid_encryption_values( assert resp.json()["detail"][0]["msg"] == "Encryption key must be 16 bytes long" @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_caches_encryption_keys( self, @@ -4398,7 +4398,7 @@ def test_create_privacy_request_registers_async_task( assert pr.get_async_execution_task() is not None @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_privacy_request.delay" + "fides.api.service.privacy_request.request_runner_service.run_privacy_request.delay" ) def test_create_privacy_request_creates_system_audit_log( self, diff --git a/tests/ops/api/v1/endpoints/test_registration_endpoints.py b/tests/ops/api/v1/endpoints/test_registration_endpoints.py index 84cc29dafb..820845a5f1 100644 --- a/tests/ops/api/v1/endpoints/test_registration_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_registration_endpoints.py @@ -2,8 +2,8 @@ import pytest -from fides.api.ops.api.v1.urn_registry import REGISTRATION, V1_URL_PREFIX -from fides.api.ops.models.registration import UserRegistration +from fides.api.api.v1.urn_registry import REGISTRATION, V1_URL_PREFIX +from fides.api.models.registration import UserRegistration class TestUserRegistration: @@ -48,9 +48,7 @@ def test_get_registration_opt_in( data = resp.json() assert data["opt_in"] == True - @mock.patch( - "fides.api.ops.api.v1.endpoints.registration_endpoints.send_registration" - ) + @mock.patch("fides.api.api.v1.endpoints.registration_endpoints.send_registration") def test_register_user( self, send_registration_mock, @@ -77,9 +75,7 @@ def test_register_user( assert len(UserRegistration.all(db)) == 1 assert send_registration_mock.call_count == 1 - @mock.patch( - "fides.api.ops.api.v1.endpoints.registration_endpoints.send_registration" - ) + @mock.patch("fides.api.api.v1.endpoints.registration_endpoints.send_registration") def test_register_user_upserts_locally( self, send_registration_mock, @@ -121,9 +117,7 @@ def test_register_user_no_analytics_id( assert resp.status_code == 422 assert len(UserRegistration.all(db)) == 0 - @mock.patch( - "fides.api.ops.api.v1.endpoints.registration_endpoints.send_registration" - ) + @mock.patch("fides.api.api.v1.endpoints.registration_endpoints.send_registration") def test_register_user_one_allowed( self, send_registration_mock, diff --git a/tests/ops/api/v1/endpoints/test_saas_config_endpoints.py b/tests/ops/api/v1/endpoints/test_saas_config_endpoints.py index b59b991b8b..34abe3d6f0 100644 --- a/tests/ops/api/v1/endpoints/test_saas_config_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_saas_config_endpoints.py @@ -7,7 +7,7 @@ from sqlalchemy.orm import Session from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CLIENT_READ, CONNECTION_AUTHORIZE, CONNECTOR_TEMPLATE_REGISTER, @@ -15,14 +15,14 @@ SAAS_CONFIG_DELETE, SAAS_CONFIG_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( AUTHORIZE, REGISTER_CONNECTOR_TEMPLATE, SAAS_CONFIG, SAAS_CONFIG_VALIDATE, V1_URL_PREFIX, ) -from fides.api.ops.models.connectionconfig import ( +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, @@ -441,7 +441,7 @@ def test_client_wrong_scope( assert 403 == response.status_code @mock.patch( - "fides.api.ops.api.v1.endpoints.saas_config_endpoints.OAuth2AuthorizationCodeAuthenticationStrategy.get_authorization_url" + "fides.api.api.v1.endpoints.saas_config_endpoints.OAuth2AuthorizationCodeAuthenticationStrategy.get_authorization_url" ) def test_get_authorize_url( self, @@ -783,7 +783,7 @@ def test_register_connector_template_wrong_scope( ], ) @mock.patch( - "fides.api.ops.service.connectors.saas.connector_registry_service.register_custom_functions" + "fides.api.service.connectors.saas.connector_registry_service.register_custom_functions" ) # prevent functions from being registered to avoid test conflicts def test_register_connector_template_allow_custom_connector_functions( self, diff --git a/tests/ops/api/v1/endpoints/test_storage_endpoints.py b/tests/ops/api/v1/endpoints/test_storage_endpoints.py index 0d787e2884..2f388a00f4 100644 --- a/tests/ops/api/v1/endpoints/test_storage_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_storage_endpoints.py @@ -8,12 +8,12 @@ from sqlalchemy.orm import Session from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( STORAGE_CREATE_OR_UPDATE, STORAGE_DELETE, STORAGE_READ, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( STORAGE_ACTIVE_DEFAULT, STORAGE_BY_KEY, STORAGE_CONFIG, @@ -25,12 +25,12 @@ STORAGE_UPLOAD, V1_URL_PREFIX, ) -from fides.api.ops.common_exceptions import KeyOrNameAlreadyExists, KeyValidationError -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.storage import StorageConfig, default_storage_config_name -from fides.api.ops.schemas.storage.data_upload_location_response import DataUpload -from fides.api.ops.schemas.storage.storage import ( +from fides.api.common_exceptions import KeyOrNameAlreadyExists, KeyValidationError +from fides.api.models.application_config import ApplicationConfig +from fides.api.models.client import ClientDetail +from fides.api.models.storage import StorageConfig, default_storage_config_name +from fides.api.schemas.storage.data_upload_location_response import DataUpload +from fides.api.schemas.storage.storage import ( FileNaming, ResponseFormat, S3AuthMethod, @@ -82,7 +82,7 @@ def test_invalid_privacy_request( response = api_client.post(url, headers=auth_header, json=payload) assert 404 == response.status_code - @mock.patch("fides.api.ops.api.v1.endpoints.storage_endpoints.upload") + @mock.patch("fides.api.api.v1.endpoints.storage_endpoints.upload") def test_post_upload_data( self, mock_post_upload_data: Mock, @@ -399,7 +399,7 @@ def test_put_config_secrets_without_verifying( == "23451345834789" ) - @mock.patch("fides.api.ops.api.v1.endpoints.storage_endpoints.secrets_are_valid") + @mock.patch("fides.api.api.v1.endpoints.storage_endpoints.secrets_are_valid") def test_put_config_secrets_and_verify( self, mock_valid: Mock, @@ -441,7 +441,7 @@ def test_put_config_secrets_and_verify( } @mock.patch( - "fides.api.ops.service.storage.storage_authenticator_service.get_s3_session" + "fides.api.service.storage.storage_authenticator_service.get_s3_session" ) def test_put_s3_config_secrets_and_verify( self, @@ -1012,7 +1012,7 @@ def test_put_default_storage_config_missing_detail( assert "field required" in response.text assert "bucket" in response.text - @mock.patch("fides.api.ops.models.storage.StorageConfig.create_or_update") + @mock.patch("fides.api.models.storage.StorageConfig.create_or_update") def test_put_default_config_key_or_name_exists( self, mock_create_or_update: Mock, @@ -1037,7 +1037,7 @@ def test_put_default_config_key_or_name_exists( assert 400 == response.status_code - @mock.patch("fides.api.ops.models.storage.StorageConfig.create_or_update") + @mock.patch("fides.api.models.storage.StorageConfig.create_or_update") def test_put_default_config_key_error( self, mock_create_or_update: Mock, @@ -1121,7 +1121,7 @@ def test_update_default_with_invalid_secrets_key( ] } - @mock.patch("fides.api.ops.models.storage.StorageConfig.set_secrets") + @mock.patch("fides.api.models.storage.StorageConfig.set_secrets") def test_update_default_set_secrets_error( self, set_secrets_mock: Mock, @@ -1170,7 +1170,7 @@ def test_put_default_config_secrets_without_verifying( == "23451345834789" ) - @mock.patch("fides.api.ops.api.v1.endpoints.storage_endpoints.secrets_are_valid") + @mock.patch("fides.api.api.v1.endpoints.storage_endpoints.secrets_are_valid") def test_put_default_config_secrets_and_verify( self, mock_valid: Mock, @@ -1212,7 +1212,7 @@ def test_put_default_config_secrets_and_verify( } @mock.patch( - "fides.api.ops.service.storage.storage_authenticator_service.get_s3_session" + "fides.api.service.storage.storage_authenticator_service.get_s3_session" ) def test_put_default_s3_config_secrets_and_verify( self, diff --git a/tests/ops/api/v1/endpoints/test_system.py b/tests/ops/api/v1/endpoints/test_system.py index a3ac0e7734..fab8454640 100644 --- a/tests/ops/api/v1/endpoints/test_system.py +++ b/tests/ops/api/v1/endpoints/test_system.py @@ -10,12 +10,12 @@ ) from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CONNECTION_CREATE_OR_UPDATE, CONNECTION_READ, STORAGE_DELETE, ) -from fides.api.ops.api.v1.urn_registry import V1_URL_PREFIX +from fides.api.api.v1.urn_registry import V1_URL_PREFIX from tests.ops.api.v1.endpoints.test_connection_config_endpoints import ( TestPatchConnections, ) diff --git a/tests/ops/api/v1/endpoints/test_user_endpoints.py b/tests/ops/api/v1/endpoints/test_user_endpoints.py index 938f74b96f..7c87979a76 100644 --- a/tests/ops/api/v1/endpoints/test_user_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_user_endpoints.py @@ -16,8 +16,7 @@ ) from starlette.testclient import TestClient -from fides.api.ctl.sql_models import PrivacyDeclaration, System -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( PRIVACY_REQUEST_READ, SCOPE_REGISTRY, STORAGE_READ, @@ -30,26 +29,27 @@ USER_READ, USER_UPDATE, ) -from fides.api.ops.api.v1.urn_registry import ( +from fides.api.api.v1.urn_registry import ( LOGIN, LOGOUT, USER_DETAIL, USERS, V1_URL_PREFIX, ) -from fides.api.ops.cryptography.cryptographic_util import str_to_b64_str -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.cryptography.cryptographic_util import str_to_b64_str +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_ROLES, JWE_PAYLOAD_SCOPES, ) -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.fides_user_permissions import FidesUserPermissions -from fides.api.ops.oauth.jwt import generate_jwe -from fides.api.ops.oauth.roles import APPROVER, CONTRIBUTOR, OWNER, VIEWER -from fides.api.ops.oauth.utils import extract_payload +from fides.api.ctl.sql_models import PrivacyDeclaration, System +from fides.api.models.client import ClientDetail +from fides.api.models.fides_user import FidesUser +from fides.api.models.fides_user_permissions import FidesUserPermissions +from fides.api.oauth.jwt import generate_jwe +from fides.api.oauth.roles import APPROVER, CONTRIBUTOR, OWNER, VIEWER +from fides.api.oauth.utils import extract_payload from fides.core.config import CONFIG from tests.conftest import generate_auth_header_for_user diff --git a/tests/ops/api/v1/endpoints/test_user_permission_endpoints.py b/tests/ops/api/v1/endpoints/test_user_permission_endpoints.py index 766f59ab97..45582fb5c7 100644 --- a/tests/ops/api/v1/endpoints/test_user_permission_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_user_permission_endpoints.py @@ -8,7 +8,7 @@ HTTP_422_UNPROCESSABLE_ENTITY, ) -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( PRIVACY_REQUEST_READ, SAAS_CONFIG_READ, SCOPE_REGISTRY, @@ -17,11 +17,11 @@ USER_PERMISSION_READ, USER_PERMISSION_UPDATE, ) -from fides.api.ops.api.v1.urn_registry import USER_PERMISSIONS, V1_URL_PREFIX -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.fides_user_permissions import FidesUserPermissions -from fides.api.ops.oauth.roles import ( +from fides.api.api.v1.urn_registry import USER_PERMISSIONS, V1_URL_PREFIX +from fides.api.models.client import ClientDetail +from fides.api.models.fides_user import FidesUser +from fides.api.models.fides_user_permissions import FidesUserPermissions +from fides.api.oauth.roles import ( APPROVER, CONTRIBUTOR, OWNER, diff --git a/tests/ops/api/v1/test_exception_handlers.py b/tests/ops/api/v1/test_exception_handlers.py index 68e61cf00a..42cf70823b 100644 --- a/tests/ops/api/v1/test_exception_handlers.py +++ b/tests/ops/api/v1/test_exception_handlers.py @@ -3,8 +3,8 @@ import pytest from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import CLIENT_CREATE -from fides.api.ops.api.v1.urn_registry import HEALTH, PRIVACY_REQUESTS, V1_URL_PREFIX +from fides.api.api.v1.scope_registry import CLIENT_CREATE +from fides.api.api.v1.urn_registry import HEALTH, PRIVACY_REQUESTS, V1_URL_PREFIX from fides.core.config import CONFIG diff --git a/tests/ops/api/v1/test_main.py b/tests/ops/api/v1/test_main.py index 46f04f7f69..4525d8ae29 100644 --- a/tests/ops/api/v1/test_main.py +++ b/tests/ops/api/v1/test_main.py @@ -4,7 +4,7 @@ from starlette.testclient import TestClient from fides.api.main import create_fides_app -from fides.api.ops.oauth.utils import ( +from fides.api.oauth.utils import ( get_root_client, verify_oauth_client, verify_oauth_client_prod, diff --git a/tests/ops/api/v1/test_utils.py b/tests/ops/api/v1/test_utils.py index 6248d8eae1..c79296207c 100644 --- a/tests/ops/api/v1/test_utils.py +++ b/tests/ops/api/v1/test_utils.py @@ -4,12 +4,12 @@ import pytest from fastapi import HTTPException -from fides.api.ops.api.v1.endpoints.utils import ( +from fides.api.api.v1.endpoints.utils import ( human_friendly_list, transform_fields, validate_start_and_end_filters, ) -from fides.api.ops.schemas.privacy_notice import PrivacyNotice +from fides.api.schemas.privacy_notice import PrivacyNotice class TestValidateStartAndEndFilters: diff --git a/tests/ops/conftest.py b/tests/ops/conftest.py index 8aa661f2de..53b539009d 100644 --- a/tests/ops/conftest.py +++ b/tests/ops/conftest.py @@ -9,9 +9,9 @@ from sqlalchemy.orm.exc import ObjectDeletedError from fides.api.ctl.sql_models import DataCategory as DataCategoryDbModel -from fides.api.ops.db.base import Base -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.tasks.scheduled.scheduler import scheduler +from fides.api.db.base import Base +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.tasks.scheduled.scheduler import scheduler from tests.conftest import create_citext_extension diff --git a/tests/ops/email_templates/test_get_email_template.py b/tests/ops/email_templates/test_get_email_template.py index d9ea4c112f..0462d7ac79 100644 --- a/tests/ops/email_templates/test_get_email_template.py +++ b/tests/ops/email_templates/test_get_email_template.py @@ -1,9 +1,9 @@ import pytest from jinja2 import Template -from fides.api.ops.common_exceptions import EmailTemplateUnhandledActionType -from fides.api.ops.email_templates import get_email_template -from fides.api.ops.schemas.messaging.messaging import MessagingActionType +from fides.api.common_exceptions import EmailTemplateUnhandledActionType +from fides.api.email_templates import get_email_template +from fides.api.schemas.messaging.messaging import MessagingActionType def test_get_email_template_returns_template(): diff --git a/tests/ops/generator/sql_data_generator.py b/tests/ops/generator/sql_data_generator.py index fff04aa7bb..40b7ea19fb 100644 --- a/tests/ops/generator/sql_data_generator.py +++ b/tests/ops/generator/sql_data_generator.py @@ -6,9 +6,9 @@ from sqlalchemy import Boolean, Column, Float, Integer, String from sqlalchemy.ext.declarative import declarative_base -from fides.api.ops.graph.config import CollectionAddress, Field, ScalarField -from fides.api.ops.graph.data_type import DataType -from fides.api.ops.graph.traversal import Row, Traversal, TraversalNode +from fides.api.graph.config import CollectionAddress, Field, ScalarField +from fides.api.graph.data_type import DataType +from fides.api.graph.traversal import Row, Traversal, TraversalNode Base = declarative_base() diff --git a/tests/ops/generator/test_data_generator.py b/tests/ops/generator/test_data_generator.py index c6431e6176..725fa45b81 100644 --- a/tests/ops/generator/test_data_generator.py +++ b/tests/ops/generator/test_data_generator.py @@ -1,13 +1,13 @@ import yaml from fideslang.models import Dataset -from fides.api.ops.graph.graph import * +from fides.api.graph.graph import * # ------------------------------------------- # graph object tests # ------------------------------------------- -from fides.api.ops.graph.traversal import Traversal -from fides.api.ops.models.datasetconfig import convert_dataset_to_graph +from fides.api.graph.traversal import Traversal +from fides.api.models.datasetconfig import convert_dataset_to_graph from . import sql_data_generator diff --git a/tests/ops/graph/graph_test_util.py b/tests/ops/graph/graph_test_util.py index 9fa2da5b59..b61150ec0e 100644 --- a/tests/ops/graph/graph_test_util.py +++ b/tests/ops/graph/graph_test_util.py @@ -4,20 +4,20 @@ from fideslang.validation import FidesKey from sqlalchemy.engine import Engine -from fides.api.ops.db.base_class import FidesBase -from fides.api.ops.graph.config import * -from fides.api.ops.graph.traversal import * -from fides.api.ops.graph.traversal import Traversal, TraversalNode +from fides.api.db.base_class import FidesBase +from fides.api.graph.config import * +from fides.api.graph.traversal import * +from fides.api.graph.traversal import Traversal, TraversalNode # to avoid having faker spam the logs -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.policy import ActionType, Policy, Rule, RuleTarget -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.service.connectors import BaseConnector, MongoDBConnector -from fides.api.ops.service.connectors.sql_connector import SQLConnector -from fides.api.ops.task.graph_task import GraphTask -from fides.api.ops.task.task_resources import TaskResources -from fides.api.ops.util.collection_util import Row +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.policy import ActionType, Policy, Rule, RuleTarget +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.service.connectors import BaseConnector, MongoDBConnector +from fides.api.service.connectors.sql_connector import SQLConnector +from fides.api.task.graph_task import GraphTask +from fides.api.task.task_resources import TaskResources +from fides.api.util.collection_util import Row from tests.fixtures.application_fixtures import faker diff --git a/tests/ops/graph/test_config.py b/tests/ops/graph/test_config.py index 3651160f80..f3aa2171f2 100644 --- a/tests/ops/graph/test_config.py +++ b/tests/ops/graph/test_config.py @@ -1,9 +1,9 @@ import pydantic import pytest -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.graph.config import * -from fides.api.ops.graph.data_type import ( +from fides.api.common_exceptions import ValidationError +from fides.api.graph.config import * +from fides.api.graph.data_type import ( BooleanTypeConverter, IntTypeConverter, NoOpTypeConverter, diff --git a/tests/ops/graph/test_data_types.py b/tests/ops/graph/test_data_types.py index bb36750253..cb88183f57 100644 --- a/tests/ops/graph/test_data_types.py +++ b/tests/ops/graph/test_data_types.py @@ -1,6 +1,6 @@ from bson import ObjectId -from fides.api.ops.graph.data_type import ( +from fides.api.graph.data_type import ( DataType, NoOpTypeConverter, StringTypeConverter, diff --git a/tests/ops/graph/test_edge.py b/tests/ops/graph/test_edge.py index 0a7111d976..d48927d04d 100644 --- a/tests/ops/graph/test_edge.py +++ b/tests/ops/graph/test_edge.py @@ -1,7 +1,7 @@ import pytest -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.graph.graph import * +from fides.api.common_exceptions import ValidationError +from fides.api.graph.graph import * class TestEdge: diff --git a/tests/ops/graph/test_graph.py b/tests/ops/graph/test_graph.py index 7f816ae4fb..2894e2a3ec 100644 --- a/tests/ops/graph/test_graph.py +++ b/tests/ops/graph/test_graph.py @@ -1,10 +1,10 @@ import pytest -from fides.api.ops.graph.config import * -from fides.api.ops.graph.traversal import * -from fides.api.ops.models.policy import ActionType -from fides.api.ops.task.graph_task import retry -from fides.api.ops.task.task_resources import TaskResources +from fides.api.graph.config import * +from fides.api.graph.traversal import * +from fides.api.models.policy import ActionType +from fides.api.task.graph_task import retry +from fides.api.task.task_resources import TaskResources from fides.core.config import CONFIG from tests.ops.task.traversal_data import integration_db_graph diff --git a/tests/ops/graph/test_graph_analytics_events.py b/tests/ops/graph/test_graph_analytics_events.py index ec75528906..37af7e26ce 100644 --- a/tests/ops/graph/test_graph_analytics_events.py +++ b/tests/ops/graph/test_graph_analytics_events.py @@ -1,5 +1,5 @@ -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.graph.analytics_events import failed_graph_analytics_event +from fides.api.common_exceptions import FidesopsException +from fides.api.graph.analytics_events import failed_graph_analytics_event class TestFailedGraphAnalyticsEvent: diff --git a/tests/ops/graph/test_graph_differences.py b/tests/ops/graph/test_graph_differences.py index e145cf1b3e..cddc7304e2 100644 --- a/tests/ops/graph/test_graph_differences.py +++ b/tests/ops/graph/test_graph_differences.py @@ -2,25 +2,25 @@ import pytest -from fides.api.ops.graph.analytics_events import prepare_rerun_graph_analytics_event -from fides.api.ops.graph.config import ( +from fides.api.graph.analytics_events import prepare_rerun_graph_analytics_event +from fides.api.graph.config import ( ROOT_COLLECTION_ADDRESS, CollectionAddress, FieldAddress, ) -from fides.api.ops.graph.graph import Edge -from fides.api.ops.graph.graph_differences import ( +from fides.api.graph.graph import Edge +from fides.api.graph.graph_differences import ( GraphDiff, GraphDiffSummary, _find_graph_differences, find_graph_differences_summary, format_graph_for_caching, ) -from fides.api.ops.graph.traversal import TraversalNode, artificial_traversal_node -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.models.policy import ActionType, Policy -from fides.api.ops.task.graph_task import EMPTY_REQUEST, GraphTask -from fides.api.ops.task.task_resources import TaskResources +from fides.api.graph.traversal import TraversalNode, artificial_traversal_node +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.models.policy import ActionType, Policy +from fides.api.task.graph_task import EMPTY_REQUEST, GraphTask +from fides.api.task.task_resources import TaskResources from ..graph.graph_test_util import generate_node diff --git a/tests/ops/graph/test_graph_traversal.py b/tests/ops/graph/test_graph_traversal.py index 4fe3be1e68..81c082885c 100644 --- a/tests/ops/graph/test_graph_traversal.py +++ b/tests/ops/graph/test_graph_traversal.py @@ -1,6 +1,6 @@ import pytest -from fides.api.ops.graph.graph import * +from fides.api.graph.graph import * from .graph_test_util import * diff --git a/tests/ops/graph/test_traversal_node.py b/tests/ops/graph/test_traversal_node.py index 0ddcd63ba1..8aab285913 100644 --- a/tests/ops/graph/test_traversal_node.py +++ b/tests/ops/graph/test_traversal_node.py @@ -1,4 +1,4 @@ -from fides.api.ops.graph.traversal import * +from fides.api.graph.traversal import * from .test_graph_traversal import generate_node diff --git a/tests/ops/integration_tests/limiter/test_rate_limiter.py b/tests/ops/integration_tests/limiter/test_rate_limiter.py index 224c1914b0..b5791b3c26 100644 --- a/tests/ops/integration_tests/limiter/test_rate_limiter.py +++ b/tests/ops/integration_tests/limiter/test_rate_limiter.py @@ -9,24 +9,24 @@ from requests import Session from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.db import session -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.connectionconfig import ( +from fides.api.db import session +from fides.api.graph.graph import DatasetGraph +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors.limiter.rate_limiter import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors.limiter.rate_limiter import ( RateLimiter, RateLimiterPeriod, RateLimiterRequest, RateLimiterTimeoutException, ) -from fides.api.ops.task import graph_task -from fides.api.ops.util.saas_util import ( +from fides.api.task import graph_task +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/ops/integration_tests/saas/connector_runner.py b/tests/ops/integration_tests/saas/connector_runner.py index 6195d409eb..58afa2c33b 100644 --- a/tests/ops/integration_tests/saas/connector_runner.py +++ b/tests/ops/integration_tests/saas/connector_runner.py @@ -3,25 +3,25 @@ from sqlalchemy.orm import Session +from fides.api.cryptography import cryptographic_util from fides.api.ctl.sql_models import Dataset as CtlDataset -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.graph.config import GraphDataset -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.connectionconfig import ( +from fides.api.graph.config import GraphDataset +from fides.api.graph.graph import DatasetGraph +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures -from fides.api.ops.util.cache import FidesopsRedis -from fides.api.ops.util.collection_util import Row -from fides.api.ops.util.saas_util import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures +from fides.api.util.cache import FidesopsRedis +from fides.api.util.collection_util import Row +from fides.api.util.saas_util import ( load_config_with_replacement, load_dataset_with_replacement, ) diff --git a/tests/ops/integration_tests/saas/request_override/test_firebase_auth_task.py b/tests/ops/integration_tests/saas/request_override/test_firebase_auth_task.py index 9e575ff0c3..6c698cb145 100644 --- a/tests/ops/integration_tests/saas/request_override/test_firebase_auth_task.py +++ b/tests/ops/integration_tests/saas/request_override/test_firebase_auth_task.py @@ -4,15 +4,15 @@ from firebase_admin import auth from firebase_admin.auth import UserNotFoundError, UserRecord -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.saas_request.override_implementations.firebase_auth_request_overrides import ( +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.saas_request.override_implementations.firebase_auth_request_overrides import ( firebase_auth_user_delete, initialize_firebase, ) -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/request_override/test_mailchimp_override_task.py b/tests/ops/integration_tests/saas/request_override/test_mailchimp_override_task.py index f9dde51d43..659822dd83 100644 --- a/tests/ops/integration_tests/saas/request_override/test_mailchimp_override_task.py +++ b/tests/ops/integration_tests/saas/request_override/test_mailchimp_override_task.py @@ -2,11 +2,11 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import ExecutionLog, PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import ExecutionLog, PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from tests.ops.graph.graph_test_util import assert_rows_match, records_matching_fields """ diff --git a/tests/ops/integration_tests/saas/test_adobe_campaign_task.py b/tests/ops/integration_tests/saas/test_adobe_campaign_task.py index 6f7422bb12..187bfc881e 100644 --- a/tests/ops/integration_tests/saas/test_adobe_campaign_task.py +++ b/tests/ops/integration_tests/saas/test_adobe_campaign_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_aircall_task.py b/tests/ops/integration_tests/saas/test_aircall_task.py index b5cc42cd87..dffd0a678a 100644 --- a/tests/ops/integration_tests/saas/test_aircall_task.py +++ b/tests/ops/integration_tests/saas/test_aircall_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match from tests.ops.test_helpers.saas_test_utils import poll_for_existence diff --git a/tests/ops/integration_tests/saas/test_amplitude_task.py b/tests/ops/integration_tests/saas/test_amplitude_task.py index 19ca9d787d..a42339dd32 100644 --- a/tests/ops/integration_tests/saas/test_amplitude_task.py +++ b/tests/ops/integration_tests/saas/test_amplitude_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_auth0_task.py b/tests/ops/integration_tests/saas/test_auth0_task.py index a6f9bfc815..9abf755178 100644 --- a/tests/ops/integration_tests/saas/test_auth0_task.py +++ b/tests/ops/integration_tests/saas/test_auth0_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.fixtures.saas.auth0_fixtures import _user_exists from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_braintree_task.py b/tests/ops/integration_tests/saas/test_braintree_task.py index 167731e678..7fe9748a0d 100644 --- a/tests/ops/integration_tests/saas/test_braintree_task.py +++ b/tests/ops/integration_tests/saas/test_braintree_task.py @@ -3,12 +3,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_braze_task.py b/tests/ops/integration_tests/saas/test_braze_task.py index 74537c85cc..3977b94d9d 100644 --- a/tests/ops/integration_tests/saas/test_braze_task.py +++ b/tests/ops/integration_tests/saas/test_braze_task.py @@ -4,12 +4,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_datadog_task.py b/tests/ops/integration_tests/saas/test_datadog_task.py index 3cbd2e7897..b54c056568 100644 --- a/tests/ops/integration_tests/saas/test_datadog_task.py +++ b/tests/ops/integration_tests/saas/test_datadog_task.py @@ -2,11 +2,11 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_delighted_task.py b/tests/ops/integration_tests/saas/test_delighted_task.py index 56c28f9162..76fa130d4c 100644 --- a/tests/ops/integration_tests/saas/test_delighted_task.py +++ b/tests/ops/integration_tests/saas/test_delighted_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match from tests.ops.test_helpers.saas_test_utils import poll_for_existence diff --git a/tests/ops/integration_tests/saas/test_domo_task.py b/tests/ops/integration_tests/saas/test_domo_task.py index 6505aac09d..1b0a4aead2 100644 --- a/tests/ops/integration_tests/saas/test_domo_task.py +++ b/tests/ops/integration_tests/saas/test_domo_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_doordash_task.py b/tests/ops/integration_tests/saas/test_doordash_task.py index 1f1269a8f9..754f9adf7a 100644 --- a/tests/ops/integration_tests/saas/test_doordash_task.py +++ b/tests/ops/integration_tests/saas/test_doordash_task.py @@ -1,6 +1,6 @@ import pytest -from fides.api.ops.models.policy import Policy +from fides.api.models.policy import Policy from tests.ops.integration_tests.saas.connector_runner import ConnectorRunner diff --git a/tests/ops/integration_tests/saas/test_friendbuy_nextgen_task.py b/tests/ops/integration_tests/saas/test_friendbuy_nextgen_task.py index 06eb503d81..8fd4d25106 100644 --- a/tests/ops/integration_tests/saas/test_friendbuy_nextgen_task.py +++ b/tests/ops/integration_tests/saas/test_friendbuy_nextgen_task.py @@ -4,12 +4,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_friendbuy_task.py b/tests/ops/integration_tests/saas/test_friendbuy_task.py index 04497b01de..12b40b5da5 100644 --- a/tests/ops/integration_tests/saas/test_friendbuy_task.py +++ b/tests/ops/integration_tests/saas/test_friendbuy_task.py @@ -5,12 +5,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_fullstory_task.py b/tests/ops/integration_tests/saas/test_fullstory_task.py index 57794f471f..fc27ecfd89 100644 --- a/tests/ops/integration_tests/saas/test_fullstory_task.py +++ b/tests/ops/integration_tests/saas/test_fullstory_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.fixtures.saas.fullstory_fixtures import FullstoryTestClient, user_updated from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_google_analytics_task.py b/tests/ops/integration_tests/saas/test_google_analytics_task.py index 1dcebc61c2..ebc52b8ed9 100644 --- a/tests/ops/integration_tests/saas/test_google_analytics_task.py +++ b/tests/ops/integration_tests/saas/test_google_analytics_task.py @@ -3,20 +3,20 @@ import pytest -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_request import ( +from fides.api.models.policy import ActionType +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, PrivacyRequestStatus, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.schemas.saas.shared_schemas import SaaSRequestParams +from fides.api.service.connectors import get_connector +from fides.api.service.privacy_request.request_runner_service import ( build_consent_dataset_graph, ) -from fides.api.ops.task import graph_task +from fides.api.task import graph_task @pytest.mark.integration_saas @@ -90,7 +90,7 @@ async def test_google_analytics_consent_request_task_old_workflow( @pytest.mark.integration_google_analytics @pytest.mark.asyncio @pytest.mark.skip(reason="Currently unable to test OAuth2 connectors") -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_google_analytics_consent_prepared_requests_old_workflow( mocked_client_send, db, @@ -134,7 +134,7 @@ async def test_google_analytics_consent_prepared_requests_old_workflow( @pytest.mark.integration_google_analytics @pytest.mark.asyncio @pytest.mark.skip(reason="Currently unable to test OAuth2 connectors") -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_google_analytics_no_ga_client_id_old_workflow( mocked_client_send, db, @@ -172,7 +172,7 @@ async def test_google_analytics_no_ga_client_id_old_workflow( @pytest.mark.integration_saas @pytest.mark.integration_google_analytics @pytest.mark.asyncio -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_google_analytics_no_ga_client_id_new_workflow( mocked_client_send, db, @@ -323,7 +323,7 @@ async def test_google_analytics_consent_request_task_new_workflow( @pytest.mark.integration_google_analytics @pytest.mark.asyncio @pytest.mark.skip(reason="Currently unable to test OAuth2 connectors") -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_google_analytics_consent_request_task_new_errored_workflow( mocked_client_send, db, @@ -404,7 +404,7 @@ async def test_google_analytics_consent_request_task_new_errored_workflow( @pytest.mark.integration_google_analytics @pytest.mark.asyncio @pytest.mark.skip(reason="Currently unable to test OAuth2 connectors") -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_google_analytics_consent_prepared_requests_new_workflow( mocked_client_send, db, diff --git a/tests/ops/integration_tests/saas/test_gorgias_task.py b/tests/ops/integration_tests/saas/test_gorgias_task.py index 8dedee4938..fefa8ed61e 100644 --- a/tests/ops/integration_tests/saas/test_gorgias_task.py +++ b/tests/ops/integration_tests/saas/test_gorgias_task.py @@ -3,12 +3,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_hubspot_task.py b/tests/ops/integration_tests/saas/test_hubspot_task.py index a955200358..1031f41762 100644 --- a/tests/ops/integration_tests/saas/test_hubspot_task.py +++ b/tests/ops/integration_tests/saas/test_hubspot_task.py @@ -2,13 +2,13 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.filter_results import filter_data_categories -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.filter_results import filter_data_categories +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.fixtures.saas.hubspot_fixtures import HubspotTestClient, user_exists from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_jira_task.py b/tests/ops/integration_tests/saas/test_jira_task.py index 982add5ddd..e25c3d2fdc 100644 --- a/tests/ops/integration_tests/saas/test_jira_task.py +++ b/tests/ops/integration_tests/saas/test_jira_task.py @@ -4,12 +4,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_klaviyo_task.py b/tests/ops/integration_tests/saas/test_klaviyo_task.py index aa51cff831..615d0638d5 100644 --- a/tests/ops/integration_tests/saas/test_klaviyo_task.py +++ b/tests/ops/integration_tests/saas/test_klaviyo_task.py @@ -3,12 +3,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_kustomer_task.py b/tests/ops/integration_tests/saas/test_kustomer_task.py index a8fea75f14..5e8c78ec2e 100644 --- a/tests/ops/integration_tests/saas/test_kustomer_task.py +++ b/tests/ops/integration_tests/saas/test_kustomer_task.py @@ -3,12 +3,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_mailchimp_task.py b/tests/ops/integration_tests/saas/test_mailchimp_task.py index e84c44baf9..72832eb6e5 100644 --- a/tests/ops/integration_tests/saas/test_mailchimp_task.py +++ b/tests/ops/integration_tests/saas/test_mailchimp_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import ExecutionLog, PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import ExecutionLog, PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from tests.ops.graph.graph_test_util import assert_rows_match, records_matching_fields diff --git a/tests/ops/integration_tests/saas/test_mailchimp_transactional_task.py b/tests/ops/integration_tests/saas/test_mailchimp_transactional_task.py index ad45a4a81f..ac9b0bedd7 100644 --- a/tests/ops/integration_tests/saas/test_mailchimp_transactional_task.py +++ b/tests/ops/integration_tests/saas/test_mailchimp_transactional_task.py @@ -4,21 +4,21 @@ import pytest -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_request import ( +from fides.api.models.policy import ActionType +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, PrivacyRequestStatus, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.schemas.saas.saas_config import SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors import SaaSConnector, get_connector -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.schemas.saas.saas_config import SaaSRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors import SaaSConnector, get_connector +from fides.api.service.privacy_request.request_runner_service import ( build_consent_dataset_graph, ) -from fides.api.ops.task import graph_task +from fides.api.task import graph_task @pytest.mark.integration_saas @@ -115,7 +115,7 @@ async def test_mailchimp_transactional_consent_request_task_old_workflow( @pytest.mark.integration_saas @pytest.mark.integration_mailchimp_transactional @pytest.mark.asyncio -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_mailchimp_transactional_consent_prepared_requests_old_workflow( mocked_client_send, db, @@ -155,7 +155,7 @@ async def test_mailchimp_transactional_consent_prepared_requests_old_workflow( @pytest.mark.integration_saas @pytest.mark.integration_mailchimp_transactional @pytest.mark.asyncio -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_no_prepared_request_fired_without_consent_preferences_old_workflow( mocked_client_send, db, @@ -302,7 +302,7 @@ async def test_mailchimp_transactional_consent_request_task_new_workflow( @pytest.mark.integration_saas @pytest.mark.integration_mailchimp_transactional @pytest.mark.asyncio -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_mailchimp_transactional_consent_prepared_requests_new_workflow( mocked_client_send, db, @@ -423,7 +423,7 @@ async def test_mailchimp_transactional_consent_request_task_new_workflow_skipped @pytest.mark.integration_mailchimp_transactional @pytest.mark.asyncio @pytest.mark.usefixtures("reset_mailchimp_transactional_data") -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_mailchimp_transactional_consent_request_task_error( mocked_client_send, db, diff --git a/tests/ops/integration_tests/saas/test_onesignal_task.py b/tests/ops/integration_tests/saas/test_onesignal_task.py index 360bf0804a..4da38ba786 100644 --- a/tests/ops/integration_tests/saas/test_onesignal_task.py +++ b/tests/ops/integration_tests/saas/test_onesignal_task.py @@ -1,6 +1,6 @@ import pytest -from fides.api.ops.models.policy import Policy +from fides.api.models.policy import Policy from tests.ops.integration_tests.saas.connector_runner import ConnectorRunner from tests.ops.test_helpers.saas_test_utils import poll_for_existence diff --git a/tests/ops/integration_tests/saas/test_outreach_task.py b/tests/ops/integration_tests/saas/test_outreach_task.py index 60054c87be..430751acbb 100644 --- a/tests/ops/integration_tests/saas/test_outreach_task.py +++ b/tests/ops/integration_tests/saas/test_outreach_task.py @@ -2,13 +2,13 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.filter_results import filter_data_categories -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.filter_results import filter_data_categories +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_recharge_tasks.py b/tests/ops/integration_tests/saas/test_recharge_tasks.py index 9ba6c109ca..91a9b1767b 100644 --- a/tests/ops/integration_tests/saas/test_recharge_tasks.py +++ b/tests/ops/integration_tests/saas/test_recharge_tasks.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_rollbar_task.py b/tests/ops/integration_tests/saas/test_rollbar_task.py index f71522da04..85fa604fd6 100644 --- a/tests/ops/integration_tests/saas/test_rollbar_task.py +++ b/tests/ops/integration_tests/saas/test_rollbar_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_salesforce_task.py b/tests/ops/integration_tests/saas/test_salesforce_task.py index cadeec362c..fca96ccd84 100644 --- a/tests/ops/integration_tests/saas/test_salesforce_task.py +++ b/tests/ops/integration_tests/saas/test_salesforce_task.py @@ -3,12 +3,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_segment_task.py b/tests/ops/integration_tests/saas/test_segment_task.py index 6e64c3e8b7..d63ec6e120 100644 --- a/tests/ops/integration_tests/saas/test_segment_task.py +++ b/tests/ops/integration_tests/saas/test_segment_task.py @@ -2,13 +2,13 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.filter_results import filter_data_categories -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.filter_results import filter_data_categories +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_sendgrid_task.py b/tests/ops/integration_tests/saas/test_sendgrid_task.py index 4a221fc5ae..446f174f76 100644 --- a/tests/ops/integration_tests/saas/test_sendgrid_task.py +++ b/tests/ops/integration_tests/saas/test_sendgrid_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.fixtures.saas.sendgrid_fixtures import contact_exists from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_sentry_task.py b/tests/ops/integration_tests/saas/test_sentry_task.py index 6bf8e71d89..e44aef93ff 100644 --- a/tests/ops/integration_tests/saas/test_sentry_task.py +++ b/tests/ops/integration_tests/saas/test_sentry_task.py @@ -5,13 +5,13 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.filter_results import filter_data_categories -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.filter_results import filter_data_categories +from fides.api.task.graph_task import get_cached_data_for_erasures from tests.ops.graph.graph_test_util import assert_rows_match from tests.ops.test_helpers.saas_test_utils import poll_for_existence diff --git a/tests/ops/integration_tests/saas/test_shippo_task.py b/tests/ops/integration_tests/saas/test_shippo_task.py index e22c00e7cc..d7db51623a 100644 --- a/tests/ops/integration_tests/saas/test_shippo_task.py +++ b/tests/ops/integration_tests/saas/test_shippo_task.py @@ -2,11 +2,11 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_shopify_task.py b/tests/ops/integration_tests/saas/test_shopify_task.py index 0d346061c0..ff3549de3d 100644 --- a/tests/ops/integration_tests/saas/test_shopify_task.py +++ b/tests/ops/integration_tests/saas/test_shopify_task.py @@ -4,12 +4,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_slack_enterprise_task.py b/tests/ops/integration_tests/saas/test_slack_enterprise_task.py index d3ea0bb771..29e99a853e 100644 --- a/tests/ops/integration_tests/saas/test_slack_enterprise_task.py +++ b/tests/ops/integration_tests/saas/test_slack_enterprise_task.py @@ -2,11 +2,11 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match from tests.ops.test_helpers.dataset_utils import update_dataset diff --git a/tests/ops/integration_tests/saas/test_square_task.py b/tests/ops/integration_tests/saas/test_square_task.py index 926a38189f..871a952af2 100644 --- a/tests/ops/integration_tests/saas/test_square_task.py +++ b/tests/ops/integration_tests/saas/test_square_task.py @@ -3,12 +3,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_stripe_task.py b/tests/ops/integration_tests/saas/test_stripe_task.py index 587dbd21ab..f23bb43105 100644 --- a/tests/ops/integration_tests/saas/test_stripe_task.py +++ b/tests/ops/integration_tests/saas/test_stripe_task.py @@ -4,13 +4,13 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.filter_results import filter_data_categories -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.filter_results import filter_data_categories +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_twilio_conversations_task.py b/tests/ops/integration_tests/saas/test_twilio_conversations_task.py index 8397c2fe98..7ec584553d 100644 --- a/tests/ops/integration_tests/saas/test_twilio_conversations_task.py +++ b/tests/ops/integration_tests/saas/test_twilio_conversations_task.py @@ -3,12 +3,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_unbounce_task.py b/tests/ops/integration_tests/saas/test_unbounce_task.py index f87bf95bda..97b7026ce9 100644 --- a/tests/ops/integration_tests/saas/test_unbounce_task.py +++ b/tests/ops/integration_tests/saas/test_unbounce_task.py @@ -2,12 +2,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_universal_analytics_task.py b/tests/ops/integration_tests/saas/test_universal_analytics_task.py index c33e2e56d2..a5da59a405 100644 --- a/tests/ops/integration_tests/saas/test_universal_analytics_task.py +++ b/tests/ops/integration_tests/saas/test_universal_analytics_task.py @@ -3,20 +3,20 @@ import pytest -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_request import ( +from fides.api.models.policy import ActionType +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, PrivacyRequestStatus, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.schemas.saas.shared_schemas import SaaSRequestParams +from fides.api.service.connectors import get_connector +from fides.api.service.privacy_request.request_runner_service import ( build_consent_dataset_graph, ) -from fides.api.ops.task import graph_task +from fides.api.task import graph_task @pytest.mark.integration_saas @@ -90,7 +90,7 @@ async def test_universal_analytics_consent_request_task_old_workflow( @pytest.mark.integration_universal_analytics @pytest.mark.asyncio @pytest.mark.skip(reason="Currently unable to test OAuth2 connectors") -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_universal_analytics_consent_prepared_requests_old_workflow( mocked_client_send, db, @@ -134,7 +134,7 @@ async def test_universal_analytics_consent_prepared_requests_old_workflow( @pytest.mark.integration_universal_analytics @pytest.mark.asyncio @pytest.mark.skip(reason="Currently unable to test OAuth2 connectors") -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_universal_analytics_no_ga_client_id_old_workflow( mocked_client_send, db, @@ -186,7 +186,7 @@ async def test_universal_analytics_no_ga_client_id_old_workflow( @pytest.mark.integration_saas @pytest.mark.integration_universal_analytics @pytest.mark.asyncio -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_universal_analytics_no_ga_client_id_new_workflow( mocked_client_send, db, @@ -337,7 +337,7 @@ async def test_universal_analytics_consent_request_task_new_workflow( @pytest.mark.integration_universal_analytics @pytest.mark.asyncio @pytest.mark.skip(reason="Currently unable to test OAuth2 connectors") -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_universal_analytics_consent_request_task_new_errored_workflow( mocked_client_send, db, @@ -419,7 +419,7 @@ async def test_universal_analytics_consent_request_task_new_errored_workflow( @pytest.mark.integration_universal_analytics @pytest.mark.asyncio @pytest.mark.skip(reason="Currently unable to test OAuth2 connectors") -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_universal_analytics_consent_prepared_requests_new_workflow( mocked_client_send, db, diff --git a/tests/ops/integration_tests/saas/test_vend_task.py b/tests/ops/integration_tests/saas/test_vend_task.py index 9da72c5cd9..806081e4d8 100644 --- a/tests/ops/integration_tests/saas/test_vend_task.py +++ b/tests/ops/integration_tests/saas/test_vend_task.py @@ -3,12 +3,12 @@ import pytest import requests -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/saas/test_wunderkind_task.py b/tests/ops/integration_tests/saas/test_wunderkind_task.py index 0145ccefb1..c2231d59e8 100644 --- a/tests/ops/integration_tests/saas/test_wunderkind_task.py +++ b/tests/ops/integration_tests/saas/test_wunderkind_task.py @@ -3,20 +3,20 @@ import pytest -from fides.api.ops.models.policy import ActionType -from fides.api.ops.models.privacy_request import ( +from fides.api.models.policy import ActionType +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, PrivacyRequestStatus, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.schemas.saas.shared_schemas import SaaSRequestParams -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.schemas.redis_cache import Identity +from fides.api.schemas.saas.shared_schemas import SaaSRequestParams +from fides.api.service.connectors import get_connector +from fides.api.service.privacy_request.request_runner_service import ( build_consent_dataset_graph, ) -from fides.api.ops.task import graph_task +from fides.api.task import graph_task @pytest.mark.integration_saas @@ -87,7 +87,7 @@ async def test_wunderkind_consent_request_task_old_workflow( @pytest.mark.integration_saas @pytest.mark.integration_wunderkind @pytest.mark.asyncio -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_wunderkind_consent_prepared_requests_old_workflow( mocked_client_send, db, @@ -214,7 +214,7 @@ async def test_wunderkind_consent_request_task_new_workflow( @pytest.mark.integration_saas @pytest.mark.integration_wunderkind @pytest.mark.asyncio -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_wunderkind_errored_logging_new_workflow( mocked_client_send, db, @@ -290,7 +290,7 @@ async def test_wunderkind_errored_logging_new_workflow( @pytest.mark.integration_saas @pytest.mark.integration_wunderkind @pytest.mark.asyncio -@mock.patch("fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send") +@mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") async def test_wunderkind_consent_prepared_requests_new_workflow( mocked_client_send, db, diff --git a/tests/ops/integration_tests/saas/test_yotpo_loyalty_task.py b/tests/ops/integration_tests/saas/test_yotpo_loyalty_task.py index ec66359ecd..4a6490fc71 100644 --- a/tests/ops/integration_tests/saas/test_yotpo_loyalty_task.py +++ b/tests/ops/integration_tests/saas/test_yotpo_loyalty_task.py @@ -3,12 +3,12 @@ import pytest -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match from tests.ops.test_helpers.saas_test_utils import poll_for_existence diff --git a/tests/ops/integration_tests/saas/test_yotpo_reviews_task.py b/tests/ops/integration_tests/saas/test_yotpo_reviews_task.py index d666c639ce..f15d3fb98a 100644 --- a/tests/ops/integration_tests/saas/test_yotpo_reviews_task.py +++ b/tests/ops/integration_tests/saas/test_yotpo_reviews_task.py @@ -1,6 +1,6 @@ import pytest -from fides.api.ops.models.policy import Policy +from fides.api.models.policy import Policy from tests.fixtures.saas.yotpo_reviews_fixtures import YotpoReviewsTestClient from tests.ops.integration_tests.saas.connector_runner import ConnectorRunner from tests.ops.test_helpers.saas_test_utils import poll_for_existence diff --git a/tests/ops/integration_tests/saas/test_zendesk_task.py b/tests/ops/integration_tests/saas/test_zendesk_task.py index 156cb1a8b5..30115d2443 100644 --- a/tests/ops/integration_tests/saas/test_zendesk_task.py +++ b/tests/ops/integration_tests/saas/test_zendesk_task.py @@ -1,6 +1,6 @@ import pytest -from fides.api.ops.models.policy import Policy +from fides.api.models.policy import Policy from tests.ops.integration_tests.saas.connector_runner import ConnectorRunner diff --git a/tests/ops/integration_tests/setup_scripts/mariadb_setup.py b/tests/ops/integration_tests/setup_scripts/mariadb_setup.py index de51e4be3d..c882b30123 100644 --- a/tests/ops/integration_tests/setup_scripts/mariadb_setup.py +++ b/tests/ops/integration_tests/setup_scripts/mariadb_setup.py @@ -4,13 +4,13 @@ import sqlalchemy from toml import load as load_toml -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.service.connectors.sql_connector import MariaDBConnector +from fides.api.service.connectors.sql_connector import MariaDBConnector from fides.core.config import CONFIG integration_config = load_toml("tests/ops/integration_test_config.toml") diff --git a/tests/ops/integration_tests/setup_scripts/postgres_setup.py b/tests/ops/integration_tests/setup_scripts/postgres_setup.py index c4555d789b..07526a41f2 100644 --- a/tests/ops/integration_tests/setup_scripts/postgres_setup.py +++ b/tests/ops/integration_tests/setup_scripts/postgres_setup.py @@ -6,13 +6,13 @@ from sqlalchemy_utils import create_database, database_exists, drop_database from toml import load as load_toml -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.service.connectors.sql_connector import PostgreSQLConnector +from fides.api.service.connectors.sql_connector import PostgreSQLConnector from fides.core.config import CONFIG integration_config = load_toml("tests/ops/integration_test_config.toml") diff --git a/tests/ops/integration_tests/setup_scripts/timescale_setup.py b/tests/ops/integration_tests/setup_scripts/timescale_setup.py index 9121560518..c5d4072d8c 100644 --- a/tests/ops/integration_tests/setup_scripts/timescale_setup.py +++ b/tests/ops/integration_tests/setup_scripts/timescale_setup.py @@ -6,13 +6,13 @@ from sqlalchemy_utils import create_database, database_exists, drop_database from toml import load as load_toml -from fides.api.ops.db.session import get_db_engine, get_db_session -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_engine, get_db_session +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.service.connectors import TimescaleConnector +from fides.api.service.connectors import TimescaleConnector from fides.core.config import CONFIG integration_config = load_toml("tests/ops/integration_test_config.toml") diff --git a/tests/ops/integration_tests/test_connection_configuration_integration.py b/tests/ops/integration_tests/test_connection_configuration_integration.py index 4ca3e3a8e6..76aaa9851f 100644 --- a/tests/ops/integration_tests/test_connection_configuration_integration.py +++ b/tests/ops/integration_tests/test_connection_configuration_integration.py @@ -6,25 +6,23 @@ from sqlalchemy.orm import Session from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import ( +from fides.api.api.v1.scope_registry import ( CONNECTION_CREATE_OR_UPDATE, CONNECTION_READ, STORAGE_READ, ) -from fides.api.ops.api.v1.urn_registry import CONNECTIONS, V1_URL_PREFIX -from fides.api.ops.common_exceptions import ConnectionException -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.connectionconfig import ConnectionTestStatus -from fides.api.ops.service.connectors import ( +from fides.api.api.v1.urn_registry import CONNECTIONS, V1_URL_PREFIX +from fides.api.common_exceptions import ConnectionException +from fides.api.models.client import ClientDetail +from fides.api.models.connectionconfig import ConnectionTestStatus +from fides.api.service.connectors import ( MongoDBConnector, PostgreSQLConnector, SaaSConnector, get_connector, ) -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.connectors.sql_connector import ( +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.connectors.sql_connector import ( MariaDBConnector, MicrosoftSQLServerConnector, MySQLConnector, diff --git a/tests/ops/integration_tests/test_execution.py b/tests/ops/integration_tests/test_execution.py index 40e464c68b..82a6421619 100644 --- a/tests/ops/integration_tests/test_execution.py +++ b/tests/ops/integration_tests/test_execution.py @@ -6,23 +6,23 @@ from pydantic import ValidationError from sqlalchemy.exc import InvalidRequestError -from fides.api.ops.db.session import get_db_session -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.session import get_db_session +from fides.api.graph.config import CollectionAddress +from fides.api.graph.graph import DatasetGraph +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.models.datasetconfig import convert_dataset_to_graph -from fides.api.ops.models.policy import CurrentStep -from fides.api.ops.models.privacy_request import ( +from fides.api.models.datasetconfig import convert_dataset_to_graph +from fides.api.models.policy import CurrentStep +from fides.api.models.privacy_request import ( CheckpointActionRequired, ExecutionLog, PrivacyRequest, ) -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from tests.fixtures.application_fixtures import integration_secrets @@ -96,7 +96,7 @@ def test_delete_collection_before_new_request( ) assert pr.get_results() == {} - @mock.patch("fides.api.ops.task.graph_task.GraphTask.log_start") + @mock.patch("fides.api.task.graph_task.GraphTask.log_start") @pytest.mark.asyncio async def test_delete_collection_while_in_progress( self, @@ -361,7 +361,7 @@ async def test_skip_collection_new_request( assert mongo_logs.count() == 9 assert mongo_logs.filter_by(status="skipped").count() == 9 - @mock.patch("fides.api.ops.task.graph_task.GraphTask.log_start") + @mock.patch("fides.api.task.graph_task.GraphTask.log_start") @pytest.mark.asyncio async def test_run_disabled_collections_in_progress( self, @@ -648,9 +648,7 @@ async def test_restart_graph_from_failure( integration_mongodb_config.save(db) # Rerun access request using cached results - with mock.patch( - "fides.api.ops.task.graph_task.fideslog_graph_rerun" - ) as mock_log_event: + with mock.patch("fides.api.task.graph_task.fideslog_graph_rerun") as mock_log_event: await graph_task.run_access_request( privacy_request, policy, @@ -779,9 +777,7 @@ async def test_restart_graph_from_failure_during_erasure( integration_postgres_config.save(db) # Rerun erasure portion of request using cached results - with mock.patch( - "fides.api.ops.task.graph_task.fideslog_graph_rerun" - ) as mock_log_event: + with mock.patch("fides.api.task.graph_task.fideslog_graph_rerun") as mock_log_event: await graph_task.run_erasure( privacy_request, policy, diff --git a/tests/ops/integration_tests/test_external_database_connections.py b/tests/ops/integration_tests/test_external_database_connections.py index ee1cd8f30c..74d7afcfda 100644 --- a/tests/ops/integration_tests/test_external_database_connections.py +++ b/tests/ops/integration_tests/test_external_database_connections.py @@ -5,12 +5,9 @@ from sqlalchemy import inspect from toml import load as load_toml -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.schemas.connection_configuration import ( - RedshiftSchema, - SnowflakeSchema, -) -from fides.api.ops.service.connectors import ( +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.schemas.connection_configuration import RedshiftSchema, SnowflakeSchema +from fides.api.service.connectors import ( RedshiftConnector, SnowflakeConnector, get_connector, diff --git a/tests/ops/integration_tests/test_integration_email.py b/tests/ops/integration_tests/test_integration_email.py index 50aea7a00e..3520cfcacb 100644 --- a/tests/ops/integration_tests/test_integration_email.py +++ b/tests/ops/integration_tests/test_integration_email.py @@ -3,14 +3,14 @@ import pytest as pytest -from fides.api.ops.email_templates import get_email_template -from fides.api.ops.models.connectionconfig import AccessLevel -from fides.api.ops.models.privacy_request import PrivacyRequestStatus -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.email_templates import get_email_template +from fides.api.models.connectionconfig import AccessLevel +from fides.api.models.privacy_request import PrivacyRequestStatus +from fides.api.schemas.messaging.messaging import ( EmailForActionType, MessagingActionType, ) -from fides.api.ops.service.privacy_request.email_batch_service import ( +from fides.api.service.privacy_request.email_batch_service import ( EmailExitState, send_email_batch, ) @@ -22,11 +22,9 @@ @pytest.mark.integration @pytest.mark.asyncio @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", -) -@mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) +@mock.patch("fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher") async def test_erasure_email( mock_mailgun_dispatcher: Mock, mock_requeue_privacy_requests: Mock, @@ -90,11 +88,9 @@ async def test_erasure_email( @pytest.mark.integration @pytest.mark.asyncio @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", -) -@mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) +@mock.patch("fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher") async def test_erasure_email_no_messaging_config( mock_mailgun_dispatcher: Mock, mock_requeue_privacy_requests: Mock, @@ -211,11 +207,9 @@ async def test_erasure_email_no_updates_needed( @pytest.mark.integration @pytest.mark.asyncio @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", -) -@mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) +@mock.patch("fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher") async def test_erasure_email_disabled_connector( mock_mailgun_dispatcher: Mock, mock_requeue_privacy_requests: Mock, @@ -258,11 +252,9 @@ async def test_erasure_email_disabled_connector( @pytest.mark.integration @pytest.mark.asyncio @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", -) -@mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) +@mock.patch("fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher") async def test_erasure_email_unsupported_identity( mock_mailgun_dispatcher: Mock, mock_requeue_privacy_requests: Mock, diff --git a/tests/ops/integration_tests/test_integration_erasure_order.py b/tests/ops/integration_tests/test_integration_erasure_order.py index 52bb04cb37..3efc2e43e9 100644 --- a/tests/ops/integration_tests/test_integration_erasure_order.py +++ b/tests/ops/integration_tests/test_integration_erasure_order.py @@ -5,22 +5,20 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import TraversalError -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.policy import ActionType, Policy -from fides.api.ops.models.privacy_request import ExecutionLog, PrivacyRequest -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.common_exceptions import TraversalError +from fides.api.graph.graph import DatasetGraph +from fides.api.graph.traversal import TraversalNode +from fides.api.models.policy import ActionType, Policy +from fides.api.models.privacy_request import ExecutionLog, PrivacyRequest +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestType, register, ) -from fides.api.ops.task import graph_task -from fides.api.ops.task.graph_task import get_cached_data_for_erasures -from fides.api.ops.util.collection_util import Row +from fides.api.task import graph_task +from fides.api.task.graph_task import get_cached_data_for_erasures +from fides.api.util.collection_util import Row from fides.core.config import get_config from tests.ops.graph.graph_test_util import assert_rows_match @@ -234,7 +232,7 @@ async def test_saas_erasure_order_request_task_with_cycle( @pytest.mark.integration_saas @pytest.mark.asyncio -@mock.patch("fides.api.ops.service.connectors.saas_connector.SaaSConnector.mask_data") +@mock.patch("fides.api.service.connectors.saas_connector.SaaSConnector.mask_data") async def test_saas_erasure_order_request_task_resume_from_error( mock_mask_data, db, diff --git a/tests/ops/integration_tests/test_manual_task.py b/tests/ops/integration_tests/test_manual_task.py index a8c26ab2c8..a3fb94d911 100644 --- a/tests/ops/integration_tests/test_manual_task.py +++ b/tests/ops/integration_tests/test_manual_task.py @@ -2,15 +2,15 @@ import pytest -from fides.api.ops.common_exceptions import PrivacyRequestPaused -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.models.policy import CurrentStep -from fides.api.ops.models.privacy_request import ( +from fides.api.common_exceptions import PrivacyRequestPaused +from fides.api.graph.config import CollectionAddress +from fides.api.models.policy import CurrentStep +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, ) -from fides.api.ops.task import graph_task +from fides.api.task import graph_task from fides.core.config import CONFIG from ..graph.graph_test_util import assert_rows_match diff --git a/tests/ops/integration_tests/test_mongo_task.py b/tests/ops/integration_tests/test_mongo_task.py index 9dd8fdfec2..0ebcf5448a 100644 --- a/tests/ops/integration_tests/test_mongo_task.py +++ b/tests/ops/integration_tests/test_mongo_task.py @@ -8,27 +8,22 @@ from bson import ObjectId from fideslang.models import Dataset -from fides.api.ops.graph.config import ( - Collection, - FieldAddress, - GraphDataset, - ScalarField, -) -from fides.api.ops.graph.data_type import ( +from fides.api.graph.config import Collection, FieldAddress, GraphDataset, ScalarField +from fides.api.graph.data_type import ( IntTypeConverter, ObjectIdTypeConverter, StringTypeConverter, ) -from fides.api.ops.graph.graph import DatasetGraph, Edge, Node -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import convert_dataset_to_graph -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.filter_results import filter_data_categories -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.graph import DatasetGraph, Edge, Node +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import convert_dataset_to_graph +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.filter_results import filter_data_categories +from fides.api.task.graph_task import get_cached_data_for_erasures from ..graph.graph_test_util import assert_rows_match, erasure_policy, field from ..task.traversal_data import ( @@ -1098,7 +1093,7 @@ def traversal_node(self, example_datasets, integration_mongodb_config): traversal_node = TraversalNode(node) return traversal_node - @mock.patch("fides.api.ops.graph.traversal.TraversalNode.incoming_edges") + @mock.patch("fides.api.graph.traversal.TraversalNode.incoming_edges") def test_retrieving_data( self, mock_incoming_edges: Mock, @@ -1120,7 +1115,7 @@ def test_retrieving_data( assert results[0]["customer_id"] == 1 - @mock.patch("fides.api.ops.graph.traversal.TraversalNode.incoming_edges") + @mock.patch("fides.api.graph.traversal.TraversalNode.incoming_edges") def test_retrieving_data_no_input( self, mock_incoming_edges: Mock, @@ -1158,7 +1153,7 @@ def test_retrieving_data_no_input( ) assert results == [] - @mock.patch("fides.api.ops.graph.traversal.TraversalNode.incoming_edges") + @mock.patch("fides.api.graph.traversal.TraversalNode.incoming_edges") def test_retrieving_data_input_not_in_table( self, mock_incoming_edges: Mock, diff --git a/tests/ops/integration_tests/test_sql_task.py b/tests/ops/integration_tests/test_sql_task.py index eef2ab8670..457ead084d 100644 --- a/tests/ops/integration_tests/test_sql_task.py +++ b/tests/ops/integration_tests/test_sql_task.py @@ -8,24 +8,24 @@ from fideslang import Dataset from sqlalchemy import text -from fides.api.ops.graph.config import ( +from fides.api.graph.config import ( Collection, CollectionAddress, FieldAddress, GraphDataset, ScalarField, ) -from fides.api.ops.graph.data_type import DataType, StringTypeConverter -from fides.api.ops.graph.graph import DatasetGraph, Edge, Node -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import convert_dataset_to_graph -from fides.api.ops.models.policy import ActionType, Policy, Rule, RuleTarget -from fides.api.ops.models.privacy_request import ExecutionLog, PrivacyRequest -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.task import graph_task -from fides.api.ops.task.filter_results import filter_data_categories -from fides.api.ops.task.graph_task import get_cached_data_for_erasures +from fides.api.graph.data_type import DataType, StringTypeConverter +from fides.api.graph.graph import DatasetGraph, Edge, Node +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import convert_dataset_to_graph +from fides.api.models.policy import ActionType, Policy, Rule, RuleTarget +from fides.api.models.privacy_request import ExecutionLog, PrivacyRequest +from fides.api.service.connectors import get_connector +from fides.api.task import graph_task +from fides.api.task.filter_results import filter_data_categories +from fides.api.task.graph_task import get_cached_data_for_erasures from fides.core.config import CONFIG from ..graph.graph_test_util import ( @@ -939,7 +939,7 @@ def traversal_node(self, example_datasets, integration_postgres_config): traversal_node = TraversalNode(node) return traversal_node - @mock.patch("fides.api.ops.graph.traversal.TraversalNode.incoming_edges") + @mock.patch("fides.api.graph.traversal.TraversalNode.incoming_edges") def test_retrieving_data( self, mock_incoming_edges: Mock, @@ -973,7 +973,7 @@ def test_retrieving_data( } ] - @mock.patch("fides.api.ops.graph.traversal.TraversalNode.incoming_edges") + @mock.patch("fides.api.graph.traversal.TraversalNode.incoming_edges") def test_retrieving_data_no_input( self, mock_incoming_edges: Mock, @@ -1009,7 +1009,7 @@ def test_retrieving_data_no_input( traversal_node, Policy(), privacy_request, {"email": None} ) - @mock.patch("fides.api.ops.graph.traversal.TraversalNode.incoming_edges") + @mock.patch("fides.api.graph.traversal.TraversalNode.incoming_edges") def test_retrieving_data_input_not_in_table( self, mock_incoming_edges: Mock, @@ -1039,9 +1039,7 @@ def test_retrieving_data_input_not_in_table( @pytest.mark.integration_postgres @pytest.mark.integration class TestRetryIntegration: - @mock.patch( - "fides.api.ops.service.connectors.sql_connector.SQLConnector.retrieve_data" - ) + @mock.patch("fides.api.service.connectors.sql_connector.SQLConnector.retrieve_data") @pytest.mark.asyncio async def test_retry_access_request( self, @@ -1094,7 +1092,7 @@ async def test_retry_access_request( ("postgres_example_test_dataset:employee", "error"), ] - @mock.patch("fides.api.ops.service.connectors.sql_connector.SQLConnector.mask_data") + @mock.patch("fides.api.service.connectors.sql_connector.SQLConnector.mask_data") @pytest.mark.asyncio async def test_retry_erasure( self, diff --git a/tests/ops/models/test_application_config.py b/tests/ops/models/test_application_config.py index 7e7c4f5b41..d66f165204 100644 --- a/tests/ops/models/test_application_config.py +++ b/tests/ops/models/test_application_config.py @@ -4,7 +4,7 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.models.application_config import ApplicationConfig +from fides.api.models.application_config import ApplicationConfig from fides.core.config import get_config from fides.core.config.config_proxy import ConfigProxy diff --git a/tests/ops/models/test_base.py b/tests/ops/models/test_base.py index 9a3f67b7d4..5bc7ea0d8b 100644 --- a/tests/ops/models/test_base.py +++ b/tests/ops/models/test_base.py @@ -6,10 +6,10 @@ from fideslang.validation import FidesValidationError from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import KeyValidationError -from fides.api.ops.db.base_class import get_key_from_data -from fides.api.ops.models.storage import StorageConfig -from fides.api.ops.schemas.storage.storage import StorageType +from fides.api.common_exceptions import KeyValidationError +from fides.api.db.base_class import get_key_from_data +from fides.api.models.storage import StorageConfig +from fides.api.schemas.storage.storage import StorageType def test_get_key_from_data_method_invalid_key() -> None: diff --git a/tests/ops/models/test_client.py b/tests/ops/models/test_client.py index 85c0097e25..a5caae8605 100644 --- a/tests/ops/models/test_client.py +++ b/tests/ops/models/test_client.py @@ -1,8 +1,8 @@ from sqlalchemy.orm import Session -from fides.api.ops.api.v1.scope_registry import SCOPE_REGISTRY -from fides.api.ops.cryptography.cryptographic_util import hash_with_salt -from fides.api.ops.models.client import ClientDetail +from fides.api.api.v1.scope_registry import SCOPE_REGISTRY +from fides.api.cryptography.cryptographic_util import hash_with_salt +from fides.api.models.client import ClientDetail from fides.core.config import CONFIG diff --git a/tests/ops/models/test_connectionconfig.py b/tests/ops/models/test_connectionconfig.py index 47bb7a029d..6c44d77a19 100644 --- a/tests/ops/models/test_connectionconfig.py +++ b/tests/ops/models/test_connectionconfig.py @@ -1,14 +1,14 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.db.base_class import KeyOrNameAlreadyExists, KeyValidationError -from fides.api.ops.models.connectionconfig import ( +from fides.api.db.base_class import KeyOrNameAlreadyExists, KeyValidationError +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.schemas.saas.saas_config import SaaSConfig -from fides.api.ops.util.text import to_snake_case +from fides.api.schemas.saas.saas_config import SaaSConfig +from fides.api.util.text import to_snake_case class TestConnectionConfigModel: diff --git a/tests/ops/models/test_consent_request.py b/tests/ops/models/test_consent_request.py index df54e8fb67..26d559d3bc 100644 --- a/tests/ops/models/test_consent_request.py +++ b/tests/ops/models/test_consent_request.py @@ -1,24 +1,24 @@ from unittest import mock -from fides.api.ctl.database.seed import DEFAULT_CONSENT_POLICY -from fides.api.ops.api.v1.endpoints.consent_request_endpoints import ( +from fides.api.api.v1.endpoints.consent_request_endpoints import ( queue_privacy_request_to_propagate_consent_old_workflow, ) -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.models.privacy_request import ( +from fides.api.ctl.database.seed import DEFAULT_CONSENT_POLICY +from fides.api.graph.config import CollectionAddress +from fides.api.models.privacy_request import ( Consent, ConsentRequest, PrivacyRequestStatus, ProvidedIdentity, ) -from fides.api.ops.schemas.policy import PolicyResponse -from fides.api.ops.schemas.privacy_request import ( +from fides.api.schemas.policy import PolicyResponse +from fides.api.schemas.privacy_request import ( BulkPostPrivacyRequests, ConsentPreferences, ConsentWithExecutableStatus, PrivacyRequestResponse, ) -from fides.api.ops.schemas.redis_cache import Identity +from fides.api.schemas.redis_cache import Identity paused_location = CollectionAddress("test_dataset", "test_collection") @@ -118,7 +118,7 @@ def test_consent_request(db): class TestQueuePrivacyRequestToPropagateConsentHelper: @mock.patch( - "fides.api.ops.api.v1.endpoints.consent_request_endpoints.create_privacy_request_func" + "fides.api.api.v1.endpoints.consent_request_endpoints.create_privacy_request_func" ) def test_queue_privacy_request_to_propagate_consent( self, mock_create_privacy_request, db, consent_policy @@ -169,7 +169,7 @@ def test_queue_privacy_request_to_propagate_consent( provided_identity.delete(db) @mock.patch( - "fides.api.ops.api.v1.endpoints.consent_request_endpoints.create_privacy_request_func" + "fides.api.api.v1.endpoints.consent_request_endpoints.create_privacy_request_func" ) def test_do_not_queue_privacy_request_if_no_executable_preferences( self, mock_create_privacy_request, db, consent_policy @@ -208,7 +208,7 @@ def test_do_not_queue_privacy_request_if_no_executable_preferences( assert not mock_create_privacy_request.called @mock.patch( - "fides.api.ops.api.v1.endpoints.consent_request_endpoints.create_privacy_request_func" + "fides.api.api.v1.endpoints.consent_request_endpoints.create_privacy_request_func" ) def test_merge_in_browser_identity_with_provided_identity( self, mock_create_privacy_request, db, consent_policy diff --git a/tests/ops/models/test_custom_connector_template.py b/tests/ops/models/test_custom_connector_template.py index ef12f751e9..5c40be627d 100644 --- a/tests/ops/models/test_custom_connector_template.py +++ b/tests/ops/models/test_custom_connector_template.py @@ -2,7 +2,7 @@ from sqlalchemy.orm import Session -from fides.api.ops.models.custom_connector_template import CustomConnectorTemplate +from fides.api.models.custom_connector_template import CustomConnectorTemplate class TestCustomConnectorTemplate: diff --git a/tests/ops/models/test_datasetconfig.py b/tests/ops/models/test_datasetconfig.py index d4af2e18d9..7d1b7e788c 100644 --- a/tests/ops/models/test_datasetconfig.py +++ b/tests/ops/models/test_datasetconfig.py @@ -2,8 +2,8 @@ from fideslang.models import Dataset, FidesDatasetReference from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.models.datasetconfig import ( +from fides.api.common_exceptions import ValidationError +from fides.api.models.datasetconfig import ( DatasetConfig, FieldAddress, convert_dataset_to_graph, diff --git a/tests/ops/models/test_fidesopsuser.py b/tests/ops/models/test_fidesopsuser.py index e0734c6860..1cecf48e06 100644 --- a/tests/ops/models/test_fidesopsuser.py +++ b/tests/ops/models/test_fidesopsuser.py @@ -1,7 +1,7 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.models.fides_user import FidesUser +from fides.api.models.fides_user import FidesUser class TestFidesUser: diff --git a/tests/ops/models/test_fidesuserpermissions.py b/tests/ops/models/test_fidesuserpermissions.py index 572a51876a..4ac0fd81c6 100644 --- a/tests/ops/models/test_fidesuserpermissions.py +++ b/tests/ops/models/test_fidesuserpermissions.py @@ -1,9 +1,9 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.models.fides_user import FidesUser -from fides.api.ops.models.fides_user_permissions import FidesUserPermissions -from fides.api.ops.oauth.roles import CONTRIBUTOR, ROLES_TO_SCOPES_MAPPING, VIEWER +from fides.api.models.fides_user import FidesUser +from fides.api.models.fides_user_permissions import FidesUserPermissions +from fides.api.oauth.roles import CONTRIBUTOR, ROLES_TO_SCOPES_MAPPING, VIEWER class TestFidesUserPermissions: diff --git a/tests/ops/models/test_manual_webhook.py b/tests/ops/models/test_manual_webhook.py index 5b2bae2001..d2361f8e9c 100644 --- a/tests/ops/models/test_manual_webhook.py +++ b/tests/ops/models/test_manual_webhook.py @@ -1,6 +1,6 @@ import pytest -from fides.api.ops.models.manual_webhook import AccessManualWebhook +from fides.api.models.manual_webhook import AccessManualWebhook class TestManualWebhook: diff --git a/tests/ops/models/test_policy.py b/tests/ops/models/test_policy.py index 082f4bc0e9..a91a4013a1 100644 --- a/tests/ops/models/test_policy.py +++ b/tests/ops/models/test_policy.py @@ -1,29 +1,27 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( DataCategoryNotSupported, PolicyValidationError, RuleValidationError, StorageConfigNotFoundException, ) -from fides.api.ops.models.client import ClientDetail -from fides.api.ops.models.policy import ( +from fides.api.models.client import ClientDetail +from fides.api.models.policy import ( ActionType, Policy, Rule, RuleTarget, _is_ancestor_of_contained_categories, ) -from fides.api.ops.models.storage import StorageConfig -from fides.api.ops.service.masking.strategy.masking_strategy_hash import ( - HashMaskingStrategy, -) -from fides.api.ops.service.masking.strategy.masking_strategy_nullify import ( +from fides.api.models.storage import StorageConfig +from fides.api.service.masking.strategy.masking_strategy_hash import HashMaskingStrategy +from fides.api.service.masking.strategy.masking_strategy_nullify import ( NullMaskingStrategy, ) -from fides.api.ops.util.data_category import DataCategory -from fides.api.ops.util.text import to_snake_case +from fides.api.util.data_category import DataCategory +from fides.api.util.text import to_snake_case def test_policy_sets_slug( diff --git a/tests/ops/models/test_policy_webhooks.py b/tests/ops/models/test_policy_webhooks.py index 830b3965e5..36ee897a39 100644 --- a/tests/ops/models/test_policy_webhooks.py +++ b/tests/ops/models/test_policy_webhooks.py @@ -3,8 +3,8 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import WebhookOrderException -from fides.api.ops.models.policy import PolicyPostWebhook +from fides.api.common_exceptions import WebhookOrderException +from fides.api.models.policy import PolicyPostWebhook def test_reorder_webhooks(db: Session, policy, https_connection_config): diff --git a/tests/ops/models/test_privacy_experience.py b/tests/ops/models/test_privacy_experience.py index 94fd4368ce..21fcc892b5 100644 --- a/tests/ops/models/test_privacy_experience.py +++ b/tests/ops/models/test_privacy_experience.py @@ -1,8 +1,8 @@ import pytest from sqlalchemy.exc import IntegrityError -from fides.api.ops.api.deps import get_api_session -from fides.api.ops.models.privacy_experience import ( +from fides.api.api.deps import get_api_session +from fides.api.models.privacy_experience import ( ComponentType, DeliveryMechanism, PrivacyExperience, @@ -10,7 +10,7 @@ upsert_privacy_experiences_after_config_update, upsert_privacy_experiences_after_notice_update, ) -from fides.api.ops.models.privacy_notice import ( +from fides.api.models.privacy_notice import ( ConsentMechanism, EnforcementLevel, PrivacyNotice, diff --git a/tests/ops/models/test_privacy_notice.py b/tests/ops/models/test_privacy_notice.py index 6542eac543..9314a4e2f1 100644 --- a/tests/ops/models/test_privacy_notice.py +++ b/tests/ops/models/test_privacy_notice.py @@ -1,8 +1,8 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import ValidationError -from fides.api.ops.models.privacy_notice import ( +from fides.api.common_exceptions import ValidationError +from fides.api.models.privacy_notice import ( ConsentMechanism, PrivacyNotice, PrivacyNoticeHistory, diff --git a/tests/ops/models/test_privacy_preference.py b/tests/ops/models/test_privacy_preference.py index a9db7098d1..01f1097ad3 100644 --- a/tests/ops/models/test_privacy_preference.py +++ b/tests/ops/models/test_privacy_preference.py @@ -1,21 +1,21 @@ import pytest from sqlalchemy.exc import InvalidRequestError -from fides.api.ops.api.v1.endpoints.privacy_preference_endpoints import ( +from fides.api.api.v1.endpoints.privacy_preference_endpoints import ( anonymize_ip_address, extract_identity_from_provided_identity, ) -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( IdentityNotFoundException, PrivacyNoticeHistoryNotFound, ) -from fides.api.ops.models.privacy_notice import PrivacyNoticeRegion -from fides.api.ops.models.privacy_preference import ( +from fides.api.models.privacy_notice import PrivacyNoticeRegion +from fides.api.models.privacy_preference import ( PrivacyPreferenceHistory, RequestOrigin, UserConsentPreference, ) -from fides.api.ops.models.privacy_request import ( +from fides.api.models.privacy_request import ( ExecutionLogStatus, ProvidedIdentity, ProvidedIdentityType, diff --git a/tests/ops/models/test_privacy_request.py b/tests/ops/models/test_privacy_request.py index e793cbf930..ffbae3abc4 100644 --- a/tests/ops/models/test_privacy_request.py +++ b/tests/ops/models/test_privacy_request.py @@ -8,15 +8,15 @@ from pydantic import ValidationError from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( ClientUnsuccessfulException, ManualWebhookFieldsUnset, NoCachedManualWebhookEntry, PrivacyRequestPaused, ) -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.models.policy import CurrentStep, Policy -from fides.api.ops.models.privacy_request import ( +from fides.api.graph.config import CollectionAddress +from fides.api.models.policy import CurrentStep, Policy +from fides.api.models.privacy_request import ( CheckpointActionRequired, PrivacyRequest, PrivacyRequestError, @@ -25,10 +25,10 @@ ProvidedIdentity, can_run_checkpoint, ) -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.connectors.manual_connector import ManualAction -from fides.api.ops.util.cache import FidesopsRedis, get_identity_cache_key -from fides.api.ops.util.constants import API_DATE_FORMAT +from fides.api.schemas.redis_cache import Identity +from fides.api.service.connectors.manual_connector import ManualAction +from fides.api.util.cache import FidesopsRedis, get_identity_cache_key +from fides.api.util.constants import API_DATE_FORMAT from fides.core.config import CONFIG paused_location = CollectionAddress("test_dataset", "test_collection") diff --git a/tests/ops/models/test_saasconfig.py b/tests/ops/models/test_saasconfig.py index ce43ca4c49..639d778ce7 100644 --- a/tests/ops/models/test_saasconfig.py +++ b/tests/ops/models/test_saasconfig.py @@ -4,10 +4,10 @@ from fideslang import FidesDatasetReference from pydantic import ValidationError -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.graph.config import CollectionAddress, FieldAddress -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.schemas.saas.saas_config import ( +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.graph.config import CollectionAddress, FieldAddress +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.schemas.saas.saas_config import ( ConnectorParam, Endpoint, ParamValue, diff --git a/tests/ops/models/test_storage.py b/tests/ops/models/test_storage.py index a5eb02cf2f..e5fd469e51 100644 --- a/tests/ops/models/test_storage.py +++ b/tests/ops/models/test_storage.py @@ -4,15 +4,15 @@ from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import Session -from fides.api.ops.db.base_class import KeyOrNameAlreadyExists -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.models.storage import ( +from fides.api.db.base_class import KeyOrNameAlreadyExists +from fides.api.models.application_config import ApplicationConfig +from fides.api.models.storage import ( StorageConfig, default_storage_config_name, get_active_default_storage_config, get_default_storage_config_by_type, ) -from fides.api.ops.schemas.storage.storage import ( +from fides.api.schemas.storage.storage import ( FileNaming, ResponseFormat, S3AuthMethod, diff --git a/tests/ops/models/test_systemmanager.py b/tests/ops/models/test_systemmanager.py index b01a4d7c42..e8d69d0cd2 100644 --- a/tests/ops/models/test_systemmanager.py +++ b/tests/ops/models/test_systemmanager.py @@ -1,9 +1,9 @@ import pytest from sqlalchemy.orm import Session +from fides.api.common_exceptions import SystemManagerException from fides.api.ctl.sql_models import System -from fides.api.ops.common_exceptions import SystemManagerException -from fides.api.ops.models.fides_user import FidesUser +from fides.api.models.fides_user import FidesUser class TestSystemManager: diff --git a/tests/ops/schemas/connection_configuration/test_connection_secrets_saas.py b/tests/ops/schemas/connection_configuration/test_connection_secrets_saas.py index d489951f88..6a44e51020 100644 --- a/tests/ops/schemas/connection_configuration/test_connection_secrets_saas.py +++ b/tests/ops/schemas/connection_configuration/test_connection_secrets_saas.py @@ -3,11 +3,11 @@ import pytest from pydantic import ValidationError -from fides.api.ops.schemas.connection_configuration.connection_secrets_saas import ( +from fides.api.schemas.connection_configuration.connection_secrets_saas import ( SaaSSchema, SaaSSchemaFactory, ) -from fides.api.ops.schemas.saas.saas_config import ( +from fides.api.schemas.saas.saas_config import ( ConnectorParam, ExternalDatasetReference, SaaSConfig, diff --git a/tests/ops/schemas/connection_configuration/test_email_schemas.py b/tests/ops/schemas/connection_configuration/test_email_schemas.py index 0933040b4f..fe482e9856 100644 --- a/tests/ops/schemas/connection_configuration/test_email_schemas.py +++ b/tests/ops/schemas/connection_configuration/test_email_schemas.py @@ -1,10 +1,10 @@ import pytest -from fides.api.ops.schemas.connection_configuration import SovrnSchema -from fides.api.ops.schemas.connection_configuration.connection_secrets_attentive import ( +from fides.api.schemas.connection_configuration import SovrnSchema +from fides.api.schemas.connection_configuration.connection_secrets_attentive import ( AttentiveSchema, ) -from fides.api.ops.schemas.connection_configuration.connection_secrets_email import ( +from fides.api.schemas.connection_configuration.connection_secrets_email import ( AdvancedSettings, AdvancedSettingsWithExtendedIdentityTypes, EmailSchema, @@ -12,9 +12,7 @@ ExtendedIdentityTypes, IdentityTypes, ) -from fides.api.ops.service.connectors.email.sovrn_connector import ( - SOVRN_REQUIRED_IDENTITY, -) +from fides.api.service.connectors.email.sovrn_connector import SOVRN_REQUIRED_IDENTITY class TestEmailSchema: diff --git a/tests/ops/schemas/limiter/test_rate_limit_config.py b/tests/ops/schemas/limiter/test_rate_limit_config.py index c690d438b5..c0167ebe04 100644 --- a/tests/ops/schemas/limiter/test_rate_limit_config.py +++ b/tests/ops/schemas/limiter/test_rate_limit_config.py @@ -1,7 +1,7 @@ import pytest from pydantic.error_wrappers import ValidationError -from fides.api.ops.schemas.limiter.rate_limit_config import ( +from fides.api.schemas.limiter.rate_limit_config import ( RateLimit, RateLimitConfig, RateLimitPeriod, diff --git a/tests/ops/schemas/messaging/messaging_test.py b/tests/ops/schemas/messaging/messaging_test.py index 65c31b2ea2..ad75027501 100644 --- a/tests/ops/schemas/messaging/messaging_test.py +++ b/tests/ops/schemas/messaging/messaging_test.py @@ -1,8 +1,6 @@ import pytest -from fides.api.ops.schemas.messaging.messaging import ( - SubjectIdentityVerificationBodyParams, -) +from fides.api.schemas.messaging.messaging import SubjectIdentityVerificationBodyParams @pytest.mark.parametrize("ttl, expected", [(600, 10), (155, 2), (33, 0)]) diff --git a/tests/ops/schemas/test_user_permission.py b/tests/ops/schemas/test_user_permission.py index a27a2e6a29..a76d760b75 100644 --- a/tests/ops/schemas/test_user_permission.py +++ b/tests/ops/schemas/test_user_permission.py @@ -3,9 +3,9 @@ from pydantic import ValidationError from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY -from fides.api.ops.api.v1.scope_registry import USER_DELETE, USER_PERMISSION_CREATE -from fides.api.ops.oauth.roles import OWNER -from fides.api.ops.schemas.user_permission import UserPermissionsCreate +from fides.api.api.v1.scope_registry import USER_DELETE, USER_PERMISSION_CREATE +from fides.api.oauth.roles import OWNER +from fides.api.schemas.user_permission import UserPermissionsCreate class TestUserPermissionsCreate: diff --git a/tests/ops/service/authentication/test_authentication_strategy_api_key.py b/tests/ops/service/authentication/test_authentication_strategy_api_key.py index 7444e4e209..b637b899a9 100644 --- a/tests/ops/service/authentication/test_authentication_strategy_api_key.py +++ b/tests/ops/service/authentication/test_authentication_strategy_api_key.py @@ -3,10 +3,10 @@ import pytest from requests import PreparedRequest, Request -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) diff --git a/tests/ops/service/authentication/test_authentication_strategy_basic.py b/tests/ops/service/authentication/test_authentication_strategy_basic.py index 8753300083..88f655ffc9 100644 --- a/tests/ops/service/authentication/test_authentication_strategy_basic.py +++ b/tests/ops/service/authentication/test_authentication_strategy_basic.py @@ -1,10 +1,10 @@ import pytest from requests import PreparedRequest, Request -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.cryptography.cryptographic_util import bytes_to_b64_str -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.cryptography.cryptographic_util import bytes_to_b64_str +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) diff --git a/tests/ops/service/authentication/test_authentication_strategy_bearer.py b/tests/ops/service/authentication/test_authentication_strategy_bearer.py index e69df1c467..9c7038690c 100644 --- a/tests/ops/service/authentication/test_authentication_strategy_bearer.py +++ b/tests/ops/service/authentication/test_authentication_strategy_bearer.py @@ -1,9 +1,9 @@ import pytest from requests import PreparedRequest, Request -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) diff --git a/tests/ops/service/authentication/test_authentication_strategy_factory.py b/tests/ops/service/authentication/test_authentication_strategy_factory.py index 25853bc2af..ee456f0f39 100644 --- a/tests/ops/service/authentication/test_authentication_strategy_factory.py +++ b/tests/ops/service/authentication/test_authentication_strategy_factory.py @@ -1,13 +1,13 @@ import pytest -from fides.api.ops.common_exceptions import NoSuchStrategyException -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import NoSuchStrategyException +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_basic import ( +from fides.api.service.authentication.authentication_strategy_basic import ( BasicAuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_bearer import ( +from fides.api.service.authentication.authentication_strategy_bearer import ( BearerAuthenticationStrategy, ) diff --git a/tests/ops/service/authentication/test_authentication_strategy_oauth2_authorization_code.py b/tests/ops/service/authentication/test_authentication_strategy_oauth2_authorization_code.py index 3e096b1cb8..4ed85a16b8 100644 --- a/tests/ops/service/authentication/test_authentication_strategy_oauth2_authorization_code.py +++ b/tests/ops/service/authentication/test_authentication_strategy_oauth2_authorization_code.py @@ -6,11 +6,11 @@ from requests import PreparedRequest, Request from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import FidesopsException, OAuth2TokenException -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import FidesopsException, OAuth2TokenException +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_oauth2_authorization_code import ( +from fides.api.service.authentication.authentication_strategy_oauth2_authorization_code import ( OAuth2AuthorizationCodeAuthenticationStrategy, ) @@ -110,10 +110,8 @@ def test_oauth2_authentication_missing_secrets( ) # access token expired, call refresh request - @mock.patch("fides.api.ops.models.connectionconfig.ConnectionConfig.update") - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.models.connectionconfig.ConnectionConfig.update") + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_oauth2_authentication_successful_refresh( self, mock_send: Mock, @@ -177,9 +175,7 @@ def test_oauth2_authentication_no_refresh( ) # access token expired, unable to refresh - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_oauth2_authentication_failed_refresh( self, mock_send: Mock, @@ -210,10 +206,10 @@ def test_oauth2_authentication_failed_refresh( class TestAuthorizationUrl: @mock.patch( - "fides.api.ops.service.authentication.authentication_strategy_oauth2_authorization_code.OAuth2AuthorizationCodeAuthenticationStrategy._generate_state" + "fides.api.service.authentication.authentication_strategy_oauth2_authorization_code.OAuth2AuthorizationCodeAuthenticationStrategy._generate_state" ) @mock.patch( - "fides.api.ops.models.authentication_request.AuthenticationRequest.create_or_update" + "fides.api.models.authentication_request.AuthenticationRequest.create_or_update" ) def test_get_authorization_url( self, @@ -271,10 +267,8 @@ def test_get_authorization_url_missing_secrets( class TestAccessTokenRequest: @mock.patch("datetime.datetime") - @mock.patch("fides.api.ops.models.connectionconfig.ConnectionConfig.update") - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.models.connectionconfig.ConnectionConfig.update") + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_get_access_token( self, mock_send: Mock, @@ -324,10 +318,8 @@ def test_get_access_token( ) @mock.patch("datetime.datetime") - @mock.patch("fides.api.ops.models.connectionconfig.ConnectionConfig.update") - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.models.connectionconfig.ConnectionConfig.update") + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_get_access_token_no_expires_in( self, mock_send: Mock, diff --git a/tests/ops/service/authentication/test_authentication_strategy_oauth2_client_credentials.py b/tests/ops/service/authentication/test_authentication_strategy_oauth2_client_credentials.py index 8e077457d4..5ac18977b8 100644 --- a/tests/ops/service/authentication/test_authentication_strategy_oauth2_client_credentials.py +++ b/tests/ops/service/authentication/test_authentication_strategy_oauth2_client_credentials.py @@ -7,16 +7,16 @@ from requests import PreparedRequest, Request from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import FidesopsException, OAuth2TokenException -from fides.api.ops.models.connectionconfig import ( +from fides.api.common_exceptions import FidesopsException, OAuth2TokenException +from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.service.authentication.authentication_strategy_oauth2_client_credentials import ( +from fides.api.service.authentication.authentication_strategy_oauth2_client_credentials import ( OAuth2ClientCredentialsAuthenticationStrategy, ) @@ -132,7 +132,7 @@ def test_oauth2_authentication( ) @mock.patch( - "fides.api.ops.service.authentication.authentication_strategy_oauth2_base.OAuth2AuthenticationStrategyBase.get_access_token" + "fides.api.service.authentication.authentication_strategy_oauth2_base.OAuth2AuthenticationStrategyBase.get_access_token" ) def test_oauth2_authentication_missing_access_token( self, @@ -161,7 +161,7 @@ def test_oauth2_authentication_missing_access_token( ) @mock.patch( - "fides.api.ops.service.authentication.authentication_strategy_oauth2_base.OAuth2AuthenticationStrategyBase.get_access_token" + "fides.api.service.authentication.authentication_strategy_oauth2_base.OAuth2AuthenticationStrategyBase.get_access_token" ) def test_oauth2_authentication_empty_access_token( self, @@ -214,10 +214,8 @@ def test_oauth2_authentication_missing_secrets( ) # access token expired, call refresh request - @mock.patch("fides.api.ops.models.connectionconfig.ConnectionConfig.update") - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.models.connectionconfig.ConnectionConfig.update") + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_oauth2_authentication_successful_refresh( self, mock_send: Mock, @@ -280,9 +278,7 @@ def test_oauth2_authentication_no_refresh( ) # access token expired, unable to refresh - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_oauth2_authentication_failed_refresh( self, mock_send: Mock, @@ -313,10 +309,8 @@ def test_oauth2_authentication_failed_refresh( class TestAccessTokenRequest: @mock.patch("datetime.datetime") - @mock.patch("fides.api.ops.models.connectionconfig.ConnectionConfig.update") - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.models.connectionconfig.ConnectionConfig.update") + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_get_access_token( self, mock_send: Mock, @@ -360,10 +354,8 @@ def test_get_access_token( ) @mock.patch("datetime.datetime") - @mock.patch("fides.api.ops.models.connectionconfig.ConnectionConfig.update") - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.models.connectionconfig.ConnectionConfig.update") + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_get_access_token_no_expires_in( self, mock_send: Mock, diff --git a/tests/ops/service/authentication/test_authentication_strategy_query_param.py b/tests/ops/service/authentication/test_authentication_strategy_query_param.py index 5a50e1c663..55bf5917c2 100644 --- a/tests/ops/service/authentication/test_authentication_strategy_query_param.py +++ b/tests/ops/service/authentication/test_authentication_strategy_query_param.py @@ -1,9 +1,9 @@ import pytest from requests import PreparedRequest, Request -from fides.api.ops.common_exceptions import ValidationError as FidesopsValidationError -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.service.authentication.authentication_strategy_factory import ( +from fides.api.common_exceptions import ValidationError as FidesopsValidationError +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.service.authentication.authentication_strategy_factory import ( get_strategy, ) diff --git a/tests/ops/service/connection_config/test_http_connector.py b/tests/ops/service/connection_config/test_http_connector.py index 28c46ec7ac..681f233330 100644 --- a/tests/ops/service/connection_config/test_http_connector.py +++ b/tests/ops/service/connection_config/test_http_connector.py @@ -3,8 +3,8 @@ import pytest import requests_mock -from fides.api.ops.common_exceptions import ClientUnsuccessfulException -from fides.api.ops.service.connectors import HTTPSConnector +from fides.api.common_exceptions import ClientUnsuccessfulException +from fides.api.service.connectors import HTTPSConnector class TestHttpConnectorMethods: diff --git a/tests/ops/service/connection_config/test_mariadb_connector.py b/tests/ops/service/connection_config/test_mariadb_connector.py index 51824dd807..5029709261 100644 --- a/tests/ops/service/connection_config/test_mariadb_connector.py +++ b/tests/ops/service/connection_config/test_mariadb_connector.py @@ -1,6 +1,6 @@ from sqlalchemy.orm import Session -from fides.api.ops.service.connectors.sql_connector import MariaDBConnector +from fides.api.service.connectors.sql_connector import MariaDBConnector def test_mariadb_connector_build_uri(connection_config_mariadb, db: Session): diff --git a/tests/ops/service/connection_config/test_mysql_connector.py b/tests/ops/service/connection_config/test_mysql_connector.py index b1d19607ac..1a65d6aaba 100644 --- a/tests/ops/service/connection_config/test_mysql_connector.py +++ b/tests/ops/service/connection_config/test_mysql_connector.py @@ -1,6 +1,6 @@ from sqlalchemy.orm import Session -from fides.api.ops.service.connectors.sql_connector import MySQLConnector +from fides.api.service.connectors.sql_connector import MySQLConnector def test_mysql_connector_build_uri(connection_config_mysql, db: Session): diff --git a/tests/ops/service/connection_config/test_postgres_connector.py b/tests/ops/service/connection_config/test_postgres_connector.py index ff37ff1eb9..99253c000a 100644 --- a/tests/ops/service/connection_config/test_postgres_connector.py +++ b/tests/ops/service/connection_config/test_postgres_connector.py @@ -1,7 +1,7 @@ from sqlalchemy.orm import Session -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.service.connectors import PostgreSQLConnector +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.service.connectors import PostgreSQLConnector def test_postgres_connector_build_uri(connection_config: ConnectionConfig, db: Session): diff --git a/tests/ops/service/connectors/fides/test_fides_client.py b/tests/ops/service/connectors/fides/test_fides_client.py index 305115c0b6..73cfa44170 100644 --- a/tests/ops/service/connectors/fides/test_fides_client.py +++ b/tests/ops/service/connectors/fides/test_fides_client.py @@ -5,8 +5,8 @@ from httpx import AsyncClient, Client, HTTPStatusError from fides.api.ctl.utils.errors import FidesError -from fides.api.ops.models.privacy_request import PrivacyRequest, PrivacyRequestStatus -from fides.api.ops.service.connectors.fides.fides_client import FidesClient +from fides.api.models.privacy_request import PrivacyRequest, PrivacyRequestStatus +from fides.api.service.connectors.fides.fides_client import FidesClient SAMPLE_TOKEN = "SOME_TOKEN" diff --git a/tests/ops/service/connectors/saas/test_authenticated_client.py b/tests/ops/service/connectors/saas/test_authenticated_client.py index ce64568103..ad378b9d37 100644 --- a/tests/ops/service/connectors/saas/test_authenticated_client.py +++ b/tests/ops/service/connectors/saas/test_authenticated_client.py @@ -6,18 +6,15 @@ import pytest from requests import ConnectionError, Response, Session -from fides.api.ops.common_exceptions import ( - ClientUnsuccessfulException, - ConnectionException, -) -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.schemas.saas.saas_config import ClientConfig -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors.saas.authenticated_client import ( +from fides.api.common_exceptions import ClientUnsuccessfulException, ConnectionException +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.schemas.saas.saas_config import ClientConfig +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors.saas.authenticated_client import ( AuthenticatedClient, get_retry_after, ) -from fides.api.ops.util.saas_util import load_config_with_replacement +from fides.api.util.saas_util import load_config_with_replacement @pytest.fixture diff --git a/tests/ops/service/connectors/test_connector_registry_service.py b/tests/ops/service/connectors/test_connector_registry_service.py index cb80b418de..ea967328fc 100644 --- a/tests/ops/service/connectors/test_connector_registry_service.py +++ b/tests/ops/service/connectors/test_connector_registry_service.py @@ -5,13 +5,13 @@ import yaml from fideslang.models import DatasetCollection -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.schemas.saas.connector_template import ConnectorTemplate -from fides.api.ops.service.connectors.saas.connector_registry_service import ( +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.schemas.saas.connector_template import ConnectorTemplate +from fides.api.service.connectors.saas.connector_registry_service import ( ConnectorRegistry, update_saas_configs, ) -from fides.api.ops.util.saas_util import ( +from fides.api.util.saas_util import ( encode_file_contents, load_config_from_string, load_dataset_from_string, @@ -64,13 +64,13 @@ def test_get_connector_template(self): assert mailchimp_template.human_readable == "Mailchimp" @mock.patch( - "fides.api.ops.service.connectors.saas.connector_registry_service.replace_dataset_placeholders" + "fides.api.service.connectors.saas.connector_registry_service.replace_dataset_placeholders" ) @mock.patch( - "fides.api.ops.service.connectors.saas.connector_registry_service.replace_config_placeholders" + "fides.api.service.connectors.saas.connector_registry_service.replace_config_placeholders" ) @mock.patch( - "fides.api.ops.service.connectors.saas.connector_registry_service.load_config_from_string" + "fides.api.service.connectors.saas.connector_registry_service.load_config_from_string" ) def test_update_config_additions( self, @@ -97,13 +97,13 @@ def test_update_config_additions( ) @mock.patch( - "fides.api.ops.service.connectors.saas.connector_registry_service.replace_dataset_placeholders" + "fides.api.service.connectors.saas.connector_registry_service.replace_dataset_placeholders" ) @mock.patch( - "fides.api.ops.service.connectors.saas.connector_registry_service.replace_config_placeholders" + "fides.api.service.connectors.saas.connector_registry_service.replace_config_placeholders" ) @mock.patch( - "fides.api.ops.service.connectors.saas.connector_registry_service.load_config_from_string" + "fides.api.service.connectors.saas.connector_registry_service.load_config_from_string" ) def test_update_config_removals( self, diff --git a/tests/ops/service/connectors/test_connector_template_loaders.py b/tests/ops/service/connectors/test_connector_template_loaders.py index 5d279cd359..e51a526854 100644 --- a/tests/ops/service/connectors/test_connector_template_loaders.py +++ b/tests/ops/service/connectors/test_connector_template_loaders.py @@ -6,23 +6,23 @@ import pytest -from fides.api.ops.common_exceptions import NoSuchSaaSRequestOverrideException -from fides.api.ops.models.custom_connector_template import CustomConnectorTemplate -from fides.api.ops.schemas.saas.connector_template import ConnectorTemplate -from fides.api.ops.service.authentication.authentication_strategy import ( +from fides.api.common_exceptions import NoSuchSaaSRequestOverrideException +from fides.api.models.custom_connector_template import CustomConnectorTemplate +from fides.api.schemas.saas.connector_template import ConnectorTemplate +from fides.api.service.authentication.authentication_strategy import ( AuthenticationStrategy, ) -from fides.api.ops.service.connectors.saas.connector_registry_service import ( +from fides.api.service.connectors.saas.connector_registry_service import ( ConnectorRegistry, CustomConnectorTemplateLoader, FileConnectorTemplateLoader, register_custom_functions, ) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestOverrideFactory, SaaSRequestType, ) -from fides.api.ops.util.saas_util import ( +from fides.api.util.saas_util import ( encode_file_contents, load_config_from_string, load_yaml_as_string, @@ -141,7 +141,7 @@ def test_custom_connector_template_loader_no_templates(self): assert connector_templates == {} @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.all" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.all" ) def test_custom_connector_template_loader_invalid_template( self, @@ -179,7 +179,7 @@ def test_custom_connector_template_loader_invalid_template( ] @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.all" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.all" ) def test_custom_connector_template_loader_invalid_functions( self, @@ -207,7 +207,7 @@ def test_custom_connector_template_loader_invalid_functions( assert connector_templates == {} @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.all" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.all" ) def test_custom_connector_template_loader_custom_connector_functions_disabled( self, @@ -246,7 +246,7 @@ def test_custom_connector_template_loader_custom_connector_functions_disabled( ] @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.all" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.all" ) def test_custom_connector_template_loader_custom_connector_functions_disabled_custom_functions( self, @@ -286,7 +286,7 @@ def test_custom_connector_template_loader_custom_connector_functions_disabled_cu } @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.all" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.all" ) def test_custom_connector_template_loader( self, @@ -335,7 +335,7 @@ def test_custom_connector_template_loader( ] @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.all" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.all" ) def test_loaders_have_separate_instances( self, @@ -367,7 +367,7 @@ def test_loaders_have_separate_instances( assert file_connector_templates != custom_connector_templates @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.create_or_update" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.create_or_update" ) def test_custom_connector_save_template( self, @@ -434,10 +434,10 @@ def test_custom_connector_template_loader_disallowed_modules( assert "Import of 'os' module is not allowed." == str(exc.value) @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.delete" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.delete" ) @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.all" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.all" ) def test_custom_connector_replacement_replaceable_with_update_available( self, @@ -472,10 +472,10 @@ def test_custom_connector_replacement_replaceable_with_update_available( mock_delete.assert_called_once() @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.delete" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.delete" ) @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.all" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.all" ) def test_custom_connector_replacement_replaceable_with_update_not_available( self, @@ -515,10 +515,10 @@ def test_custom_connector_replacement_replaceable_with_update_not_available( mock_delete.assert_not_called() @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.delete" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.delete" ) @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.all" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.all" ) def test_custom_connector_replacement_not_replaceable( self, @@ -558,7 +558,7 @@ def test_custom_connector_replacement_not_replaceable( mock_delete.assert_not_called() @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.create_or_update" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.create_or_update" ) def test_replaceable_template_for_existing_template( self, mock_create_or_update: MagicMock, zendesk_config, replaceable_zendesk_zip @@ -578,7 +578,7 @@ def test_replaceable_template_for_existing_template( assert custom_config["version"] == existing_config["version"] @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.create_or_update" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.create_or_update" ) def test_replaceable_template_for_new_template( self, mock_create_or_update: MagicMock, replaceable_planet_express_zip @@ -597,7 +597,7 @@ def test_replaceable_template_for_new_template( assert custom_config["version"] == "0.0.1" @mock.patch( - "fides.api.ops.models.custom_connector_template.CustomConnectorTemplate.create_or_update" + "fides.api.models.custom_connector_template.CustomConnectorTemplate.create_or_update" ) def test_non_replaceable_template( self, @@ -620,9 +620,7 @@ class TestRegisterCustomFunctions: def test_function_loader(self): """Verify that all override implementations can be loaded by RestrictedPython""" - overrides_path = ( - "src/fides/api/ops/service/saas_request/override_implementations" - ) + overrides_path = "src/fides/api/service/saas_request/override_implementations" for filename in os.listdir(overrides_path): if filename.endswith(".py") and filename != "__init__.py": diff --git a/tests/ops/service/connectors/test_consent_email_connector.py b/tests/ops/service/connectors/test_consent_email_connector.py index 90fdfd7db2..93156193e0 100644 --- a/tests/ops/service/connectors/test_consent_email_connector.py +++ b/tests/ops/service/connectors/test_consent_email_connector.py @@ -2,31 +2,29 @@ import pytest -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.models.connectionconfig import AccessLevel, ConnectionTestStatus -from fides.api.ops.models.privacy_notice import ConsentMechanism, EnforcementLevel -from fides.api.ops.models.privacy_preference import UserConsentPreference -from fides.api.ops.schemas.connection_configuration.connection_secrets_email import ( +from fides.api.common_exceptions import MessageDispatchException +from fides.api.models.connectionconfig import AccessLevel, ConnectionTestStatus +from fides.api.models.privacy_notice import ConsentMechanism, EnforcementLevel +from fides.api.models.privacy_preference import UserConsentPreference +from fides.api.schemas.connection_configuration.connection_secrets_email import ( AdvancedSettingsWithExtendedIdentityTypes, ExtendedEmailSchema, ExtendedIdentityTypes, ) -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.schemas.messaging.messaging import ( ConsentPreferencesByUser, MessagingActionType, ) -from fides.api.ops.schemas.privacy_notice import PrivacyNoticeHistorySchema -from fides.api.ops.schemas.privacy_preference import ( - MinimalPrivacyPreferenceHistorySchema, -) -from fides.api.ops.schemas.privacy_request import Consent -from fides.api.ops.service.connectors.consent_email_connector import ( +from fides.api.schemas.privacy_notice import PrivacyNoticeHistorySchema +from fides.api.schemas.privacy_preference import MinimalPrivacyPreferenceHistorySchema +from fides.api.schemas.privacy_request import Consent +from fides.api.service.connectors.consent_email_connector import ( GenericConsentEmailConnector, filter_user_identities_for_connector, get_identity_types_for_connector, send_single_consent_email, ) -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.service.privacy_request.request_runner_service import ( get_consent_email_connection_configs, ) @@ -145,9 +143,7 @@ def test_get_user_identities_for_connector( == filtered_identities ) - @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.dispatch_message" - ) + @mock.patch("fides.api.service.connectors.consent_email_connector.dispatch_message") def test_send_single_consent_email_no_org_defined(self, mock_dispatch, db): with pytest.raises(MessageDispatchException) as exc: send_single_consent_email( @@ -182,9 +178,7 @@ def test_send_single_consent_email_no_org_defined(self, mock_dispatch, db): == "Cannot send an email to third-party vendor. No organization name found." ) - @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.dispatch_message" - ) + @mock.patch("fides.api.service.connectors.consent_email_connector.dispatch_message") def test_send_single_consent_email_old_workflow( self, mock_dispatch, test_fides_org, db, messaging_config ): @@ -249,9 +243,7 @@ def test_send_single_consent_email_old_workflow( == "Test notification of users' consent preference changes from Test Org" ) - @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.dispatch_message" - ) + @mock.patch("fides.api.service.connectors.consent_email_connector.dispatch_message") def test_send_single_consent_email_preferences_by_privacy_notice( self, mock_dispatch, test_fides_org, db, messaging_config ): @@ -496,7 +488,7 @@ def test_connection_no_test_email_address( assert status == ConnectionTestStatus.failed @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email" + "fides.api.service.connectors.consent_email_connector.send_single_consent_email" ) def test_test_connection_call( self, mock_send_email, db, test_sovrn_consent_email_connector diff --git a/tests/ops/service/connectors/test_erasure_email_connector.py b/tests/ops/service/connectors/test_erasure_email_connector.py index 450ffa339d..3af6db3e9a 100644 --- a/tests/ops/service/connectors/test_erasure_email_connector.py +++ b/tests/ops/service/connectors/test_erasure_email_connector.py @@ -2,21 +2,21 @@ import pytest -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.models.connectionconfig import AccessLevel, ConnectionTestStatus -from fides.api.ops.schemas.connection_configuration.connection_secrets_email import ( +from fides.api.common_exceptions import MessageDispatchException +from fides.api.models.connectionconfig import AccessLevel, ConnectionTestStatus +from fides.api.schemas.connection_configuration.connection_secrets_email import ( AdvancedSettings, EmailSchema, IdentityTypes, ) -from fides.api.ops.schemas.messaging.messaging import MessagingActionType -from fides.api.ops.service.connectors.erasure_email_connector import ( +from fides.api.schemas.messaging.messaging import MessagingActionType +from fides.api.service.connectors.erasure_email_connector import ( GenericErasureEmailConnector, filter_user_identities_for_connector, get_identity_types_for_connector, send_single_erasure_email, ) -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.service.privacy_request.request_runner_service import ( get_erasure_email_connection_configs, ) @@ -140,9 +140,7 @@ def test_get_user_identities_for_connector( == filtered_identities ) - @mock.patch( - "fides.api.ops.service.connectors.erasure_email_connector.dispatch_message" - ) + @mock.patch("fides.api.service.connectors.erasure_email_connector.dispatch_message") def test_send_single_erasure_email_no_org_defined(self, mock_dispatch, db): with pytest.raises(MessageDispatchException) as exc: send_single_erasure_email( @@ -159,9 +157,7 @@ def test_send_single_erasure_email_no_org_defined(self, mock_dispatch, db): == "Cannot send an email to third-party vendor. No organization name found." ) - @mock.patch( - "fides.api.ops.service.connectors.erasure_email_connector.dispatch_message" - ) + @mock.patch("fides.api.service.connectors.erasure_email_connector.dispatch_message") def test_send_single_erasure_email( self, mock_dispatch, test_fides_org, db, messaging_config ): @@ -267,7 +263,7 @@ def test_connection_no_test_email_address( assert status == ConnectionTestStatus.failed @mock.patch( - "fides.api.ops.service.connectors.erasure_email_connector.send_single_erasure_email" + "fides.api.service.connectors.erasure_email_connector.send_single_erasure_email" ) def test_test_connection_call( self, mock_send_email, db, test_attentive_erasure_email_connector diff --git a/tests/ops/service/connectors/test_fides_connector.py b/tests/ops/service/connectors/test_fides_connector.py index 1315da7bb7..45c477250d 100644 --- a/tests/ops/service/connectors/test_fides_connector.py +++ b/tests/ops/service/connectors/test_fides_connector.py @@ -4,19 +4,19 @@ import pytest from httpx import Client -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionTestStatus -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.policy import ActionType, Policy -from fides.api.ops.models.privacy_request import PrivacyRequest, PrivacyRequestStatus -from fides.api.ops.service.connectors.fides.fides_client import FidesClient -from fides.api.ops.service.connectors.fides_connector import ( +from fides.api.graph.traversal import TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionTestStatus +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.policy import ActionType, Policy +from fides.api.models.privacy_request import PrivacyRequest, PrivacyRequestStatus +from fides.api.service.connectors.fides.fides_client import FidesClient +from fides.api.service.connectors.fides_connector import ( DEFAULT_POLLING_INTERVAL, DEFAULT_POLLING_TIMEOUT, FidesConnector, filter_fides_connector_datasets, ) -from fides.api.ops.service.privacy_request import request_service +from fides.api.service.privacy_request import request_service from tests.ops.graph.graph_test_util import assert_rows_match, generate_node diff --git a/tests/ops/service/connectors/test_queryconfig.py b/tests/ops/service/connectors/test_queryconfig.py index 753f654053..555ae5abff 100644 --- a/tests/ops/service/connectors/test_queryconfig.py +++ b/tests/ops/service/connectors/test_queryconfig.py @@ -5,28 +5,26 @@ from boto3.dynamodb.types import TypeDeserializer, TypeSerializer from fideslang.models import Dataset -from fides.api.ops.graph.config import ( +from fides.api.graph.config import ( CollectionAddress, FieldAddress, FieldPath, ObjectField, ScalarField, ) -from fides.api.ops.graph.graph import DatasetGraph, Edge -from fides.api.ops.graph.traversal import Traversal, TraversalNode -from fides.api.ops.models.datasetconfig import convert_dataset_to_graph -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.masking.masking_configuration import HashMaskingConfiguration -from fides.api.ops.schemas.masking.masking_secrets import MaskingSecretCache, SecretType -from fides.api.ops.service.connectors.query_config import ( +from fides.api.graph.graph import DatasetGraph, Edge +from fides.api.graph.traversal import Traversal, TraversalNode +from fides.api.models.datasetconfig import convert_dataset_to_graph +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.masking.masking_configuration import HashMaskingConfiguration +from fides.api.schemas.masking.masking_secrets import MaskingSecretCache, SecretType +from fides.api.service.connectors.query_config import ( DynamoDBQueryConfig, MongoQueryConfig, SQLQueryConfig, ) -from fides.api.ops.service.masking.strategy.masking_strategy_hash import ( - HashMaskingStrategy, -) -from fides.api.ops.util.data_category import DataCategory +from fides.api.service.masking.strategy.masking_strategy_hash import HashMaskingStrategy +from fides.api.util.data_category import DataCategory from ...task.traversal_data import combined_mongo_postgresql_graph, integration_db_graph from ...test_helpers.cache_secrets_helper import cache_secret, clear_cache_secrets diff --git a/tests/ops/service/connectors/test_saas_connector.py b/tests/ops/service/connectors/test_saas_connector.py index b2e91e9e31..7493dd8b31 100644 --- a/tests/ops/service/connectors/test_saas_connector.py +++ b/tests/ops/service/connectors/test_saas_connector.py @@ -9,16 +9,16 @@ from sqlalchemy.orm import Session from starlette.status import HTTP_200_OK, HTTP_404_NOT_FOUND -from fides.api.ops.common_exceptions import SkippingConsentPropagation -from fides.api.ops.graph.graph import Node -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest, PrivacyRequestStatus -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.schemas.saas.saas_config import ParamValue, SaaSConfig, SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod -from fides.api.ops.service.connectors import get_connector -from fides.api.ops.service.connectors.saas_connector import SaaSConnector +from fides.api.common_exceptions import SkippingConsentPropagation +from fides.api.graph.graph import Node +from fides.api.graph.traversal import TraversalNode +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest, PrivacyRequestStatus +from fides.api.schemas.redis_cache import Identity +from fides.api.schemas.saas.saas_config import ParamValue, SaaSConfig, SaaSRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod +from fides.api.service.connectors import get_connector +from fides.api.service.connectors.saas_connector import SaaSConnector from tests.ops.graph.graph_test_util import generate_node @@ -151,9 +151,7 @@ def test_delete_only_endpoint( traversal_node, Policy(), PrivacyRequest(id="123"), {} ) == [{}] - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_input_values( self, mock_send: Mock, saas_example_config, saas_example_connection_config ): @@ -218,9 +216,7 @@ def test_missing_input_values( == [] ) - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_grouped_input_values( self, mock_send: Mock, saas_example_config, saas_example_connection_config ): @@ -285,9 +281,7 @@ def test_missing_grouped_inputs_input_values( == [] ) - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_skip_missing_param_values_masking( self, mock_send: Mock, saas_example_config, saas_example_connection_config ): @@ -621,9 +615,7 @@ def test_no_requests_of_that_type_defined( privacy_preference_history.affected_system_status == {} ), "Updated to skipped in graph task, not updated here" - @mock.patch( - "fides.api.ops.service.connectors.saas_connector.AuthenticatedClient.send" - ) + @mock.patch("fides.api.service.connectors.saas_connector.AuthenticatedClient.send") def test_preferences_executable( self, mock_send, diff --git a/tests/ops/service/connectors/test_saas_queryconfig.py b/tests/ops/service/connectors/test_saas_queryconfig.py index 813ce900d2..68421417b1 100644 --- a/tests/ops/service/connectors/test_saas_queryconfig.py +++ b/tests/ops/service/connectors/test_saas_queryconfig.py @@ -5,15 +5,15 @@ import pytest -from fides.api.ops.graph.config import CollectionAddress -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.graph.traversal import Traversal, TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import DatasetConfig -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.schemas.saas.saas_config import ParamValue, SaaSConfig, SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors.saas_query_config import SaaSQueryConfig +from fides.api.graph.config import CollectionAddress +from fides.api.graph.graph import DatasetGraph +from fides.api.graph.traversal import Traversal, TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import DatasetConfig +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.schemas.saas.saas_config import ParamValue, SaaSConfig, SaaSRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors.saas_query_config import SaaSQueryConfig from fides.core.config import CONFIG from tests.ops.graph.graph_test_util import generate_node @@ -53,7 +53,7 @@ def test_external_reference_traversal( ) @mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.get_cached_identity_data" + "fides.api.models.privacy_request.PrivacyRequest.get_cached_identity_data" ) def test_generate_requests( self, @@ -351,7 +351,7 @@ def test_generate_update_stmt_with_url_encoded_body( assert prepared_request.body == "name%5Bfirst%5D=MASKED&name%5Blast%5D=MASKED" @mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.get_cached_identity_data" + "fides.api.models.privacy_request.PrivacyRequest.get_cached_identity_data" ) def test_get_read_requests_by_identity( self, diff --git a/tests/ops/service/masking/strategy/test_masking_strategy_aes_encrypt.py b/tests/ops/service/masking/strategy/test_masking_strategy_aes_encrypt.py index 58b85356e8..64e0132c3a 100644 --- a/tests/ops/service/masking/strategy/test_masking_strategy_aes_encrypt.py +++ b/tests/ops/service/masking/strategy/test_masking_strategy_aes_encrypt.py @@ -2,11 +2,11 @@ from unittest import mock from unittest.mock import Mock -from fides.api.ops.schemas.masking.masking_configuration import ( +from fides.api.schemas.masking.masking_configuration import ( AesEncryptionMaskingConfiguration, ) -from fides.api.ops.schemas.masking.masking_secrets import MaskingSecretCache, SecretType -from fides.api.ops.service.masking.strategy.masking_strategy_aes_encrypt import ( +from fides.api.schemas.masking.masking_secrets import MaskingSecretCache, SecretType +from fides.api.service.masking.strategy.masking_strategy_aes_encrypt import ( AesEncryptionMaskingStrategy, ) @@ -19,9 +19,7 @@ AES_STRATEGY = AesEncryptionMaskingStrategy(configuration=GCM_CONFIGURATION) -@mock.patch( - "fides.api.ops.service.masking.strategy.masking_strategy_aes_encrypt.encrypt" -) +@mock.patch("fides.api.service.masking.strategy.masking_strategy_aes_encrypt.encrypt") def test_mask_gcm_happypath(mock_encrypt: Mock): mock_encrypt.return_value = "encrypted" @@ -37,9 +35,7 @@ def test_mask_gcm_happypath(mock_encrypt: Mock): clear_cache_secrets(request_id) -@mock.patch( - "fides.api.ops.service.masking.strategy.masking_strategy_aes_encrypt.encrypt" -) +@mock.patch("fides.api.service.masking.strategy.masking_strategy_aes_encrypt.encrypt") def test_mask_all_aes_modes(mock_encrypt: Mock): cache_secrets() for mode in AesEncryptionMaskingConfiguration.Mode: diff --git a/tests/ops/service/masking/strategy/test_masking_strategy_factory.py b/tests/ops/service/masking/strategy/test_masking_strategy_factory.py index c77fc25f81..b8020b28c4 100644 --- a/tests/ops/service/masking/strategy/test_masking_strategy_factory.py +++ b/tests/ops/service/masking/strategy/test_masking_strategy_factory.py @@ -1,14 +1,12 @@ import pytest -from fides.api.ops.common_exceptions import NoSuchStrategyException -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy -from fides.api.ops.service.masking.strategy.masking_strategy_aes_encrypt import ( +from fides.api.common_exceptions import NoSuchStrategyException +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.service.masking.strategy.masking_strategy_aes_encrypt import ( AesEncryptionMaskingStrategy, ) -from fides.api.ops.service.masking.strategy.masking_strategy_hash import ( - HashMaskingStrategy, -) -from fides.api.ops.service.masking.strategy.masking_strategy_string_rewrite import ( +from fides.api.service.masking.strategy.masking_strategy_hash import HashMaskingStrategy +from fides.api.service.masking.strategy.masking_strategy_string_rewrite import ( StringRewriteMaskingStrategy, ) diff --git a/tests/ops/service/masking/strategy/test_masking_strategy_hash.py b/tests/ops/service/masking/strategy/test_masking_strategy_hash.py index de467b0b67..c33e509187 100644 --- a/tests/ops/service/masking/strategy/test_masking_strategy_hash.py +++ b/tests/ops/service/masking/strategy/test_masking_strategy_hash.py @@ -1,10 +1,8 @@ from datetime import datetime -from fides.api.ops.schemas.masking.masking_configuration import HashMaskingConfiguration -from fides.api.ops.schemas.masking.masking_secrets import MaskingSecretCache, SecretType -from fides.api.ops.service.masking.strategy.masking_strategy_hash import ( - HashMaskingStrategy, -) +from fides.api.schemas.masking.masking_configuration import HashMaskingConfiguration +from fides.api.schemas.masking.masking_secrets import MaskingSecretCache, SecretType +from fides.api.service.masking.strategy.masking_strategy_hash import HashMaskingStrategy from ....test_helpers.cache_secrets_helper import cache_secret, clear_cache_secrets diff --git a/tests/ops/service/masking/strategy/test_masking_strategy_hmac.py b/tests/ops/service/masking/strategy/test_masking_strategy_hmac.py index 9d22bd3d3b..59b1f48a52 100644 --- a/tests/ops/service/masking/strategy/test_masking_strategy_hmac.py +++ b/tests/ops/service/masking/strategy/test_masking_strategy_hmac.py @@ -1,10 +1,8 @@ from datetime import datetime -from fides.api.ops.schemas.masking.masking_configuration import HmacMaskingConfiguration -from fides.api.ops.schemas.masking.masking_secrets import MaskingSecretCache, SecretType -from fides.api.ops.service.masking.strategy.masking_strategy_hmac import ( - HmacMaskingStrategy, -) +from fides.api.schemas.masking.masking_configuration import HmacMaskingConfiguration +from fides.api.schemas.masking.masking_secrets import MaskingSecretCache, SecretType +from fides.api.service.masking.strategy.masking_strategy_hmac import HmacMaskingStrategy from ....test_helpers.cache_secrets_helper import cache_secret, clear_cache_secrets diff --git a/tests/ops/service/masking/strategy/test_masking_strategy_null.py b/tests/ops/service/masking/strategy/test_masking_strategy_null.py index d12ca33a7a..607ac546e6 100644 --- a/tests/ops/service/masking/strategy/test_masking_strategy_null.py +++ b/tests/ops/service/masking/strategy/test_masking_strategy_null.py @@ -1,5 +1,5 @@ -from fides.api.ops.schemas.masking.masking_configuration import NullMaskingConfiguration -from fides.api.ops.service.masking.strategy.masking_strategy_nullify import ( +from fides.api.schemas.masking.masking_configuration import NullMaskingConfiguration +from fides.api.service.masking.strategy.masking_strategy_nullify import ( NullMaskingStrategy, ) diff --git a/tests/ops/service/masking/strategy/test_masking_strategy_random_string_rewrite.py b/tests/ops/service/masking/strategy/test_masking_strategy_random_string_rewrite.py index 7fcda33b6a..9ad2343977 100644 --- a/tests/ops/service/masking/strategy/test_masking_strategy_random_string_rewrite.py +++ b/tests/ops/service/masking/strategy/test_masking_strategy_random_string_rewrite.py @@ -1,7 +1,7 @@ -from fides.api.ops.schemas.masking.masking_configuration import ( +from fides.api.schemas.masking.masking_configuration import ( RandomStringMaskingConfiguration, ) -from fides.api.ops.service.masking.strategy.masking_strategy_random_string_rewrite import ( +from fides.api.service.masking.strategy.masking_strategy_random_string_rewrite import ( RandomStringRewriteMaskingStrategy, ) diff --git a/tests/ops/service/masking/strategy/test_masking_strategy_string_rewrite.py b/tests/ops/service/masking/strategy/test_masking_strategy_string_rewrite.py index 13f3233784..040f720fc7 100644 --- a/tests/ops/service/masking/strategy/test_masking_strategy_string_rewrite.py +++ b/tests/ops/service/masking/strategy/test_masking_strategy_string_rewrite.py @@ -1,7 +1,7 @@ -from fides.api.ops.schemas.masking.masking_configuration import ( +from fides.api.schemas.masking.masking_configuration import ( StringRewriteMaskingConfiguration, ) -from fides.api.ops.service.masking.strategy.masking_strategy_string_rewrite import ( +from fides.api.service.masking.strategy.masking_strategy_string_rewrite import ( StringRewriteMaskingStrategy, ) diff --git a/tests/ops/service/messaging/message_dispatch_service_test.py b/tests/ops/service/messaging/message_dispatch_service_test.py index 719126a7b2..464427f192 100644 --- a/tests/ops/service/messaging/message_dispatch_service_test.py +++ b/tests/ops/service/messaging/message_dispatch_service_test.py @@ -6,14 +6,14 @@ from sendgrid.helpers.mail import Email, To from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.models.messaging import MessagingConfig -from fides.api.ops.models.privacy_notice import ( +from fides.api.common_exceptions import MessageDispatchException +from fides.api.models.messaging import MessagingConfig +from fides.api.models.privacy_notice import ( ConsentMechanism, EnforcementLevel, UserConsentPreference, ) -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.schemas.messaging.messaging import ( ConsentEmailFulfillmentBodyParams, ConsentPreferencesByUser, EmailForActionType, @@ -24,13 +24,11 @@ MessagingServiceType, SubjectIdentityVerificationBodyParams, ) -from fides.api.ops.schemas.privacy_notice import PrivacyNoticeHistorySchema -from fides.api.ops.schemas.privacy_preference import ( - MinimalPrivacyPreferenceHistorySchema, -) -from fides.api.ops.schemas.privacy_request import Consent -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.messaging.message_dispatch_service import ( +from fides.api.schemas.privacy_notice import PrivacyNoticeHistorySchema +from fides.api.schemas.privacy_preference import MinimalPrivacyPreferenceHistorySchema +from fides.api.schemas.privacy_request import Consent +from fides.api.schemas.redis_cache import Identity +from fides.api.service.messaging.message_dispatch_service import ( EMAIL_TEMPLATE_NAME, _compose_twilio_mail, _get_dispatcher_from_config_type, @@ -76,7 +74,7 @@ def test_message_body(): @pytest.mark.unit class TestMessageDispatchService: @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) def test_email_dispatch_mailgun_success( self, mock_mailgun_dispatcher: Mock, db: Session, messaging_config @@ -101,7 +99,7 @@ def test_email_dispatch_mailgun_success( ) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) def test_email_dispatch_mailgun_config_not_found( self, mock_mailgun_dispatcher: Mock, db: Session @@ -123,7 +121,7 @@ def test_email_dispatch_mailgun_config_not_found( mock_mailgun_dispatcher.assert_not_called() @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) def test_email_dispatch_mailgun_config_no_secrets( self, mock_mailgun_dispatcher: Mock, db: Session @@ -191,7 +189,7 @@ def test_email_dispatch_mailgun_failed_email( ) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) def test_email_dispatch_mailgun_test_message( self, mock_mailgun_dispatcher, db, messaging_config @@ -213,7 +211,7 @@ def test_email_dispatch_mailgun_test_message( ) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._twilio_email_dispatcher" + "fides.api.service.messaging.message_dispatch_service._twilio_email_dispatcher" ) def test_email_dispatch_twilio_email_test_message( self, mock_twilio_dispatcher, db, messaging_config_twilio_email @@ -235,7 +233,7 @@ def test_email_dispatch_twilio_email_test_message( ) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._twilio_sms_dispatcher" + "fides.api.service.messaging.message_dispatch_service._twilio_sms_dispatcher" ) def test_email_dispatch_twilio_sms_test_message( self, mock_twilio_dispatcher, db, messaging_config_twilio_sms @@ -276,7 +274,7 @@ def test_fidesops_email_parse_object(self): ) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._twilio_sms_dispatcher" + "fides.api.service.messaging.message_dispatch_service._twilio_sms_dispatcher" ) def test_sms_dispatch_twilio_success( self, mock_twilio_dispatcher: Mock, db: Session, messaging_config_twilio_sms @@ -313,7 +311,7 @@ def test_sms_dispatch_twilio_no_to(self, db, messaging_config_twilio_sms): assert "No phone identity supplied." in str(err.value) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._twilio_sms_dispatcher" + "fides.api.service.messaging.message_dispatch_service._twilio_sms_dispatcher" ) def test_sms_dispatch_twilio_config_not_found( self, mock_twilio_dispatcher: Mock, db: Session @@ -336,7 +334,7 @@ def test_sms_dispatch_twilio_config_not_found( mock_twilio_dispatcher.assert_not_called() @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._twilio_sms_dispatcher" + "fides.api.service.messaging.message_dispatch_service._twilio_sms_dispatcher" ) def test_sms_dispatch_twilio_config_no_secrets( self, mock_mailgun_dispatcher: Mock, db: Session @@ -370,7 +368,7 @@ def test_sms_dispatch_twilio_config_no_secrets( messaging_config.delete(db) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._twilio_sms_dispatcher" + "fides.api.service.messaging.message_dispatch_service._twilio_sms_dispatcher" ) def test_dispatch_no_identity( self, mock_mailgun_dispatcher: Mock, db: Session @@ -400,7 +398,7 @@ def test_dispatch_no_identity( mock_mailgun_dispatcher.assert_not_called() @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._twilio_sms_dispatcher" + "fides.api.service.messaging.message_dispatch_service._twilio_sms_dispatcher" ) def test_dispatch_no_service_type( self, mock_mailgun_dispatcher: Mock, db: Session @@ -437,7 +435,7 @@ def test_dispatcher_from_config_type_unknown(self): assert _get_dispatcher_from_config_type("bad") is None @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) def test_email_dispatch_consent_request_email_fulfillment_for_sovrn_old_workflow( self, mock_mailgun_dispatcher: Mock, db: Session, messaging_config @@ -475,7 +473,7 @@ def test_email_dispatch_consent_request_email_fulfillment_for_sovrn_old_workflow ) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) def test_email_dispatch_consent_request_email_fulfillment_for_sovrn_new_workflow( self, mock_mailgun_dispatcher: Mock, db: Session, messaging_config @@ -605,7 +603,7 @@ def test_dispatch_no_sender(self, messaging_config_twilio_sms): assert "must be provided" in str(exc.value) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) def test_subject_override_for_email( self, mock_mailgun_dispatcher: Mock, db: Session, messaging_config @@ -631,7 +629,7 @@ def test_subject_override_for_email( ) @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._twilio_sms_dispatcher" + "fides.api.service.messaging.message_dispatch_service._twilio_sms_dispatcher" ) def test_sms_subject_override_ignored( self, mock_twilio_dispatcher: Mock, db: Session, messaging_config_twilio_sms diff --git a/tests/ops/service/pagination/test_pagination_strategy_cursor.py b/tests/ops/service/pagination/test_pagination_strategy_cursor.py index ffffa7df44..b22b26e8e4 100644 --- a/tests/ops/service/pagination/test_pagination_strategy_cursor.py +++ b/tests/ops/service/pagination/test_pagination_strategy_cursor.py @@ -4,11 +4,9 @@ import pytest from requests import Response -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.schemas.saas.strategy_configuration import ( - CursorPaginationConfiguration, -) -from fides.api.ops.service.pagination.pagination_strategy_cursor import ( +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.schemas.saas.strategy_configuration import CursorPaginationConfiguration +from fides.api.service.pagination.pagination_strategy_cursor import ( CursorPaginationStrategy, ) diff --git a/tests/ops/service/pagination/test_pagination_strategy_factory.py b/tests/ops/service/pagination/test_pagination_strategy_factory.py index 73d285b7ca..69909611cc 100644 --- a/tests/ops/service/pagination/test_pagination_strategy_factory.py +++ b/tests/ops/service/pagination/test_pagination_strategy_factory.py @@ -1,14 +1,12 @@ import pytest -from fides.api.ops.common_exceptions import NoSuchStrategyException, ValidationError -from fides.api.ops.service.pagination.pagination_strategy import PaginationStrategy -from fides.api.ops.service.pagination.pagination_strategy_cursor import ( +from fides.api.common_exceptions import NoSuchStrategyException, ValidationError +from fides.api.service.pagination.pagination_strategy import PaginationStrategy +from fides.api.service.pagination.pagination_strategy_cursor import ( CursorPaginationStrategy, ) -from fides.api.ops.service.pagination.pagination_strategy_link import ( - LinkPaginationStrategy, -) -from fides.api.ops.service.pagination.pagination_strategy_offset import ( +from fides.api.service.pagination.pagination_strategy_link import LinkPaginationStrategy +from fides.api.service.pagination.pagination_strategy_offset import ( OffsetPaginationStrategy, ) diff --git a/tests/ops/service/pagination/test_pagination_strategy_link.py b/tests/ops/service/pagination/test_pagination_strategy_link.py index b15b1e5c77..f22305b94a 100644 --- a/tests/ops/service/pagination/test_pagination_strategy_link.py +++ b/tests/ops/service/pagination/test_pagination_strategy_link.py @@ -4,13 +4,9 @@ import pytest from requests import Response -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.schemas.saas.strategy_configuration import ( - LinkPaginationConfiguration, -) -from fides.api.ops.service.pagination.pagination_strategy_link import ( - LinkPaginationStrategy, -) +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.schemas.saas.strategy_configuration import LinkPaginationConfiguration +from fides.api.service.pagination.pagination_strategy_link import LinkPaginationStrategy @pytest.fixture(scope="function") diff --git a/tests/ops/service/pagination/test_pagination_strategy_offset.py b/tests/ops/service/pagination/test_pagination_strategy_offset.py index 2dc201b4b5..557ce7576a 100644 --- a/tests/ops/service/pagination/test_pagination_strategy_offset.py +++ b/tests/ops/service/pagination/test_pagination_strategy_offset.py @@ -4,13 +4,11 @@ import pytest from requests import Response -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.schemas.saas.saas_config import SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.schemas.saas.strategy_configuration import ( - OffsetPaginationConfiguration, -) -from fides.api.ops.service.pagination.pagination_strategy_offset import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.schemas.saas.saas_config import SaaSRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.schemas.saas.strategy_configuration import OffsetPaginationConfiguration +from fides.api.service.pagination.pagination_strategy_offset import ( OffsetPaginationStrategy, ) diff --git a/tests/ops/service/privacy_request/test_email_batch_send.py b/tests/ops/service/privacy_request/test_email_batch_send.py index 72b96d242c..ea9ff870cf 100644 --- a/tests/ops/service/privacy_request/test_email_batch_send.py +++ b/tests/ops/service/privacy_request/test_email_batch_send.py @@ -3,28 +3,26 @@ import pytest from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import MessageDispatchException -from fides.api.ops.models.messaging import MessagingConfig -from fides.api.ops.models.policy import ActionType, Policy -from fides.api.ops.models.privacy_preference import UserConsentPreference -from fides.api.ops.models.privacy_request import ( +from fides.api.common_exceptions import MessageDispatchException +from fides.api.models.messaging import MessagingConfig +from fides.api.models.policy import ActionType, Policy +from fides.api.models.privacy_preference import UserConsentPreference +from fides.api.models.privacy_request import ( ExecutionLog, ExecutionLogStatus, PrivacyRequest, PrivacyRequestStatus, ) -from fides.api.ops.schemas.messaging.messaging import ConsentPreferencesByUser -from fides.api.ops.schemas.privacy_notice import PrivacyNoticeHistorySchema -from fides.api.ops.schemas.privacy_preference import ( - MinimalPrivacyPreferenceHistorySchema, -) -from fides.api.ops.schemas.privacy_request import Consent -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.service.privacy_request.email_batch_service import ( +from fides.api.schemas.messaging.messaging import ConsentPreferencesByUser +from fides.api.schemas.privacy_notice import PrivacyNoticeHistorySchema +from fides.api.schemas.privacy_preference import MinimalPrivacyPreferenceHistorySchema +from fides.api.schemas.privacy_request import Consent +from fides.api.schemas.redis_cache import Identity +from fides.api.service.privacy_request.email_batch_service import ( EmailExitState, send_email_batch, ) -from fides.api.ops.util.cache import get_all_cache_keys_for_privacy_request, get_cache +from fides.api.util.cache import get_all_cache_keys_for_privacy_request, get_cache from fides.core.config import get_config from tests.fixtures.application_fixtures import ( _create_privacy_request_for_policy, @@ -98,10 +96,10 @@ def third_privacy_request_awaiting_erasure_email_send( class TestConsentEmailBatchSend: @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email", + "fides.api.service.connectors.consent_email_connector.send_single_consent_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) def test_send_email_batch_no_applicable_privacy_requests( self, @@ -115,10 +113,10 @@ def test_send_email_batch_no_applicable_privacy_requests( assert not requeue_privacy_requests.called @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email", + "fides.api.service.connectors.consent_email_connector.send_single_consent_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) @pytest.mark.usefixtures("privacy_request_awaiting_consent_email_send") def test_send_email_batch_no_applicable_connectors( @@ -133,10 +131,10 @@ def test_send_email_batch_no_applicable_connectors( assert requeue_privacy_requests.called @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email", + "fides.api.service.connectors.consent_email_connector.send_single_consent_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) @pytest.mark.usefixtures("privacy_request_awaiting_consent_email_send") @pytest.mark.usefixtures("sovrn_email_connection_config") @@ -152,10 +150,10 @@ def test_send_email_batch_missing_identities( assert requeue_privacy_requests.called @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email", + "fides.api.service.connectors.consent_email_connector.send_single_consent_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) @pytest.mark.usefixtures("sovrn_email_connection_config") def test_send_consent_email_no_consent_or_privacy_preferences_saved( @@ -174,7 +172,7 @@ def test_send_consent_email_no_consent_or_privacy_preferences_saved( assert requeue_privacy_requests.called @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) @pytest.mark.usefixtures("sovrn_email_connection_config", "test_fides_org") def test_send_consent_email_failure_old_workflow( @@ -212,7 +210,7 @@ def test_send_consent_email_failure_old_workflow( assert not email_execution_log @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) @pytest.mark.usefixtures("test_fides_org") def test_send_consent_email_failure_new_workflow( @@ -286,10 +284,10 @@ def test_send_consent_email_failure_new_workflow( assert not privacy_preference_history_us_ca_provide.secondary_user_ids @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email", + "fides.api.service.connectors.consent_email_connector.send_single_consent_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) def test_send_consent_email_old_workflow( self, @@ -356,10 +354,10 @@ def test_send_consent_email_old_workflow( assert logs_for_privacy_request_without_identity is None @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email", + "fides.api.service.connectors.consent_email_connector.send_single_consent_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) def test_send_consent_email_skipped_logs_due_to_data_use_mismatch( self, @@ -410,10 +408,10 @@ def test_send_consent_email_skipped_logs_due_to_data_use_mismatch( assert not privacy_preference_history_us_ca_provide.secondary_user_ids @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email", + "fides.api.service.connectors.consent_email_connector.send_single_consent_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) def test_send_consent_email_new_workflow( self, @@ -540,10 +538,10 @@ def test_send_consent_email_new_workflow( assert not privacy_preference_history_us_ca_provide.secondary_user_ids @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email", + "fides.api.service.connectors.consent_email_connector.send_single_consent_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) def test_send_consent_email_multiple_users_old_workflow( self, @@ -606,10 +604,10 @@ def test_send_consent_email_multiple_users_old_workflow( ) @mock.patch( - "fides.api.ops.service.connectors.consent_email_connector.send_single_consent_email", + "fides.api.service.connectors.consent_email_connector.send_single_consent_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) def test_send_consent_email_multiple_users_new_workflow( self, @@ -682,10 +680,10 @@ def test_send_consent_email_multiple_users_new_workflow( class TestErasureEmailBatchSend: @mock.patch( - "fides.api.ops.service.connectors.erasure_email_connector.send_single_erasure_email", + "fides.api.service.connectors.erasure_email_connector.send_single_erasure_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) def test_send_email_batch_no_applicable_privacy_requests( self, @@ -699,10 +697,10 @@ def test_send_email_batch_no_applicable_privacy_requests( assert not requeue_privacy_requests.called @mock.patch( - "fides.api.ops.service.connectors.erasure_email_connector.send_single_erasure_email", + "fides.api.service.connectors.erasure_email_connector.send_single_erasure_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) @pytest.mark.usefixtures("privacy_request_awaiting_consent_email_send") def test_send_email_batch_no_applicable_connectors( @@ -717,10 +715,10 @@ def test_send_email_batch_no_applicable_connectors( assert requeue_privacy_requests.called @mock.patch( - "fides.api.ops.service.connectors.erasure_email_connector.send_single_erasure_email", + "fides.api.service.connectors.erasure_email_connector.send_single_erasure_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) @pytest.mark.usefixtures("privacy_request_awaiting_consent_email_send") @pytest.mark.usefixtures("attentive_email_connection_config") @@ -736,7 +734,7 @@ def test_send_email_batch_missing_identities( assert requeue_privacy_requests.called @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) @pytest.mark.usefixtures("attentive_email_connection_config", "test_fides_org") def test_send_erasure_email_failure( @@ -771,10 +769,10 @@ def test_send_erasure_email_failure( assert not email_execution_log @mock.patch( - "fides.api.ops.service.connectors.erasure_email_connector.send_single_erasure_email", + "fides.api.service.connectors.erasure_email_connector.send_single_erasure_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) def test_send_erasure_email( self, @@ -862,10 +860,10 @@ def test_send_erasure_email( ) @mock.patch( - "fides.api.ops.service.connectors.erasure_email_connector.send_single_erasure_email", + "fides.api.service.connectors.erasure_email_connector.send_single_erasure_email", ) @mock.patch( - "fides.api.ops.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", + "fides.api.service.privacy_request.email_batch_service.requeue_privacy_requests_after_email_send", ) def test_send_erasure_email_multiple_users( self, diff --git a/tests/ops/service/privacy_request/test_request_runner_service.py b/tests/ops/service/privacy_request/test_request_runner_service.py index 0e586f9899..10464f2cef 100644 --- a/tests/ops/service/privacy_request/test_request_runner_service.py +++ b/tests/ops/service/privacy_request/test_request_runner_service.py @@ -13,15 +13,15 @@ from sqlalchemy import column, select, table from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( ClientUnsuccessfulException, PrivacyRequestPaused, ) -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.models.application_config import ApplicationConfig -from fides.api.ops.models.audit_log import AuditLog, AuditLogAction -from fides.api.ops.models.policy import CurrentStep, PolicyPostWebhook -from fides.api.ops.models.privacy_request import ( +from fides.api.graph.graph import DatasetGraph +from fides.api.models.application_config import ApplicationConfig +from fides.api.models.audit_log import AuditLog, AuditLogAction +from fides.api.models.policy import CurrentStep, PolicyPostWebhook +from fides.api.models.privacy_request import ( ActionType, CheckpointActionRequired, ExecutionLog, @@ -30,38 +30,36 @@ PrivacyRequest, PrivacyRequestStatus, ) -from fides.api.ops.schemas.external_https import SecondPartyResponseFormat -from fides.api.ops.schemas.masking.masking_configuration import ( +from fides.api.schemas.external_https import SecondPartyResponseFormat +from fides.api.schemas.masking.masking_configuration import ( HmacMaskingConfiguration, MaskingConfiguration, ) -from fides.api.ops.schemas.masking.masking_secrets import MaskingSecretCache -from fides.api.ops.schemas.messaging.messaging import ( +from fides.api.schemas.masking.masking_secrets import MaskingSecretCache +from fides.api.schemas.messaging.messaging import ( AccessRequestCompleteBodyParams, MessagingActionType, MessagingServiceType, ) -from fides.api.ops.schemas.policy import Rule -from fides.api.ops.schemas.privacy_request import Consent -from fides.api.ops.schemas.redis_cache import Identity -from fides.api.ops.schemas.saas.saas_config import SaaSRequest -from fides.api.ops.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams -from fides.api.ops.service.connectors.dynamodb_connector import DynamoDBConnector -from fides.api.ops.service.connectors.saas_connector import SaaSConnector -from fides.api.ops.service.connectors.sql_connector import ( +from fides.api.schemas.policy import Rule +from fides.api.schemas.privacy_request import Consent +from fides.api.schemas.redis_cache import Identity +from fides.api.schemas.saas.saas_config import SaaSRequest +from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams +from fides.api.service.connectors.dynamodb_connector import DynamoDBConnector +from fides.api.service.connectors.saas_connector import SaaSConnector +from fides.api.service.connectors.sql_connector import ( RedshiftConnector, SnowflakeConnector, ) -from fides.api.ops.service.masking.strategy.masking_strategy import MaskingStrategy -from fides.api.ops.service.masking.strategy.masking_strategy_hmac import ( - HmacMaskingStrategy, -) -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.service.masking.strategy.masking_strategy import MaskingStrategy +from fides.api.service.masking.strategy.masking_strategy_hmac import HmacMaskingStrategy +from fides.api.service.privacy_request.request_runner_service import ( build_consent_dataset_graph, needs_batch_email_send, run_webhooks_and_report_status, ) -from fides.api.ops.util.data_category import DataCategory +from fides.api.util.data_category import DataCategory from fides.core.config import CONFIG PRIVACY_REQUEST_TASK_TIMEOUT = 5 @@ -80,10 +78,8 @@ def privacy_request_complete_email_notification_enabled(db): ApplicationConfig.update_config_set(db, CONFIG) -@mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.dispatch_message" -) -@mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") +@mock.patch("fides.api.service.privacy_request.request_runner_service.dispatch_message") +@mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_policy_upload_dispatch_message_called( upload_mock: Mock, mock_email_dispatch: Mock, @@ -99,10 +95,8 @@ def test_policy_upload_dispatch_message_called( assert mock_email_dispatch.call_count == 1 -@mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.dispatch_message" -) -@mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") +@mock.patch("fides.api.service.privacy_request.request_runner_service.dispatch_message") +@mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_start_processing_sets_started_processing_at( upload_mock: Mock, mock_email_dispatch: Mock, @@ -125,10 +119,8 @@ def test_start_processing_sets_started_processing_at( assert mock_email_dispatch.call_count == 1 -@mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.dispatch_message" -) -@mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") +@mock.patch("fides.api.service.privacy_request.request_runner_service.dispatch_message") +@mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_start_processing_doesnt_overwrite_started_processing_at( upload_mock: Mock, mock_email_dispatch: Mock, @@ -154,7 +146,7 @@ def test_start_processing_doesnt_overwrite_started_processing_at( @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.upload_access_results" + "fides.api.service.privacy_request.request_runner_service.upload_access_results" ) def test_halts_proceeding_if_cancelled( upload_access_results_mock, @@ -176,19 +168,17 @@ def test_halts_proceeding_if_cancelled( assert not upload_access_results_mock.called +@mock.patch("fides.api.service.privacy_request.request_runner_service.dispatch_message") @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.dispatch_message" + "fides.api.service.privacy_request.request_runner_service.upload_access_results" ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.upload_access_results" + "fides.api.service.privacy_request.request_runner_service.run_webhooks_and_report_status", ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_webhooks_and_report_status", + "fides.api.service.privacy_request.request_runner_service.run_access_request" ) -@mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_access_request" -) -@mock.patch("fides.api.ops.service.privacy_request.request_runner_service.run_erasure") +@mock.patch("fides.api.service.privacy_request.request_runner_service.run_erasure") def test_from_graph_resume_does_not_run_pre_webhooks( run_erasure, run_access, @@ -226,16 +216,14 @@ def test_from_graph_resume_does_not_run_pre_webhooks( assert mock_email_dispatch.call_count == 1 +@mock.patch("fides.api.service.privacy_request.request_runner_service.dispatch_message") @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.dispatch_message" -) -@mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_webhooks_and_report_status", + "fides.api.service.privacy_request.request_runner_service.run_webhooks_and_report_status", ) @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_access_request" + "fides.api.service.privacy_request.request_runner_service.run_access_request" ) -@mock.patch("fides.api.ops.service.privacy_request.request_runner_service.run_erasure") +@mock.patch("fides.api.service.privacy_request.request_runner_service.run_erasure") def test_resume_privacy_request_from_erasure( run_erasure, run_access, @@ -325,9 +313,7 @@ def get_privacy_request_results( @pytest.mark.integration_postgres @pytest.mark.integration -@mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" -) +@mock.patch("fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook") def test_create_and_process_access_request_postgres( trigger_webhook_mock, postgres_example_test_dataset_config_read_access, @@ -395,9 +381,7 @@ def test_create_and_process_access_request_postgres( @pytest.mark.integration -@mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" -) +@mock.patch("fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook") def test_create_and_process_access_request_mssql( trigger_webhook_mock, mssql_example_test_dataset_config, @@ -442,9 +426,7 @@ def test_create_and_process_access_request_mssql( @pytest.mark.integration -@mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" -) +@mock.patch("fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook") def test_create_and_process_access_request_mysql( trigger_webhook_mock, mysql_example_test_dataset_config, @@ -490,9 +472,7 @@ def test_create_and_process_access_request_mysql( @pytest.mark.integration_mariadb @pytest.mark.integration -@mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" -) +@mock.patch("fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook") def test_create_and_process_access_request_mariadb( trigger_webhook_mock, mariadb_example_test_dataset_config, @@ -538,9 +518,7 @@ def test_create_and_process_access_request_mariadb( @pytest.mark.integration_saas @pytest.mark.integration_mailchimp -@mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" -) +@mock.patch("fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook") def test_create_and_process_access_request_saas_mailchimp( trigger_webhook_mock, mailchimp_connection_config, @@ -586,9 +564,7 @@ def test_create_and_process_access_request_saas_mailchimp( @pytest.mark.integration_saas @pytest.mark.integration_mailchimp -@mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" -) +@mock.patch("fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook") def test_create_and_process_erasure_request_saas( _, mailchimp_connection_config, @@ -650,9 +626,7 @@ def test_create_and_process_erasure_request_saas( @pytest.mark.integration_saas @pytest.mark.integration_hubspot -@mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" -) +@mock.patch("fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook") def test_create_and_process_access_request_saas_hubspot( trigger_webhook_mock, connection_config_hubspot, @@ -1467,7 +1441,7 @@ def test_create_and_process_erasure_request_bigquery( class TestRunPrivacyRequestRunsWebhooks: @mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" + "fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook" ) def test_run_webhooks_halt_received( self, @@ -1487,7 +1461,7 @@ def test_run_webhooks_halt_received( assert privacy_request.paused_at is not None @mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" + "fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook" ) def test_run_webhooks_ap_scheduler_cleanup( self, @@ -1512,7 +1486,7 @@ def test_run_webhooks_ap_scheduler_cleanup( assert privacy_request.paused_at is not None @mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" + "fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook" ) def test_run_webhooks_client_error( self, @@ -1536,7 +1510,7 @@ def test_run_webhooks_client_error( assert privacy_request.paused_at is None @mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" + "fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook" ) def test_run_webhooks_validation_error( self, @@ -1556,7 +1530,7 @@ def test_run_webhooks_validation_error( assert privacy_request.paused_at is None @mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" + "fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook" ) def test_run_webhooks( self, @@ -1572,7 +1546,7 @@ def test_run_webhooks( assert mock_trigger_policy_webhook.call_count == 2 @mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" + "fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook" ) def test_run_webhooks_after_webhook( self, @@ -1601,11 +1575,9 @@ def test_run_webhooks_after_webhook( @pytest.mark.integration_postgres @pytest.mark.integration @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_access_request" -) -@mock.patch( - "fides.api.ops.models.privacy_request.PrivacyRequest.trigger_policy_webhook" + "fides.api.service.privacy_request.request_runner_service.run_access_request" ) +@mock.patch("fides.api.models.privacy_request.PrivacyRequest.trigger_policy_webhook") def test_privacy_request_log_failure( _, run_access_request_mock, @@ -1627,7 +1599,7 @@ def test_privacy_request_log_failure( } with mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.fideslog_graph_failure" + "fides.api.service.privacy_request.request_runner_service.fideslog_graph_failure" ) as mock_log_event: pr = get_privacy_request_results( db, @@ -1661,7 +1633,7 @@ def privacy_request_complete_email_notification_enabled(self, db): @pytest.mark.integration_postgres @pytest.mark.integration @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.dispatch_message" + "fides.api.service.privacy_request.request_runner_service.dispatch_message" ) def test_email_complete_send_erasure( self, @@ -1697,9 +1669,9 @@ def test_email_complete_send_erasure( @pytest.mark.integration_postgres @pytest.mark.integration @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.dispatch_message" + "fides.api.service.privacy_request.request_runner_service.dispatch_message" ) - @mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") + @mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_email_complete_send_access( self, upload_mock, @@ -1736,9 +1708,9 @@ def test_email_complete_send_access( @pytest.mark.integration_postgres @pytest.mark.integration @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.dispatch_message" + "fides.api.service.privacy_request.request_runner_service.dispatch_message" ) - @mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") + @mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_email_complete_send_access_and_erasure( self, upload_mock, @@ -1798,9 +1770,9 @@ def test_email_complete_send_access_and_erasure( @pytest.mark.integration_postgres @pytest.mark.integration @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) - @mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") + @mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_email_complete_send_access_no_messaging_config( self, upload_mock, @@ -1838,9 +1810,9 @@ def test_email_complete_send_access_no_messaging_config( @pytest.mark.integration_postgres @pytest.mark.integration @mock.patch( - "fides.api.ops.service.messaging.message_dispatch_service._mailgun_dispatcher" + "fides.api.service.messaging.message_dispatch_service._mailgun_dispatcher" ) - @mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") + @mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_email_complete_send_access_no_email_identity( self, upload_mock, @@ -1876,7 +1848,7 @@ def test_email_complete_send_access_no_email_identity( class TestPrivacyRequestsManualWebhooks: - @mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") + @mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_privacy_request_needs_manual_input_key_in_cache( self, mock_upload, @@ -1903,10 +1875,8 @@ def test_privacy_request_needs_manual_input_key_in_cache( assert pr.status == PrivacyRequestStatus.requires_input assert not mock_upload.called - @mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") - @mock.patch( - "fides.api.ops.service.privacy_request.request_runner_service.run_erasure" - ) + @mock.patch("fides.api.service.privacy_request.request_runner_service.upload") + @mock.patch("fides.api.service.privacy_request.request_runner_service.run_erasure") def test_manual_input_not_required_for_erasure_only_policies( self, mock_erasure, @@ -1938,7 +1908,7 @@ def test_manual_input_not_required_for_erasure_only_policies( assert not mock_upload.called # erasure only request, no data uploaded assert mock_erasure.called - @mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") + @mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_pass_on_manually_added_input( self, mock_upload, @@ -1962,7 +1932,7 @@ def test_pass_on_manually_added_input( ] } - @mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") + @mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_pass_on_partial_manually_added_input( self, mock_upload, @@ -1991,7 +1961,7 @@ def test_pass_on_partial_manually_added_input( ] } - @mock.patch("fides.api.ops.service.privacy_request.request_runner_service.upload") + @mock.patch("fides.api.service.privacy_request.request_runner_service.upload") def test_pass_on_empty_confirmed_input( self, mock_upload, diff --git a/tests/ops/service/privacy_request/test_request_service.py b/tests/ops/service/privacy_request/test_request_service.py index 191396fc3f..ee80399ffc 100644 --- a/tests/ops/service/privacy_request/test_request_service.py +++ b/tests/ops/service/privacy_request/test_request_service.py @@ -3,11 +3,11 @@ import pytest from httpx import HTTPStatusError +from fides.api.api.v1.urn_registry import LOGIN, V1_URL_PREFIX +from fides.api.cryptography.cryptographic_util import str_to_b64_str from fides.api.ctl.database.seed import create_or_update_parent_user -from fides.api.ops.api.v1.urn_registry import LOGIN, V1_URL_PREFIX -from fides.api.ops.cryptography.cryptographic_util import str_to_b64_str -from fides.api.ops.models.privacy_request import PrivacyRequest, PrivacyRequestStatus -from fides.api.ops.service.privacy_request.request_service import ( +from fides.api.models.privacy_request import PrivacyRequest, PrivacyRequestStatus +from fides.api.service.privacy_request.request_service import ( build_required_privacy_request_kwargs, poll_server_for_completion, ) diff --git a/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_factory.py b/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_factory.py index 5a89555a31..5238cf3155 100644 --- a/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_factory.py +++ b/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_factory.py @@ -1,13 +1,13 @@ import pytest -from fides.api.ops.common_exceptions import NoSuchStrategyException, ValidationError -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy import ( +from fides.api.common_exceptions import NoSuchStrategyException, ValidationError +from fides.api.service.processors.post_processor_strategy.post_processor_strategy import ( PostProcessorStrategy, ) -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy_filter import ( +from fides.api.service.processors.post_processor_strategy.post_processor_strategy_filter import ( FilterPostProcessorStrategy, ) -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy_unwrap import ( +from fides.api.service.processors.post_processor_strategy.post_processor_strategy_unwrap import ( UnwrapPostProcessorStrategy, ) diff --git a/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_filter.py b/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_filter.py index 3a7c5486da..d9d8bf8b82 100644 --- a/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_filter.py +++ b/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_filter.py @@ -2,11 +2,11 @@ import pytest -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.schemas.saas.strategy_configuration import ( FilterPostProcessorConfiguration, ) -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy_filter import ( +from fides.api.service.processors.post_processor_strategy.post_processor_strategy_filter import ( FilterPostProcessorStrategy, ) diff --git a/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_unwrap.py b/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_unwrap.py index 3d9be91795..25886ddd84 100644 --- a/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_unwrap.py +++ b/tests/ops/service/processors/post_processor_strategy/test_post_processor_strategy_unwrap.py @@ -1,7 +1,7 @@ -from fides.api.ops.schemas.saas.strategy_configuration import ( +from fides.api.schemas.saas.strategy_configuration import ( UnwrapPostProcessorConfiguration, ) -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy_unwrap import ( +from fides.api.service.processors.post_processor_strategy.post_processor_strategy_unwrap import ( UnwrapPostProcessorStrategy, ) diff --git a/tests/ops/service/saas_request/test_saas_request_override_factory.py b/tests/ops/service/saas_request/test_saas_request_override_factory.py index 2370a039f3..3ce5023250 100644 --- a/tests/ops/service/saas_request/test_saas_request_override_factory.py +++ b/tests/ops/service/saas_request/test_saas_request_override_factory.py @@ -3,22 +3,20 @@ import pytest -from fides.api.ops.common_exceptions import ( +from fides.api.common_exceptions import ( InvalidSaaSRequestOverrideException, NoSuchSaaSRequestOverrideException, ) -from fides.api.ops.graph.traversal import TraversalNode -from fides.api.ops.models.policy import Policy -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.service.connectors.saas.authenticated_client import ( - AuthenticatedClient, -) -from fides.api.ops.service.saas_request.saas_request_override_factory import ( +from fides.api.graph.traversal import TraversalNode +from fides.api.models.policy import Policy +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.service.connectors.saas.authenticated_client import AuthenticatedClient +from fides.api.service.saas_request.saas_request_override_factory import ( SaaSRequestOverrideFactory, SaaSRequestType, register, ) -from fides.api.ops.util.collection_util import Row +from fides.api.util.collection_util import Row def uuid(): diff --git a/tests/ops/service/storage_uploader_service_test.py b/tests/ops/service/storage_uploader_service_test.py index b53179814a..3405154812 100644 --- a/tests/ops/service/storage_uploader_service_test.py +++ b/tests/ops/service/storage_uploader_service_test.py @@ -12,10 +12,10 @@ from bson import ObjectId from sqlalchemy.orm import Session -from fides.api.ops.common_exceptions import StorageUploadError -from fides.api.ops.models.privacy_request import PrivacyRequest -from fides.api.ops.models.storage import StorageConfig -from fides.api.ops.schemas.storage.storage import ( +from fides.api.common_exceptions import StorageUploadError +from fides.api.models.privacy_request import PrivacyRequest +from fides.api.models.storage import StorageConfig +from fides.api.schemas.storage.storage import ( FileNaming, ResponseFormat, S3AuthMethod, @@ -23,20 +23,20 @@ StorageSecrets, StorageType, ) -from fides.api.ops.service.storage.storage_uploader_service import get_extension, upload -from fides.api.ops.tasks.storage import ( +from fides.api.service.storage.storage_uploader_service import get_extension, upload +from fides.api.tasks.storage import ( LOCAL_FIDES_UPLOAD_DIRECTORY, encrypt_access_request_results, write_to_in_memory_buffer, ) -from fides.api.ops.util.encryption.aes_gcm_encryption_scheme import ( +from fides.api.util.encryption.aes_gcm_encryption_scheme import ( decrypt, decrypt_combined_nonce_and_message, ) from fides.core.config import CONFIG -@mock.patch("fides.api.ops.service.storage.storage_uploader_service.upload_to_s3") +@mock.patch("fides.api.service.storage.storage_uploader_service.upload_to_s3") def test_uploader_s3_success_secrets_auth( mock_upload_to_s3: Mock, db: Session, privacy_request ) -> None: @@ -145,7 +145,7 @@ def test_write_to_in_memory_buffer_handles_bson(): } -@mock.patch("fides.api.ops.service.storage.storage_uploader_service.upload_to_s3") +@mock.patch("fides.api.service.storage.storage_uploader_service.upload_to_s3") def test_uploader_s3_success_automatic_auth( mock_upload_to_s3: Mock, db: Session, privacy_request ) -> None: @@ -189,7 +189,7 @@ def test_uploader_s3_success_automatic_auth( storage_config.delete(db) -@mock.patch("fides.api.ops.service.storage.storage_uploader_service.upload_to_s3") +@mock.patch("fides.api.service.storage.storage_uploader_service.upload_to_s3") def test_uploader_s3_invalid_file_naming(mock_upload_to_s3: Mock, db: Session) -> None: request_id = "214513r" @@ -223,7 +223,7 @@ def test_uploader_s3_invalid_file_naming(mock_upload_to_s3: Mock, db: Session) - sc.delete(db) -@mock.patch("fides.api.ops.service.storage.storage_uploader_service.upload_to_s3") +@mock.patch("fides.api.service.storage.storage_uploader_service.upload_to_s3") def test_uploader_no_config(mock_upload_to_s3: Mock, db: Session) -> None: request_id = "214513r" storage_key = "s3_key" diff --git a/tests/ops/service/test_strategy_retrieval.py b/tests/ops/service/test_strategy_retrieval.py index 4d35a5c850..e515a8a7d0 100644 --- a/tests/ops/service/test_strategy_retrieval.py +++ b/tests/ops/service/test_strategy_retrieval.py @@ -3,9 +3,9 @@ import pytest -from fides.api.ops.common_exceptions import NoSuchStrategyException -from fides.api.ops.schemas.saas.strategy_configuration import StrategyConfiguration -from fides.api.ops.service.processors.post_processor_strategy.post_processor_strategy import ( +from fides.api.common_exceptions import NoSuchStrategyException +from fides.api.schemas.saas.strategy_configuration import StrategyConfiguration +from fides.api.service.processors.post_processor_strategy.post_processor_strategy import ( PostProcessorStrategy, ) diff --git a/tests/ops/task/test_consolidate_query_matches.py b/tests/ops/task/test_consolidate_query_matches.py index b8d249b1ad..26c6525b37 100644 --- a/tests/ops/task/test_consolidate_query_matches.py +++ b/tests/ops/task/test_consolidate_query_matches.py @@ -1,5 +1,5 @@ -from fides.api.ops.graph.config import FieldPath -from fides.api.ops.task.consolidate_query_matches import consolidate_query_matches +from fides.api.graph.config import FieldPath +from fides.api.task.consolidate_query_matches import consolidate_query_matches def test_consolidate_query_matches(): diff --git a/tests/ops/task/test_filter_element_match.py b/tests/ops/task/test_filter_element_match.py index 95ef05e0e2..d6867b8cbe 100644 --- a/tests/ops/task/test_filter_element_match.py +++ b/tests/ops/task/test_filter_element_match.py @@ -2,13 +2,13 @@ import pytest -from fides.api.ops.graph.config import FieldPath -from fides.api.ops.task.filter_element_match import ( +from fides.api.graph.config import FieldPath +from fides.api.task.filter_element_match import ( _expand_array_paths_to_preserve, _remove_paths_from_row, filter_element_match, ) -from fides.api.ops.util.collection_util import FIDESOPS_DO_NOT_MASK_INDEX +from fides.api.util.collection_util import FIDESOPS_DO_NOT_MASK_INDEX class TestFilterElementMatch: diff --git a/tests/ops/task/test_filter_results.py b/tests/ops/task/test_filter_results.py index 4e5993c8b9..227e1da5d8 100644 --- a/tests/ops/task/test_filter_results.py +++ b/tests/ops/task/test_filter_results.py @@ -4,8 +4,8 @@ import pytest from bson import ObjectId -from fides.api.ops.graph.config import CollectionAddress, FieldPath -from fides.api.ops.task.filter_results import ( +from fides.api.graph.config import CollectionAddress, FieldPath +from fides.api.task.filter_results import ( filter_data_categories, remove_empty_containers, select_and_save_field, diff --git a/tests/ops/task/test_graph_task.py b/tests/ops/task/test_graph_task.py index 0b8ac23e8c..8275e8810d 100644 --- a/tests/ops/task/test_graph_task.py +++ b/tests/ops/task/test_graph_task.py @@ -4,8 +4,8 @@ import pytest from bson import ObjectId -from fides.api.ops.common_exceptions import SkippingConsentPropagation -from fides.api.ops.graph.config import ( +from fides.api.common_exceptions import SkippingConsentPropagation +from fides.api.graph.config import ( ROOT_COLLECTION_ADDRESS, TERMINATOR_ADDRESS, Collection, @@ -13,12 +13,12 @@ FieldPath, GraphDataset, ) -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.graph.traversal import Traversal, TraversalNode -from fides.api.ops.models.connectionconfig import ConnectionConfig, ConnectionType -from fides.api.ops.models.policy import ActionType, Policy, Rule, RuleTarget -from fides.api.ops.models.privacy_request import ExecutionLog, ExecutionLogStatus -from fides.api.ops.task.graph_task import ( +from fides.api.graph.graph import DatasetGraph +from fides.api.graph.traversal import Traversal, TraversalNode +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType +from fides.api.models.policy import ActionType, Policy, Rule, RuleTarget +from fides.api.models.privacy_request import ExecutionLog, ExecutionLogStatus +from fides.api.task.graph_task import ( EMPTY_REQUEST, GraphTask, TaskResources, @@ -28,7 +28,7 @@ start_function, update_erasure_mapping_from_cache, ) -from fides.api.ops.util.consent_util import ( +from fides.api.util.consent_util import ( cache_initial_status_and_identities_for_consent_reporting, ) @@ -689,7 +689,7 @@ def mock_graph_task( return GraphTask(tn, task_resources) @mock.patch( - "fides.api.ops.service.connectors.saas_connector.SaaSConnector.run_consent_request" + "fides.api.service.connectors.saas_connector.SaaSConnector.run_consent_request" ) def test_skipped_consent_task_for_connector( self, @@ -738,7 +738,7 @@ def test_skipped_consent_task_for_connector( assert logs.first().status == ExecutionLogStatus.skipped @mock.patch( - "fides.api.ops.service.connectors.saas_connector.SaaSConnector.run_consent_request" + "fides.api.service.connectors.saas_connector.SaaSConnector.run_consent_request" ) def test_errored_consent_task_for_connector_no_relevant_preferences( self, diff --git a/tests/ops/task/test_refine_target_path.py b/tests/ops/task/test_refine_target_path.py index 15b4443e91..2696f14c3e 100644 --- a/tests/ops/task/test_refine_target_path.py +++ b/tests/ops/task/test_refine_target_path.py @@ -1,11 +1,11 @@ -from fides.api.ops.graph.config import FieldPath -from fides.api.ops.task.refine_target_path import ( +from fides.api.graph.config import FieldPath +from fides.api.task.refine_target_path import ( _match_found, build_refined_target_paths, join_detailed_path, refine_target_path, ) -from fides.api.ops.util.collection_util import FIDESOPS_DO_NOT_MASK_INDEX +from fides.api.util.collection_util import FIDESOPS_DO_NOT_MASK_INDEX class TestRefineTargetPathToValue: diff --git a/tests/ops/task/test_task_resources.py b/tests/ops/task/test_task_resources.py index 666d450d57..87306bf378 100644 --- a/tests/ops/task/test_task_resources.py +++ b/tests/ops/task/test_task_resources.py @@ -1,4 +1,4 @@ -from fides.api.ops.task.task_resources import TaskResources +from fides.api.task.task_resources import TaskResources class TestTaskResources: diff --git a/tests/ops/task/traversal_data.py b/tests/ops/task/traversal_data.py index 1a84db3ee2..25e2b7c350 100644 --- a/tests/ops/task/traversal_data.py +++ b/tests/ops/task/traversal_data.py @@ -2,7 +2,7 @@ from fideslang.validation import FidesKey -from fides.api.ops.graph.config import ( +from fides.api.graph.config import ( Collection, CollectionAddress, FieldAddress, @@ -10,7 +10,7 @@ ObjectField, ScalarField, ) -from fides.api.ops.graph.data_type import ( +from fides.api.graph.data_type import ( DataType, IntTypeConverter, NoOpTypeConverter, @@ -18,9 +18,9 @@ ObjectTypeConverter, StringTypeConverter, ) -from fides.api.ops.graph.graph import DatasetGraph -from fides.api.ops.graph.traversal import Traversal -from fides.api.ops.models.connectionconfig import ConnectionConfig +from fides.api.graph.graph import DatasetGraph +from fides.api.graph.traversal import Traversal +from fides.api.models.connectionconfig import ConnectionConfig str_converter = DataType.string.value bool_converter = DataType.boolean.value diff --git a/tests/ops/tasks/test_celery.py b/tests/ops/tasks/test_celery.py index 54feeee1e0..53aef44348 100644 --- a/tests/ops/tasks/test_celery.py +++ b/tests/ops/tasks/test_celery.py @@ -4,7 +4,7 @@ from sqlalchemy.orm import Session from sqlalchemy.pool import QueuePool -from fides.api.ops.tasks import DatabaseTask, _create_celery +from fides.api.tasks import DatabaseTask, _create_celery from fides.core.config import CONFIG, get_config diff --git a/tests/ops/tasks/test_scheduled.py b/tests/ops/tasks/test_scheduled.py index 8598032539..6b41e867d2 100644 --- a/tests/ops/tasks/test_scheduled.py +++ b/tests/ops/tasks/test_scheduled.py @@ -2,15 +2,15 @@ from apscheduler.triggers.cron import CronTrigger from apscheduler.triggers.date import DateTrigger -from fides.api.ops.models.privacy_request import PrivacyRequestStatus -from fides.api.ops.service.privacy_request.email_batch_service import ( +from fides.api.models.privacy_request import PrivacyRequestStatus +from fides.api.service.privacy_request.email_batch_service import ( BATCH_EMAIL_SEND, initiate_scheduled_batch_email_send, ) -from fides.api.ops.service.privacy_request.request_runner_service import ( +from fides.api.service.privacy_request.request_runner_service import ( initiate_paused_privacy_request_followup, ) -from fides.api.ops.tasks.scheduled.scheduler import scheduler +from fides.api.tasks.scheduled.scheduler import scheduler from fides.core.config import get_config CONFIG = get_config() diff --git a/tests/ops/test_helpers/cache_secrets_helper.py b/tests/ops/test_helpers/cache_secrets_helper.py index b8b95d7b28..ea7f8e4193 100644 --- a/tests/ops/test_helpers/cache_secrets_helper.py +++ b/tests/ops/test_helpers/cache_secrets_helper.py @@ -1,9 +1,5 @@ -from fides.api.ops.schemas.masking.masking_secrets import MaskingSecretCache -from fides.api.ops.util.cache import ( - FidesopsRedis, - get_cache, - get_masking_secret_cache_key, -) +from fides.api.schemas.masking.masking_secrets import MaskingSecretCache +from fides.api.util.cache import FidesopsRedis, get_cache, get_masking_secret_cache_key def cache_secret(masking_secret_cache: MaskingSecretCache, request_id: str) -> None: diff --git a/tests/ops/test_helpers/dataset_utils.py b/tests/ops/test_helpers/dataset_utils.py index 62ebb1d4bc..08d03611fb 100644 --- a/tests/ops/test_helpers/dataset_utils.py +++ b/tests/ops/test_helpers/dataset_utils.py @@ -4,17 +4,17 @@ import yaml from fideslang.models import Dataset -from fides.api.ops.graph.config import ( +from fides.api.graph.config import ( Collection, Field, FieldPath, ObjectField, ScalarField, ) -from fides.api.ops.graph.data_type import DataType, get_data_type, to_data_type_string -from fides.api.ops.models.connectionconfig import ConnectionConfig -from fides.api.ops.models.datasetconfig import DatasetConfig, convert_dataset_to_graph -from fides.api.ops.util.collection_util import Row +from fides.api.graph.data_type import DataType, get_data_type, to_data_type_string +from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.datasetconfig import DatasetConfig, convert_dataset_to_graph +from fides.api.util.collection_util import Row SAAS_DATASET_DIRECTORY = "data/saas/dataset/" diff --git a/tests/ops/test_helpers/vault_client.py b/tests/ops/test_helpers/vault_client.py index e827bbdfd2..1f064327d1 100644 --- a/tests/ops/test_helpers/vault_client.py +++ b/tests/ops/test_helpers/vault_client.py @@ -4,7 +4,7 @@ from hvac import Client from loguru import logger -from fides.api.ops.common_exceptions import FidesopsException +from fides.api.common_exceptions import FidesopsException params = { "VAULT_ADDR": os.environ.get("VAULT_ADDR"), diff --git a/tests/ops/util/encryption/test_aes_gcm_encryption_scheme.py b/tests/ops/util/encryption/test_aes_gcm_encryption_scheme.py index 6e13e76053..970b806a67 100644 --- a/tests/ops/util/encryption/test_aes_gcm_encryption_scheme.py +++ b/tests/ops/util/encryption/test_aes_gcm_encryption_scheme.py @@ -1,7 +1,7 @@ import pytest -from fides.api.ops.cryptography import cryptographic_util -from fides.api.ops.util.encryption.aes_gcm_encryption_scheme import ( +from fides.api.cryptography import cryptographic_util +from fides.api.util.encryption.aes_gcm_encryption_scheme import ( decrypt, encrypt_verify_secret_length, ) diff --git a/tests/ops/util/encryption/test_hmac_encryption_scheme.py b/tests/ops/util/encryption/test_hmac_encryption_scheme.py index 1f448739b1..adc44df171 100644 --- a/tests/ops/util/encryption/test_hmac_encryption_scheme.py +++ b/tests/ops/util/encryption/test_hmac_encryption_scheme.py @@ -1,5 +1,5 @@ -from fides.api.ops.schemas.masking.masking_configuration import HmacMaskingConfiguration -from fides.api.ops.util.encryption.hmac_encryption_scheme import ( +from fides.api.schemas.masking.masking_configuration import HmacMaskingConfiguration +from fides.api.util.encryption.hmac_encryption_scheme import ( hmac_encrypt_return_bytes, hmac_encrypt_return_str, ) diff --git a/tests/ops/util/encryption/test_secrets_util.py b/tests/ops/util/encryption/test_secrets_util.py index d03a173aaf..58d72fbddd 100644 --- a/tests/ops/util/encryption/test_secrets_util.py +++ b/tests/ops/util/encryption/test_secrets_util.py @@ -1,17 +1,15 @@ from typing import Dict, List -from fides.api.ops.schemas.masking.masking_secrets import ( +from fides.api.schemas.masking.masking_secrets import ( MaskingSecretCache, MaskingSecretMeta, SecretType, ) -from fides.api.ops.service.masking.strategy.masking_strategy_aes_encrypt import ( +from fides.api.service.masking.strategy.masking_strategy_aes_encrypt import ( AesEncryptionMaskingStrategy, ) -from fides.api.ops.service.masking.strategy.masking_strategy_hmac import ( - HmacMaskingStrategy, -) -from fides.api.ops.util.encryption.secrets_util import SecretsUtil +from fides.api.service.masking.strategy.masking_strategy_hmac import HmacMaskingStrategy +from fides.api.util.encryption.secrets_util import SecretsUtil from ...test_helpers.cache_secrets_helper import cache_secret, clear_cache_secrets diff --git a/tests/ops/util/test_api_router.py b/tests/ops/util/test_api_router.py index cc5927b2e0..eec681462c 100644 --- a/tests/ops/util/test_api_router.py +++ b/tests/ops/util/test_api_router.py @@ -2,9 +2,9 @@ from starlette.status import HTTP_200_OK, HTTP_404_NOT_FOUND from starlette.testclient import TestClient -from fides.api.ops.api.v1.scope_registry import PRIVACY_REQUEST_READ -from fides.api.ops.api.v1.urn_registry import PRIVACY_REQUESTS, V1_URL_PREFIX -from fides.api.ops.models.client import ClientDetail +from fides.api.api.v1.scope_registry import PRIVACY_REQUEST_READ +from fides.api.api.v1.urn_registry import PRIVACY_REQUESTS, V1_URL_PREFIX +from fides.api.models.client import ClientDetail class TestApiRouter: diff --git a/tests/ops/util/test_cache.py b/tests/ops/util/test_cache.py index fa54c37186..51ef6e4d12 100644 --- a/tests/ops/util/test_cache.py +++ b/tests/ops/util/test_cache.py @@ -8,7 +8,7 @@ import pytest from bson.objectid import ObjectId -from fides.api.ops.util.cache import ( +from fides.api.util.cache import ( ENCODED_BYTES_PREFIX, ENCODED_DATE_PREFIX, ENCODED_MONGO_OBJECT_ID_PREFIX, diff --git a/tests/ops/util/test_collection_util.py b/tests/ops/util/test_collection_util.py index a964820c6e..f377f711e7 100644 --- a/tests/ops/util/test_collection_util.py +++ b/tests/ops/util/test_collection_util.py @@ -1,6 +1,6 @@ from typing import Dict, List -from fides.api.ops.util.collection_util import ( +from fides.api.util.collection_util import ( append, filter_nonempty_values, merge_dicts, diff --git a/tests/ops/util/test_connection_type.py b/tests/ops/util/test_connection_type.py index 05740aa5a3..906052637c 100644 --- a/tests/ops/util/test_connection_type.py +++ b/tests/ops/util/test_connection_type.py @@ -1,12 +1,12 @@ import pytest -from fides.api.ops.models.connectionconfig import ConnectionType -from fides.api.ops.models.policy import ActionType -from fides.api.ops.schemas.connection_configuration.connection_config import SystemType -from fides.api.ops.service.connectors.saas.connector_registry_service import ( +from fides.api.models.connectionconfig import ConnectionType +from fides.api.models.policy import ActionType +from fides.api.schemas.connection_configuration.connection_config import SystemType +from fides.api.service.connectors.saas.connector_registry_service import ( ConnectorRegistry, ) -from fides.api.ops.util.connection_type import get_connection_types +from fides.api.util.connection_type import get_connection_types def test_get_connection_types(): diff --git a/tests/ops/util/test_consent_util.py b/tests/ops/util/test_consent_util.py index bbacebbb7a..0b6cc447b8 100644 --- a/tests/ops/util/test_consent_util.py +++ b/tests/ops/util/test_consent_util.py @@ -1,8 +1,8 @@ import pytest from sqlalchemy.orm.attributes import flag_modified -from fides.api.ops.models.privacy_preference import PrivacyPreferenceHistory -from fides.api.ops.util.consent_util import ( +from fides.api.models.privacy_preference import PrivacyPreferenceHistory +from fides.api.util.consent_util import ( add_complete_system_status_for_consent_reporting, add_errored_system_status_for_consent_reporting, cache_initial_status_and_identities_for_consent_reporting, diff --git a/tests/ops/util/test_dataset_yaml.py b/tests/ops/util/test_dataset_yaml.py index 530d5e1680..5422d5e0cf 100644 --- a/tests/ops/util/test_dataset_yaml.py +++ b/tests/ops/util/test_dataset_yaml.py @@ -5,14 +5,14 @@ from fideslang.models import Dataset from pydantic import ValidationError -from fides.api.ops.graph.config import ( +from fides.api.graph.config import ( CollectionAddress, FieldAddress, ObjectField, ScalarField, ) -from fides.api.ops.graph.graph import DatasetGraph, Edge -from fides.api.ops.models.datasetconfig import convert_dataset_to_graph +from fides.api.graph.graph import DatasetGraph, Edge +from fides.api.models.datasetconfig import convert_dataset_to_graph from ..graph.graph_test_util import field diff --git a/tests/ops/util/test_jwt_util.py b/tests/ops/util/test_jwt_util.py index 5364f57300..ada5542356 100644 --- a/tests/ops/util/test_jwt_util.py +++ b/tests/ops/util/test_jwt_util.py @@ -1,13 +1,13 @@ import json from datetime import datetime -from fides.api.ops.cryptography.schemas.jwt import ( +from fides.api.cryptography.schemas.jwt import ( JWE_ISSUED_AT, JWE_PAYLOAD_CLIENT_ID, JWE_PAYLOAD_SCOPES, ) -from fides.api.ops.oauth.jwt import generate_jwe -from fides.api.ops.oauth.utils import extract_payload, is_token_expired +from fides.api.oauth.jwt import generate_jwe +from fides.api.oauth.utils import extract_payload, is_token_expired from fides.core.config import CONFIG diff --git a/tests/ops/util/test_logger.py b/tests/ops/util/test_logger.py index 65c6a58bc1..5dcb9f045a 100644 --- a/tests/ops/util/test_logger.py +++ b/tests/ops/util/test_logger.py @@ -2,7 +2,7 @@ import pytest -from fides.api.ops.util.logger import MASKED, Pii, _log_exception, _log_warning +from fides.api.util.logger import MASKED, Pii, _log_exception, _log_warning from fides.core.config import CONFIG diff --git a/tests/ops/util/test_matching_queue.py b/tests/ops/util/test_matching_queue.py index 106892df3a..df5c91e9a9 100644 --- a/tests/ops/util/test_matching_queue.py +++ b/tests/ops/util/test_matching_queue.py @@ -1,4 +1,4 @@ -from fides.api.ops.util.matching_queue import * +from fides.api.util.matching_queue import * def test_queue() -> None: diff --git a/tests/ops/util/test_oauth_util.py b/tests/ops/util/test_oauth_util.py index 0f53bdfc28..a28917a6d2 100644 --- a/tests/ops/util/test_oauth_util.py +++ b/tests/ops/util/test_oauth_util.py @@ -1,7 +1,7 @@ import pytest -from fides.api.ops.common_exceptions import AuthorizationError -from fides.api.ops.oauth.utils import get_root_client +from fides.api.common_exceptions import AuthorizationError +from fides.api.oauth.utils import get_root_client class TestGetRootClient: diff --git a/tests/ops/util/test_saas_util.py b/tests/ops/util/test_saas_util.py index 35891034b7..3b2ed173b7 100644 --- a/tests/ops/util/test_saas_util.py +++ b/tests/ops/util/test_saas_util.py @@ -1,7 +1,7 @@ import pytest -from fides.api.ops.common_exceptions import FidesopsException -from fides.api.ops.graph.config import ( +from fides.api.common_exceptions import FidesopsException +from fides.api.graph.config import ( Collection, FieldAddress, FieldPath, @@ -9,7 +9,7 @@ ObjectField, ScalarField, ) -from fides.api.ops.util.saas_util import ( +from fides.api.util.saas_util import ( assign_placeholders, merge_datasets, replace_version, diff --git a/tests/ops/util/test_storage_authenticator.py b/tests/ops/util/test_storage_authenticator.py index e996e59b0b..90bf0357a1 100644 --- a/tests/ops/util/test_storage_authenticator.py +++ b/tests/ops/util/test_storage_authenticator.py @@ -1,16 +1,14 @@ import pytest -from fides.api.ops.common_exceptions import StorageUploadError -from fides.api.ops.schemas.storage.storage import ( +from fides.api.common_exceptions import StorageUploadError +from fides.api.schemas.storage.storage import ( S3AuthMethod, StorageSecrets, StorageSecretsS3, StorageType, ) -from fides.api.ops.service.storage.storage_authenticator_service import ( - secrets_are_valid, -) -from fides.api.ops.util.storage_authenticator import get_s3_session +from fides.api.service.storage.storage_authenticator_service import secrets_are_valid +from fides.api.util.storage_authenticator import get_s3_session class TestGetS3Session: diff --git a/tests/ops/util/test_storage_util.py b/tests/ops/util/test_storage_util.py index 27adbd7992..8d263d3a51 100644 --- a/tests/ops/util/test_storage_util.py +++ b/tests/ops/util/test_storage_util.py @@ -1,7 +1,7 @@ import pytest -from fides.api.ops.schemas.storage.storage import StorageSecretsS3, StorageType -from fides.api.ops.util.storage_util import get_schema_for_secrets +from fides.api.schemas.storage.storage import StorageSecretsS3, StorageType +from fides.api.util.storage_util import get_schema_for_secrets class TestStorageUtil: