@@ -49,13 +49,31 @@ def test_hmsl_other_env_config_values(isolated_fs, hmsl_no_env_vars, monkeypatch
4949 WHEN getting HasMySecretLeaked config values
5050 THEN the values are correctly set
5151 """
52+ # If the user defines a custom HMSL URL
5253 monkeypatch .setenv (
53- "GITGUARDIAN_HMSL_URL" , "https://hasmysecretleaked.secretdomain.net "
54+ "GITGUARDIAN_HMSL_URL" , "https://hasmysecretleaked.env.gitguardian.com "
5455 )
56+ # They are also expected to set a corresponding GitGuardian instance
57+ monkeypatch .setenv ("GITGUARDIAN_INSTANCE" , "https://dashboard.env.gitguardian.com" )
5558 config = Config ()
56- assert config .hmsl_url == "https://hasmysecretleaked.secretdomain.net"
57- assert config .hmsl_audience == "https://hasmysecretleaked.secretdomain.net"
58- assert config .saas_api_url == "https://api.secretdomain.net"
59+ assert config .hmsl_url == "https://hasmysecretleaked.env.gitguardian.com"
60+ assert config .hmsl_audience == "https://hasmysecretleaked.env.gitguardian.com"
61+ assert config .saas_api_url == "https://api.env.gitguardian.com"
62+
63+
64+ def test_hmsl_region_specific_config_values (isolated_fs , hmsl_no_env_vars , monkeypatch ):
65+ """
66+ GIVEN another SaaS environment
67+ WHEN getting HasMySecretLeaked config values
68+ THEN the values are correctly set
69+ """
70+ monkeypatch .setenv (
71+ "GITGUARDIAN_INSTANCE" , "https://dashboard.region3.gitguardian.com"
72+ )
73+ config = Config ()
74+ assert config .hmsl_url == "https://api.hasmysecretleaked.com"
75+ assert config .hmsl_audience == "https://api.hasmysecretleaked.com"
76+ assert config .saas_api_url == "https://api.region3.gitguardian.com"
5977
6078
6179def test_no_token (isolated_fs , hmsl_no_env_vars ):
0 commit comments