dataflow.utils.vault_migration_script¶
Fixed Vault Reference Migration Script.
This script migrates API keys and secrets to the vault schema, using proper schema mapping with the existing table() helper function.
Attributes¶
Functions¶
|
Add helper functions to resolve vault references. |
|
Create a new secret in the vault. |
|
Ensure the table has a vault_reference column for secret references. |
|
Execute SQL safely through Supabase RPC function. |
|
Get existing vault secrets to avoid duplicates. |
|
Main function to run the migration. |
|
Migrate component_env_mappings to include vault references. |
|
Migrate engine API keys to vault references. |
|
Migrate config.environment_variables to use vault references. |
|
Migrate provider API keys to vault references. |
Module Contents¶
- dataflow.utils.vault_migration_script.add_vault_helper_functions() bool¶
Add helper functions to resolve vault references.
- Returns:
True if successful, False if SQL should be run manually
- dataflow.utils.vault_migration_script.create_vault_secret(name: str, description: str, value: str | None = None) str | None¶
Create a new secret in the vault.
- dataflow.utils.vault_migration_script.ensure_vault_reference_column(table_name: str) bool¶
Ensure the table has a vault_reference column for secret references. Uses table() helper function for proper schema resolution.
- Parameters:
table_name – Full table name including schema
- Returns:
True if column exists or was created, False otherwise
- dataflow.utils.vault_migration_script.execute_sql(sql: str) Any¶
Execute SQL safely through Supabase RPC function.
- dataflow.utils.vault_migration_script.get_existing_vault_secrets() dict[str, str]¶
Get existing vault secrets to avoid duplicates.
- dataflow.utils.vault_migration_script.main()¶
Main function to run the migration.
- dataflow.utils.vault_migration_script.migrate_component_env_mappings() int¶
Migrate component_env_mappings to include vault references.
- Returns:
Number of mappings migrated
- dataflow.utils.vault_migration_script.migrate_engine_api_keys() int¶
Migrate engine API keys to vault references.
- Returns:
Number of engines with API keys migrated
- dataflow.utils.vault_migration_script.migrate_environment_variables() int¶
Migrate config.environment_variables to use vault references.
- Returns:
Number of environment variables migrated
- dataflow.utils.vault_migration_script.migrate_provider_api_keys() int¶
Migrate provider API keys to vault references.
- Returns:
Number of providers migrated
- dataflow.utils.vault_migration_script.exit_code = 0¶
- dataflow.utils.vault_migration_script.logger¶
- dataflow.utils.vault_migration_script.supabase¶