Skip to content

Commit 0846e66

Browse files
committed
fix
1 parent 3714578 commit 0846e66

File tree

1 file changed

+10
-5
lines changed
  • components/public-api-server/pkg/server

1 file changed

+10
-5
lines changed

components/public-api-server/pkg/server/server.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"github.com/gitpod-io/gitpod/public-api-server/pkg/auth"
3434
"github.com/gitpod-io/gitpod/public-api-server/pkg/billingservice"
3535
"github.com/gitpod-io/gitpod/public-api-server/pkg/identityprovider"
36+
"github.com/gitpod-io/gitpod/public-api-server/pkg/jws"
3637
"github.com/gitpod-io/gitpod/public-api-server/pkg/oidc"
3738
"github.com/gitpod-io/gitpod/public-api-server/pkg/origin"
3839
"github.com/gitpod-io/gitpod/public-api-server/pkg/proxy"
@@ -92,6 +93,15 @@ func Start(logger *logrus.Entry, version string, cfg *config.Configuration) erro
9293
}
9394
}
9495

96+
keyset, err := jws.NewKeySetFromAuthPKI(cfg.Auth.PKI)
97+
if err != nil {
98+
return fmt.Errorf("failed to setup JWS Keyset: %w", err)
99+
}
100+
_, err = jws.NewRSA256(keyset)
101+
if err != nil {
102+
return fmt.Errorf("failed to setup jws.RSA256: %w", err)
103+
}
104+
95105
var stateJWT *oidc.StateJWT
96106
if cfg.OIDCClientJWTSigningSecretPath != "" {
97107
oidcClientJWTSigningSecret, err := readSecretFromFile(cfg.OIDCClientJWTSigningSecretPath)
@@ -126,11 +136,6 @@ func Start(logger *logrus.Entry, version string, cfg *config.Configuration) erro
126136
log.Info("No Personal Access Token signign key specified, PersonalAccessToken service will be disabled.")
127137
}
128138

129-
_, err = auth.NewJWTFromAuthPKI(cfg.Auth.PKI, 7*24*time.Hour, "TODO")
130-
if err != nil {
131-
return fmt.Errorf("failed to setup JWT signer/verifier: %w", err)
132-
}
133-
134139
srv.HTTPMux().Handle("/stripe/invoices/webhook", handlers.ContentTypeHandler(stripeWebhookHandler, "application/json"))
135140

136141
oidcService := oidc.NewService(cfg.SessionServiceAddress, dbConn, cipherSet, stateJWT)

0 commit comments

Comments
 (0)