diff --git a/scripts/kratos/providers_sync.go b/scripts/kratos/providers_sync.go index d1e0867..60cf665 100644 --- a/scripts/kratos/providers_sync.go +++ b/scripts/kratos/providers_sync.go @@ -8,7 +8,6 @@ import ( "time" "github.com/cloudflare/cfssl/log" - "github.com/google/uuid" "github.com/uptrace/bun" "github.com/uptrace/bun/dialect/pgdialect" "github.com/uptrace/bun/driver/pgdriver" @@ -16,7 +15,7 @@ import ( ) type Provider struct { - Id uuid.UUID `bun:"id,type:uuid"` + Id string `bun:"name"` Provider string `bun:"provider_name,notnull"` MapperURL string `bun:"mapper_url" yaml:"mapper_url"` ClientId string `bun:"client_id,notnull" yaml:"client_id"` @@ -43,7 +42,7 @@ type Config struct { var ProvidersDB []Provider func sync(ctx context.Context, db *bun.DB, path string) error { - err := db.NewSelect().Model(&ProvidersDB).ModelTableExpr("authsrv_oidc_provider AS provider").Scan(ctx) + err := db.NewSelect().Model(&ProvidersDB).ModelTableExpr("authsrv_oidc_provider AS provider").Where("trash = 'f'").Scan(ctx) if err != nil { return fmt.Errorf("failed to fetch providers from DB: %s", err) }