• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

prebid / Prebid.js / 19176070562

07 Nov 2025 05:26PM UTC coverage: 96.231% (+0.003%) from 96.228%
19176070562

push

github

web-flow
Adagio Bid Adapter: enable gzip compression (#14110)

* AdagioBidAdapter: add endpoint "orgid" query param

* AdagioBidAdapter: enable gzip compression

52862 of 64751 branches covered (81.64%)

9 of 9 new or added lines in 1 file covered. (100.0%)

11 existing lines in 7 files now uncovered.

202066 of 209980 relevant lines covered (96.23%)

124.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.15
/libraries/objectGuard/ortbGuard.js
1
import {isActivityAllowed} from '../../src/activities/rules.js';
2
import {ACTIVITY_ENRICH_EIDS, ACTIVITY_ENRICH_UFPD} from '../../src/activities/activities.js';
3
import {
4
  appliesWhenActivityDenied,
5
  ortb2TransmitRules,
6
  ORTB_EIDS_PATHS,
7
  ORTB_UFPD_PATHS
8
} from '../../src/activities/redactor.js';
9
import {objectGuard, writeProtectRule} from './objectGuard.js';
10
import {logError} from '../../src/utils.js';
11

12
function ortb2EnrichRules(isAllowed = isActivityAllowed) {
52!
13
  return [
52✔
14
    {
15
      name: ACTIVITY_ENRICH_EIDS,
16
      paths: ORTB_EIDS_PATHS,
17
      applies: appliesWhenActivityDenied(ACTIVITY_ENRICH_EIDS, isAllowed)
18
    },
19
    {
20
      name: ACTIVITY_ENRICH_UFPD,
21
      paths: ORTB_UFPD_PATHS,
22
      applies: appliesWhenActivityDenied(ACTIVITY_ENRICH_UFPD, isAllowed)
23
    }
24
  ].map(writeProtectRule)
25
}
26

27
export function ortb2GuardFactory(isAllowed = isActivityAllowed) {
52✔
28
  return objectGuard(ortb2TransmitRules(isAllowed).concat(ortb2EnrichRules(isAllowed)));
52✔
29
}
30

31
/*
32
 * Get a guard for an ORTB object. Read access is restricted in the same way it'd be redacted (see activites/redactor.js);
33
 * and writes are checked against the enrich* activites.
34
 *
35
 */
36
export const ortb2Guard = ortb2GuardFactory();
4✔
37

38
export function ortb2FragmentsGuardFactory(guardOrtb2 = ortb2Guard) {
7✔
39
  return function guardOrtb2Fragments(fragments, params) {
7✔
40
    fragments.global = fragments.global || {};
9✔
41
    fragments.bidder = fragments.bidder || {};
9✔
42
    const guard = {
9✔
43
      global: guardOrtb2(fragments.global, params),
44
      bidder: new Proxy(fragments.bidder, {
45
        get(target, prop, receiver) {
46
          let bidderData = Reflect.get(target, prop, receiver);
1✔
47
          if (bidderData != null) {
1✔
48
            bidderData = guardOrtb2(bidderData, params)
1✔
49
          }
50
          return bidderData;
1✔
51
        },
52
        set(target, prop, newValue, receiver) {
53
          if (newValue == null || typeof newValue !== 'object') {
1!
UNCOV
54
            logError(`ortb2Fragments.bidder[bidderCode] must be an object`);
×
55
          }
56
          let bidderData = Reflect.get(target, prop, receiver);
1✔
57
          if (bidderData == null) {
1✔
58
            bidderData = target[prop] = {};
1✔
59
          }
60
          bidderData = guardOrtb2(bidderData, params);
1✔
61
          Object.entries(newValue).forEach(([prop, value]) => {
2✔
62
            bidderData[prop] = value;
2✔
63
          })
64
          return true;
1✔
65
        }
66
      })
67
    };
68

69
    return Object.defineProperties(
9✔
70
      {},
71
      Object.fromEntries(
72
        // disallow overwriting of the top level `global` / `bidder`
73
        Object.entries(guard).map(([prop, obj]) => [prop, {get: () => obj}])
18✔
74
      )
75
    )
76
  }
77
}
78

79
/**
80
 * Get a guard for an ortb2Fragments object.
81
 */
82
export const guardOrtb2Fragments = ortb2FragmentsGuardFactory();
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc