diff --git a/cmd/keymaster/main.go b/cmd/keymaster/main.go index 90a598fe..8ed8620a 100644 --- a/cmd/keymaster/main.go +++ b/cmd/keymaster/main.go @@ -374,6 +374,7 @@ func setupCerts( } } + logger.Debugf(1, "SetupCerts: authentication Complete") if err := signers.Wait(); err != nil { return err } diff --git a/cmd/keymasterd/2fa_okta.go b/cmd/keymasterd/2fa_okta.go index dea30ea9..1101e989 100644 --- a/cmd/keymasterd/2fa_okta.go +++ b/cmd/keymasterd/2fa_okta.go @@ -95,12 +95,24 @@ func (state *RuntimeState) oktaPushStartHandler(w http.ResponseWriter, r *http.R state.writeFailureResponse(w, r, http.StatusInternalServerError, "Apperent Misconfiguration") return } + userResponse, err := oktaAuth.GetValidUserResponse(authData.Username) + if err != nil { + logger.Debugf(2, "oktaPushStartHandler: ") + } + if len(userResponse.Embedded.Factor) < 1 { + logger.Printf("oktaPushStartHandler: user %s does not have valid authenticators", authData.Username) + logger.Debugf(2, "oktaPushStartHandler: userdata for broken user%s is :%s", authData.Username, userResponse) + state.writeFailureResponse(w, r, http.StatusPreconditionFailed, "No valid MFA authenticators available") + return + } + pushResponse, err := oktaAuth.ValidateUserPush(authData.Username) if err != nil { logger.Println(err) state.writeFailureResponse(w, r, http.StatusInternalServerError, "Failure when validating OKTA push") return } + logger.Debugf(2, "oktaPushStartHandler: after validating push response=%+v", pushResponse) switch pushResponse { case okta.PushResponseWaiting: w.WriteHeader(http.StatusOK) diff --git a/cmd/keymasterd/adminHandlers_test.go b/cmd/keymasterd/adminHandlers_test.go index de502ab2..e766e0de 100644 --- a/cmd/keymasterd/adminHandlers_test.go +++ b/cmd/keymasterd/adminHandlers_test.go @@ -46,10 +46,11 @@ func testCreateRuntimeStateWithBothCAs(t *testing.T) ( return nil, "", err } state.Signer = signer - state.caCertDer, err = generateCADer(state, state.Signer) + caCertDer, err := generateCADer(state, state.Signer) if err != nil { return nil, "", err } + state.caCertDer = append(state.caCertDer, caCertDer) state.signerPublicKeyToKeymasterKeys() state.totpLocalRateLimit = make(map[string]totpRateLimitInfo) if err := initDB(state); err != nil { diff --git a/cmd/keymasterd/app.go b/cmd/keymasterd/app.go index 4ca38153..80770b24 100644 --- a/cmd/keymasterd/app.go +++ b/cmd/keymasterd/app.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "crypto" "crypto/rand" "crypto/tls" @@ -30,6 +31,7 @@ import ( texttemplate "text/template" "time" + "golang.org/x/crypto/ssh" "golang.org/x/net/context" "golang.org/x/time/rate" @@ -195,7 +197,7 @@ type RuntimeState struct { ClientCAPool *x509.CertPool HostIdentity string KerberosRealm *string - caCertDer []byte + caCertDer [][]byte certManager *certmanager.CertificateManager vipPushCookie map[string]pushPollTransaction localAuthData map[string]localUserData @@ -1043,6 +1045,7 @@ func (state *RuntimeState) publicPathHandler(w http.ResponseWriter, r *http.Requ target := r.URL.Path[len(publicPath):] + caPubMaxSeconds := 30 switch target { case "loginForm": //fmt.Fprintf(w, "%s", loginFormText) @@ -1050,11 +1053,46 @@ func (state *RuntimeState) publicPathHandler(w http.ResponseWriter, r *http.Requ state.writeHTMLLoginPage(w, r, 200, "", profilePath, "") return case "x509ca": - pemCert := string(pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: state.caCertDer})) + var outCABuf bytes.Buffer + for _, derCert := range state.caCertDer { + err := pem.Encode(&outCABuf, &pem.Block{Type: "CERTIFICATE", Bytes: derCert}) + if err != nil { + state.writeFailureResponse(w, r, http.StatusInternalServerError, "") + logger.Printf("Error computing pemCA") + return + } + } + w.Header().Add("Cache-Control", + fmt.Sprintf("max-age=%d, public, must-revalidate, proxy-revalidate", + caPubMaxSeconds)) + w.Header().Set("Content-Disposition", `attachment; filename=keymasterx509CA.pem"`) + w.WriteHeader(200) + outCABuf.WriteTo(w) + case "sshca": + var outCABuf bytes.Buffer + for _, pub := range state.KeymasterPublicKeys { + sshPub, err := ssh.NewPublicKey(pub) + if err != nil { + state.writeFailureResponse(w, r, http.StatusInternalServerError, "") + logger.Printf("Error computing sshCA") + return + } + pubBytes := ssh.MarshalAuthorizedKey(sshPub) + _, err = fmt.Fprintf(&outCABuf, "%s", pubBytes) + if err != nil { + state.writeFailureResponse(w, r, http.StatusInternalServerError, "") + logger.Printf("Error computing sshCA") + return + } - w.Header().Set("Content-Disposition", `attachment; filename="id_rsa-cert.pub"`) + } + w.Header().Add("Cache-Control", + fmt.Sprintf("max-age=%d, public, must-revalidate, proxy-revalidate", + caPubMaxSeconds)) + w.Header().Set("Content-Disposition", `attachment; filename=keymastersshCCA.pub"`) w.WriteHeader(200) - fmt.Fprintf(w, "%s", pemCert) + outCABuf.WriteTo(w) + default: state.writeFailureResponse(w, r, http.StatusNotFound, "") return @@ -1985,11 +2023,13 @@ func startServerAfterLoad(runtimeState *RuntimeState, realLogger *serverlogger.L if runtimeState.ClientCAPool == nil { runtimeState.ClientCAPool = x509.NewCertPool() } - myCert, err := x509.ParseCertificate(runtimeState.caCertDer) - if err != nil { - panic(err) + for _, derCert := range runtimeState.caCertDer { + myCert, err := x509.ParseCertificate(derCert) + if err != nil { + panic(err) + } + runtimeState.ClientCAPool.AddCert(myCert) } - runtimeState.ClientCAPool.AddCert(myCert) // Safari in MacOS 10.12.x required a cert to be presented by the user even // when optional. // Our usage shows this is less than 1% of users so we are now mandating diff --git a/cmd/keymasterd/authToken.go b/cmd/keymasterd/authToken.go index c9c3fd26..a33255d6 100644 --- a/cmd/keymasterd/authToken.go +++ b/cmd/keymasterd/authToken.go @@ -8,8 +8,9 @@ import ( "github.com/Cloud-Foundations/keymaster/lib/instrumentedwriter" "github.com/Cloud-Foundations/keymaster/lib/paths" - "gopkg.in/square/go-jose.v2" - "gopkg.in/square/go-jose.v2/jwt" + + "github.com/go-jose/go-jose/v4" + "github.com/go-jose/go-jose/v4/jwt" ) func (state *RuntimeState) generateAuthJWT(username string) (string, error) { @@ -32,7 +33,7 @@ func (state *RuntimeState) generateAuthJWT(username string) (string, error) { IssuedAt: now, TokenType: "keymaster_webauth_for_cli_identity", } - return jwt.Signed(signer).Claims(authToken).CompactSerialize() + return jwt.Signed(signer).Claims(authToken).Serialize() } func (state *RuntimeState) SendAuthDocumentHandler(w http.ResponseWriter, diff --git a/cmd/keymasterd/awsRole.go b/cmd/keymasterd/awsRole.go index 1066cb22..79ae6d53 100644 --- a/cmd/keymasterd/awsRole.go +++ b/cmd/keymasterd/awsRole.go @@ -178,12 +178,16 @@ func (state *RuntimeState) generateRoleCert(template *x509.Certificate, if !strong { return nil, fmt.Errorf("key too weak") } - caCert, err := x509.ParseCertificate(state.caCertDer) + signer, caCertDer, err := state.getSignerX509CAForPublic(publicKey) + if err != nil { + return nil, err + } + caCert, err := x509.ParseCertificate(caCertDer) if err != nil { return nil, err } certDER, err := x509.CreateCertificate(rand.Reader, template, caCert, - publicKey, state.Signer) + publicKey, signer) if err != nil { return nil, err } diff --git a/cmd/keymasterd/certgen.go b/cmd/keymasterd/certgen.go index 6561542b..4db38897 100644 --- a/cmd/keymasterd/certgen.go +++ b/cmd/keymasterd/certgen.go @@ -237,6 +237,13 @@ func (state *RuntimeState) expandSSHExtensions(username string) (map[string]stri return userExtensions, nil } +func (state *RuntimeState) getSignerX509CAForPublic(pub interface{}) (crypto.Signer, []byte, error) { + //v0... always returnt the primary signer + baseIndex := len(state.caCertDer) - 1 + return state.Signer, state.caCertDer[baseIndex], nil + +} + func (state *RuntimeState) postAuthSSHCertHandler( w http.ResponseWriter, r *http.Request, targetUser string, duration time.Duration) { @@ -453,14 +460,20 @@ func (state *RuntimeState) postAuthX509CertHandler( logger.Printf("Invalid File, Check Key strength/key type") return } - caCert, err := x509.ParseCertificate(state.caCertDer) + signer, caCertDer, err := state.getSignerX509CAForPublic(userPub) + if err != nil { + state.writeFailureResponse(w, r, http.StatusInternalServerError, "") + logger.Printf("Error Finding Cert for public key: %s\n data", err) + return + } + caCert, err := x509.ParseCertificate(caCertDer) if err != nil { state.writeFailureResponse(w, r, http.StatusInternalServerError, "") logger.Printf("Cannot parse CA Der: %s\n data", err) return } derCert, err := certgen.GenUserX509Cert(targetUser, userPub, caCert, - keySigner, state.KerberosRealm, duration, groups, organizations, + signer, state.KerberosRealm, duration, groups, organizations, serviceMethods, logger) if err != nil { state.writeFailureResponse(w, r, http.StatusInternalServerError, "") diff --git a/cmd/keymasterd/config.go b/cmd/keymasterd/config.go index 928bb2e9..1f301ffc 100644 --- a/cmd/keymasterd/config.go +++ b/cmd/keymasterd/config.go @@ -3,6 +3,7 @@ package main import ( "bufio" "bytes" + "crypto" "crypto/ecdsa" "crypto/ed25519" "crypto/rand" @@ -262,23 +263,30 @@ func (state *RuntimeState) loadTemplates() (err error) { func (state *RuntimeState) signerPublicKeyToKeymasterKeys() error { state.logger.Debugf(3, "number of pk known=%d", len(state.KeymasterPublicKeys)) - signerPKFingerprint, err := getKeyFingerprint(state.Signer.Public()) - if err != nil { - return err + var localSigners []crypto.Signer + if state.Ed25519Signer != nil { + localSigners = append(localSigners, state.Ed25519Signer) } - found := false - for _, key := range state.KeymasterPublicKeys { - fp, err := getKeyFingerprint(key) + localSigners = append(localSigners, state.Signer) + for _, signer := range localSigners { + signerPKFingerprint, err := getKeyFingerprint(signer.Public()) if err != nil { return err } - if signerPKFingerprint == fp { - found = true + found := false + for _, key := range state.KeymasterPublicKeys { + fp, err := getKeyFingerprint(key) + if err != nil { + return err + } + if signerPKFingerprint == fp { + found = true + } + } + if !found { + state.KeymasterPublicKeys = append(state.KeymasterPublicKeys, + signer.Public()) } - } - if !found { - state.KeymasterPublicKeys = append(state.KeymasterPublicKeys, - state.Signer.Public()) } state.logger.Debugf(3, "number of pk known=%d", len(state.KeymasterPublicKeys)) @@ -312,6 +320,12 @@ func (state *RuntimeState) loadSignersFromPemData(signerPem, ed25519Pem []byte) default: return fmt.Errorf("Ed2559 configred file is not really an Ed25519 key. Type is %T!\n", v) } + ed25519CaCertDer, err := generateCADer(state, edSigner) + if err != nil { + state.logger.Printf("Cannot generate Ed25519 CA DER") + return err + } + state.caCertDer = append(state.caCertDer, ed25519CaCertDer) state.Ed25519Signer = edSigner } signer, err := getSignerFromPEMBytes(signerPem) @@ -327,11 +341,12 @@ func (state *RuntimeState) loadSignersFromPemData(signerPem, ed25519Pem []byte) default: return fmt.Errorf("Signer file is a valid Signer key. Type is %T!\n", v) } - state.caCertDer, err = generateCADer(state, signer) + caCertDer, err := generateCADer(state, signer) if err != nil { state.logger.Printf("Cannot generate CA DER") return err } + state.caCertDer = append(state.caCertDer, caCertDer) // Assignment of signer MUST be the last operation after // all error checks state.Signer = signer diff --git a/cmd/keymasterd/idp_oidc.go b/cmd/keymasterd/idp_oidc.go index 41eadcd3..5a40f895 100644 --- a/cmd/keymasterd/idp_oidc.go +++ b/cmd/keymasterd/idp_oidc.go @@ -19,8 +19,8 @@ import ( "github.com/Cloud-Foundations/keymaster/lib/authutil" "github.com/Cloud-Foundations/keymaster/lib/instrumentedwriter" - "gopkg.in/square/go-jose.v2" - "gopkg.in/square/go-jose.v2/jwt" + "github.com/go-jose/go-jose/v4" + "github.com/go-jose/go-jose/v4/jwt" ) //For minimal openid connect interaface and easy config we need 5 enpoints @@ -491,7 +491,7 @@ func (state *RuntimeState) idpOpenIDCAuthorizationHandler(w http.ResponseWriter, } logger.Debugf(3, "auth request is valid, now proceeding to generate redirect") - raw, err := jwt.Signed(signer).Claims(codeToken).CompactSerialize() + raw, err := jwt.Signed(signer).Claims(codeToken).Serialize() if err != nil { panic(err) } @@ -592,7 +592,7 @@ func (state *RuntimeState) idpOpenIDCTokenHandler(w http.ResponseWriter, r *http return } - tok, err := jwt.ParseSigned(codeString) + tok, err := jwt.ParseSigned(codeString, []jose.SignatureAlgorithm{jose.RS256}) if err != nil { logger.Printf("err=%s", err) state.writeFailureResponse(w, r, http.StatusBadRequest, "bad code") @@ -741,7 +741,7 @@ func (state *RuntimeState) idpOpenIDCTokenHandler(w http.ResponseWriter, r *http idToken.Expiration = keymasterToken.AuthExpiration idToken.IssuedAt = time.Now().Unix() - signedIdToken, err := jwt.Signed(signer).Claims(idToken).CompactSerialize() + signedIdToken, err := jwt.Signed(signer).Claims(idToken).Serialize() if err != nil { log.Printf("error signing idToken in idpOpenIDCTokenHandler,: %s", err) state.writeFailureResponse(w, r, http.StatusInternalServerError, "Internal Error") @@ -756,7 +756,7 @@ func (state *RuntimeState) idpOpenIDCTokenHandler(w http.ResponseWriter, r *http if len(keymasterToken.AccessAudience) > 0 { accessToken.Audience = append(keymasterToken.AccessAudience, state.idpGetIssuer()+idpOpenIDCUserinfoPath) } - signedAccessToken, err := jwt.Signed(signer).Claims(accessToken).CompactSerialize() + signedAccessToken, err := jwt.Signed(signer).Claims(accessToken).Serialize() if err != nil { log.Printf("error signing accessToken in idpOpenIDCTokenHandler: %s", err) state.writeFailureResponse(w, r, http.StatusInternalServerError, "Internal Error") @@ -927,7 +927,7 @@ func (state *RuntimeState) idpOpenIDCUserinfoHandler(w http.ResponseWriter, "Missing access token") return } - tok, err := jwt.ParseSigned(accessToken) + tok, err := jwt.ParseSigned(accessToken, []jose.SignatureAlgorithm{jose.RS256}) if err != nil { logger.Printf("err=%s", err) state.writeFailureResponse(w, r, http.StatusBadRequest, diff --git a/cmd/keymasterd/idp_oidc_test.go b/cmd/keymasterd/idp_oidc_test.go index 9368bd5b..68aa1d71 100644 --- a/cmd/keymasterd/idp_oidc_test.go +++ b/cmd/keymasterd/idp_oidc_test.go @@ -13,8 +13,9 @@ import ( "testing" "github.com/Cloud-Foundations/Dominator/lib/log/debuglogger" + "github.com/go-jose/go-jose/v4" + "github.com/go-jose/go-jose/v4/jwt" cv "github.com/nirasan/go-oauth-pkce-code-verifier" - "gopkg.in/square/go-jose.v2/jwt" ) func init() { @@ -159,7 +160,7 @@ func TestIDPOpenIDCAuthorizationHandlerSuccess(t *testing.T) { } rCode := location.Query().Get("code") t.Logf("rCode=%s", rCode) - tok, err := jwt.ParseSigned(rCode) + tok, err := jwt.ParseSigned(rCode, []jose.SignatureAlgorithm{jose.RS256}) if err != nil { t.Fatal(err) } @@ -585,7 +586,7 @@ func TestIDPOpenIDCPKCEFlowWithAudienceSuccess(t *testing.T) { t.Logf("resultAccessToken='%+v'", resultAccessToken) // lets parse the access token to ensure the requested audience is there. - tok, err := jwt.ParseSigned(resultAccessToken.AccessToken) + tok, err := jwt.ParseSigned(resultAccessToken.AccessToken, []jose.SignatureAlgorithm{jose.RS256}) if err != nil { t.Fatal(err) } diff --git a/cmd/keymasterd/jwt.go b/cmd/keymasterd/jwt.go index 3474aaa9..dd8b7796 100644 --- a/cmd/keymasterd/jwt.go +++ b/cmd/keymasterd/jwt.go @@ -7,9 +7,9 @@ import ( "fmt" "time" + "github.com/go-jose/go-jose/v4" + "github.com/go-jose/go-jose/v4/jwt" "golang.org/x/crypto/ssh" - "gopkg.in/square/go-jose.v2" - "gopkg.in/square/go-jose.v2/jwt" ) // This actually gets the SSH key fingerprint @@ -46,6 +46,8 @@ func (state *RuntimeState) JWTClaims(t *jwt.JSONWebToken, dest ...interface{}) ( return err } +//func (state *RuntimeState) getJoseSignerFromSigner( + func (state *RuntimeState) genNewSerializedAuthJWT(username string, authLevel int, durationSeconds int64) (string, error) { signerOptions := (&jose.SignerOptions{}).WithType("JWT") @@ -59,7 +61,7 @@ func (state *RuntimeState) genNewSerializedAuthJWT(username string, authToken.NotBefore = time.Now().Unix() authToken.IssuedAt = authToken.NotBefore authToken.Expiration = authToken.IssuedAt + durationSeconds - return jwt.Signed(signer).Claims(authToken).CompactSerialize() + return jwt.Signed(signer).Claims(authToken).Serialize() } func (state *RuntimeState) getAuthInfoFromAuthJWT(serializedToken string) ( @@ -69,7 +71,7 @@ func (state *RuntimeState) getAuthInfoFromAuthJWT(serializedToken string) ( func (state *RuntimeState) getAuthInfoFromJWT(serializedToken, tokenType string) (rvalue authInfo, err error) { - tok, err := jwt.ParseSigned(serializedToken) + tok, err := jwt.ParseSigned(serializedToken, []jose.SignatureAlgorithm{jose.RS256}) if err != nil { return rvalue, err } @@ -100,7 +102,7 @@ func (state *RuntimeState) updateAuthJWTWithNewAuthLevel(intoken string, newAuth return "", err } - tok, err := jwt.ParseSigned(intoken) + tok, err := jwt.ParseSigned(intoken, []jose.SignatureAlgorithm{jose.RS256}) if err != nil { return "", err } @@ -117,7 +119,7 @@ func (state *RuntimeState) updateAuthJWTWithNewAuthLevel(intoken string, newAuth return "", err } parsedJWT.AuthType = newAuthLevel - return jwt.Signed(signer).Claims(parsedJWT).CompactSerialize() + return jwt.Signed(signer).Claims(parsedJWT).Serialize() } func (state *RuntimeState) genNewSerializedStorageStringDataJWT(username string, dataType int, data string, expiration int64) (string, error) { @@ -134,11 +136,11 @@ func (state *RuntimeState) genNewSerializedStorageStringDataJWT(username string, storageToken.IssuedAt = storageToken.NotBefore storageToken.Expiration = expiration - return jwt.Signed(signer).Claims(storageToken).CompactSerialize() + return jwt.Signed(signer).Claims(storageToken).Serialize() } func (state *RuntimeState) getStorageDataFromStorageStringDataJWT(serializedToken string) (rvalue storageStringDataJWT, err error) { - tok, err := jwt.ParseSigned(serializedToken) + tok, err := jwt.ParseSigned(serializedToken, []jose.SignatureAlgorithm{jose.RS256}) if err != nil { return rvalue, err } diff --git a/cmd/keymasterd/jwt_test.go b/cmd/keymasterd/jwt_test.go index eb3e5d67..05ecd3de 100644 --- a/cmd/keymasterd/jwt_test.go +++ b/cmd/keymasterd/jwt_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gopkg.in/square/go-jose.v2" - "gopkg.in/square/go-jose.v2/jwt" + "github.com/go-jose/go-jose/v4" + "github.com/go-jose/go-jose/v4/jwt" ) func testONLYGenerateAuthJWT(state *RuntimeState, username string, authLevel int, issuer string, audience []string) (string, error) { @@ -20,7 +20,7 @@ func testONLYGenerateAuthJWT(state *RuntimeState, username string, authLevel int authToken.NotBefore = time.Now().Unix() authToken.IssuedAt = authToken.NotBefore authToken.Expiration = authToken.IssuedAt + maxAgeSecondsAuthCookie // TODO seek the actual duration - return jwt.Signed(signer).Claims(authToken).CompactSerialize() + return jwt.Signed(signer).Claims(authToken).Serialize() } func TestJWTAudtienceAuthToken(t *testing.T) { diff --git a/cmd/keymasterd/main_test.go b/cmd/keymasterd/main_test.go index cc590e0a..44652bd4 100644 --- a/cmd/keymasterd/main_test.go +++ b/cmd/keymasterd/main_test.go @@ -185,10 +185,11 @@ func setupValidRuntimeStateSigner(t *testing.T) ( state.signerPublicKeyToKeymasterKeys() //for x509 - state.caCertDer, err = generateCADer(&state, signer) + caCertDer, err := generateCADer(&state, signer) if err != nil { return nil, nil, err } + state.caCertDer = append(state.caCertDer, caCertDer) passwdFile, err := setupPasswdFile() if err != nil { @@ -512,7 +513,7 @@ func TestPublicHandleLoginForm(t *testing.T) { } state.Signer = signer state.signerPublicKeyToKeymasterKeys() - urlList := []string{"/public/loginForm", "/public/x509ca"} + urlList := []string{"/public/loginForm", "/public/x509ca", "/public/sshca"} err = state.loadTemplates() if err != nil { t.Fatal(err) diff --git a/go.mod b/go.mod index b27a62df..e590eb17 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/Cloud-Foundations/keymaster go 1.22.0 -toolchain go1.22.6 +toolchain go1.22.4 replace github.com/bearsh/hid v1.3.0 => github.com/bearsh/hid v1.5.0 @@ -23,6 +23,7 @@ require ( github.com/duo-labs/webauthn v0.0.0-20221205164246-ebaf9b74c6ec github.com/flynn/u2f v0.0.0-20180613185708-15554eb68e5d github.com/foomo/htpasswd v0.0.0-20200116085101-e3a90e78da9c + github.com/go-jose/go-jose/v4 v4.0.4 github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef github.com/lib/pq v1.10.9 github.com/marshallbrekka/go-u2fhost v0.0.0-20210111072507-3ccdec8c8105 @@ -37,7 +38,6 @@ require ( golang.org/x/oauth2 v0.23.0 golang.org/x/term v0.25.0 gopkg.in/ldap.v2 v2.5.1 - gopkg.in/square/go-jose.v2 v2.6.0 gopkg.in/yaml.v2 v2.4.0 mvdan.cc/sh/v3 v3.9.0 ) @@ -98,5 +98,4 @@ require ( golang.org/x/time v0.7.0 google.golang.org/protobuf v1.35.1 // indirect gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect ) diff --git a/go.sum b/go.sum index ab0a639f..f38ef10b 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,4 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -28,68 +26,36 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuW github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.54.0 h1:tGCQ6YS2TepzKtbl+ddXnLIoV8XvWdxMKtuMxdrsa4U= -github.com/aws/aws-sdk-go v1.54.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/aws/aws-sdk-go-v2 v1.27.2 h1:pLsTXqX93rimAOZG2FIYraDQstZaaGVVN4tNw65v0h8= -github.com/aws/aws-sdk-go-v2 v1.27.2/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= -github.com/aws/aws-sdk-go-v2/config v1.27.18 h1:wFvAnwOKKe7QAyIxziwSKjmer9JBMH1vzIL6W+fYuKk= -github.com/aws/aws-sdk-go-v2/config v1.27.18/go.mod h1:0xz6cgdX55+kmppvPm2IaKzIXOheGJhAufacPJaXZ7c= github.com/aws/aws-sdk-go-v2/config v1.27.43 h1:p33fDDihFC390dhhuv8nOmX419wjOSDQRb+USt20RrU= github.com/aws/aws-sdk-go-v2/config v1.27.43/go.mod h1:pYhbtvg1siOOg8h5an77rXle9tVG8T+BWLWAo7cOukc= -github.com/aws/aws-sdk-go-v2/credentials v1.17.18 h1:D/ALDWqK4JdY3OFgA2thcPO1c9aYTT5STS/CvnkqY1c= -github.com/aws/aws-sdk-go-v2/credentials v1.17.18/go.mod h1:JuitCWq+F5QGUrmMPsk945rop6bB57jdscu+Glozdnc= github.com/aws/aws-sdk-go-v2/credentials v1.17.41 h1:7gXo+Axmp+R4Z+AK8YFQO0ZV3L0gizGINCOWxSLY9W8= github.com/aws/aws-sdk-go-v2/credentials v1.17.41/go.mod h1:u4Eb8d3394YLubphT4jLEwN1rLNq2wFOlT6OuxFwPzU= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.5 h1:dDgptDO9dxeFkXy+tEgVkzSClHZje/6JkPW5aZyEvrQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.5/go.mod h1:gjvE2KBUgUQhcv89jqxrIxH9GaKs1JbZzWejj/DaHGA= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 h1:TMH3f/SCAWdNtXXVPPu5D6wrr4G5hI1rAxbcocKfC7Q= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17/go.mod h1:1ZRXLdTpzdJb9fwTMXiLipENRxkGMTn1sfKexGllQCw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9 h1:cy8ahBJuhtM8GTTSyOkfy6WVPV1IE+SS5/wfXUYuulw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9/go.mod h1:CZBXGLaJnEZI6EVNcPd7a6B5IC5cA/GkRWtu9fp3S6Y= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 h1:UAsR3xA31QGf79WzpG/ixT9FZvQlh5HY1NRqSHBNOCk= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21/go.mod h1:JNr43NFf5L9YaG3eKTm7HQzls9J+A9YYcGI5Quh1r2Y= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9 h1:A4SYk07ef04+vxZToz9LWvAXl9LW0NClpPpMsi31cz0= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9/go.mod h1:5jJcHuwDagxN+ErjQ3PU3ocf6Ylc/p9x+BLO/+X4iXw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 h1:6jZVETqmYCadGFvrYEQfC5fAQmlo80CeL5psbno6r0s= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21/go.mod h1:1SR0GbLlnN3QUmYaflZNiH1ql+1qrSiB2vwcJ+4UM60= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11 h1:o4T+fKxA3gTMcluBNZZXE9DNaMkJuUL1O3mffCUjoJo= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11/go.mod h1:84oZdJ+VjuJKs9v1UTC9NaodRZRseOXCTgku+vQJWR8= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 h1:s7NA1SOw8q/5c0wr8477yOPp0z+uBaXBnLE0XYb0POA= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2/go.mod h1:fnjjWyAW/Pj5HYOxl9LJqWtEwS7W2qgcRLWP+uWbss0= -github.com/aws/aws-sdk-go-v2/service/organizations v1.27.9 h1:KNXacqpLvkK4oAMqSNhG2ETQzrVK4mKETAeNeo+dWyk= -github.com/aws/aws-sdk-go-v2/service/organizations v1.27.9/go.mod h1:hcr6lPG6K2l0WiKyu2ag/JrHbiIOUMg3tdNPtpTe+PM= github.com/aws/aws-sdk-go-v2/service/organizations v1.34.2 h1:ndH1E8olS/rDB+tiUMKj09g0o11PoOLAC+xRFB13bJw= github.com/aws/aws-sdk-go-v2/service/organizations v1.34.2/go.mod h1:YZvv/wXIgIviYq9P/fQDhoMlzlI89M0D45GnYvIorLk= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.30.0 h1:nqR1mkoDntCpOwdlEfa2pZLiwvQeF4Mi56WzOTyuF/s= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.30.0/go.mod h1:M9TqBwpQ7AC6zu1Yji7vijRliqir7hxjuRcnxIk7jCc= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.2 h1:Rrqru2wYkKQCS2IM5/JrgKUQIoNTqA6y/iuxkjzxC6M= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.2/go.mod h1:QuCURO98Sqee2AXmqDNxKXYFm2OEDAVAPApMqO0Vqnc= -github.com/aws/aws-sdk-go-v2/service/sso v1.20.11 h1:gEYM2GSpr4YNWc6hCd5nod4+d4kd9vWIAWrmGuLdlMw= -github.com/aws/aws-sdk-go-v2/service/sso v1.20.11/go.mod h1:gVvwPdPNYehHSP9Rs7q27U1EU+3Or2ZpXvzAYJNh63w= github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 h1:bSYXVyUzoTHoKalBmwaZxs97HU9DWWI3ehHSAMa7xOk= github.com/aws/aws-sdk-go-v2/service/sso v1.24.2/go.mod h1:skMqY7JElusiOUjMJMOv1jJsP7YUg7DrhgqZZWuzu1U= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.5 h1:iXjh3uaH3vsVcnyZX7MqCoCfcyxIrVE9iOQruRaWPrQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.5/go.mod h1:5ZXesEuy/QcO0WUnt+4sDkxhdXRHTu2yG0uCSH8B6os= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 h1:AhmO1fHINP9vFYUE0LHzCWg/LfUWUF+zFPEcY9QXb7o= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2/go.mod h1:o8aQygT2+MVP0NaV6kbdE1YnnIM8RRVQzoeUH45GOdI= -github.com/aws/aws-sdk-go-v2/service/sts v1.28.12 h1:M/1u4HBpwLuMtjlxuI2y6HoVLzF5e2mfxHCg7ZVMYmk= -github.com/aws/aws-sdk-go-v2/service/sts v1.28.12/go.mod h1:kcfd+eTdEi/40FIbLq4Hif3XMXnl5b/+t/KTfLt9xIk= github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 h1:CiS7i0+FUe+/YY1GvIBLLrR/XNGZ4CtM1Ll0XavNuVo= github.com/aws/aws-sdk-go-v2/service/sts v1.32.2/go.mod h1:HtaiBI8CjYoNVde8arShXb94UbQQi9L4EMr6D+xGBwo= -github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= -github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/bearsh/hid v1.5.0 h1:8ChLlc9Nqmlrla4U0QMHLhb/h1hnVcs2Unjoz7iY+vk= @@ -99,12 +65,9 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs= -github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.2 h1:79yrbttoZrLGkL/oOI8hBrUKucwOL0oOjUgEguGMcJ4= github.com/boombuler/barcode v1.0.2/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -112,8 +75,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cloudflare/cfssl v1.6.5 h1:46zpNkm6dlNkMZH/wMW22ejih6gIaJbzL2du6vD7ZeI= github.com/cloudflare/cfssl v1.6.5/go.mod h1:Bk1si7sq8h2+yVEDrFJiz3d7Aw+pfjjJSZVaD+Taky4= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE= -github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= github.com/cloudflare/circl v1.5.0 h1:hxIWksrX6XN5a1L2TI/h53AGPhNHoUBo+TD1ms9+pys= github.com/cloudflare/circl v1.5.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -124,12 +85,8 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cviecco/argon2 v0.0.0-20171122181119-1dc43e2eaa99 h1:8co/GRKovq1R4wCidV2GrIf9FQ+2s0bV4IXulkzbkeI= github.com/cviecco/argon2 v0.0.0-20171122181119-1dc43e2eaa99/go.mod h1:bhY/hbDzWD0J/Sr4zDxR9WaRilSZ06n+qMzGWUjU6yQ= -github.com/cviecco/webauth-sshcert v0.0.0-20241002165410-bee0202d04f5 h1:Hb8wwfZcVLcu6FyQcuSReIQ2ApyT3Zli/zufi2vS3BQ= -github.com/cviecco/webauth-sshcert v0.0.0-20241002165410-bee0202d04f5/go.mod h1:tGQETMLmW4RLPTrbxq21h1iNeJLQ3xM0m5DtQhrWUCQ= github.com/cviecco/webauth-sshcert v0.0.0-20241011234852-c2476e5f6f0f h1:tIOpxFgFSk3KXAVTUSvBt+kLrGSJI0JJS8ZBF3uXAEU= github.com/cviecco/webauth-sshcert v0.0.0-20241011234852-c2476e5f6f0f/go.mod h1:tGQETMLmW4RLPTrbxq21h1iNeJLQ3xM0m5DtQhrWUCQ= -github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= -github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/cyphar/filepath-securejoin v0.3.4 h1:VBWugsJh2ZxJmLFSM06/0qzQyiQX2Qs0ViKrUAcqdZ8= github.com/cyphar/filepath-securejoin v0.3.4/go.mod h1:8s/MCNJREmFK0H02MF6Ihv1nakJe4L/w3WZLHNkvlYM= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -151,13 +108,9 @@ github.com/flynn/u2f v0.0.0-20180613185708-15554eb68e5d h1:2D6Rp/MRcrKnRFr7kfgBO github.com/flynn/u2f v0.0.0-20180613185708-15554eb68e5d/go.mod h1:shcCQPgKtaJz4obqb6Si031WgtSrW+Tj+ZLq/mRNrM8= github.com/foomo/htpasswd v0.0.0-20200116085101-e3a90e78da9c h1:DBGU7zCwrrPPDsD6+gqKG8UfMxenWg9BOJE/Nmfph+4= github.com/foomo/htpasswd v0.0.0-20200116085101-e3a90e78da9c/go.mod h1:SHawtolbB0ZOFoRWgDwakX5WpwuIWAK88bUXVZqK0Ss= -github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= -github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/fxamacker/cbor/v2 v2.6.0 h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA= -github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -171,9 +124,13 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMj github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-jose/go-jose/v4 v4.0.4 h1:VsjPI33J0SB9vQM6PLmNjoHqMQNGPiZ0rHL7Ni7Q6/E= +github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= +github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -226,6 +183,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 h1:wIONC+HMNRqmWBjuMxhatuSzHaljStc4gjDeKycxy0A= @@ -233,8 +192,6 @@ github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3/go.mod h1:37YR9jabpi github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/marshallbrekka/go-u2fhost v0.0.0-20210111072507-3ccdec8c8105 h1:Si3VAYdC1ZtA58UsDXxlkbpF5EMWxoCJP9gn1cYQ+vc= github.com/marshallbrekka/go-u2fhost v0.0.0-20210111072507-3ccdec8c8105/go.mod h1:VyqGj5jbZtzHO11cS7rkDh/owr/rNCEM98IhQwWvmXg= -github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= -github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM= github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -262,8 +219,6 @@ github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg= github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -272,8 +227,6 @@ github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= -github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA= github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -291,8 +244,6 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= -github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -334,10 +285,6 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -357,15 +304,9 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -393,10 +334,6 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -404,10 +341,6 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -417,13 +350,9 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -438,8 +367,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -455,8 +382,6 @@ gopkg.in/ldap.v2 v2.5.1/go.mod h1:oI0cpe/D7HRtBQl8aTg+ZmzFUAvu4lsv3eLXMLGFxWk= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= -gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -468,7 +393,5 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -mvdan.cc/sh/v3 v3.8.0 h1:ZxuJipLZwr/HLbASonmXtcvvC9HXY9d2lXZHnKGjFc8= -mvdan.cc/sh/v3 v3.8.0/go.mod h1:w04623xkgBVo7/IUK89E0g8hBykgEpN0vgOj3RJr6MY= mvdan.cc/sh/v3 v3.9.0 h1:it14fyjCdQUk4jf/aYxLO3FG8jFarR9GzMCtnlvvD7c= mvdan.cc/sh/v3 v3.9.0/go.mod h1:cdBk8bgoiBI7lSZqK5JhUuq7OB64VQ7fgm85xelw3Nk= diff --git a/lib/authenticators/okta/impl.go b/lib/authenticators/okta/impl.go index e7bba181..6dcf1df3 100644 --- a/lib/authenticators/okta/impl.go +++ b/lib/authenticators/okta/impl.go @@ -122,7 +122,7 @@ func (pa *PasswordAuthenticator) passwordAuthenticate(username string, } } -func (pa *PasswordAuthenticator) getValidUserResponse(username string) (*OktaApiPrimaryResponseType, error) { +func (pa *PasswordAuthenticator) GetValidUserResponse(username string) (*OktaApiPrimaryResponseType, error) { pa.mutex.Lock() userData, ok := pa.recentAuth[username] defer pa.mutex.Unlock() @@ -138,7 +138,7 @@ func (pa *PasswordAuthenticator) getValidUserResponse(username string) (*OktaApi } func (pa *PasswordAuthenticator) validateUserOTP(username string, otpValue int) (bool, error) { - userResponse, err := pa.getValidUserResponse(username) + userResponse, err := pa.GetValidUserResponse(username) if err != nil { return false, err } @@ -195,13 +195,14 @@ func (pa *PasswordAuthenticator) validateUserOTP(username string, otpValue int) } func (pa *PasswordAuthenticator) validateUserPush(username string) (PushResponse, error) { - userResponse, err := pa.getValidUserResponse(username) + userResponse, err := pa.GetValidUserResponse(username) if err != nil { return PushResponseRejected, err } if userResponse == nil { return PushResponseRejected, nil } + pa.logger.Debugf(2, "oktaAuthenticator: validateUserPush: after getting userResponse=%+v", userResponse) rvalue := PushResponseRejected for _, factor := range userResponse.Embedded.Factor { if !(factor.FactorType == "push" && factor.VendorName == "OKTA") { diff --git a/lib/client/twofa/pushtoken/pushtoken.go b/lib/client/twofa/pushtoken/pushtoken.go index 477cc99e..ab67e2af 100644 --- a/lib/client/twofa/pushtoken/pushtoken.go +++ b/lib/client/twofa/pushtoken/pushtoken.go @@ -2,6 +2,7 @@ package pushtoken import ( "bufio" + "crypto/x509" "encoding/json" "errors" "fmt" @@ -20,6 +21,11 @@ import ( const vipCheckTimeoutSecs = 180 +func debugLogCert(messageSuffix string, cert *x509.Certificate, logger log.DebugLogger) { + logger.Debugf(2, "%s.issuer=%+v", messageSuffix, cert.Issuer) + logger.Debugf(2, "%s.subject=%+v", messageSuffix, cert.Subject) +} + func startGenericPush(client *http.Client, baseURL string, pushType string, @@ -42,6 +48,14 @@ func startGenericPush(client *http.Client, return err } defer pushStartResp.Body.Close() + + if pushStartResp.TLS != nil { + debugLogCert("startGenericPush peeerCerts[0]", pushStartResp.TLS.PeerCertificates[0], logger) + if pushStartResp.TLS.VerifiedChains != nil { + debugLogCert("startGenericPush verifiedcerts[0]", pushStartResp.TLS.VerifiedChains[0][0], logger) + } + } + // since we dont care about content we just consume it all. io.Copy(ioutil.Discard, pushStartResp.Body) if pushStartResp.StatusCode != 200 { @@ -94,6 +108,7 @@ func doGenericPushCheck(client *http.Client, baseURL string, pushType string, userAgentString string, + codeIsDone <-chan bool, logger log.DebugLogger, errorReturnDuration time.Duration) error { @@ -118,7 +133,15 @@ func doGenericPushCheck(client *http.Client, logger.Printf("") //To do a CR return nil } - time.Sleep(2 * time.Second) + select { + case codeSuccess := <-codeIsDone: + if codeSuccess { + return nil + } + continue + case <-time.After(2 * time.Second): + logger.Debugf(1, "doGenericPushCheck: timeout on checkGenericPollStatus loop") + } } err = errors.New("Vip Push Checked timeout out") @@ -178,7 +201,7 @@ func genericAuthenticateWithToken( defer loginResp.Body.Close() if loginResp.StatusCode != 200 { logger.Printf("got error from login call %s", loginResp.Status) - return err + return fmt.Errorf("Failed to authenticate with token") } loginJSONResponse := proto.LoginResponse{} @@ -203,14 +226,19 @@ func doGenericTokenPushAuthenticate( timeout := time.Duration(time.Duration(vipCheckTimeoutSecs) * time.Second) ch := make(chan error, 1) + doneCh := make(chan bool, 1) go func() { err := genericAuthenticateWithToken(client, baseURL, pushType, userAgentString, logger) + if err == nil { + doneCh <- true + } ch <- err }() go func() { err := doGenericPushCheck(client, baseURL, pushType, userAgentString, + doneCh, logger, timeout) ch <- err diff --git a/lib/client/webauth/impl.go b/lib/client/webauth/impl.go index 32780863..b48a4915 100644 --- a/lib/client/webauth/impl.go +++ b/lib/client/webauth/impl.go @@ -15,8 +15,9 @@ import ( "time" "github.com/Cloud-Foundations/keymaster/lib/paths" + "github.com/go-jose/go-jose/v4" + "github.com/go-jose/go-jose/v4/jwt" "golang.org/x/term" - "gopkg.in/square/go-jose.v2/jwt" ) const ( @@ -60,7 +61,7 @@ func authenticate(s state) (string, error) { } func parseToken(serialisedToken string) (*authInfoJWT, error) { - token, err := jwt.ParseSigned(serialisedToken) + token, err := jwt.ParseSigned(serialisedToken, []jose.SignatureAlgorithm{jose.RS256}) if err != nil { return nil, err }