jiengup opened a new issue, #4167:
URL: https://github.com/apache/iggy/issues/4167
### Description
The Rust SDK returns `IdentityInfo` from both username/password login and
personal access token login:
```rust
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
- [ ] I'm willing to submit a pull request to implement this feature
### Good first issue
- [x] I think this could be a good first issue for a new contributor
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]