Skip to content

Commit 6babf2f

Browse files
committed
[installer] Remove OIDC secret from public-api
1 parent 793a04c commit 6babf2f

File tree

6 files changed

+0
-64
lines changed

6 files changed

+0
-64
lines changed

components/public-api/go/config/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ type Configuration struct {
2020
// StripeWebhookSigningSecretPath is a filepath to a secret used to validate incoming webhooks from Stripe
2121
StripeWebhookSigningSecretPath string `json:"stripeWebhookSigningSecretPath"`
2222

23-
// OIDCClientJWTSigningSecretPath is a filepath to a secret used to sign and validate JWTs used for OIDC flows
24-
OIDCClientJWTSigningSecretPath string `json:"oidcClientJWTSigningSecretPath"`
25-
2623
// Path to file which contains personal access token singing key
2724
PersonalAccessTokenSigningKeyPath string `json:"personalAccessTokenSigningKeyPath"`
2825

install/installer/pkg/components/public-api-server/configmap.go

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,9 @@ const (
2828
)
2929

3030
func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
31-
var oidcClientJWTSigningSecretPath string
3231
var stripeSecretPath string
3332
var personalAccessTokenSigningKeyPath string
3433

35-
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
36-
_, _, oidcClientJWTSigningSecretPath, _ = getOIDCClientJWTSecretConfig(cfg)
37-
return nil
38-
})
39-
4034
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
4135
_, _, stripeSecretPath, _ = getStripeConfig(cfg)
4236
return nil
@@ -54,7 +48,6 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
5448
cfg := config.Configuration{
5549
PublicURL: fmt.Sprintf("https://api.%s", ctx.Config.Domain),
5650
GitpodServiceURL: common.ClusterURL("ws", server.Component, ctx.Namespace, server.ContainerPort),
57-
OIDCClientJWTSigningSecretPath: oidcClientJWTSigningSecretPath,
5851
StripeWebhookSigningSecretPath: stripeSecretPath,
5952
PersonalAccessTokenSigningKeyPath: personalAccessTokenSigningKeyPath,
6053
BillingServiceAddress: common.ClusterAddress(usage.Component, ctx.Namespace, usage.GRPCServicePort),
@@ -137,38 +130,6 @@ func getStripeConfig(cfg *experimental.Config) (corev1.Volume, corev1.VolumeMoun
137130
return volume, mount, path, true
138131
}
139132

140-
func getOIDCClientJWTSecretConfig(cfg *experimental.Config) (corev1.Volume, corev1.VolumeMount, string, bool) {
141-
var volume corev1.Volume
142-
var mount corev1.VolumeMount
143-
var path string
144-
145-
if cfg == nil || cfg.WebApp == nil || cfg.WebApp.PublicAPI == nil || cfg.WebApp.PublicAPI.OIDCClientJWTSigningKeySecretName == "" {
146-
return volume, mount, path, false
147-
}
148-
149-
oidcClientJWTSigningKeySecretName := cfg.WebApp.PublicAPI.OIDCClientJWTSigningKeySecretName
150-
path = oidcClientJWTSigningKeyMountPath
151-
152-
volume = corev1.Volume{
153-
Name: "oidc-client-jwt-signing-key",
154-
VolumeSource: corev1.VolumeSource{
155-
Secret: &corev1.SecretVolumeSource{
156-
SecretName: oidcClientJWTSigningKeySecretName,
157-
Optional: pointer.Bool(true),
158-
},
159-
},
160-
}
161-
162-
mount = corev1.VolumeMount{
163-
Name: "oidc-client-jwt-signing-key",
164-
MountPath: oidcClientJWTSigningKeyMountPath,
165-
SubPath: "oidc-client-jwt-signing-key",
166-
ReadOnly: true,
167-
}
168-
169-
return volume, mount, path, true
170-
}
171-
172133
func getPersonalAccessTokenSigningKey(cfg *experimental.Config) (corev1.Volume, corev1.VolumeMount, string, bool) {
173134
var volume corev1.Volume
174135
var mount corev1.VolumeMount

install/installer/pkg/components/public-api-server/configmap_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ func TestConfigMap(t *testing.T) {
3333
return nil
3434
})
3535

36-
var oidcClientJWTSigningSecretPath string
37-
_ = ctx.WithExperimental(func(ucfg *experimental.Config) error {
38-
_, _, oidcClientJWTSigningSecretPath, _ = getOIDCClientJWTSecretConfig(ucfg)
39-
return nil
40-
})
41-
4236
var personalAccessTokenSigningKeyPath string
4337
_ = ctx.WithExperimental(func(ucfg *experimental.Config) error {
4438
_, _, personalAccessTokenSigningKeyPath, _ = getPersonalAccessTokenSigningKey(ucfg)
@@ -50,7 +44,6 @@ func TestConfigMap(t *testing.T) {
5044
GitpodServiceURL: fmt.Sprintf("ws://server.%s.svc.cluster.local:3000", ctx.Namespace),
5145
BillingServiceAddress: fmt.Sprintf("usage.%s.svc.cluster.local:9001", ctx.Namespace),
5246
SessionServiceAddress: fmt.Sprintf("server.%s.svc.cluster.local:9876", ctx.Namespace),
53-
OIDCClientJWTSigningSecretPath: oidcClientJWTSigningSecretPath,
5447
StripeWebhookSigningSecretPath: stripeSecretPath,
5548
PersonalAccessTokenSigningKeyPath: personalAccessTokenSigningKeyPath,
5649
DatabaseConfigPath: "/secrets/database-config",

install/installer/pkg/components/public-api-server/deployment.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,6 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
5959
databaseSecretMount,
6060
}
6161

62-
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
63-
volume, mount, _, ok := getOIDCClientJWTSecretConfig(cfg)
64-
if !ok {
65-
return nil
66-
}
67-
68-
volumes = append(volumes, volume)
69-
volumeMounts = append(volumeMounts, mount)
70-
return nil
71-
})
72-
7362
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
7463
volume, mount, _, ok := getStripeConfig(cfg)
7564
if !ok {

install/installer/pkg/components/public-api-server/objects_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ func renderContextWithPublicAPI(t *testing.T) *common.RenderContext {
3030
WebApp: &experimental.WebAppConfig{
3131
PublicAPI: &experimental.PublicAPIConfig{
3232
StripeSecretName: "stripe-webhook-secret",
33-
OIDCClientJWTSigningKeySecretName: "oidc-client-jwt-signing-key",
3433
PersonalAccessTokenSigningKeySecretName: "personal-access-token-signing-key",
3534
},
3635
},

install/installer/pkg/config/v1/experimental/experimental.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,6 @@ type PublicAPIConfig struct {
301301
// Name of the kubernetes secret to use for Stripe secrets
302302
StripeSecretName string `json:"stripeSecretName"`
303303

304-
// Name of the kubernetes secret to use for signing JWTs
305-
OIDCClientJWTSigningKeySecretName string `json:"oidcClientJWTSigningKeySecretName"`
306-
307304
// Name of the kubernetes secret to use for signature of Personal Access Tokens
308305
PersonalAccessTokenSigningKeySecretName string `json:"personalAccessTokenSigningKeySecretName"`
309306
}

0 commit comments

Comments
 (0)