From b922dbdbdac38361512652751e728193c0f27e30 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Fri, 20 Sep 2024 16:54:25 -0600 Subject: [PATCH] Removed VerifyClaims --- pkg/auth.go | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/pkg/auth.go b/pkg/auth.go index 58aea04..c857102 100644 --- a/pkg/auth.go +++ b/pkg/auth.go @@ -8,26 +8,9 @@ import ( "slices" "github.com/OpenCHAMI/jwtauth/v5" - "github.com/lestrrat-go/jwx/jwk" + "github.com/lestrrat-go/jwx/v2/jwk" ) -func VerifyClaims(testClaims []string, r *http.Request) (bool, error) { - // extract claims from JWT - _, claims, err := jwtauth.FromContext(r.Context()) - if err != nil { - return false, fmt.Errorf("failed to get claims(s) from token: %v", err) - } - - // verify that each one of the test claims are included - for _, testClaim := range testClaims { - _, ok := claims[testClaim] - if !ok { - return false, fmt.Errorf("failed to verify claim(s) from token: %s", testClaim) - } - } - return true, nil -} - func VerifyScope(testScopes []string, r *http.Request) (bool, error) { // extract the scopes from JWT var scopes []string @@ -112,3 +95,7 @@ func FetchPublicKeyFromURL(url string) (*jwtauth.JWTAuth, error) { return tokenAuth, nil } + +func LoadAccessToken() { + +}