Skip to content

Commit 52c9d7b

Browse files
Remove x5t Header Check (#452)
* Remove x5t Header Check This check doesn't exist on the Terraform provider, and was added in the initial commit of this builder. It's a very old change that I do not think is required anymore An Azure employee reported that with entra minted tokens, this validation causes failures: #451 * Remove thumbprint x5t test
1 parent eddf679 commit 52c9d7b

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

builder/azure/common/client/config.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,10 @@ func (c Config) Validate(errs *packersdk.MultiError) {
211211
c.ClientJWT != "" {
212212
p := jwt.Parser{}
213213
claims := jwt.StandardClaims{}
214-
token, _, err := p.ParseUnverified(c.ClientJWT, &claims)
214+
_, _, err := p.ParseUnverified(c.ClientJWT, &claims)
215215
if err != nil {
216216
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("client_jwt is not a JWT: %v", err))
217-
} else {
218-
if t, ok := token.Header["x5t"]; !ok || t == "" {
219-
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("client_jwt is missing the x5t header value, which is required for bearer JWT client authentication to Azure"))
220-
}
221217
}
222-
223218
return
224219
}
225220

builder/azure/common/client/config_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,6 @@ func Test_ClientConfig_CannotUseBothClientJWTAndSecret(t *testing.T) {
304304
assertInvalid(t, cfg)
305305
}
306306

307-
func Test_ClientConfig_ClientJWTShouldHaveThumbprint(t *testing.T) {
308-
cfg := Config{
309-
SubscriptionID: "12345",
310-
ClientID: "12345",
311-
ClientJWT: getJWT(10*time.Minute, false),
312-
}
313-
314-
assertInvalid(t, cfg)
315-
}
316-
317307
func Test_getJWT(t *testing.T) {
318308
if getJWT(time.Minute, true) == "" {
319309
t.Fatalf("getJWT is broken")

0 commit comments

Comments
 (0)