Skip to content

Commit afdd2f5

Browse files
committed
feat(api): add ParseNotificationV2WithClaim api to parse notification to jwt.Claims
1 parent 66775de commit afdd2f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

store.go

+8
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,14 @@ func (c *StoreClient) ParseNotificationV2(tokenStr string) (*jwt.Token, error) {
379379
})
380380
}
381381

382+
func (c *StoreClient) ParseNotificationV2WithClaim(tokenStr string) (jwt.Claims, error) {
383+
result := &jwt.RegisteredClaims{}
384+
_, err := jwt.ParseWithClaims(tokenStr, result, func(token *jwt.Token) (interface{}, error) {
385+
return c.cert.extractPublicKeyFromToken(tokenStr)
386+
})
387+
return result, err
388+
}
389+
382390
// ParseSignedTransactions parse the jws singed transactions
383391
// Per doc: https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.6
384392
func (c *StoreClient) ParseSignedTransactions(transactions []string) ([]*JWSTransaction, error) {

0 commit comments

Comments
 (0)