Merge pull request #1983 from vmware-tanzu/handle_another_github_interstitial

handle another github login interstitial page
This commit is contained in:
Joshua Casey
2024-06-06 16:00:58 -05:00
committed by GitHub
4 changed files with 15 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ module go.pinniped.dev/generated/1.30/apis
go 1.22.0
toolchain go1.22.3
toolchain go1.22.4
require (
k8s.io/api v0.30.1

View File

@@ -3,7 +3,7 @@ module go.pinniped.dev/generated/1.30/client
go 1.22.0
toolchain go1.22.3
toolchain go1.22.4
replace go.pinniped.dev/generated/1.30/apis => ../apis

2
go.mod
View File

@@ -2,7 +2,7 @@ module go.pinniped.dev
go 1.22.0
toolchain go1.22.2
toolchain go1.22.4
// This version taken from https://github.com/kubernetes/apiserver/blob/v0.30.0/go.mod#L14 to avoid compile failures.
replace github.com/google/cel-go => github.com/google/cel-go v0.17.8

View File

@@ -499,6 +499,18 @@ func handleOccasionalGithubLoginPage(t *testing.T, b *Browser, upstream testlib.
b.ClickFirstMatch(t, submitConfirmButtonSelector)
return true
case strings.HasPrefix(lowercaseTitle, "verify two-factor authentication"):
// Next GitHub might occasionally as you to confirm your MFA settings.
// Wait for the page to be rendered.
t.Logf("waiting for GitHub skip link")
// There are several buttons and links. We want to click this link to "skip 2FA verification":
// <button type="submit" data-view-component="true" class="Button--link Button--medium Button">
submitSkipButtonSelector := "button.Button--link[type=submit]"
b.WaitForVisibleElements(t, submitSkipButtonSelector)
t.Logf("clicking skip link")
b.ClickFirstMatch(t, submitSkipButtonSelector)
return true
case strings.HasPrefix(lowercaseTitle, "configure passwordless authentication"):
// Next GitHub might occasionally ask if we want to configure a passkey for auth.
// The URL bar shows https://github.com/sessions/trusted-device for this page.