Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
feat: Add Webauthn routes (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Sep 19, 2020
1 parent 445c3b2 commit 14efcc9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions lib/protocol/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/protocol/routes-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

Expand Down

0 comments on commit 14efcc9

Please sign in to comment.