Description
The Rust SDK returns IdentityInfo from both username/password login and personal access token login:
async fn login_user(
&self,
username: &str,
password: &str,
) -> Result<IdentityInfo, IggyError>;
async fn login_with_personal_access_token(
&self,
token: &str,
) -> Result<IdentityInfo, IggyError>;
The Python SDK currently discards the value returned by login_user() and has no manual login_with_personal_access_token() method. Python callers therefore cannot obtain the authenticated user ID or the access token information returned by HTTP login.
This covers B10 and B12 of the Python SDK parity work tracked in #3893.
Affected area / component
Python SDK
Proposed solution
- Add Python wrappers for
IdentityInfo and TokenInfo, following the existing wrapper pattern in foreign/python/src/user.rs.
- Expose:
IdentityInfo.user_id
IdentityInfo.access_token: TokenInfo | None
TokenInfo.token
TokenInfo.expiry
- Register the new classes in
foreign/python/src/lib.rs.
- Change
login_user() to return IdentityInfo instead of discarding it.
- Add
login_with_personal_access_token() and return the same IdentityInfo wrapper.
- Avoid exposing token values through
repr() or diagnostic output.
- Regenerate
foreign/python/apache_iggy.pyi.
- Add tests for username/password login over TCP and HTTP, including the transport-specific
access_token value.
- Add a successful PAT login test using a token minted out of band by the test setup, so this issue does not depend on exposing the PAT creation API.
Creating, listing, and deleting personal access tokens remain outside this issue.
Alternatives considered
Return only the numeric user ID. This would continue to discard the HTTP access-token details present in the Rust API.
Contribution
Good first issue
Description
The Rust SDK returns
IdentityInfofrom both username/password login and personal access token login:The Python SDK currently discards the value returned by
login_user()and has no manuallogin_with_personal_access_token()method. Python callers therefore cannot obtain the authenticated user ID or the access token information returned by HTTP login.This covers B10 and B12 of the Python SDK parity work tracked in #3893.
Affected area / component
Python SDK
Proposed solution
IdentityInfoandTokenInfo, following the existing wrapper pattern inforeign/python/src/user.rs.IdentityInfo.user_idIdentityInfo.access_token: TokenInfo | NoneTokenInfo.tokenTokenInfo.expiryforeign/python/src/lib.rs.login_user()to returnIdentityInfoinstead of discarding it.login_with_personal_access_token()and return the sameIdentityInfowrapper.repr()or diagnostic output.foreign/python/apache_iggy.pyi.access_tokenvalue.Creating, listing, and deleting personal access tokens remain outside this issue.
Alternatives considered
Return only the numeric user ID. This would continue to discard the HTTP access-token details present in the Rust API.
Contribution
Good first issue