-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Add support to debug virtual authenticators #7842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Thank you! I love that it has tests too :) I'll wait for your comments before landing this. Feel free to disagree with anything: a lot of my comments are just questions.
java/client/src/org/openqa/selenium/virtualauthenticator/Credential.java
Show resolved
Hide resolved
java/client/src/org/openqa/selenium/virtualauthenticator/Credential.java
Outdated
Show resolved
Hide resolved
java/client/src/org/openqa/selenium/virtualauthenticator/Credential.java
Show resolved
Hide resolved
|
||
public Map<String, Object> toMap() { | ||
Base64.Encoder encoder = Base64.getUrlEncoder(); | ||
HashMap<String, Object> map = new HashMap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Map
on the LHS.
It doesn't matter a huge amount, but I'm curious why you've used ImmutableMap
elsewhere and not here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an earlier version of my patch modified the map in place on RemoteWebDriver
. Changed to ImmutableMap
here and in VirtualAuthenticatorOptions
for consistency. This means I had to add guava as a dependency to the bazel package -- ptal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! We strive to make sure that the selenium-api
doesn't need any third party libraries. If we want this to be immutable, the only Java 8 option is to use Collections.unmodifiableMap
. The Map.of()
method from Java 11 would be better, but we can't use that yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the dependency and used Collections.unmodifiableMap
instead. Please take a look.
java/client/src/org/openqa/selenium/virtualauthenticator/VirtualAuthenticatorOptions.java
Show resolved
Hide resolved
java/client/test/org/openqa/selenium/virtualauthenticator/VirtualAuthenticatorTest.java
Outdated
Show resolved
Hide resolved
9b63b59
to
3d7ef7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your quick review! Comments addressed below:
java/client/src/org/openqa/selenium/virtualauthenticator/Credential.java
Show resolved
Hide resolved
java/client/src/org/openqa/selenium/virtualauthenticator/Credential.java
Outdated
Show resolved
Hide resolved
|
||
public Map<String, Object> toMap() { | ||
Base64.Encoder encoder = Base64.getUrlEncoder(); | ||
HashMap<String, Object> map = new HashMap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an earlier version of my patch modified the map in place on RemoteWebDriver
. Changed to ImmutableMap
here and in VirtualAuthenticatorOptions
for consistency. This means I had to add guava as a dependency to the bazel package -- ptal.
java/client/test/org/openqa/selenium/virtualauthenticator/VirtualAuthenticatorTest.java
Outdated
Show resolved
Hide resolved
Also fix some if without braces.
080b579
to
059d4e0
Compare
Description
This patch adds support for the
addCredential
,getCredentials
,removeCredential
,removeAllCredentials
andsetUserVerified
commands of the WebAuthn automation API.To add these methods directly into the
VirtualAuthenticator
class, I extracted it into an interface and implemented aRemoteVirtualAuthenticator
as inner class ofRemoteWebDriver
.Motivation and Context
Support more WebAuthn use cases:
Types of changes
Checklist
Fixes #7829