Type alias AllowRead<Context, AuthContext>

AllowRead<Context, AuthContext>: ((readRequest) => boolean)

Type Parameters

Type declaration

    • (readRequest): boolean
    • allowRead will be called for every read request sent to an instance of the machine you are exposing.

      If allowRead returns true, the request will be permitted. Otherwise, the request will be rejected with a 403 status and { code: "denied-by-machine-definition" }.

      allowRead must be exported from your machine definition file.

      Use AllowRead<Context, AuthContext> to specify the shape of your machine's context and the expected shape of the authContext you will provide.

      Parameters

      Returns boolean

Generated using TypeDoc