Nitrokey / nethsm-sdk-rs

Client-side Rust SDK for NetHSM
MIT License
3 stars 1 forks source link

Multipart requests do not work #20

Closed robin-nitrokey closed 6 months ago

robin-nitrokey commented 6 months ago

Multipart requests, for example in default_api::system_restore_post, are not implemented.

wiktor-k commented 4 months ago

:thinking: c7cbe7b74d69db328767489e2ab1b5e2fb31598c adds dependency on the multipart crate which is unmaintained for a year (see RUSTSEC-2023-0050).

Would it be possible to use one of the alternatives listed there? (e.g. multer or multiparty)

Thanks for your time! :wave:

robin-nitrokey commented 4 months ago

I’m aware of the problem but I don’t know a suitable replacement. multer and multiparty only support multipart decoding, not encoding.

robin-nitrokey commented 4 months ago

I’ve created https://github.com/Nitrokey/nethsm-sdk-rs/issues/29 to keep track of the issue.

wiktor-k commented 4 months ago

I’m aware of the problem but I don’t know a suitable replacement. multer and multiparty only support multipart decoding, not encoding.

Oh, I see. I wonder what would be the effort of writing a limited scope encoder. I haven't checked the usages yet so this may be a very bad idea 😅

robin-nitrokey commented 4 months ago

It should not be that hard. I just did not want to include it in this crate directly because I think it should be maintained and tested separately, and I did not want to do that myself unless there are concrete issues with multipart other than being unmaintained. If you want to look into that, I’m happy to test and eventually migrate.

wiktor-k commented 4 months ago

Agreed. I'll check out if it makes sense to extend existing crates. Thanks for the explanation! 👋