Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/appconfiguration/azure-appconfiguration-provider",
"Tag": "python/appconfiguration/azure-appconfiguration-provider_d81e6a8e3c"
"Tag": "python/appconfiguration/azure-appconfiguration-provider_d4cf1efd37"
}

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
add_remove_header_sanitizer,
add_uri_string_sanitizer,
is_live,
get_credential,
)
import pytest
from azure.appconfiguration import AzureAppConfigurationClient
from azure.identity import DefaultAzureCredential
from testcase import setup_configs, cleanup_test_resources

# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method
Expand All @@ -32,10 +32,10 @@ def setup_app_config_keys():
yield
return

credential = DefaultAzureCredential()
credential = get_credential()
client = AzureAppConfigurationClient(endpoint, credential)
keyvault_secret_url = os.environ.get("APPCONFIGURATION_KEY_VAULT_REFERENCE")
keyvault_secret_url2 = os.environ.get("APPCONFIGURATION_KEY_VAULT_REFERENCE2")
keyvault_secret_url = os.environ.get("APPCONFIGURATION_KEYVAULT_SECRET_URL")
keyvault_secret_url2 = os.environ.get("APPCONFIGURATION_KEYVAULT_SECRET_URL2")
snap_name, ff_snap_name = setup_configs(client, keyvault_secret_url, keyvault_secret_url2)

snapshot_names["snapshot"] = snap_name
Expand All @@ -49,18 +49,25 @@ def setup_app_config_keys():
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
add_general_regex_sanitizer(
value="https://sanitized.azconfig.io",
regex=os.environ.get("APPCONFIGURATION_ENDPOINT_STRING", "https://sanitized.azconfig.io"),
value="https://Sanitized.azconfig.io",
regex=os.environ.get("APPCONFIGURATION_ENDPOINT_STRING", "https://Sanitized.azconfig.io"),
)
add_general_regex_sanitizer(
value="sanitized",
regex=os.environ.get("APPCONFIGURATION_CONNECTION_STRING", "https://sanitized.azconfig.io"),
value="Sanitized",
regex=os.environ.get("APPCONFIGURATION_CONNECTION_STRING", "https://Sanitized.azconfig.io"),
)
add_uri_string_sanitizer()
# Register the longer URL2 sanitizer FIRST to prevent URL1's sanitizer from partially matching within URL2
add_general_string_sanitizer(
value="https://sanitized.vault.azure.net/secrets/fake-secret/",
value="https://Sanitized.vault.azure.net/secrets/TestSecret2/",
target=os.environ.get(
"APPCONFIGURATION_KEY_VAULT_REFERENCE", "https://sanitized.vault.azure.net/secrets/fake-secret/"
"APPCONFIGURATION_KEYVAULT_SECRET_URL2", "https://Sanitized.vault.azure.net/secrets/TestSecret2/"
),
)
add_general_string_sanitizer(
value="https://Sanitized.vault.azure.net/secrets/TestSecret/",
target=os.environ.get(
"APPCONFIGURATION_KEYVAULT_SECRET_URL", "https://Sanitized.vault.azure.net/secrets/TestSecret/"
),
)
add_remove_header_sanitizer(headers="Correlation-Context")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
FEATURE_FLAG_KEY = "feature_flags"

APPCONFIGURATION_CONNECTION_STRING = (
"Endpoint=https://sanitized.azconfig.io;"
"Endpoint=https://Sanitized.azconfig.io;"
"Id=0-l4-s0:h5htBaY5Z1LwFz50bIQv;"
"Secret=lamefakesecretlamefakesecretlamefakesecrett=" # cspell: disable-line
)
APPCONFIGURATION_ENDPOINT_STRING = "https://sanitized.azconfig.io"
APPCONFIGURATION_KEYVAULT_SECRET_URL = "https://sanitized.vault.azure.net/secrets/fake-secret/"
APPCONFIGURATION_KEYVAULT_SECRET_URL2 = "https://sanitized.vault.azure.net/secrets/fake-secret2/"
APPCONFIGURATION_ENDPOINT_STRING = "https://Sanitized.azconfig.io"
APPCONFIGURATION_KEYVAULT_SECRET_URL = "https://Sanitized.vault.azure.net/secrets/TestSecret/"
APPCONFIGURATION_KEYVAULT_SECRET_URL2 = "https://Sanitized.vault.azure.net/secrets/TestSecret2/"
Loading
Loading