Skip to content

Don't require identityPool in cognito-config; fix Dependabot alerts - #22

Merged
jwagenaar merged 2 commits into
mainfrom
fix/cognito-config-optional-identity-pool
Oct 20, 2026
Merged

jwagenaar merged 2 commits into
mainfrom
fix/cognito-config-optional-identity-pool

Conversation

@jwagenaar

@jwagenaar jwagenaar commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Two changes: login no longer depends on identityPool in the cognito-config response, and the open Dependabot alerts are fixed.

1. Don't require identityPool

Direct mode builds its Cognito config with CognitoConfig(**response.json()) from GET /authentication/cognito-config (direct/provider.py:28). CognitoConfig.__init__ declared identityPool as a required argument, but only the token pool is used, for initiate_auth. identity_pool isn't read anywhere.

The Cognito identity pool is being retired. It only served legacy uploads-bucket credentials to agents older than v2.0.0 (Pennsieve/upload-service-v2#117, Pennsieve/pennsieve-api#421). For now pennsieve-api keeps an empty identityPool in the response, so that clients up to this version can still log in. Once the key leaves the response, login with older versions fails with TypeError: __init__() missing 1 required positional argument: 'identityPool'.

  • CognitoConfig(region, userPool, tokenPool, **_ignored): identityPool and any other extra keys are accepted and ignored. The unused identity_pool attribute is removed.
  • tests/test_cognito_config.py: a response without identityPool, and one with identityPool plus an unknown key.

2. Dependabot alerts

pyproject.toml floors are raised to the patched versions, and poetry update --lock updated only the affected packages:

Package Locked Alerts (highest)
pyjwt (^2.15) 2.10.1 → 2.15.1 14 (critical)
urllib3 (via requests/botocore) 2.3.0 → 2.8.0 8 (high)
requests (^2.33) 2.32.3 → 2.34.2 2 (medium)
setuptools 76.0.0 → 84.2.1 2 (high)
idna 3.10 → 3.20 1 (medium)
pygments 2.19.1 → 2.21.0 1 (low)
black, dev (^26.3.1) 25.12.0 → 26.10.1 1 (high)
pytest, dev (^9.0.3) 8.4.2 → 9.1.1 1 (medium)

Other changes in the lock:

  • The two numpy entries (1.26.0 and 1.26.4, by Python marker) merge into 1.26.4, still within ^1.26.
  • pathspec 0.12.1 → 1.1.1 (a black dependency).
  • The lock header moves from Poetry 2.4.1 to 2.5.1.

Formatting: CI lints with flake8, and reviewdog installs the latest black itself, so the black 26 upgrade doesn't change either.

Dependabot's own #11 (markdown-it-py 2.1.0 → 2.2.0) is stale: the lock already has markdown-it-py 3.0.0, so it can be closed.

Check

poetry check --lock passes. poetry install --with dev on Python 3.12, then pytest: 33 passed (with jwt 2.15.1, urllib3 2.8.0, requests 2.34.2).

After release

Once users are on this version, pennsieve-api can drop identityPool from the cognito-config response.

🤖 Generated with Claude Code

CognitoConfig is built with CognitoConfig(**response.json()) and declared
identityPool as a required argument, although only the token pool is used
(login). The Cognito identity pool is being retired server-side, and if the
key ever leaves GET /authentication/cognito-config, login fails with a
TypeError before it starts.

CognitoConfig now takes region, userPool and tokenPool, and ignores
identityPool and any other keys. Adds tests for both cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Raises the floors of the direct dependencies to their patched versions and
updates only the affected packages in poetry.lock:

- pyjwt ^2.15 (2.10.1 -> 2.15.1; 14 alerts, highest critical)
- urllib3 2.3.0 -> 2.8.0 (8 alerts, high), via requests/botocore
- requests ^2.33 (2.32.3 -> 2.34.2; 2 alerts)
- setuptools 76.0.0 -> 84.2.1, idna 3.10 -> 3.20, pygments 2.19.1 -> 2.21.0
- dev: black ^26.3.1 (25.12.0 -> 26.10.1), pytest ^9.0.3 (8.4.2 -> 9.1.1)

Also in the lock: the two numpy entries (1.26.0/1.26.4 by marker) merge
into 1.26.4, and pathspec 0.12.1 -> 1.1.1 (black dependency). All 33 tests
pass on Python 3.12.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jwagenaar jwagenaar changed the title Don't require identityPool in the cognito-config response Don't require identityPool in cognito-config; fix Dependabot alerts Oct 20, 2026
@jwagenaar
jwagenaar merged commit 0d83fd8 into main Oct 20, 2026
14 checks passed
@jwagenaar
jwagenaar deleted the fix/cognito-config-optional-identity-pool branch October 20, 2026 23:58
@jwagenaar jwagenaar mentioned this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant