Skip to content

Commit 3d59acb

Browse files
committed
add a comment on keyFunc to explain it better
Signed-off-by: Jon Carl <[email protected]>
1 parent 7cf83f9 commit 3d59acb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

validate/josev2/josev2.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ func New(keyFunc func(context.Context) (interface{}, error),
8787

8888
type Validator struct {
8989
// required options
90+
91+
// in the past keyFunc might take in a token as a parameter in order to
92+
// allow the function provider to return a key based on a header kid.
93+
// With josev2 `jose.JSONWebKeySet` is supported as a return type of
94+
// this function which hands off the heavy lifting of determining which
95+
// key to used based on the header `kid` to the josev2 library.
96+
// TODO(joncarl): provide an example of using a kid
9097
keyFunc func(context.Context) (interface{}, error)
9198
signatureAlgorithm jose.SignatureAlgorithm
9299

0 commit comments

Comments
 (0)