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.
- Loading branch information
1 parent
d96f2b2
commit 957884d
Showing
9 changed files
with
74 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 trustx | ||
|
||
import ( | ||
"text/template" | ||
|
||
"github.com/prebid/prebid-server/adapters" | ||
"github.com/prebid/prebid-server/usersync" | ||
) | ||
|
||
func NewTrustXSyncer(temp *template.Template) usersync.Usersyncer { | ||
return adapters.NewSyncer("trustx", 686, 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 trustx | ||
|
||
import ( | ||
"testing" | ||
"text/template" | ||
|
||
"github.com/prebid/prebid-server/privacy" | ||
"github.com/prebid/prebid-server/privacy/gdpr" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestTrustXSyncer(t *testing.T) { | ||
syncURL := "//not_localhost/synclocalhost%2Fsetuid%3Fbidder%3Dgrid%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%24UID" | ||
syncURLTemplate := template.Must( | ||
template.New("sync-template").Parse(syncURL), | ||
) | ||
|
||
syncer := NewTrustXSyncer(syncURLTemplate) | ||
syncInfo, err := syncer.GetUsersyncInfo(privacy.Policies{ | ||
GDPR: gdpr.Policy{ | ||
Signal: "0", | ||
}, | ||
}) | ||
|
||
assert.NoError(t, err) | ||
assert.Equal(t, "//not_localhost/synclocalhost%2Fsetuid%3Fbidder%3Dgrid%26gdpr%3D0%26gdpr_consent%3D%26uid%3D%24UID", syncInfo.URL) | ||
assert.Equal(t, "redirect", syncInfo.Type) | ||
assert.EqualValues(t, 686, 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: "grid-tech@themediagrid.com" | ||
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,13 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "TrustX Adapter Params", | ||
"description": "A schema which validates params accepted by TrustX adapter", | ||
"type": "object", | ||
"properties": { | ||
"uid": { | ||
"type": "integer", | ||
"description": "An ID which identifies this placement of the impression" | ||
} | ||
}, | ||
"required": [] | ||
} |
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