Skip to content

feat(python): type get_auth_nonce and login_with_signature responses - #2644

Open
ibrhmyi wants to merge 1 commit into
pmxt-dev:mainfrom
ibrhmyi:feat/python-auth-response-types
Open

ibrhmyi wants to merge 1 commit into
pmxt-dev:mainfrom
ibrhmyi:feat/python-auth-response-types

Conversation

@ibrhmyi

@ibrhmyi ibrhmyi commented Nov 26, 2026

Copy link
Copy Markdown

Closes #2630.

Change

  • sdks/python/pmxt/models.py: add AuthNonceResponse (nonce, messageToSign, optional expiresAt) and AuthLoginResponse (apiKey, apiSecret, optional passphrase, expiresAt) as TypedDicts, matching the TypeScript interfaces.
  • sdks/python/pmxt/__init__.py: export both from the package root.
  • sdks/python/pmxt/client.py: get_auth_nonce / login_with_signature now return these types instead of Dict[str, Any]. Runtime behaviour is unchanged (still the raw dict).
  • sdks/python/scripts/generate-client-methods.js: TYPE_MAP points at the new types. Both methods are in PRESERVE_EXISTING_METHODS, so their annotations are edited by hand in client.py; re-running the generator leaves them as they are.

Tests

  • New test in tests/test_public_exports.py checks the required/optional keys, the root exports, and the two return annotations. It fails without the change and passes with it.

Verification and limits

  • The generated pmxt_internal client isn't in the repo and needs openapi-generator, which I don't have, so I ran the Python tests against a throwaway stub of that package. tests/test_public_exports.py: 10 passed. The rest of tests/ (excluding e2e): 264 passed, 4 failed, and the same 4 fail with and without my change because they need the real generated client. CI is the proper run.
  • Re-running generate-client-methods.js produces no further changes to client.py.

AI assistance was used for this contribution (implementation and review); I checked the diff and test results myself.

Add AuthNonceResponse and AuthLoginResponse TypedDicts mirroring the
TypeScript SDK, export them from the package root, and use them as the
return types. Point the generator's TYPE_MAP at them so a regeneration
keeps the annotations.

This branch has not been deployed

No deployments
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.

SDK drift: AuthNonceResponse/AuthLoginResponse are typed in TypeScript; Python's get_auth_nonce/login_with_signature return untyped Dict[str, Any]

1 participant