Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/scripts/codepath-notification
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ thetradedesk|TheTradeDesk: Prebid-Maintainers@thetradedesk.com
gumgum|GumGum: prebid@gumgum.com
kargo|Kargo: kraken@kargo.com
bidwave|Bidwave: prebid@bidwave.net
ocm|Ocm: devs-subs@orangeclickmedia.com
437 changes: 437 additions & 0 deletions src/main/java/org/prebid/server/bidder/ocm/OcmBidder.java

Large diffs are not rendered by default.

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")

Copy link
Copy Markdown
Collaborator

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.

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;
}
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();
}
}
34 changes: 34 additions & 0 deletions src/main/resources/bidder-config/ocm.yaml
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'
27 changes: 27 additions & 0 deletions src/main/resources/static/bidder-params/ocm.json
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"
]
}
Loading