Skip to content

Commit

Permalink
Vungle: Rename from liftoff (prebid#3727)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vungle-GordonTian authored and mefjush committed Jul 19, 2024
1 parent 436291a commit dabf07a
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package liftoff
package vungle

import (
"encoding/json"
Expand Down Expand Up @@ -26,7 +26,7 @@ func TestValidParams(t *testing.T) {
}

for _, p := range validParams {
if err := validator.Validate(openrtb_ext.BidderLiftoff, json.RawMessage(p)); err != nil {
if err := validator.Validate(openrtb_ext.BidderVungle, json.RawMessage(p)); err != nil {
t.Errorf("Schema rejected valid params: %s", p)
}
}
Expand All @@ -39,7 +39,7 @@ func TestInvalidParams(t *testing.T) {
}

for _, p := range invalidParams {
if err := validator.Validate(openrtb_ext.BidderLiftoff, json.RawMessage(p)); err == nil {
if err := validator.Validate(openrtb_ext.BidderVungle, json.RawMessage(p)); err == nil {
t.Errorf("Schema allowed invalid params: %s", p)
}
}
Expand Down
16 changes: 8 additions & 8 deletions adapters/liftoff/liftoff.go → adapters/vungle/vungle.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package liftoff
package vungle

import (
"encoding/json"
Expand All @@ -19,18 +19,18 @@ type adapter struct {
Endpoint string
}

type liftoffImpressionExt struct {
type vungleImpressionExt struct {
*adapters.ExtImpBidder
// Ext represents the vungle extension.
Ext openrtb_ext.ImpExtLiftoff `json:"vungle"`
Ext openrtb_ext.ImpExtVungle `json:"vungle"`
}

// Builder builds a new instance of the Liftoff adapter for the given bidder with the given config.
// Builder builds a new instance of the Vungle adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
return &adapter{Endpoint: config.Endpoint}, nil
}

// MakeRequests split impressions into bid requests and change them into the form that liftoff can handle.
// MakeRequests split impressions into bid requests and change them into the form that vungle can handle.
func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
var requests []*adapters.RequestData
var errs []error
Expand All @@ -51,14 +51,14 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
imp.BidFloor = convertedValue
}

var impExt liftoffImpressionExt
var impExt vungleImpressionExt
if err := json.Unmarshal(imp.Ext, &impExt); err != nil {
errs = append(errs, fmt.Errorf("failed unmarshalling imp ext (err)%s", err.Error()))
continue
}

// get placement_reference_id & pub_app_store_id
var bidderImpExt openrtb_ext.ImpExtLiftoff
var bidderImpExt openrtb_ext.ImpExtVungle
if err := json.Unmarshal(impExt.Bidder, &bidderImpExt); err != nil {
errs = append(errs, fmt.Errorf("failed unmarshalling bidder imp ext (err)%s", err.Error()))
continue
Expand Down Expand Up @@ -116,7 +116,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
return requests, errs
}

// MakeBids collect bid response from liftoff and change them into the form that Prebid Server can handle.
// MakeBids collect bid response from vungle and change them into the form that Prebid Server can handle.
func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) {
if adapters.IsResponseStatusCodeNoContent(responseData) {
return nil, nil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package liftoff
package vungle

import (
"testing"
Expand All @@ -10,12 +10,12 @@ import (

func TestJsonSamples(t *testing.T) {
conf := config.Adapter{
Endpoint: "https://liftoff.io/bit/t",
Endpoint: "https://vungle.io/bit/t",
}
bidder, buildErr := Builder(openrtb_ext.BidderLiftoff, conf, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 667, DataCenter: "2"})
bidder, buildErr := Builder(openrtb_ext.BidderVungle, conf, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 667, DataCenter: "2"})
if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
}

adapterstest.RunJSONBidderTest(t, "liftofftest", bidder)
adapterstest.RunJSONBidderTest(t, "vungletest", bidder)
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://liftoff.io/bit/t",
"uri": "https://vungle.io/bit/t",
"headers": {
"Content-Type": ["application/json"],
"Accept": ["application/json"],
Expand Down
4 changes: 2 additions & 2 deletions exchange/adapter_builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ import (
"github.com/prebid/prebid-server/v2/adapters/kiviads"
"github.com/prebid/prebid-server/v2/adapters/krushmedia"
"github.com/prebid/prebid-server/v2/adapters/lemmadigital"
"github.com/prebid/prebid-server/v2/adapters/liftoff"
"github.com/prebid/prebid-server/v2/adapters/limelightDigital"
lmkiviads "github.com/prebid/prebid-server/v2/adapters/lm_kiviads"
"github.com/prebid/prebid-server/v2/adapters/lockerdome"
Expand Down Expand Up @@ -194,6 +193,7 @@ import (
"github.com/prebid/prebid-server/v2/adapters/visx"
"github.com/prebid/prebid-server/v2/adapters/vox"
"github.com/prebid/prebid-server/v2/adapters/vrtcal"
"github.com/prebid/prebid-server/v2/adapters/vungle"
"github.com/prebid/prebid-server/v2/adapters/xeworks"
"github.com/prebid/prebid-server/v2/adapters/yahooAds"
"github.com/prebid/prebid-server/v2/adapters/yandex"
Expand Down Expand Up @@ -323,7 +323,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder {
openrtb_ext.BidderLmKiviads: lmkiviads.Builder,
openrtb_ext.BidderKrushmedia: krushmedia.Builder,
openrtb_ext.BidderLemmadigital: lemmadigital.Builder,
openrtb_ext.BidderLiftoff: liftoff.Builder,
openrtb_ext.BidderVungle: vungle.Builder,
openrtb_ext.BidderLimelightDigital: limelightDigital.Builder,
openrtb_ext.BidderLockerDome: lockerdome.Builder,
openrtb_ext.BidderLogan: logan.Builder,
Expand Down
1 change: 1 addition & 0 deletions exchange/adapter_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func GetDisabledBidderWarningMessages(infos config.BidderInfos) map[string]strin
"applogy": `Bidder "applogy" is no longer available in Prebid Server. Please update your configuration.`,
"rhythmone": `Bidder "rhythmone" is no longer available in Prebid Server. Please update your configuration.`,
"nanointeractive": `Bidder "nanointeractive" is no longer available in Prebid Server. Please update your configuration.`,
"liftoff": `Bidder "liftoff" is no longer available in Prebid Server. If you're looking to use the Vungle Exchange adapter, please rename it to "vungle" in your configuration.`,
}

return mergeRemovedAndDisabledBidderWarningMessages(removed, infos)
Expand Down
4 changes: 2 additions & 2 deletions openrtb_ext/bidders.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ var coreBidderNames []BidderName = []BidderName{
BidderLmKiviads,
BidderKrushmedia,
BidderLemmadigital,
BidderLiftoff,
BidderLimelightDigital,
BidderLockerDome,
BidderLogan,
Expand Down Expand Up @@ -212,6 +211,7 @@ var coreBidderNames []BidderName = []BidderName{
BidderVisx,
BidderVox,
BidderVrtcal,
BidderVungle,
BidderXeworks,
BidderYahooAds,
BidderYandex,
Expand Down Expand Up @@ -439,7 +439,6 @@ const (
BidderLmKiviads BidderName = "lm_kiviads"
BidderKrushmedia BidderName = "krushmedia"
BidderLemmadigital BidderName = "lemmadigital"
BidderLiftoff BidderName = "liftoff"
BidderLimelightDigital BidderName = "limelightDigital"
BidderLockerDome BidderName = "lockerdome"
BidderLogan BidderName = "logan"
Expand Down Expand Up @@ -522,6 +521,7 @@ const (
BidderVisx BidderName = "visx"
BidderVox BidderName = "vox"
BidderVrtcal BidderName = "vrtcal"
BidderVungle BidderName = "vungle"
BidderXeworks BidderName = "xeworks"
BidderYahooAds BidderName = "yahooAds"
BidderYandex BidderName = "yandex"
Expand Down
2 changes: 1 addition & 1 deletion openrtb_ext/imp_liftoff.go → openrtb_ext/imp_vungle.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package openrtb_ext

type ImpExtLiftoff struct {
type ImpExtVungle struct {
BidToken string `json:"bid_token"`
PubAppStoreID string `json:"app_store_id"`
PlacementRefID string `json:"placement_reference_id"`
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Liftoff Adapter Params",
"description": "A schema which validates params accepted by the Liftoff adapter",
"title": "Vungle Adapter Params",
"description": "A schema which validates params accepted by the Vungle adapter",
"type": "object",
"properties": {
"app_store_id": {
Expand Down

0 comments on commit dabf07a

Please sign in to comment.