WebAuthN bindings
Adds bindings to part of the Windows WebAuthN API.
Specifically, I have only added the bindings necessary to use the WebAuthNAuthenticatorGetAssertion function.
This is my first contribution here and also my first time writing Rust bindings. Thus, it's very likely that I missed something!
I have also introduced the bindings necessary to use WebAuthNAuthenticatorMakeCredential in 939d8f5915aa02f4dd6d982977837361841334a0.
webauthn.h implies several of these structs might gain additional fields in the future (and in fact has comments implying this happened a few times already before WEBAUTHN_API_VERSION_1 as found in 10.0.18362.0!). In modern Rust, #[non_exhaustive] might be appropriate? But that's not available until well after winapi's minimum supported rust version of 1.6. I'm not sure if extending the STRUCT! macro to support adding an old style hidden _non_exhaustive: () field might be appropriate...?
WEBAUTHN_API_VERSION_2 (10.0.19041.0, which this PR appears to be based on) doesn't add any new fields to any of the structs if the header comments are to be believed, so that's a plus at least.
Thus, it's very likely that I missed something!
For what it's worth, these are pretty spot on as far as I'm concerned! Good stuff! 👍
- Organization of code
- [x] All definitions go into the source file that directly maps to the header the definition is from.
- [ ] Definitions are defined in the same order as they are in the original header. ❌ A couple of minor deviations (called out in source annotations above)
- Imports
- [x] Are sorted in asciibetical order.
- Extern functions
- [x] ABIS are correct (
WINAPI="system") - [ ] Names are correct (functions, parameters) ⚠️ A couple of minor parameter name typos (only important if we care about doc comments?)
- [x] Parameter types are correct
- [x] Return types are correct
- [x] ABIS are correct (
- Constants
- [x] Names are correct
- [x] Values are correct
- [x] Types are correct
- Structs
- [x] Each field must be on its own line.
- [x] Struct and field names match header.
- [x] Field types match header.
- [ ] Misc
⚠️ The previously mentioned
#[non_exhaustive]concerns.
Thanks for taking a look @MaulingMonkey!
I think I took care of most of the issues. Let me know if I should rebase and squash all the commits together.
I'm not sure if extending the STRUCT! macro to support adding an old style hidden _non_exhaustive: () field might be appropriate...?
I am not very familiar with macros nor the internals of the library, so I don't think I can discuss this :sweat_smile: Maybe we should wait until @retep998 gets a chance to review this. No rush!
webauthn.h implies several of these structs might gain additional fields in the future (and in fact has comments implying this happened a few times already before WEBAUTHN_API_VERSION_1 as found in 10.0.18362.0!). In modern Rust, #[non_exhaustive] might be appropriate?
I believe there is a great deal of structs in winapi that have had fields added to them as time went on. I don't know what the best way to deal with that is, but whatever it is, it should probably be punted to a 0.4 release.