From 13e38f00e54583c693985ab48c38579ffbcab8e9 Mon Sep 17 00:00:00 2001 From: Dan Allan Date: Fri, 17 May 2024 09:12:50 -0400 Subject: [PATCH] Handle case of short manually set single-user API keys Co-authored-by: Padraic Shafer <76011594+padraic-shafer@users.noreply.github.com> --- tiled/client/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiled/client/context.py b/tiled/client/context.py index 840f97cde..bf667f662 100644 --- a/tiled/client/context.py +++ b/tiled/client/context.py @@ -172,7 +172,7 @@ def __repr__(self): ",".join(f"'{identity['id']}'" for identity in identities) ) if self.api_key is not None: - auth_info.append(f"with API key '{self.api_key[:8]}...'") + auth_info.append(f"with API key '{self.api_key[:min(len(self.api_key)//2, 8)]}...'") auth_repr = " ".join(auth_info) return f"<{type(self).__name__} {auth_repr}>"