trussed-dev / ctap-types

3 stars 9 forks source link

client_pin: Add permissions #30

Closed robin-nitrokey closed 7 months ago

robin-nitrokey commented 7 months ago

The placeholders are not really nice but I don’t see a better way atm. Ideally, serde-indexed would support skipping indizes. I’ve made the placeholders private for now. This should not be a problem as we only deserialize requests and don’t construct them manually.

sosthene-nitrokey commented 7 months ago

The placeholders are not really nice but I don’t see a better way atm. Ideally, serde-indexed would support skipping indizes. I’ve made the placeholders private for now. This should not be a problem as we only deserialize requests and don’t construct them manually.

This got me to think that if #[serde(rename = 0x07)] was supported we could get rid of serde-indexed and this would also solve the issues of SerdeIndexed being a backward compatibility footgun.

Looking at https://github.com/serde-rs/serde/issues/745 it looks like this could be accepted if submitted as a PR in serde itself. This would also just work with #[serde(alias = "…")].

Edit: though there is a 2 years old open PR without maintainer feedback: https://github.com/serde-rs/serde/pull/2209

robin-nitrokey commented 7 months ago

Yes, that would be great. It is also annoying that serde_indexed needs to manually implement serde attributes. In this case, #[serde(skip)] would be useful.