ores.http.assets

Table of Contents

1. Diagram

ores.http.assets component diagram

Figure 1: ores.http.assets

2. Summary

ores.http.assets is the adapter part that projects the assets domain onto the HTTP server's REST surface. It holds the generated route units for the assets models that opt in, and each unit owns one route per derived verb.

Assets' models opt in through the :ores.cpp.http-route.enabled: property in their own model drawer, so a model that needs no route can leave the facet off. The units speak the canonical protocol over NATS and hold no service, repository or database context: the assets service stays the only place that decides, and the caller's own token travels with every forwarded request.

The part declares #+component_kind: adapter. Its CMakeLists.txt files are hand-authored, because the link libraries belong to the HTTP surface rather than to the domain, and codegen writes only the two component_files.cmake lists. A regeneration therefore never writes over the build.

The units are output of the ores.cpp.http-route facet, which is opt-in per model. The facet writes here because the part is named after the domain the units project, which is the fractal naming rule in Component architecture.

3. Inputs

  • HTTP requests on the /api/v1/assets/... paths the units register.
  • The caller's bearer token, forwarded to the service on every NATS request.
  • The connected NATS client the hand-written per-component aggregator passes to register_routes.
  • The assets models under projects/ores.assets/modeling/ whose drawers opt in to the ores.cpp.http-route facet.

4. Outputs

  • One route unit per opted-in model, at src/routes/assets/<unit>_routes.cpp and include/ores.http/routes/assets/<unit>_routes.hpp.
  • The routes and their OpenAPI schemas, registered on the router and the endpoint registry.
  • NATS request messages to the assets service, one per route.

5. Entry points

  • include/ores.http/routes/assets/ – the generated unit headers.
  • src/routes/assets/ – the generated unit implementations.
  • image_routes, image_tag_routes and tag_routes – the unit-level entries the host calls to install each entity's routes.

6. Dependencies

  • ores.http.api – the router, the route builder, the OpenAPI registry and the request/response types.
  • ores.nats – NATS transport for service calls.
  • ores.assets.api – the canonical protocol messages the units send.
  • ores.utility – the codecs and the wire support types.
  • ores.logging – logger factory.

7. See also

target_link_libraries(${lib_target_name}
    PUBLIC
        ores.http.api.lib
        ores.nats.lib
        ores.logging.lib
    PRIVATE
        ores.assets.api.lib
        ores.utility.lib)
target_link_libraries(${tests_target_name}
    PRIVATE
        ${lib_target_name}
        ores.testing.lib
        Catch2::Catch2
        ores.openssl_cleanup
        Threads::Threads)

Emacs 29.3 (Org mode 9.6.15)