From 030636a694289e229afac4ce1a9fc78289de8256 Mon Sep 17 00:00:00 2001 From: Ildar Nurislamov Date: Wed, 6 Nov 2024 17:20:54 +0400 Subject: [PATCH] bulker: add keepOriginalNames to known options --- bulkerlib/options.go | 2 +- ingest/router.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bulkerlib/options.go b/bulkerlib/options.go index 5385ea3..62e3959 100644 --- a/bulkerlib/options.go +++ b/bulkerlib/options.go @@ -14,7 +14,7 @@ type StreamOption func(*StreamOptions) var optionsRegistry = make(map[string]ParseableOption) // Not used by bulker. Just added here to be treated as known options and don't print errors -var ignoredOptions = []string{"functions", "streams", "dataLayout", "events", "debugTill", "hosts", "schedule", "timezone", "storageKey", "tableNamePrefix", "multithreading"} +var ignoredOptions = []string{"functions", "streams", "dataLayout", "events", "debugTill", "hosts", "schedule", "timezone", "storageKey", "tableNamePrefix", "multithreading", "keepOriginalNames"} var ( BatchSizeOption = ImplementationOption[int]{ diff --git a/ingest/router.go b/ingest/router.go index 5d1ba29..58e8286 100644 --- a/ingest/router.go +++ b/ingest/router.go @@ -478,6 +478,10 @@ func hashApiKey(token string, salt string, secret string) string { func (r *Router) checkHash(hash string, secret string) bool { pk := strings.SplitN(hash, ".", 2) + if len(pk) < 2 { + r.Errorf("invalid hash format: %s", hash) + return false + } salt := pk[0] hashPart := pk[1] for _, globalSecret := range r.config.GlobalHashSecrets {