Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/PaesslerAG/jsonpath v0.1.1
github.com/cenkalti/backoff/v4 v4.3.0
github.com/docker/docker v27.3.1+incompatible
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/google/android-cuttlefish/frontend/src/host_orchestrator v0.0.0-20250408215131-62b596e12abb
github.com/google/android-cuttlefish/frontend/src/liboperator v0.0.0-20250408215131-62b596e12abb
github.com/google/go-cmp v0.6.0
Expand Down Expand Up @@ -51,6 +50,7 @@ require (
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/android-cuttlefish/frontend/src/libhoclient v0.0.0-20250618121121-082e6c1a7b47 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
Expand Down
8 changes: 3 additions & 5 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
appOAuth2 "github.com/google/cloud-android-orchestration/pkg/app/oauth2"
"github.com/google/cloud-android-orchestration/pkg/app/session"

"github.com/golang-jwt/jwt"
"github.com/golang-jwt/jwt/v4"
"github.com/gorilla/mux"
"golang.org/x/oauth2"
)
Expand Down Expand Up @@ -620,10 +620,8 @@ func extractIDToken(tk *oauth2.Token) (*jwt.Token, error) {
return nil, fmt.Errorf("unexpected id token in oauth2 response")
}
// No need to verify the JWT here since it came directly from the oauth2 provider.
noVerify := func(tk *jwt.Token) (interface{}, error) { return nil, nil }
idTk, err := jwt.Parse(tokenString, noVerify)
if err != nil && errors.Is(err, jwt.ErrInvalidKeyType) {
// The error should be invalid key type because of the nil return in the lambda.
idTk, _, err := new(jwt.Parser).ParseUnverified(tokenString, jwt.MapClaims{})
if err != nil {
return nil, err
}
return idTk, nil
Expand Down
Loading