Skip to content

Configuration

Mocktioneer is configured through edgezero.toml, which is compiled into every adapter binary. This manifest-driven approach ensures consistent behavior across all platforms.

Configuration File

The edgezero.toml file lives at the root of the mocktioneer workspace:

toml
[app]
name = "mocktioneer"
entry = "crates/mocktioneer-core"
middleware = [
  "edgezero_core::middleware::RequestLogger",
  "mocktioneer_core::routes::Cors"
]

App Section

The [app] section defines the core application:

FieldDescription
nameApplication identifier
entryPath to the core crate
middlewareList of middleware to apply to all routes

HTTP Triggers

Routes are defined as [[triggers.http]] blocks:

toml
[[triggers.http]]
id = "openrtb_auction"
path = "/openrtb2/auction"
methods = ["POST"]
handler = "mocktioneer_core::routes::handle_openrtb_auction"
adapters = ["axum", "cloudflare", "fastly"]
FieldDescription
idUnique route identifier
pathURL path (supports {param} placeholders)
methodsHTTP methods to accept
handlerRust function path
adaptersWhich adapters support this route

Available Routes

PathMethodsHandlerDescription
/GEThandle_rootService info page
/openrtb2/auctionPOSThandle_openrtb_auctionOpenRTB 2.x bid request
/e/dtb/bidPOSThandle_aps_bidAPS TAM bid request
/static/img/{size}GEThandle_static_imgSVG creative image
/static/creatives/{size}GEThandle_static_creativesHTML creative wrapper
/clickGEThandle_clickClick landing page
/pixelGEThandle_pixelTracking pixel
/aps/winGEThandle_aps_winAPS win notification
/adserver/mediatePOSThandle_adserver_mediateAuction mediation
/_/sizesGEThandle_sizesSupported sizes as JSON
/sync/startGEThandle_sync_startEC pixel sync initiation
/sync/doneGEThandle_sync_doneEC pixel sync callback
/resolveGEThandle_resolveEC pull sync resolution

All routes also have OPTIONS handlers for CORS preflight.

Adapter Configuration

Each adapter has its own configuration section:

Axum Adapter

toml
[adapters.axum.adapter]
crate = "crates/mocktioneer-adapter-axum"
manifest = "crates/mocktioneer-adapter-axum/axum.toml"

[adapters.axum.build]
target = "native"
profile = "dev"

[adapters.axum.commands]
build = "cargo build -p mocktioneer-adapter-axum"
serve = "cargo run -p mocktioneer-adapter-axum"
deploy = "# configure deployment for Axum"

[adapters.axum.logging]
level = "info"
echo_stdout = true

Fastly Adapter

toml
[adapters.fastly.adapter]
crate = "crates/mocktioneer-adapter-fastly"
manifest = "crates/mocktioneer-adapter-fastly/fastly.toml"

[adapters.fastly.build]
target = "wasm32-wasip1"
profile = "release"
features = ["fastly"]

[adapters.fastly.commands]
build = "cargo build --release --target wasm32-wasip1 -p mocktioneer-adapter-fastly"
serve = "fastly compute serve -C crates/mocktioneer-adapter-fastly"
deploy = "fastly compute deploy -C crates/mocktioneer-adapter-fastly"

[adapters.fastly.logging]
endpoint = "mocktioneerlog"
level = "info"
echo_stdout = false

Cloudflare Adapter

toml
[adapters.cloudflare.adapter]
crate = "crates/mocktioneer-adapter-cloudflare"
manifest = "crates/mocktioneer-adapter-cloudflare/wrangler.toml"

[adapters.cloudflare.build]
target = "wasm32-unknown-unknown"
profile = "release"
features = ["cloudflare"]

[adapters.cloudflare.commands]
build = "cargo build --release --target wasm32-unknown-unknown -p mocktioneer-adapter-cloudflare"
serve = "wrangler dev --config crates/mocktioneer-adapter-cloudflare/wrangler.toml"
deploy = "wrangler publish --config crates/mocktioneer-adapter-cloudflare/wrangler.toml"

[adapters.cloudflare.logging]
level = "info"
echo_stdout = true

Logging Configuration

FieldDescription
endpointLog endpoint name (Fastly-specific)
levelLog level: trace, debug, info, warn, error
echo_stdoutWhether to print logs to stdout

Environment Variables

Mocktioneer reads these optional environment variables at runtime for Edge Cookie sync configuration:

VariableDescriptionDefault
MOCKTIONEER_TS_DOMAINSComma-separated allowlist of trusted-server hostnames for /sync/startUnset (all syntactically valid domains allowed; demo/dev mode)
MOCKTIONEER_PULL_TOKENBearer token required for /resolve authenticationUnset (auth disabled); empty values fail closed
bash
# Example: restrict sync to specific trusted-server instances
export MOCKTIONEER_TS_DOMAINS="ts.publisher.com,ts.staging.publisher.com"
export MOCKTIONEER_PULL_TOKEN="<YOUR_PULL_TOKEN>"

Production Security

Set both MOCKTIONEER_TS_DOMAINS and a non-empty MOCKTIONEER_PULL_TOKEN for production-style deployments. On Cloudflare Workers, these values are currently read with std::env::var, so wrangler.toml bindings are not enforced by this core code path.

See the Trusted Server integration guide for full setup details.

Rebuilding After Changes

Since edgezero.toml is embedded at compile time via include_str!, you must rebuild the adapter after making changes:

bash
cargo build -p mocktioneer-adapter-axum

Environment-Specific Configuration

For adapter-specific settings not covered by edgezero.toml:

  • Axum: Edit crates/mocktioneer-adapter-axum/axum.toml
  • Fastly: Edit crates/mocktioneer-adapter-fastly/fastly.toml
  • Cloudflare: Edit crates/mocktioneer-adapter-cloudflare/wrangler.toml

Built with EdgeZero