You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/application-settings.md
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ There are two ways to configure application settings: database and file. This do
12
12
-`auction.truncate-target-attr` - Maximum targeting attributes size. Values between 1 and 255.
13
13
-`auction.default-integration` - Default integration to assume.
14
14
-`auction.debug-allow` - enables debug output in the auction response. Default `true`.
15
+
-`auction.impression-limit` - a max number of impressions allowed for the auction, impressions that exceed this limit will be dropped, 0 means no limit.
15
16
-`auction.bid-validations.banner-creative-max-size` - Overrides creative max size validation for banners. Valid values
16
17
are:
17
18
- "skip": don't do anything about creative max size for this publisher
@@ -25,6 +26,11 @@ There are two ways to configure application settings: database and file. This do
25
26
-`auction.bidadjustments.mediatype.*.*.*[].value` - value of the bid adjustment
26
27
-`auction.bidadjustments.mediatype.*.*.*[].currency` - currency of the bid adjustment
27
28
-`auction.events.enabled` - enables events for account if true
-**down** - rounding down to the lower price bucket
31
+
-**up** - rounding up to the higher price bucket
32
+
-**timesplit** - 50% of the time rounding down to the lower PB and 50% of the time rounding up to the higher price bucket
33
+
-**true** - if the price >= 50% of the range, rounding up to the higher price bucket, otherwise rounding down
28
34
-`auction.price-floors.enabled` - enables price floors for account if true. Defaults to true.
29
35
-`auction.price-floors.fetch.enabled`- enables data fetch for price floors for account if true. Defaults to false.
30
36
-`auction.price-floors.fetch.url` - url to fetch price floors data from.
@@ -50,6 +56,7 @@ Keep in mind following restrictions:
50
56
-`auction.preferredmediatype.<bidder>.<media-type>` - <media-type> that will be left for <bidder> that doesn't support multi-format. Other media types will be removed. Acceptable values: `banner`, `video`, `audio`, `native`.
51
57
-`auction.privacysandbox.cookiedeprecation.enabled` - boolean that turns on setting and reading of the Chrome Privacy Sandbox testing label header. Defaults to false.
52
58
-`auction.privacysandbox.cookiedeprecation.ttlsec` - if the above setting is true, how long to set the receive-cookie-deprecation cookie's expiration
59
+
-`auction.cache.enabled` - enables bids caching for account if true. Defaults to true.
53
60
-`privacy.gdpr.enabled` - enables gdpr verifications if true. Has higher priority than configuration in
54
61
application.yaml.
55
62
-`privacy.gdpr.eea-countries` - overrides the host-level list of 2-letter country codes where TCF processing is applied
@@ -277,8 +284,8 @@ The general idea is that you'll place all the account-specific settings in a sep
region: <region name> # if not provided AWS_GLOBAL will be used. Example value: 'eu-central-1'
@@ -298,6 +305,14 @@ settings:
298
305
timeout: 5000
299
306
```
300
307
308
+
If `accessKeyId` and `secretAccessKey` are not specified in the Prebid Server configuration then AWS credentials will be looked up in this order:
309
+
- Java System Properties - `aws.accessKeyId` and `aws.secretAccessKey`
310
+
- Environment Variables - `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
311
+
- Web Identity Token credentials from system properties or environment variables
312
+
- Credential profiles file at the default location (`~/.aws/credentials`) shared by all AWS SDKs and the AWS CLI
313
+
- Credentials delivered through the Amazon EC2 container service if "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" environment variable is set and security manager has permission to access the variable,
314
+
- Instance profile credentials delivered through the Amazon EC2 metadata service
315
+
301
316
### File format
302
317
303
318
We recommend using the `json` format for your account configuration. A minimal configuration may look like this.
Copy file name to clipboardExpand all lines: docs/config-app.md
+24-3Lines changed: 24 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ This section can be extended against standard [Spring configuration](https://doc
14
14
This parameter exists to allow to change the location of the directory Vert.x will create because it will and there is no way to make it not.
15
15
-`vertx.init-timeout-ms` - time to wait for asynchronous initialization steps completion before considering them stuck. When exceeded - exception is thrown and Prebid Server stops.
16
16
-`vertx.enable-per-client-endpoint-metrics` - enables HTTP client metrics per destination endpoint (`host:port`)
17
+
-`vertx.round-robin-inet-address` - enables round-robin inet address selection of the ip address to use
17
18
18
19
## Server
19
20
-`server.max-headers-size` - set the maximum length of all headers.
@@ -96,6 +97,7 @@ Removes and downloads file again if depending service cant process probably corr
96
97
-`auction.cache.expected-request-time-ms` - approximate value in milliseconds for Cache Service interacting.
97
98
-`auction.cache.only-winning-bids` - if equals to `true` only the winning bids would be cached. Has lower priority than request-specific flags.
98
99
-`auction.generate-bid-id` - whether to generate seatbid[].bid[].ext.prebid.bidid in the OpenRTB response.
100
+
-`auction.enforce-random-bid-id` - whether to enforce generating a robust random seatbid[].bid[].id in the OpenRTB response if the initial value is less than 17 characters.
99
101
-`auction.validations.banner-creative-max-size` - enables creative max size validation for banners. Possible values: `skip`, `enforce`, `warn`. Default is `skip`.
100
102
-`auction.validations.secure-markup` - enables secure markup validation. Possible values: `skip`, `enforce`, `warn`. Default is `skip`.
101
103
-`auction.host-schain-node` - defines global schain node that will be appended to `request.source.ext.schain.nodes` passed to bidders
@@ -283,8 +285,12 @@ For `JVM` metrics
283
285
-`cache.scheme` - set the external Cache Service protocol: `http`, `https`, etc.
284
286
-`cache.host` - set the external Cache Service destination in format `host:port`.
285
287
-`cache.path` - set the external Cache Service path, for example `/cache`.
288
+
-`cache.internal.scheme` - set the internal Cache Service protocol: `http`, `https`, etc., the internal scheme get priority over the external one when provided.
289
+
-`cache.internal.host` - set the internal Cache Service destination in format `host:port`, the internal port get priority over the external one when provided.
290
+
-`cache.internal.path` - set the internal Cache Service path, for example `/cache`, the internal path get priority over the external one when provided.
286
291
-`storage.pbc.enabled` - If set to true, this will allow storing modules’ data in third-party storage.
287
292
-`storage.pbc.path` - set the external Cache Service path for module caching, for example `/pbc-storage`.
293
+
-`cache.api-key-secured` - if set to `true`, will cause Prebid Server to add a special API key header to Prebid Cache requests.
288
294
-`pbc.api.key` - set the external Cache Service api key for secured calls.
289
295
-`cache.query` - appends to the cache path as query string params (used for legacy Auction requests).
290
296
-`cache.banner-ttl-seconds` - how long (in seconds) banner will be available via the external Cache Service.
-`cache.account.<ACCOUNT>.video-ttl-seconds` - how long (in seconds) video creative will be available in Cache Service
295
301
for particular publisher account. Overrides `cache.video-ttl-seconds` property.
296
302
-`cache.default-ttl-seconds.{banner, video, audio, native}` - a default value how long (in seconds) a creative of the specific type will be available in Cache Service
303
+
-`cache.append-trace-info-to-cache-id` - if set to `true`, causes the addition account ID and datacenter to cache UUID: _ACCOUNT-DATACENTER-remainderOfUUID_. Implies that cache UUID will be generated by the Prebid Server.
297
304
298
305
## Application settings (account configuration, stored ad unit configurations, stored requests)
299
306
Preconfigured application settings can be obtained from multiple data sources consequently:
@@ -303,6 +310,10 @@ Preconfigured application settings can be obtained from multiple data sources co
303
310
304
311
Warning! Application will not start in case of no one data source is defined and you'll get an exception in logs.
305
312
313
+
For requests validation mode available next options:
314
+
-`settings.fail-on-unknown-bidders` - fail with validation error or just make warning for unknown bidders.
315
+
-`settings.fail-on-disabled-bidders` - fail with validation error or just make warning for disabled bidders.
316
+
306
317
For filesystem data source available next options:
307
318
-`settings.filesystem.settings-filename` - location of file settings.
308
319
-`settings.filesystem.stored-requests-dir` - directory with stored requests.
@@ -335,9 +346,10 @@ For HTTP data source available next options:
335
346
-`settings.http.amp-endpoint` - the url to fetch AMP stored requests.
336
347
-`settings.http.video-endpoint` - the url to fetch video stored requests.
337
348
-`settings.http.category-endpoint` - the url to fetch categories for long form video.
349
+
-`settings.http.rfc3986-compatible` - if equals to `true` the url will be build according to RFC 3986, `false` by default
338
350
339
351
For account processing rules available next options:
340
-
-`settings.enforce-valid-account` - if equals to `true` then request without account id will be rejected with 401.
352
+
-`settings.enforce-valid-account` - if equals to `true` then request without account id will be rejection with 401.
341
353
-`settings.generate-storedrequest-bidrequest-id` - overrides `bidrequest.id` in amp or app stored request with generated UUID if true. Default value is false. This flag can be overridden by setting `bidrequest.id` as `{{UUID}}` placeholder directly in stored request.
342
354
343
355
It is possible to specify default account configuration values that will be assumed if account config have them
@@ -384,8 +396,8 @@ contain 'WHERE last_updated > ?' for MySQL and 'WHERE last_updated > $1' for Pos
384
396
385
397
For S3 storage configuration
386
398
- `settings.in-memory-cache.s3-update.refresh-rate`- refresh period in ms for stored request updates in S3
387
-
- `settings.s3.access-key-id`- an access key
388
-
- `settings.s3.secret-access-key`- a secret access key
399
+
- `settings.s3.access-key-id`- an access key (optional)
400
+
- `settings.s3.secret-access-key`- a secret access key (optional)
389
401
- `settings.s3.region`- a region, AWS_GLOBAL by default
390
402
- `settings.s3.endpoint`- an endpoint
391
403
- `settings.s3.bucket`- a bucket name
@@ -395,6 +407,15 @@ For S3 storage configuration
395
407
- `settings.s3.stored-requests-dir`- a directory with stored requests
396
408
- `settings.s3.stored-responses-dir`- a directory with stored responses
397
409
410
+
If `settings.s3.access-key-id` and `settings.s3.secret-access-key` are not specified in the Prebid Server configuration then AWS credentials will be looked up in this order:
411
+
- Java System Properties - `aws.accessKeyId` and `aws.secretAccessKey`
412
+
- Environment Variables - `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
413
+
- Web Identity Token credentials from system properties or environment variables
414
+
- Credential profiles file at the default location (`~/.aws/credentials`) shared by all AWS SDKs and the AWS CLI
415
+
- Credentials delivered through the Amazon EC2 container service if "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" environment variable is set and security manager has permission to access the variable,
416
+
- Instance profile credentials delivered through the Amazon EC2 metadata service
417
+
418
+
398
419
For targeting available next options:
399
420
- `settings.targeting.truncate-attr-chars`- set the max length for names of targeting keywords (0 means no truncation).
First, thank you for taking on the migration of an adapter from Go to Java. But really the best way to think of it is not as straight port. Instead, we recommend treat this task as a re-implementation. It will take a few adapters before you fully get the hang of it, and that's okay—everyone goes through a learning curve.
6
+
7
+
Keep in mind that the PBS-Go team is more lenient about what they allow in adapters compared to the PBS-Java team.
8
+
9
+
## Pull Request Requirements
10
+
11
+
We would appreciate it if your porting PR title follows these patterns:
12
+
13
+
-`Port <adapter_name>: New Adapter` – For porting a completely new adapter to the project (e.g., `Port Kobler: New Adapter`).
14
+
-`Port <adapter_name>: <update_description>` – For porting a specific update to an existing adapter (e.g., `Port OpenX: Native Support`).
15
+
-`Port <alias_name>: New alias for <adapter_name>` – For porting an alias of an existing adapter to the project (e.g., `Port Artechnology: New alias of StartHub`).
16
+
17
+
Additionally, we kindly ask that you:
18
+
19
+
- Link any existing GitHub issues that your PR resolves. This ensures the issue will be automatically closed when your PR is merged.
20
+
- Add the label `do not port` to your PR.
21
+
22
+
## Porting Requirements
23
+
24
+
1.**Feature Parity**: A Java adapter should have the same functionality as the Go adapter.
25
+
2.**Java Adapter Code Should:**
26
+
- Follow the code style of the PBS-Java repository (see [the code style page](code-style.md)).
27
+
- Be well-written Java code: clear, readable, optimized, and following best practices.
28
+
- Maintain a structure similar to existing adapters (see below).
29
+
3.**The adapter should be covered with tests:**
30
+
- Unit tests for implementation details.
31
+
- A simple integration test to ensure the adapter is reachable, can send requests to the bidder, and that its configuration works.
32
+
33
+
### What does "having a similar structure to existing adapters" mean?
34
+
35
+
The PBS-Java codebase has evolved over time. While existing adapters may not be perfect and could contain legacy issues (e.g., using outdated Java syntax), they still serve as a valuable reference for learning, inspiration, and even reuse.
36
+
37
+
Each adapter is unique, but most share common patterns. For example, nearly every adapter includes:
- Collects errors encountered during `imp` processing.
44
+
- Prepares outgoing request(s):
45
+
- Constructs headers.
46
+
- Builds the request URL.
47
+
- Modifies the incoming bid request based on the updated `imps`.
48
+
49
+
2.**A `makeBids(...)` method**
50
+
- Parses the `BidResponse`.
51
+
- Iterates over `seatBids` and `bids`.
52
+
- Creates a list of `BidderBid` objects.
53
+
54
+
### Ensuring Structural Consistency
55
+
56
+
To maintain consistency across adapters:
57
+
- Fit the Go adapter functionality into the Java adapter structure.
58
+
- Use the same or similar method and variable names where applicable.
59
+
- Reuse existing solutions for common functionality (e.g., use `BidderUtil`, `HttpUtil` classes).
60
+
- Ensure unit tests follow a similar structure, with comparable test cases and code patterns.
61
+
62
+
## Specific Rules and Tips for Porting
63
+
64
+
1. Begin by determining how the Go adapter's functionality fits into the Java adapter structure.
65
+
2. Go adapters deserialize JSON objects in-place, while Java adapters work with pre-deserialized objects. As a result, many errors thrown in the Go version do not apply in Java.
66
+
3.**No hardcoded URLs.** If an adapter has a "test URL," it must be defined in the YAML file. See `org.prebid.server.spring.config.bidder.NextMillenniumConfiguration.NextMillenniumConfigurationProperties` for an example of how to handle special YAML entries.
67
+
4. The structure of Go and Java bidder configuration files differs—do not copy and paste directly. Pay attention to details such as macros in the endpoint and redirect/iframe URLs.
68
+
5.**Prohibited in bidder adapters:**
69
+
- Blocking code.
70
+
- Fully dynamic hostnames in URLs.
71
+
- Non-thread-safe code (bidder adapters should not store state internally).
72
+
6. If an adapter has no special logic, consider using an alias to `Generic` instead. In this case, there will still need to be an integration test for this bidder. e.g. `src/test/java/org/prebid/server/it/BidderNameTest.java`
0 commit comments