-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UOE:10435 Migrate Wakanda to prebid #771
Conversation
@@ -142,6 +142,15 @@ func (m OpenWrap) handleEntrypointHook( | |||
rCtx.PubID = pubid | |||
} | |||
|
|||
// rCtx.WakandaDebug.EnableIfRequired(rCtx.PubIDStr, rCtx.ProfileIDStr) | |||
// if rCtx.WakandaDebug.Enabled { | |||
rCtx.WakandaDebug.DebugData.HTTPRequest = payload.Request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getAccountIdFromRawRequest
endpoints/openrtb2/auction_ow.go
Outdated
@@ -81,4 +81,6 @@ func UpdateResponseExtOW(w http.ResponseWriter, bidResponse *openrtb2.BidRespons | |||
w.WriteHeader(http.StatusNoContent) | |||
} | |||
} | |||
rCtx.WakandaDebug.DebugData.HTTPResponse = w |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this required?. Response is already available in ao
if rCtx.WakandaDebug.Enabled { | ||
rCtx.WakandaDebug.DebugData.OpenRTB = payload.BidRequest | ||
// defer rCtx.WakandaDebug.WriteLogToFiles() /// need to move | ||
} else { | ||
rCtx.WakandaDebug.DebugData.HTTPRequest = nil | ||
rCtx.WakandaDebug.DebugData.HTTPRequestBody = nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not needed.
@@ -88,6 +88,15 @@ func (m OpenWrap) handleBeforeValidationHook( | |||
rCtx.DeviceCtx.Platform = getDevicePlatform(rCtx, payload.BidRequest) | |||
populateDeviceContext(&rCtx.DeviceCtx, payload.BidRequest.Device) | |||
|
|||
rCtx.WakandaDebug.EnableIfRequired(rCtx.PubIDStr, rCtx.ProfileIDStr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to entrypoint hook
hbMux := http.NewServeMux() | ||
hbMux.HandleFunc("/wakanda", wakanda.Handler(cfg.Wakanda)) | ||
srvInterface := ":" + cfg.Server.Port | ||
go startServer(srvInterface, hbMux) | ||
wakanda.InitWakanda(time.Duration(cfg.Wakanda.MaxDuration), time.Duration(cfg.Wakanda.CleanupFrequency)) | ||
return *ow, nil | ||
} | ||
|
||
var startServer = func(srvInterface string, hbMux *http.ServeMux) error { | ||
if err := http.ListenAndServe(srvInterface, hbMux); err != nil { | ||
logger.Fatal("main.main:unable to start http server: %s", err.Error()) | ||
return err | ||
} | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this code to separate file server.go
HTTPRequest *http.Request | ||
HTTPRequestBody json.RawMessage | ||
HTTPResponse http.ResponseWriter | ||
HTTPResponseBody string | ||
OpenRTB any | ||
PrebidHTTPRequest *http.Request | ||
PrebidRequestBody json.RawMessage | ||
PrebidHTTPResponse *httptest.ResponseRecorder | ||
Logger json.RawMessage | ||
WinningBid bool | ||
// PartnerMapping | ||
// AdUnitConfig | ||
// Logger | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTTPRequest
will be mapped to request cached in rctx.
HTTPRequestBody
will be mapped to request body cached in rctx.
HTTPResponse
will be mapped to ao.Response
OpenRTB
will be mapped to ao.RequestWrapper
Logger
will be mapped to ao.Logger
d1ad34d
to
8d38608
Compare
No description provided.