Repository navigation
New adapter: OCM #4652
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
Open
ocm-ntinos
wants to merge
2
commits into
prebid:master
Choose a base branch
from
ocm-ntinos:new-adapter-ocm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,062
−0
Open
New adapter: OCM #4652
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
437 changes: 437 additions & 0 deletions
437
src/main/java/org/prebid/server/bidder/ocm/OcmBidder.java
Large diffs are not rendered by default.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
src/main/java/org/prebid/server/proto/openrtb/ext/request/ocm/ExtImpOcm.java
This file contains hidden or 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 org.prebid.server.proto.openrtb.ext.request.ocm; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import lombok.Value; | ||
|
|
||
| @Value(staticConstructor = "of") | ||
| public class ExtImpOcm { | ||
|
|
||
| /** | ||
| * Orange Click Media publisher identifier. It is propagated to the request-level publisher id, | ||
| * so every impression in a single request must carry the same value. | ||
| */ | ||
| @JsonProperty("publisherId") | ||
| String publisherId; | ||
|
|
||
| /** | ||
| * Names the impression's stored request on the OCM endpoint, which expands it into the | ||
| * impression's real configuration. | ||
| */ | ||
| @JsonProperty("placementId") | ||
| String placementId; | ||
|
|
||
| /** | ||
| * Deducted from the request tmax before it is forwarded. The OCM endpoint is itself a Prebid Server | ||
| * that would otherwise spend the whole budget on its own bidders, leaving no room for the round trip | ||
| * back. Null selects the adapter default; an explicit 0 disables the buffer. | ||
| */ | ||
| @JsonProperty("tmaxBufferMs") | ||
| Integer tmaxBufferMs; | ||
| } | ||
35 changes: 35 additions & 0 deletions
35
src/main/java/org/prebid/server/spring/config/bidder/OcmConfiguration.java
This file contains hidden or 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,35 @@ | ||
| package org.prebid.server.spring.config.bidder; | ||
|
|
||
| import org.prebid.server.bidder.BidderDeps; | ||
| import org.prebid.server.bidder.ocm.OcmBidder; | ||
| import org.prebid.server.json.JacksonMapper; | ||
| import org.prebid.server.spring.config.bidder.model.BidderConfigurationProperties; | ||
| import org.prebid.server.spring.config.bidder.util.BidderDepsAssembler; | ||
| import org.prebid.server.spring.env.YamlPropertySourceFactory; | ||
| import org.springframework.boot.context.properties.ConfigurationProperties; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.context.annotation.PropertySource; | ||
|
|
||
| @Configuration | ||
| @PropertySource(value = "classpath:/bidder-config/ocm.yaml", factory = YamlPropertySourceFactory.class) | ||
| public class OcmConfiguration { | ||
|
|
||
| private static final String BIDDER_NAME = "ocm"; | ||
|
|
||
| @Bean("ocmConfigurationProperties") | ||
| @ConfigurationProperties("adapters.ocm") | ||
| BidderConfigurationProperties configurationProperties() { | ||
| return new BidderConfigurationProperties(); | ||
| } | ||
|
|
||
| @Bean | ||
| BidderDeps ocmBidderDeps(BidderConfigurationProperties ocmConfigurationProperties, | ||
| JacksonMapper mapper) { | ||
|
|
||
| return BidderDepsAssembler.forBidder(BIDDER_NAME) | ||
| .withConfig(ocmConfigurationProperties) | ||
| .bidderCreator(config -> new OcmBidder(config.getEndpoint(), mapper)) | ||
| .assemble(); | ||
| } | ||
| } |
This file contains hidden or 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,34 @@ | ||
| # The endpoint is itself a Prebid Server, so this bidder is disabled by default: | ||
| # enabled on that server, a stored request naming ocm would call itself. | ||
| # To use it, set `adapters.ocm.enabled: true` in the application config | ||
| # (or ADAPTERS_OCM_ENABLED=true). | ||
| adapters: | ||
| ocm: | ||
| enabled: false | ||
| ortb-version: "2.6" | ||
| endpoint: https://pbam.orangeclickmedia.com/openrtb2/auction | ||
| endpoint-compression: gzip | ||
| geoscope: | ||
| - global | ||
| ortb: | ||
| multiformat-supported: true | ||
| meta-info: | ||
| maintainer-email: devs-subs@orangeclickmedia.com | ||
| app-media-types: | ||
| - banner | ||
| - video | ||
| - native | ||
| site-media-types: | ||
| - banner | ||
| - video | ||
| - native | ||
| supported-vendors: | ||
| vendor-id: 1148 | ||
| usersync: | ||
| cookie-family-name: ocm | ||
| redirect: | ||
| url: https://pbam.orangeclickmedia.com/usersync/redirect?gdpr={gdpr}&gdpr_consent={gdpr_consent}&us_privacy={us_privacy}&gpp={gpp}&gpp_sid={gpp_sid}&redirect={redirect_url} | ||
| uid-macro: '$UID' | ||
| iframe: | ||
| url: https://pbam.orangeclickmedia.com/usersync/iframe?gdpr={gdpr}&gdpr_consent={gdpr_consent}&us_privacy={us_privacy}&gpp={gpp}&gpp_sid={gpp_sid}&redirect={redirect_url} | ||
| uid-macro: '$UID' |
This file contains hidden or 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,27 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-04/schema#", | ||
| "title": "OCM Adapter Params", | ||
| "description": "A schema which validates params accepted by the OCM adapter", | ||
| "type": "object", | ||
| "properties": { | ||
| "publisherId": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "description": "Orange Click Media publisher identifier" | ||
| }, | ||
| "placementId": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "description": "Placement identifier, resolved as the impression's stored request" | ||
| }, | ||
| "tmaxBufferMs": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "description": "Milliseconds deducted from tmax before forwarding, to cover network and processing overhead; default 250" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "publisherId", | ||
| "placementId" | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think those are needed.