@@ -17,10 +17,6 @@ import (
17
17
"github.com/tidwall/gjson"
18
18
"github.com/tidwall/sjson"
19
19
20
- "github.com/rudderlabs/rudder-go-kit/sanitize"
21
- "github.com/rudderlabs/rudder-go-kit/stringify"
22
- kituuid "github.com/rudderlabs/rudder-go-kit/uuid"
23
-
24
20
"github.com/rudderlabs/rudder-go-kit/config"
25
21
"github.com/rudderlabs/rudder-go-kit/logger"
26
22
"github.com/rudderlabs/rudder-go-kit/stats"
@@ -101,18 +97,18 @@ type Handle struct {
101
97
conf struct { // configuration parameters
102
98
webPort , maxUserWebRequestWorkerProcess , maxDBWriterProcess int
103
99
maxUserWebRequestBatchSize , maxDBBatchSize , maxHeaderBytes , maxConcurrentRequests int
104
- userWebRequestBatchTimeout , dbBatchWriteTimeout config .ValueLoader [time.Duration ]
100
+ userWebRequestBatchTimeout , dbBatchWriteTimeout misc .ValueLoader [time.Duration ]
105
101
106
- maxReqSize config .ValueLoader [int ]
107
- enableRateLimit config .ValueLoader [bool ]
102
+ maxReqSize misc .ValueLoader [int ]
103
+ enableRateLimit misc .ValueLoader [bool ]
108
104
enableSuppressUserFeature bool
109
105
diagnosisTickerTime time.Duration
110
106
ReadTimeout time.Duration
111
107
ReadHeaderTimeout time.Duration
112
108
WriteTimeout time.Duration
113
109
IdleTimeout time.Duration
114
- allowReqsWithoutUserIDAndAnonymousID config .ValueLoader [bool ]
115
- gwAllowPartialWriteWithErrors config .ValueLoader [bool ]
110
+ allowReqsWithoutUserIDAndAnonymousID misc .ValueLoader [bool ]
111
+ gwAllowPartialWriteWithErrors misc .ValueLoader [bool ]
116
112
}
117
113
118
114
// additional internal http handlers
@@ -284,7 +280,7 @@ func (gw *Handle) getJobDataFromRequest(req *webRequestT) (jobData *jobFromReq,
284
280
285
281
fillMessageID := func (event map [string ]interface {}) {
286
282
messageID , _ := event ["messageId" ].(string )
287
- messageID = strings .TrimSpace (sanitize . Unicode (messageID ))
283
+ messageID = strings .TrimSpace (misc . SanitizeUnicode (messageID ))
288
284
if messageID == "" {
289
285
event ["messageId" ] = uuid .New ().String ()
290
286
} else {
@@ -334,8 +330,8 @@ func (gw *Handle) getJobDataFromRequest(req *webRequestT) (jobData *jobFromReq,
334
330
return
335
331
}
336
332
337
- anonIDFromReq := strings .TrimSpace (sanitize . Unicode ( stringify . Data (toSet ["anonymousId" ])))
338
- userIDFromReq := strings .TrimSpace (sanitize . Unicode ( stringify . Data (toSet ["userId" ])))
333
+ anonIDFromReq := strings .TrimSpace (misc . SanitizeUnicode ( misc . GetStringifiedData (toSet ["anonymousId" ])))
334
+ userIDFromReq := strings .TrimSpace (misc . SanitizeUnicode ( misc . GetStringifiedData (toSet ["userId" ])))
339
335
eventTypeFromReq , _ := misc .MapLookup (
340
336
toSet ,
341
337
"type" ,
@@ -392,7 +388,7 @@ func (gw *Handle) getJobDataFromRequest(req *webRequestT) (jobData *jobFromReq,
392
388
393
389
// hashing combination of userIDFromReq + anonIDFromReq, using colon as a delimiter
394
390
var rudderId uuid.UUID
395
- rudderId , err = kituuid .GetMD5UUID (userIDFromReq + ":" + anonIDFromReq )
391
+ rudderId , err = misc .GetMD5UUID (userIDFromReq + ":" + anonIDFromReq )
396
392
if err != nil {
397
393
err = errors .New (response .NonIdentifiableRequest )
398
394
return
0 commit comments