Skip to content

Commit

Permalink
Deprecate token issuer validation (#127) (#129)
Browse files Browse the repository at this point in the history
- default disable_iss_validation to true
- deprecate disable_iss_validation, and issuer fields.
  • Loading branch information
benashz authored Oct 28, 2021
1 parent aded896 commit 6d0896d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
12 changes: 8 additions & 4 deletions path_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,20 @@ extracted. Not every installation of Kubernetes exposes these keys.`,
},
},
"issuer": {
Type: framework.TypeString,
Description: "Optional JWT issuer. If no issuer is specified, then this plugin will use kubernetes.io/serviceaccount as the default issuer.",
Type: framework.TypeString,
Deprecated: true,
Description: `Optional JWT issuer. If no issuer is specified,
then this plugin will use kubernetes.io/serviceaccount as the default issuer.
(Deprecated, will be removed in a future release)`,
DisplayAttrs: &framework.DisplayAttributes{
Name: "JWT Issuer",
},
},
"disable_iss_validation": {
Type: framework.TypeBool,
Description: "Disable JWT issuer validation. Allows to skip ISS validation.",
Default: false,
Deprecated: true,
Description: `Disable JWT issuer validation (Deprecated, will be removed in a future release)`,
Default: true,
DisplayAttrs: &framework.DisplayAttributes{
Name: "Disable JWT Issuer Validation",
},
Expand Down
16 changes: 8 additions & 8 deletions path_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestConfig(t *testing.T) {
PEMKeys: []string{},
Host: "host",
CACert: testCACert,
DisableISSValidation: false,
DisableISSValidation: true,
}

conf, err := b.(*kubeAuthBackend).config(context.Background(), storage)
Expand Down Expand Up @@ -185,7 +185,7 @@ func TestConfig(t *testing.T) {
Host: "host",
CACert: testCACert,
TokenReviewerJWT: jwtData,
DisableISSValidation: false,
DisableISSValidation: true,
DisableLocalCAJwt: false,
}

Expand Down Expand Up @@ -227,7 +227,7 @@ func TestConfig(t *testing.T) {
PEMKeys: []string{testRSACert},
Host: "host",
CACert: testCACert,
DisableISSValidation: false,
DisableISSValidation: true,
DisableLocalCAJwt: false,
}

Expand Down Expand Up @@ -274,7 +274,7 @@ func TestConfig(t *testing.T) {
PEMKeys: []string{testRSACert, testECCert},
Host: "host",
CACert: testCACert,
DisableISSValidation: false,
DisableISSValidation: true,
DisableLocalCAJwt: false,
}

Expand Down Expand Up @@ -355,7 +355,7 @@ func TestConfig_LocalCaJWT(t *testing.T) {
Host: "host",
CACert: testLocalCACert,
TokenReviewerJWT: testLocalJWT,
DisableISSValidation: false,
DisableISSValidation: true,
DisableLocalCAJwt: false,
},
},
Expand All @@ -370,7 +370,7 @@ func TestConfig_LocalCaJWT(t *testing.T) {
Host: "host",
CACert: testCACert,
TokenReviewerJWT: testLocalJWT,
DisableISSValidation: false,
DisableISSValidation: true,
DisableLocalCAJwt: false,
},
},
Expand All @@ -385,7 +385,7 @@ func TestConfig_LocalCaJWT(t *testing.T) {
Host: "host",
CACert: testLocalCACert,
TokenReviewerJWT: jwtData,
DisableISSValidation: false,
DisableISSValidation: true,
DisableLocalCAJwt: false,
},
},
Expand All @@ -401,7 +401,7 @@ func TestConfig_LocalCaJWT(t *testing.T) {
Host: "host",
CACert: testCACert,
TokenReviewerJWT: "",
DisableISSValidation: false,
DisableISSValidation: true,
DisableLocalCAJwt: true,
},
},
Expand Down

0 comments on commit 6d0896d

Please sign in to comment.