Skip to content
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

Implement authenticator API #20

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (wd *remoteWD) voidCommand(urlTemplate string, params interface{}) error {
return voidCommand("POST", wd.requestURL(urlTemplate, wd.id), params)
}

func (wd remoteWD) stringsCommand(urlTemplate string) ([]string, error) {
func (wd *remoteWD) stringsCommand(urlTemplate string) ([]string, error) {
url := wd.requestURL(urlTemplate, wd.id)
response, err := wd.execute("GET", url, nil)
if err != nil {
Expand Down Expand Up @@ -1278,6 +1278,15 @@ func (wd *remoteWD) SetAlertText(text string) error {
return wd.voidCommand("/session/%s/alert/text", data)
}

func (wd *remoteWD) AddVirtualAuthenticator(params map[string]interface{}) error {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

return wd.voidCommand("/session/%s/webauthn/authenticator", params)
}

func (wd *remoteWD) RemoveVirtualAuthenticator(id string) error {
_, err := wd.execute("DELETE", wd.requestURL("/session/%s/webauthn/authenticator/"+id, wd.id), nil)
return err
}

func (wd *remoteWD) execScriptRaw(script string, args []interface{}, suffix string) ([]byte, error) {
if args == nil {
args = make([]interface{}, 0)
Expand Down