using Microsoft.AspNetCore.Mvc; using w4c_workflows.Filters; using w4c_workflows.Services.Execution; namespace w4c_workflows.Controllers; /// /// The runtime registry surface: which execution languages are available on the /// worker host. Authenticates with the tenant operator key like the rest of the /// control plane. /// [ApiController] [Route("api/languages")] public class RuntimesController : ControllerBase { private readonly RuntimeRegistry _runtimes; public RuntimesController(RuntimeRegistry runtimes) { _runtimes = runtimes; } [HttpGet] [RequireScope("read")] public IActionResult List() => Ok(_runtimes.All.Select(r => new { r.Id, r.DisplayName, r.DefaultFunction, r.Extension, r.Available, })); }