cedarcode / webauthn-ruby

WebAuthn ruby server library ― Make your Ruby/Rails web server become a conformant WebAuthn Relying Party
https://rubygems.org/gems/webauthn
MIT License
644 stars 51 forks source link

Add interface for accessing `transports` #421

Closed santiagorodriguez96 closed 5 months ago

santiagorodriguez96 commented 6 months ago

Summary

Step 23 of the Registering a New Credential section of the WebAuthn Level 2 spec states:

It is RECOMMENDED to also:

Associate the credentialId with the transport hints returned by calling credential.response.getTransports(). This value SHOULD NOT be modified before or after storing it. It is RECOMMENDED to use this value to populate the transports of the allowCredentials option in future get() calls to help the client know how to find a suitable authenticator.

This PR adds the necessary interface for relying parties to easily access to this value, by doing:

WebAuthn::Credential.from_create(credential_params).response.transports # => ["internal"]