Skip to content

Commit

Permalink
Merge pull request #153 from sonatard/http-client
Browse files Browse the repository at this point in the history
Path jwk.Options to VerifyWithJKUAndContext
  • Loading branch information
lestrrat committed Apr 13, 2020
2 parents c2546e6 + d84539d commit 1402056
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jws/jws.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,14 @@ func Verify(buf []byte, alg jwa.SignatureAlgorithm, key interface{}) (ret []byte
}

// VerifyWithJKU wraps VerifyWithJKUAndContext using the background context.
func VerifyWithJKU(buf []byte, jwkurl string) ([]byte, error) {
return VerifyWithJKUAndContext(context.Background(), buf, jwkurl)
func VerifyWithJKU(buf []byte, jwkurl string, options ...Option) ([]byte, error) {
return VerifyWithJKUAndContext(context.Background(), buf, jwkurl, options...)
}

// VerifyWithJKUAndContext verifies the JWS message using a remote JWK
// file represented in the url.
func VerifyWithJKUAndContext(ctx context.Context, buf []byte, jwkurl string) ([]byte, error) {
key, err := jwk.FetchHTTPWithContext(ctx, jwkurl)
func VerifyWithJKUAndContext(ctx context.Context, buf []byte, jwkurl string, options ...Option) ([]byte, error) {
key, err := jwk.FetchHTTPWithContext(ctx, jwkurl, options...)
if err != nil {
return nil, errors.Wrap(err, `failed to fetch jwk via HTTP`)
}
Expand Down

0 comments on commit 1402056

Please sign in to comment.