NAME
ttypt/axil-hyle.h - Generic Axil-Hyle HTTP bridge.
SYNOPSIS
Data Structures
Context describing one requested partition change.
One parameter-name alias for a schema field.
Declarative specification for partition sub-resource routes.
Typedefs
Per-item read authorization filter for dataset API routes.
Callback invoked after a partition change executes.
Pluggable authorization callback for a request.
Functions
Mount the standard Axil-Hyle REST CRUD routes (/api/dataset/...).
Register (or clear with NULL) the per-item read filter callback.
Execute a partition sub-resource action (no route registration).
Mount standard sub-resource routes for a partition spec.
Detailed Description
Generic Axil-Hyle HTTP bridge.
Mounts standard REST CRUD endpoints (/api/dataset/...) for any Axil web application. Framework-neutral: serves JSON only, with pluggable partition routes for parent/child datasets.
Typedef Documentation
typedef int(* axil_hyle_access_check_fn) (int fd, const char *module, const char *parent_id, const char *username, void *user_data)
Pluggable authorization callback for a request.
Parameters
fd Client fd.
module Entity module name.
parent_id Parent item key.
username Authenticated username.
user_data Caller data.
Returns
Non-zero to allow, zero to deny.
typedef int(* axil_hyle_item_read_filter_fn) (int fd, const char *dataset_id, const char *items_path, const char *item_id, const char *username, void *user_data)
Per-item read authorization filter for dataset API routes. When registered via axil_hyle_set_item_read_filter(), invoked for each item returned by GET /api/dataset/:dataset_id and GET /api/dataset/:dataset_id/:key.
Parameters
fd Client fd.
dataset_id Dataset identifier, e.g. "software.items".
items_path Filesystem base path for the dataset, or NULL.
item_id Item key.
username Authenticated username, or empty string if anonymous.
user_data Opaque pointer passed at registration time.
Returns
Non-zero to allow read access, zero to hide/deny the item.
typedef int(* axil_hyle_partition_change_fn) (const axil_hyle_partition_change_ctx_t *ctx)
Callback invoked after a partition change executes.
Parameters
ctx Change context.
Returns
0 on success, non-zero to signal failure.
Function Documentation
int axil_hyle_partition_execute (int fd, char * body, const char * action, const axil_hyle_partition_routes_spec_t * spec, const char * parent_id)
Execute a partition sub-resource action (no route registration).
Parameters
fd Client fd.
body Request body.
action Action slug ("add", "remove", "replace", "update").
spec Partition routes specification.
parent_id Parent item key.
Returns
0 on success, negative on failure.
int axil_hyle_register_partition_routes (const axil_hyle_partition_routes_spec_t * spec)
Mount standard sub-resource routes for a partition spec.
Parameters
spec Partition routes specification.
Returns
0 on success, negative on failure.
void axil_hyle_set_item_read_filter (axil_hyle_item_read_filter_fn fn, void * user_data)
Register (or clear with NULL) the per-item read filter callback.
Parameters
fn Filter callback, or NULL to disable filtering.
user_data Opaque user pointer forwarded to fn.
Author
Generated automatically by Doxygen for axil-hyle from the source code.