Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit 15a9e69

Browse files
committed
Move skip_cert field from one of for backwards compatibility
1 parent 7e217a4 commit 15a9e69

File tree

8 files changed

+103
-121
lines changed

8 files changed

+103
-121
lines changed

config/gen/go/v1/oidc/config.pb.go

+59-66
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/gen/go/v1/oidc/config.pb.validate.go

+29-41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/v1/oidc/config.proto

+7-7
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,6 @@ message OIDCConfig {
200200
// The file path to the PEM-encoded certificate authority to trust when performing HTTPS calls to the OIDC Identity Provider.
201201
// Optional.
202202
string trusted_certificate_authority_file = 20;
203-
204-
// If set to true, the verification of the destination certificate will be skipped when
205-
// making a request to the Token Endpoint. This option is useful when you want to use a
206-
// self-signed certificate for testing purposes, but basically should not be set to true
207-
// in any other cases.
208-
// Optional.
209-
google.protobuf.Value skip_verify_peer_cert = 18;
210203
}
211204

212205
// The Authservice makes two kinds of direct network connections directly to the OIDC Provider.
@@ -228,5 +221,12 @@ message OIDCConfig {
228221
// When specified, the Authservice will use the configured Redis server to store session data.
229222
// Optional.
230223
RedisConfig redis_session_store_config = 16;
224+
225+
// If set to true, the verification of the destination certificate will be skipped when
226+
// making a request to the Token Endpoint. This option is useful when you want to use a
227+
// self-signed certificate for testing purposes, but basically should not be set to true
228+
// in any other cases.
229+
// Optional.
230+
google.protobuf.Value skip_verify_peer_cert = 18; // keep this field out from the trusted_ca_config one of for backward compatibility.
231231
}
232232

internal/config_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ func TestLoadOIDC(t *testing.T) {
222222
RedisSessionStoreConfig: &oidcv1.RedisConfig{ServerUri: "redis://localhost:6379/0"},
223223
Scopes: []string{scopeOIDC},
224224
Logout: &oidcv1.LogoutConfig{Path: "/logout", RedirectUri: "http://fake"},
225-
TrustedCaConfig: &oidcv1.OIDCConfig_SkipVerifyPeerCert{SkipVerifyPeerCert: structpb.NewBoolValue(true)},
225+
TrustedCaConfig: &oidcv1.OIDCConfig_TrustedCertificateAuthority{TrustedCertificateAuthority: "fake-ca-pem"},
226+
SkipVerifyPeerCert: structpb.NewBoolValue(true),
226227
},
227228
},
228229
},

internal/oidc/jwks_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ func TestDynamicJWKSProvider(t *testing.T) {
188188
PeriodicFetchIntervalSec: 1,
189189
},
190190
},
191-
TrustedCaConfig: &oidcv1.OIDCConfig_SkipVerifyPeerCert{
192-
SkipVerifyPeerCert: structpb.NewBoolValue(true),
193-
},
191+
SkipVerifyPeerCert: structpb.NewBoolValue(true),
194192
}
195193

196194
keys, err := cache.Get(context.Background(), config)

internal/testdata/oidc-override.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"jwks_fetcher": {
3434
"jwks_uri": "http://fake/jwks",
3535
"skip_verify_peer_cert": "true"
36-
}
36+
},
37+
"trusted_certificate_authority": "fake-ca-pem"
3738
}
3839
}
3940
]

internal/testdata/oidc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"jwks_fetcher": {
3030
"jwks_uri": "http://fake/jwks",
3131
"skip_verify_peer_cert": "true"
32-
}
32+
},
33+
"trusted_certificate_authority": "fake-ca-pem"
3334
}
3435
}
3536
]

internal/tls_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestLoadTLSConfig(t *testing.T) {
6666
},
6767
{
6868
name: "skip verify config",
69-
config: &oidc.OIDCConfig{TrustedCaConfig: &oidc.OIDCConfig_SkipVerifyPeerCert{SkipVerifyPeerCert: structpb.NewBoolValue(true)}},
69+
config: &oidc.OIDCConfig{SkipVerifyPeerCert: structpb.NewBoolValue(true)},
7070
wantTLS: true,
7171
wantSkip: true,
7272
},

0 commit comments

Comments
 (0)