MasterKale / SimpleWebAuthn

WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
https://simplewebauthn.dev
MIT License
1.63k stars 138 forks source link

Missing exported type `VerifiedAttestation` #104

Closed akanass closed 3 years ago

akanass commented 3 years ago

The response of verifyAttestationResponse isn't exported in types package or server package.

TS is going inside @simplewebauthn/server/dist/attestation/verifyAttestationResponse to get it.

JayHelton commented 3 years ago

I played around with this too and found a few more types that could be exported to better support strict typescript users, or more complex use cases.

@MasterKale how do you feel about exporting respective Options type and then the VerifiedAttestation and VerifiedAssertion types?

Currently, the types package seems focused on the external interfaces that SimpleWebAuthn uses that dont have types (i.e. WebAuthn responses and options).

I imagine we could just export from the server package, if the types module wasnt best suited for these particular types. I can throw up a PR if you dont have the bandwidth

MasterKale commented 3 years ago

I imagine we could just export from the server package, if the types module wasnt best suited for these particular types. I can throw up a PR if you dont have the bandwidth

I think this is a great idea, I don't have any reason not to export these types from Server. The various Options will need to be renamed accordingly before export but other than that I'd approve a PR with those changes.

JayHelton commented 3 years ago

Great! I'll work on this and push up a PR tonight.

MasterKale commented 3 years ago

Additional types are now exported from the newly-published @simplewebauthn/server@2.2.0 to help with typing inputs and outputs for its various methods

Thanks to @JayHelton for making this happen! :tada: