Skip to content

Support publisher_domains[] compact form in publisher_properties selectors (adcp#4504) #5

Description

@bokelley

Background

adcp#4504 adds a compact form to publisher_properties[] selectors in adagents.json for managed-network scale:

{
  "authorization_type": "publisher_properties",
  "publisher_properties": [{
    "publisher_domains": ["site1.example", "site2.example", "site3.example"],
    "selection_type": "by_tag",
    "property_tags": ["managed_network"]
  }]
}

Each publisher_properties[] entry now accepts either publisher_domain (singular string, existing) or publisher_domains (plural array, new), mutually exclusive. Semantics: the plural form is exactly equivalent to repeating the entry once per listed domain.

The spec PR also extends the managerdomain fallback safety rule so that every domain in publisher_domains[] counts as explicit scoping for that publisher.

Work for this SDK

Anywhere this codebase resolves or indexes publisher_properties[*].publisher_domain, it MUST also resolve publisher_properties[*].publisher_domains[] as the same selector fanned out per listed domain. Specifically:

  1. Parse / type model: accept either publisher_domain or publisher_domains on each publisher_properties[] entry. Reject entries that have both or neither (mirror the JSON Schema XOR).
  2. Authorization index / lookup: when building per-publisher indices from an adagents.json, an entry with publisher_domains: [a, b, c] contributes the same selector predicate under all three publisher keys.
  3. managerdomain fallback validation: explicit-publisher-scoping checks must succeed when the source publisher domain appears anywhere in publisher_properties[].publisher_domain or publisher_properties[].publisher_domains[]. The fallback rule MUST still fail closed when the source publisher only appears under top-level properties[] or is reached by resolving a top-level property_tags selector through properties[].
  4. Tests: add coverage for the compact form (single entry → N publisher matches) and for the XOR validation (both fields present, neither present).

Not in scope

Round-tripping: SDKs MAY choose to preserve the compact form on read/write or normalize to singular. Either is conformant. Recommend preserve-as-authored for diff stability.

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions