From 79e8baa6098206de243d64f18123701502037d2d Mon Sep 17 00:00:00 2001 From: Barcode Betty <32+cs_betty@noreply.git.farh.net> Date: Tue, 9 Jun 2026 17:47:11 +0000 Subject: [PATCH] fix(ci): use REGISTRY_TOKEN for build-and-push registry login (CAR-1330) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Squashed fix swaps github.token → secrets.REGISTRY_TOKEN at .gitea/workflows/ci.yml:121, matching the proven-green cartsnitch/auth pattern (CAR-1009). Parity fix with uat PR #49 to prevent reintroduction on next dev→uat promotion. Note: includes 3 absorbed lint/typecheck commits from PR #48 (already merged to dev via #48) to unblock CI on this branch. No app code changes; one-line CI config swap only. QA: PR #50 approved by @cs_charlie (review id 4616); CI run 3443 lint/typecheck/test all green. Co-authored-by: Barcode Betty <32+cs_betty@noreply.git.farh.net> Co-committed-by: Barcode Betty <32+cs_betty@noreply.git.farh.net> --- .gitea/workflows/ci.yml | 2 +- src/cartsnitch_api/cache.py | 2 +- src/cartsnitch_api/middleware/rate_limit.py | 4 ---- tests/conftest.py | 1 - 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d17525e..be9b718 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -118,7 +118,7 @@ jobs: echo "CalVer tag: $VERSION" - name: Log in to Gitea Container Registry - run: echo "${{ github.token }}" | docker login git.farh.net -u ${{ github.actor }} --password-stdin + run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.farh.net -u ${{ github.actor }} --password-stdin - name: Extract metadata id: meta diff --git a/src/cartsnitch_api/cache.py b/src/cartsnitch_api/cache.py index 6766a8c..836bfb8 100644 --- a/src/cartsnitch_api/cache.py +++ b/src/cartsnitch_api/cache.py @@ -35,7 +35,7 @@ class CacheClient: async def get(self, key: str) -> str | None: if not self._client: return None - value = await self._client.get(key) + value: str | bytes | None = await self._client.get(key) if value is None: return None if isinstance(value, bytes): diff --git a/src/cartsnitch_api/middleware/rate_limit.py b/src/cartsnitch_api/middleware/rate_limit.py index c6d5f21..e736537 100644 --- a/src/cartsnitch_api/middleware/rate_limit.py +++ b/src/cartsnitch_api/middleware/rate_limit.py @@ -121,10 +121,6 @@ if settings.rate_limit_redis_enabled: logger.warning("Failed to connect to Redis for rate limiting, using in-memory: %s", e) _use_redis = False -_public_limiter: RateLimitBackend -_auth_limiter: RateLimitBackend -_auth_strict_limiter: RateLimitBackend - if _use_redis and _redis_client: _public_limiter = RedisSlidingWindow( _redis_client, settings.rate_limit_requests, settings.rate_limit_window_seconds diff --git a/tests/conftest.py b/tests/conftest.py index 1958022..133f726 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -117,7 +117,6 @@ def _register_event_listeners(): event.listen(cls, "before_insert", _set_timestamp_defaults) - TEST_JWT_SECRET = secrets.token_urlsafe(32) TEST_SERVICE_KEY = secrets.token_urlsafe(32) TEST_FERNET_KEY = "7reF42nmTwbdN21PBoubGp7h_FU8qSimstmlaMLoRK8="