Skip to main content

Module def

Module def 

Source
Expand description

Traits defining Lexe’s various APIs.

§API Definitions

This module, as closely as possible, defines the various APIs exposed by different services to different clients. Although we do not have compile-time guarantees that the services exposed exactly match the definitions below, it is straightforward to compare the Axum routers and handlers with the definitions below to ensure consistency.

§Guidelines

All API requests and responses should return structs for upgradeability, e.g. UserPkStruct instead of UserPk.

If an API method takes or returns nothing, make the type Empty and NOT () (unit type). Using () makes it impossible to add optional fields in a backwards-compatible way.

Each endpoint should be documented with:

    1. HTTP method e.g. GET
    1. Endpoint e.g. /v1/file
    1. Data used to make the request e.g. VfsFileId
    1. The return type e.g. MaybeVfsFile

The methods below should resemble the data actually sent across the wire.

Traits§

AppBackendApi
Defines the api that the backend exposes to the app (via the gateway).
AppGatewayApi
Defines the api that the gateway directly exposes to the app.
AppNodeProvisionApi
Defines the api that the node exposes to the app during provisioning.
AppNodeRunApi
Defines the api that the node exposes to the app during normal operation.
BearerAuthBackendApi
The bearer auth API exposed by the backend (sometimes via the gateway) to various consumers. This trait is defined separately from the usual ConsumerServiceApi traits because BearerAuthenticator needs to abstract over a generic implementor of BearerAuthBackendApi.
LexeMegaApi
Defines the API the mega node exposes to the Lexe operators.
LexeNodeRunApi
Defines the API the node exposes to the Lexe operators at run time.
MegaRunnerApi
Defines the API the runner exposes to mega nodes.
NodeBackendApi
Defines the api that the backend exposes to the node.
NodeLspApi
Defines the api that the LSP exposes to user nodes.
NodeRunnerApi
Defines the api that the runner exposes to the user node.
PublicGatewayApi
Defines the api that the gateway exposes to the internet.