From cc74d7890bb517e7eaa8c1b9c052e86726e448d2 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Thu, 18 Jan 2024 23:21:18 +0000 Subject: [PATCH] feat: universe domain support in GAPICs --- google/api_core/universe_domain.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 google/api_core/universe_domain.py diff --git a/google/api_core/universe_domain.py b/google/api_core/universe_domain.py new file mode 100644 index 000000000..5ee35f0a8 --- /dev/null +++ b/google/api_core/universe_domain.py @@ -0,0 +1,9 @@ + +GOOGLE_DEFAULT_UNIVERSE = "googleapis.com" + +def _validate_universe_domain(client_universe, credentials_universe): + """Validates the universe domain used by the client instance against + the universe domain in the credentials. + """ + if client_universe != credentials_universe: + raise ValueError(f"The configured universe domain ({client_universe}) does not match the universe domain found in the credentials ({credentials_universe}). If you haven't configured the universe domain explicitly, `googleapis.com` is the default.") \ No newline at end of file