def call_victim(self, config): env = ApplicationVersion("DEV", "04fab6", "my-branch") with mock.patch( "takeoff.azure.credentials.keyvault.ServicePrincipalCredentials.credentials", return_value="mylittlepony") as m_creds: victim.vault_and_client(config, env) m_creds.assert_called_once_with(config, "dev")
def __init__(self, env: ApplicationVersion, config: dict): super().__init__(env, config) self.vault_name, self.vault_client = KeyVaultClient.vault_and_client( self.config, self.env) self.databricks_client = Databricks( self.vault_name, self.vault_client).api_client(self.config) self.secret_api = SecretApi(self.databricks_client)
def _get_cosmos_management_client(self) -> CosmosDB: vault, client = KeyVaultClient.vault_and_client(self.config, self.env) credentials = ActiveDirectoryUserCredentials( vault_name=vault, vault_client=client).credentials(self.config) return CosmosDB( credentials, SubscriptionId(vault, client).subscription_id(self.config))
def __init__(self, config, app_version): super().__init__(config, app_version) self.vault_name, self.vault_client = KeyVaultClient.vault_and_client( self.config, self.env)
def __init__(self, env: ApplicationVersion, config: dict): super().__init__(env, config) self.vault_name, self.vault_client = KeyVaultClient.vault_and_client( self.config, self.env)
def __init__(self, env: ApplicationVersion, config: dict): self.env = env self.config = config self.vault_name, self.vault_client = KeyVaultClient.vault_and_client( self.config, self.env)