Skip to content

Commit fcfc235

Browse files
committed
[installer] Remove OIDC secret from public-api
1 parent 3fe86d0 commit fcfc235

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
@@ -22,9 +22,6 @@ type Configuration struct {
2222
// StripeWebhookSigningSecretPath is a filepath to a secret used to validate incoming webhooks from Stripe
2323
StripeWebhookSigningSecretPath string `json:"stripeWebhookSigningSecretPath"`
2424

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

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),
@@ -141,38 +134,6 @@ func getStripeConfig(cfg *experimental.Config) (corev1.Volume, corev1.VolumeMoun
141134
return volume, mount, path, true
142135
}
143136

144-
func getOIDCClientJWTSecretConfig(cfg *experimental.Config) (corev1.Volume, corev1.VolumeMount, string, bool) {
145-
var volume corev1.Volume
146-
var mount corev1.VolumeMount
147-
var path string
148-
149-
if cfg == nil || cfg.WebApp == nil || cfg.WebApp.PublicAPI == nil || cfg.WebApp.PublicAPI.OIDCClientJWTSigningKeySecretName == "" {
150-
return volume, mount, path, false
151-
}
152-
153-
oidcClientJWTSigningKeySecretName := cfg.WebApp.PublicAPI.OIDCClientJWTSigningKeySecretName
154-
path = oidcClientJWTSigningKeyMountPath
155-
156-
volume = corev1.Volume{
157-
Name: "oidc-client-jwt-signing-key",
158-
VolumeSource: corev1.VolumeSource{
159-
Secret: &corev1.SecretVolumeSource{
160-
SecretName: oidcClientJWTSigningKeySecretName,
161-
Optional: pointer.Bool(true),
162-
},
163-
},
164-
}
165-
166-
mount = corev1.VolumeMount{
167-
Name: "oidc-client-jwt-signing-key",
168-
MountPath: oidcClientJWTSigningKeyMountPath,
169-
SubPath: "oidc-client-jwt-signing-key",
170-
ReadOnly: true,
171-
}
172-
173-
return volume, mount, path, true
174-
}
175-
176137
func getPersonalAccessTokenSigningKey(cfg *experimental.Config) (corev1.Volume, corev1.VolumeMount, string, bool) {
177138
var volume corev1.Volume
178139
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
@@ -34,12 +34,6 @@ func TestConfigMap(t *testing.T) {
3434
return nil
3535
})
3636

37-
var oidcClientJWTSigningSecretPath string
38-
_ = ctx.WithExperimental(func(ucfg *experimental.Config) error {
39-
_, _, oidcClientJWTSigningSecretPath, _ = getOIDCClientJWTSecretConfig(ucfg)
40-
return nil
41-
})
42-
4337
var personalAccessTokenSigningKeyPath string
4438
_ = ctx.WithExperimental(func(ucfg *experimental.Config) error {
4539
_, _, personalAccessTokenSigningKeyPath, _ = getPersonalAccessTokenSigningKey(ucfg)
@@ -51,7 +45,6 @@ func TestConfigMap(t *testing.T) {
5145
GitpodServiceURL: fmt.Sprintf("ws://server.%s.svc.cluster.local:3000", ctx.Namespace),
5246
BillingServiceAddress: fmt.Sprintf("usage.%s.svc.cluster.local:9001", ctx.Namespace),
5347
SessionServiceAddress: fmt.Sprintf("server.%s.svc.cluster.local:9876", ctx.Namespace),
54-
OIDCClientJWTSigningSecretPath: oidcClientJWTSigningSecretPath,
5548
StripeWebhookSigningSecretPath: stripeSecretPath,
5649
PersonalAccessTokenSigningKeyPath: personalAccessTokenSigningKeyPath,
5750
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)