feat: Add Webauthn routes
MODIFY
lib/protocol/routes.js
lib/protocol/routes.js
@@ -706,6 +706,56 @@ const METHOD_MAP = {
'/session/:sessionId/:vendor/cdp/execute': {
POST: {command: 'executeCdp', payloadParams: {required: ['cmd', 'params']}}
},
+
+ //region Webauthn
+ // https://www.w3.org/TR/webauthn-2/#sctn-automation-add-virtual-authenticator
+
+ '/session/:sessionId/webauthn/authenticator': {
+ POST: {
+ command: 'addVirtualAuthenticator',
+ payloadParams: {
+ required: ['protocol', 'transport'],
+ optional: ['hasResidentKey', 'hasUserVerification', 'isUserConsenting', 'isUserVerified'],
+ }
+ }
+ },
+
+ '/session/:sessionId/webauthn/authenticator/:authenticatorId': {
+ DELETE: {
+ command: 'removeVirtualAuthenticator'
+ }
+ },
+
+ '/session/:sessionId/webauthn/authenticator/:authenticatorId/credential': {
+ POST: {
+ command: 'addAuthCredential',
+ payloadParams: {
+ required: ['credentialId', 'isResidentCredential', 'rpId', 'privateKey'],
+ optional: ['userHandle', 'signCount'],
+ }
+ }
+ },
+
+ '/session/:sessionId/webauthn/authenticator/:authenticatorId/credentials': {
+ GET: {command: 'getAuthCredential'},
+ DELETE: {command: 'removeAllAuthCredentials'},
+ },
+
+ '/session/:sessionId/webauthn/authenticator/:authenticatorId/credentials/:credentialId': {
+ DELETE: {command: 'removeAuthCredential'}
+ },
+
+ '/session/:sessionId/webauthn/authenticator/:authenticatorId/uv': {
+ POST: {
+ command: 'setUserAuthVerified',
+ payloadParams: {
+ required: ['isUserVerified']
+ }
+ }
+ },
+
+ //endregion
+
};
// driver command names

MODIFY
test/protocol/routes-specs.js
test/protocol/routes-specs.js
@@ -40,7 +40,7 @@ describe('Protocol', function () {
}
let hash = shasum.digest('hex').substring(0, 8);
// Modify the hash whenever the protocol has intentionally been modified.
- hash.should.equal('e4576115');
+ hash.should.equal('52aacae0');
});
});

feat: Add Webauthn routes (#433)