forked from prebid/prebid-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* MediaFuse alias * Syncer and tests * gvlid * gvlid * new mail
- Loading branch information
Showing
9 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package mediafuse | ||
|
||
import ( | ||
"text/template" | ||
|
||
"github.com/prebid/prebid-server/adapters" | ||
"github.com/prebid/prebid-server/usersync" | ||
) | ||
|
||
func NewMediafuseSyncer(temp *template.Template) usersync.Usersyncer { | ||
return adapters.NewSyncer("mediafuse", 411, temp, adapters.SyncTypeRedirect) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package mediafuse | ||
|
||
import ( | ||
"testing" | ||
"text/template" | ||
|
||
"github.com/prebid/prebid-server/privacy" | ||
"github.com/prebid/prebid-server/privacy/gdpr" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestMediafuseSyncer(t *testing.T) { | ||
syncURL := "//sync.hbmp.mediafuse.com/csync?t=p&ep=0&redir=localhost%2Fsetuid%3Fbidder%3Dmediafuse%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%7Buid%7D" | ||
syncURLTemplate := template.Must( | ||
template.New("sync-template").Parse(syncURL), | ||
) | ||
|
||
syncer := NewMediafuseSyncer(syncURLTemplate) | ||
syncInfo, err := syncer.GetUsersyncInfo(privacy.Policies{ | ||
GDPR: gdpr.Policy{ | ||
Signal: "0", | ||
}, | ||
}) | ||
|
||
assert.NoError(t, err) | ||
assert.Equal(t, "//sync.hbmp.mediafuse.com/csync?t=p&ep=0&redir=localhost%2Fsetuid%3Fbidder%3Dmediafuse%26gdpr%3D0%26gdpr_consent%3D%26uid%3D%7Buid%7D", syncInfo.URL) | ||
assert.Equal(t, "redirect", syncInfo.Type) | ||
assert.EqualValues(t, 411, syncer.GDPRVendorID()) | ||
assert.Equal(t, false, syncInfo.SupportCORS) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
maintainer: | ||
email: "[email protected]" | ||
capabilities: | ||
app: | ||
mediaTypes: | ||
- banner | ||
- video | ||
site: | ||
mediaTypes: | ||
- banner | ||
- video |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Mediafuse Adapter Params", | ||
"description": "A schema which validates params accepted by the Mediafuse adapter", | ||
|
||
"type": "object", | ||
"properties": { | ||
"placementId": { | ||
"type": "integer", | ||
"description": "An ID which identifies this placement of the impression" | ||
}, | ||
"siteId": { | ||
"type": "integer", | ||
"description": "An ID which identifies the site selling the impression" | ||
}, | ||
"aid": { | ||
"type": "integer", | ||
"description": "An ID which identifies the channel" | ||
}, | ||
"bidFloor": { | ||
"type": "number", | ||
"description": "BidFloor, US Dollars" | ||
} | ||
}, | ||
"required": ["aid"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters