SelectoComponents.QueryContract.ChoiceSource.Plug (selecto_components v0.4.8)

Plug endpoint for Selecto choice-source option and membership requests.

Host applications mount this plug under a choice-source collection path and provide a domain plus resolver functions. The plug serves:

  • GET /:choice_source/options
  • POST /:choice_source/validate

The domain may be supplied directly with :domain or lazily with :resolver. Option and membership lookups use :options_resolver and :membership_resolver, each receiving the corresponding Selecto.Domain.Choices request struct.

Use :scope_resolver when option or membership requests need server-owned actor, tenant, record, context, metadata, or Domain-of-Interest filter constraints. The resolver receives the current Plug.Conn and must derive scope from authenticated assigns/session data, not from untrusted query parameters.