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