From b42a4698e6d31d77f165c1435aef60211fc2f367 Mon Sep 17 00:00:00 2001 From: kyy Date: Fri, 23 Jan 2026 17:42:54 +0900 Subject: [PATCH] =?UTF-8?q?IDP=20=EC=B4=88=EA=B8=B0=ED=99=94=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=ED=8C=A9=ED=86=A0=EB=A6=AC=20=ED=8C=A8=ED=84=B4=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/cmd/server/main.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/backend/cmd/server/main.go b/backend/cmd/server/main.go index ab39a986..58000329 100644 --- a/backend/cmd/server/main.go +++ b/backend/cmd/server/main.go @@ -3,6 +3,7 @@ package main import ( "baron-sso-backend/internal/domain" "baron-sso-backend/internal/handler" + "baron-sso-backend/internal/idp" "baron-sso-backend/internal/logger" "baron-sso-backend/internal/repository" "baron-sso-backend/internal/service" @@ -73,14 +74,12 @@ func main() { ) // --- Fail-Fast Schema Validation --- - // Initialize the IDP Provider (Descope) - descopeProjectID := getEnv("DESCOPE_PROJECT_ID", "") - descopeManagementKey := getEnv("DESCOPE_MANAGEMENT_KEY", "") - - // We create a provider instance to check schema compatibility. - // This ensures that our BrokerUser model requirements (e.g. custom attributes) - // are supported by the configured IDP. - idpProvider := service.NewDescopeProvider(descopeProjectID, descopeManagementKey) + // 팩토리를 사용하여 IDP 공급자를 초기화합니다. + idpProvider, err := idp.InitializeProvider() + if err != nil { + slog.Error("❌ [CRITICAL] Failed to initialize IDP Provider", "error", err) + os.Exit(1) + } if err := validator.ValidateIDPCompatibility(domain.BrokerUser{}, idpProvider); err != nil { slog.Error("❌ [CRITICAL] Broker Schema Mismatch",