Skip to content

[Feature]: ctx.contributions should say which extension contributed each value #753

Closed

Description

@jimhoyd

Problem or use case

HostContext.contributions(name) (packages/core/src/extensions.ts, collected in packages/core/src/host.ts) returns the bare contributes[name] values with no contributor identity. A receiver that keys contributions by namespace can only trust the namespace each contributor declares about itself. The new mail extension (templates contributed under a namespace by auth and forms) can therefore check only that namespaces are unique, not that auth.* templates actually came from auth; this is documented as a limitation in packages/mail/SECURITY.md. ui has the same shape for its template namespaces. Found during the extension architecture refactor; observed by reading, not exploited.

Proposed behavior and alternatives

  • contributions(name) returns { from: string; value: T }[], where from is the contributing extension name core stamps (like the principal provider stamp), so a receiver can require that a namespace equal its contributor's name.
  • Alternative: core namespaces each contribution itself. Heavier, and it makes core interpret contribution shapes.
    Owner is the only user, so no compatibility path is needed; ui and mail would adopt it in the same change.
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

    enhancementextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions