Skip to content

A crate holds the list of modules on every adapter's behalf #1334

Open

Description

@jwrosewell

One of the removals listed in #777.

What is wrong

crates/trusted-server-modules holds the list of the twenty stock module builders in hook order, from Prebid to the loading cache, and every adapter links the whole of it. It also holds the table ts audit reads to write entries, with every stock middleware's phase and media type, and the section and name each stock module is selected by. So a deployment that wants a different set of modules than the stock list edits a crate that is not its own, and a module's description of itself lives in a crate that is not the module's.

That crate is also where the stack's own modules sit under names that say nothing about who maintains them, being the mock ad server at crates/ad-server/mock, the seam probe at crates/testing/seam-probe and the ads.txt sellers at crates/ads-txt/sellers.

What changes

  • The list goes. Each adapter lists the builders it links in its own composition, as the Fastly adapter already lists its registered integrations, and a deployment that wants a different set links a different set. A deployment's own builders go after the adapter's through the adapter's own composition function.
  • Each module describes itself. The builder already carries the section and the module name a module is selected by. It gains the middleware the module supplies, with their phases and media types, so ts audit asks the builders it links and holds no table. Core's own rows, being the script proxy, robots.txt and the service version, come from core.
  • The stack's own modules take the stack's name. crates/ad-server/mock becomes crates/ad-server/iabtl, crates/testing/seam-probe becomes crates/testing/iabtl and crates/ads-txt/sellers becomes crates/ads-txt/iabtl, each with its maintainers named as every crate outside core names them.

Why

Nothing is shared by being listed. Every piece of functionality is its own crate under crates/<type>/<vendor>/, with iabtl as the vendor where the stack's own initial version has no vendor, and each adapter and each deployment names the crates it links itself. A module that describes its own middleware is the only place that description cannot drift from the code.

What breaks

A deployment that depended on trusted-server-modules for its list of builders names the crates it links instead, which is the same list written where it belongs. ts audit writes the same entries from the builders' own descriptions.

Where it is

A series on the stack, as a draft on the fork, jwrosewell#38, on top of the consent decoders series (fork pull request 37). The ts change and the three renames are commits of their own in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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