Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: Don't return Vec<u8> #257

Merged

Conversation

chrysn
Copy link
Collaborator

@chrysn chrysn commented Apr 19, 2024

The ID_CRED_x returned in the initiator and responder APIs are unintuitive for Python users when arrays (esp. if they see examples where it's a [10] style single value -- to a Python user that looks more like a parsed CBOR, more so if that is actually what parsing a CBOR sequence would give). Returning it as Python bytes makes it easier to understand that this is the opaque data indicating either an identifier or a credential by value.

Closes: #256

The ID_CRED_x returned in the initiator and responder APIs are
unintuitive for Python users when arrays (esp. if they see examples
where it's a `[10]` style single value -- to a Python user that looks
more like a parsed CBOR, more so if that is actually what parsing a CBOR
sequence would give). Returning it as Python bytes makes it easier to
understand that this is the opaque data indicating either an identifier
or a credential by value.

Closes: openwsn-berkeley#256
@geonnave
Copy link
Collaborator

geonnave commented May 3, 2024

Looks good, thank you. (this was an overlook on my side, initially did all with Vec but then realized bytes was better, and obviously forgot to update some functions 🙃)

@geonnave geonnave merged commit 643ee3c into openwsn-berkeley:main May 3, 2024
20 checks passed
@chrysn chrysn deleted the py-return-no-vec-u8 branch May 3, 2024 08:29
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.

Python: parse_message_2 produces id_cred_r as array
2 participants