Skip to content

bug/feat(pipes): WH_PIPES_DIR bootstrap can't declare allowed_roles/params (lands admin-only); inline empty default {{name:}} treated as required #363

Description

@EricAndrechek

Summary

Two related rough edges in the WH_PIPES_DIR file-bootstrap path for named pipes.

1. Bootstrapped pipes are stuck admin-only. A .sql file loaded from WH_PIPES_DIR becomes a pipe with empty allowed_roles → admin-only (internal/pipes/pipes.go: "empty = admin role only (fails closed)"), and the file can't declare allowed_roles or parameter definitions. So a file-bootstrapped public pipe can't actually be reached by a non-admin role — you must re-register it via PUT /v1/admin/pipes/{name} with roles+params. In practice WH_PIPES_DIR is only usable for admin-only, param-less pipes.

2. Inline empty default {{name:}} is treated as REQUIRED (bug). A pipe body with ... {{division:}} ... rejects a call that omits division (HTTP 400 "missing required param") instead of defaulting to empty string. Given {{name:default}} semantics, {{name:}} reads as "default = empty string", not "required". (e.g. scoreboard_public?day=1 400s because division has an empty inline default.)

Impact

WH_PIPES_DIR looks like a convenient GitOps way to ship a pipe library, but every pipe then needs a follow-up admin-API call to set roles + dodge the empty-default trap — so the bootstrap is effectively unusable for the common case (public pipes with optional params).

Suggested

  • Let the file-bootstrap declare allowed_roles + param defs — e.g. a sidecar <name>.json/.yaml, SQL frontmatter, or a pipes.manifest.json the loader reads.
  • Treat {{name:}} as an empty-string default, not a required param.

(Related to the tracked "bring named pipes under the main access-control policy" work. Found building the SCC 2026 tracker pilot; we ship a pipes.manifest.json + register via the admin API to work around both.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pipesNamed query pipesarea/policyAccess control policies (Hasura-style)bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions