zitadel/cmd/setup/51.go
Iraq 9f0da00cd5
fix: manage root CA for LDAP IdPs correctly (#9517)
# Which Problems Are Solved

#9292 did not correctly change the projection table to list IdPs for existing ZITADEL setups.

# How the Problems Are Solved

Fixed the projection table by an explicit setup.

# Additional Changes

To prevent user facing error when using the LDAP with a custom root CA as much as possible, the certificate is parsed when passing it to the API.

# Additional Context

- Closes https://github.com/zitadel/zitadel/issues/9514

---------

Co-authored-by: Iraq Jaber <IraqJaber@gmail.com>
(cherry picked from commit 11c9be3b8de8685d8bda64471a2bf4a8b08cda20)
2025-03-18 16:38:22 +01:00

28 lines
499 B
Go

package setup
import (
"context"
_ "embed"
"github.com/zitadel/zitadel/internal/database"
"github.com/zitadel/zitadel/internal/eventstore"
)
var (
//go:embed 51.sql
addRootCA string
)
type IDPTemplate6RootCA struct {
dbClient *database.DB
}
func (mig *IDPTemplate6RootCA) Execute(ctx context.Context, _ eventstore.Event) error {
_, err := mig.dbClient.ExecContext(ctx, addRootCA)
return err
}
func (mig *IDPTemplate6RootCA) String() string {
return "51_idp_templates6_add_root_ca"
}