Skip to content

Commit 1602ef8

Browse files
fix(deps): update module github.com/cristalhq/jwt/v3 to v5 (#578)
* fix(deps): update module github.com/cristalhq/jwt/v3 to v5 * chore: Address breaking changes of v3 -> v4 Signed-off-by: Marco Maurer <[email protected]> --------- Signed-off-by: Marco Maurer <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Marco Maurer <[email protected]>
1 parent 0f2d40b commit 1602ef8

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

argocd/resource_argocd_account_token.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/argoproj-labs/terraform-provider-argocd/internal/provider"
1111
"github.com/argoproj/argo-cd/v2/pkg/apiclient/account"
1212
"github.com/argoproj/argo-cd/v2/pkg/apiclient/session"
13-
"github.com/cristalhq/jwt/v3"
13+
"github.com/cristalhq/jwt/v5"
1414
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1515
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1616
)
@@ -202,13 +202,13 @@ func resourceArgoCDAccountTokenCreate(ctx context.Context, d *schema.ResourceDat
202202
return argoCDAPIError("create", "token for account", accountName, err)
203203
}
204204

205-
token, err := jwt.ParseString(resp.GetToken())
205+
token, err := jwt.ParseNoVerify([]byte(resp.GetToken()))
206206
if err != nil {
207207
return errorToDiagnostics(fmt.Sprintf("token for account %s is not a valid jwt", accountName), err)
208208
}
209209

210-
var claims jwt.StandardClaims
211-
if err = json.Unmarshal(token.RawClaims(), &claims); err != nil {
210+
var claims jwt.RegisteredClaims
211+
if err = json.Unmarshal(token.Claims(), &claims); err != nil {
212212
return errorToDiagnostics(fmt.Sprintf("token claims for account %s could not be parsed", accountName), err)
213213
}
214214

argocd/resource_argocd_project_token.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
"github.com/argoproj-labs/terraform-provider-argocd/internal/provider"
1212
"github.com/argoproj/argo-cd/v2/pkg/apiclient/project"
13-
"github.com/cristalhq/jwt/v3"
13+
"github.com/cristalhq/jwt/v5"
1414
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1515
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1616
)
@@ -216,13 +216,13 @@ func resourceArgoCDProjectTokenCreate(ctx context.Context, d *schema.ResourceDat
216216
return argoCDAPIError("create", "token for project", projectName, err)
217217
}
218218

219-
token, err := jwt.ParseString(resp.GetToken())
219+
token, err := jwt.ParseNoVerify([]byte(resp.GetToken()))
220220
if err != nil {
221221
return errorToDiagnostics(fmt.Sprintf("token for project %s is not a valid jwt", projectName), err)
222222
}
223223

224-
var claims jwt.StandardClaims
225-
if err = json.Unmarshal(token.RawClaims(), &claims); err != nil {
224+
var claims jwt.RegisteredClaims
225+
if err = json.Unmarshal(token.Claims(), &claims); err != nil {
226226
return errorToDiagnostics(fmt.Sprintf("token claims for project %s could not be parsed", projectName), err)
227227
}
228228

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
// make sure this matches with version used in Argo CD's go.mod
1010
github.com/argoproj/gitops-engine v0.7.1-0.20250129155113-faf5a4e5c37d
1111
github.com/argoproj/pkg v0.13.7-0.20230626144333-d56162821bd1
12-
github.com/cristalhq/jwt/v3 v3.1.0
12+
github.com/cristalhq/jwt/v5 v5.4.0
1313
github.com/elliotchance/pie/v2 v2.9.1
1414
github.com/hashicorp/terraform-plugin-framework v1.13.0
1515
github.com/hashicorp/terraform-plugin-framework-validators v0.16.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
806806
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
807807
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
808808
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
809-
github.com/cristalhq/jwt/v3 v3.1.0 h1:iLeL9VzB0SCtjCy9Kg53rMwTcrNm+GHyVcz2eUujz6s=
810-
github.com/cristalhq/jwt/v3 v3.1.0/go.mod h1:XOnIXst8ozq/esy5N1XOlSyQqBd+84fxJ99FK+1jgL8=
809+
github.com/cristalhq/jwt/v5 v5.4.0 h1:Wxi1TocFHaijyV608j7v7B9mPc4ZNjvWT3LKBO0d4QI=
810+
github.com/cristalhq/jwt/v5 v5.4.0/go.mod h1:+b/BzaCWEpFDmXxspJ5h4SdJ1N/45KMjKOetWzmHvDA=
811811
github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM=
812812
github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
813813
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

0 commit comments

Comments
 (0)