Skip to content

Commit bc50c81

Browse files
committedFeb 5, 2025
feat: upgrade golang-jwt/jwt to v5
1 parent 639e355 commit bc50c81

File tree

5 files changed

+54
-6
lines changed

5 files changed

+54
-6
lines changed
 

‎go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module github.com/richzw/appstore
33
go 1.18
44

55
require (
6-
github.com/golang-jwt/jwt/v4 v4.3.0
6+
github.com/golang-jwt/jwt/v5 v5.2.1
77
github.com/google/uuid v1.3.0
88
)

‎go.sum

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog=
2-
github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
1+
github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=
2+
github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
3+
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
34
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
45
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=

‎model.go

+48-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package appstore
22

33
import (
4-
"github.com/golang-jwt/jwt/v4"
4+
"github.com/golang-jwt/jwt/v5"
55
)
66

77
// OrderLookupResponse https://developer.apple.com/documentation/appstoreserverapi/orderlookupresponse
@@ -111,6 +111,30 @@ func (J JWSRenewalInfoDecodedPayload) Valid() error {
111111
return nil
112112
}
113113

114+
func (J JWSRenewalInfoDecodedPayload) GetAudience() (jwt.ClaimStrings, error) {
115+
return nil, nil
116+
}
117+
118+
func (J JWSRenewalInfoDecodedPayload) GetExpirationTime() (*jwt.NumericDate, error) {
119+
return nil, nil
120+
}
121+
122+
func (J JWSRenewalInfoDecodedPayload) GetIssuedAt() (*jwt.NumericDate, error) {
123+
return nil, nil
124+
}
125+
126+
func (J JWSRenewalInfoDecodedPayload) GetIssuer() (string, error) {
127+
return "", nil
128+
}
129+
130+
func (J JWSRenewalInfoDecodedPayload) GetNotBefore() (*jwt.NumericDate, error) {
131+
return nil, nil
132+
}
133+
134+
func (J JWSRenewalInfoDecodedPayload) GetSubject() (string, error) {
135+
return "", nil
136+
}
137+
114138
// JWSDecodedHeader https://developer.apple.com/documentation/appstoreserverapi/jwsdecodedheader
115139
type JWSDecodedHeader struct {
116140
Alg string `json:"alg,omitempty"`
@@ -178,6 +202,29 @@ type JWSTransaction struct {
178202
func (J JWSTransaction) Valid() error {
179203
return nil
180204
}
205+
func (J JWSTransaction) GetAudience() (jwt.ClaimStrings, error) {
206+
return nil, nil
207+
}
208+
209+
func (J JWSTransaction) GetExpirationTime() (*jwt.NumericDate, error) {
210+
return nil, nil
211+
}
212+
213+
func (J JWSTransaction) GetIssuedAt() (*jwt.NumericDate, error) {
214+
return nil, nil
215+
}
216+
217+
func (J JWSTransaction) GetIssuer() (string, error) {
218+
return "", nil
219+
}
220+
221+
func (J JWSTransaction) GetNotBefore() (*jwt.NumericDate, error) {
222+
return nil, nil
223+
}
224+
225+
func (J JWSTransaction) GetSubject() (string, error) {
226+
return "", nil
227+
}
181228

182229
// https://developer.apple.com/documentation/appstoreserverapi/extendreasoncode
183230
type ExtendReasonCode int

‎store.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"strings"
1414
"time"
1515

16-
"github.com/golang-jwt/jwt/v4"
16+
"github.com/golang-jwt/jwt/v5"
1717
)
1818

1919
const (

‎token.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"sync"
1010
"time"
1111

12-
"github.com/golang-jwt/jwt/v4"
12+
"github.com/golang-jwt/jwt/v5"
1313
"github.com/google/uuid"
1414
)
1515

0 commit comments

Comments
 (0)