From 844bf1bfbbad2a85ffce2d93b4ec121f71423d1d Mon Sep 17 00:00:00 2001 From: David Michaels Date: Thu, 4 Jan 2024 12:49:50 -0500 Subject: [PATCH] Sanity check in portal_utils.Portal constructor. --- dcicutils/portal_utils.py | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dcicutils/portal_utils.py b/dcicutils/portal_utils.py index cec8d8ac0..974679638 100644 --- a/dcicutils/portal_utils.py +++ b/dcicutils/portal_utils.py @@ -94,6 +94,8 @@ def init_from_key(key: dict, server: Optional[str], unspecified: Optional[list] self._key_pair = (key_id, secret) if ((isinstance(server, str) and server) or (isinstance(server := key.get("server"), str) and server)): if server := normalize_server(server): + if isinstance(key_server := key.get("server"), str) and key_server and key_server != server: + raise Exception(f"Portal server inconsistency: {server} vs {key_server}") self._key["server"] = self._server = server if not self._key: raise Exception("Portal init error; from key.") diff --git a/pyproject.toml b/pyproject.toml index fe8f0fcdf..1ab36a318 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dcicutils" -version = "8.7.0.1b5" # TODO: To become 8.7.1 +version = "8.7.0.1b6" # TODO: To become 8.7.1 description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources" authors = ["4DN-DCIC Team "] license = "MIT"