forked from baron/baron-sso
관리자 계정 생성 및 로컬 DB 동기화 실행 순서 조정
This commit is contained in:
@@ -136,9 +136,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
slog.Info("✅ IDP Schema Validation Passed", "idp", idpProvider.Name())
|
slog.Info("✅ IDP Schema Validation Passed", "idp", idpProvider.Name())
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
if err := bootstrap.SeedAdminIdentity(idpProvider); err != nil {
|
|
||||||
slog.Error("❌ Admin identity seed failed", "error", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Initialize DB Connections
|
// 2. Initialize DB Connections
|
||||||
// ClickHouse
|
// ClickHouse
|
||||||
@@ -212,6 +209,16 @@ func main() {
|
|||||||
slog.Error("❌ Bootstrap failed", "error", err)
|
slog.Error("❌ Bootstrap failed", "error", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [Moved & Enhanced] Seed Admin Identity & Sync Local Role
|
||||||
|
if kratosID, err := bootstrap.SeedAdminIdentity(idpProvider); err != nil {
|
||||||
|
slog.Error("❌ Admin identity seed failed", "error", err)
|
||||||
|
} else {
|
||||||
|
// Sync role to local DB
|
||||||
|
if err := bootstrap.SyncAdminRole(db, kratosID); err != nil {
|
||||||
|
slog.Error("❌ Admin role sync failed", "error", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// [New] Sync existing data to Keto
|
// [New] Sync existing data to Keto
|
||||||
if ketoService != nil {
|
if ketoService != nil {
|
||||||
if err := bootstrap.SyncKetoRelations(db, ketoService); err != nil {
|
if err := bootstrap.SyncKetoRelations(db, ketoService); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user