aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/include
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'sb/orch' of ssh://arn-wd-l1704:2222/ue-foundation/zen into sb/orchStefan Boberg2026-02-271-0/+79
|\
| * added Websocket client HttpWsClientStefan Boberg2026-02-271-0/+79
| | | | | | | | implemented in terms of asio
| * MeasureLatency now bails out quickly if it experiences a connection errorStefan Boberg2026-02-271-0/+3
| | | | | | | | previously it would stall some 40s in this case
* | Merge remote-tracking branch 'origin/main' into sb/orchStefan Boberg2026-02-271-0/+17
|\ \ | |/ |/|
| * MeasureLatency now bails out quickly if it experiences a connection error (#789)Stefan Boberg2026-02-271-0/+3
| | | | | | previously it would stall some 40s in this case
| * add support in http client to accept multi-range responses (#788)Dan Engelbrecht2026-02-271-0/+14
| | | | | | * add support in http client to accept multi-range responses
* | Merge remote-tracking branch 'origin/main' into sb/orchStefan Boberg2026-02-271-1/+2
|\|
| * adding HttpClient tests (#785)Stefan Boberg2026-02-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add comprehensive `HttpClient` test suite. Covers: - **HTTP verbs** -- GET, POST, PUT, DELETE, HEAD dispatch correctly - **GET/POST/PUT/Upload/Download** -- payload round-trips (IoBuffer, CbObject, CompositeBuffer), content types, large payloads, file-spill downloads - **Status codes** -- 2xx/4xx/5xx classification, exact code matching - **Response API** -- IsSuccess, AsText, AsObject, ToText, ErrorMessage, ThrowError - **Error handling** -- connection refused, request timeout, nonexistent endpoints - **Session management** -- default ID, SetSessionId, reset to zero - **Authentication** -- token provider, expired tokens, bearer verification - **Content type detection** -- text, JSON, binary, CbObject - **Request metadata** -- elapsed time, upload/download byte counts - **Retry logic** -- retry after transient 503s, no-retry baseline - **Latency measurement** -- MeasureLatency against live and unreachable servers - **KeyValueMap** -- construction from pairs, string_views, initializer lists - **Transport-level faults (GET)** -- connection reset/close before response, partial headers, truncated body, mid-body reset, stalled response timeout, retry after RST - **Transport-level faults (POST)** -- server reset/close before consuming body, mid-body reset, early 503 without consuming upload, stalled upload timeout, retry with large body after transient failures Also adds zenhttp-test to the xmake test runner (xmake test --run=http).
| * HttpService/Frontend improvements (#782)Stefan Boberg2026-02-251-0/+16
| | | | | | | | | | | | | | - zenhttp: added `GetServiceUri()`/`GetExternalHost()` - enables code to quickly generate an externally reachable URI for a given service - frontend: improved Uri handling (better defaults) - added support for 404 page (to make it easier to find a good URL)
* | httpasio websockets supportStefan Boberg2026-02-242-1/+67
| |
* | Merge branch 'main' into sb/orchStefan Boberg2026-02-241-0/+9
|\|
| * use partial blocks for oplog import (#780)Dan Engelbrecht2026-02-241-0/+9
| | | | | | | | | | Feature: Add --allow-partial-block-requests to zen oplog-import Improvement: zen oplog-import now uses partial block requests to reduce download size Improvement: Use latency to Cloud Storage host and Zen Cache host when calculating partial block requests
* | made it so HttpServer::GetServiceUri returns an IP instead of the machine ↵Stefan Boberg2026-02-231-2/+11
| | | | | | | | name, for better resolution
* | added HttpServer::GetServiceUriStefan Boberg2026-02-191-0/+7
| | | | | | | | intended to be used to get an externally accessible URI to a given service (or the root endpoint if `nullptr` is specified)
* | added `IsHttpOk` helper to check HTTP codes against OK-ish codesStefan Boberg2026-02-191-0/+7
|/
* add http server root password protection (#757)Dan Engelbrecht2026-02-173-28/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Feature: Added `--security-config-path` option to zenserver to configure security settings - Expects a path to a .json file - Default is an empty path resulting in no extra security settings and legacy behavior - Current support is a top level filter of incoming http requests restricted to the `password` type - `password` type will check the `Authorization` header and match it to the selected authorization strategy - Currently the security settings is very basic and configured to a fixed username+password at startup { "http" { "root": { "filter": { "type": "password", "config": { "password": { "username": "<username>", "password": "<password>" }, "protect-machine-local-requests": false, "unprotected-uris": [ "/health/", "/health/info", "/health/version" ] } } } } }
* misc fixes brought over from sb/proto (#759)Stefan Boberg2026-02-172-4/+17
| | | | | | | | * `RwLock::WithSharedLock` and `RwLock::WithExclusiveLock` can now return a value (which is returned by the passed function) * Comma-separated logger specification now correctly deals with commas * `GetSystemMetrics` properly accounts for cores * cpr response formatter passes arguments in the right order * `HttpServerRequest::SetLogRequest` can be used to selectively log HTTP requests
* add foundation for http password protection (#756)Dan Engelbrecht2026-02-131-0/+52
|
* add IHttpRequestFilter to allow server implementation to filter/reject ↵Dan Engelbrecht2026-02-131-4/+18
| | | | | requests (#753) * add IHttpRequestFilter to allow server implementation to filter/reject requests
* add IsLocalMachineRequest to HttpServerRequest (#749)Dan Engelbrecht2026-02-121-0/+2
| | | * add IsLocalMachineRequest to HttpServerRequest
* add simple http client tests (#751)Dan Engelbrecht2026-02-121-1/+3
| | | * add simple http client tests and fix run loop of http server to not rely on application quit
* remove ZENCORE_API completely (#718)Stefan Boberg2026-01-191-2/+2
| | | initially we had ZENCORE_API macros to potentially allow for DLL linkage. It turns out that this is not useful and the macros just contribute noise, so this change removes them completely.
* add otel instrumentation (#581)Stefan Boberg2025-12-111-2/+5
| | | | | | | | this change adds OTEL tracing to a few places * Top-level application lifecycle (config/init/cleanup, main loop) * http.sys requests it also brings some otlptrace optimizations and dynamic configuration of tracing. OTLP tracing is currently always disabled
* HTTP server API changes for improved extensibility (#684)Stefan Boberg2025-12-112-5/+37
| | | | * refactored `HttpServer` so all subclass member functions are proctected, to make it easier to extend base functionality * added API service, can be used to enumerate registered endpoints (at `/api`). Currently only very basic information is provided
* Add regex-free route matching support (#662)Stefan Boberg2025-11-241-33/+81
| | | | | This change adds support for non-regex matching of routes. Instead of using regex patterns you can associate matcher functions with pattern names and string literal components are identified and matched directly. Also implemented tests for `HttpRequestRouter` class.
* add `--boost-worker-memory` option to zen builds (#639)Dan Engelbrecht2025-11-101-5/+6
|
* add `--verbose-http` option to builds commands (#630)Dan Engelbrecht2025-11-041-0/+1
|
* Various fixes to address issues flagged by gcc / non-UE toolchain build (#621)Stefan Boberg2025-11-011-2/+14
| | | | | | | | | | | | | | | | | | | | * gcc: avoid using memset on nontrivial struct * redundant `return std::move` * fixed various compilation issues flagged by gcc * fix issue in xmake.lua detecting whether we are building with the UE toolchain or not * add GCC ignore -Wundef (comment is inaccurate) * remove redundant std::move * don't catch exceptions by value * unreferenced variables * initialize "by the book" instead of memset * remove unused exception reference * add #include <cstring> to fix gcc build * explicitly poulate KeyValueMap by traversing input spans fixes gcc compilation * remove unreferenced variable * eliminate redundant `std::move` which gcc complains about * fix gcc compilation by including <cstring> * tag unreferenced variable to fix gcc compilation * fixes for various cases of naming members the same as their type
* add support for OTLP logging/tracing (#599)Stefan Boberg2025-10-221-1/+1
| | | | | | | | - adds `zentelemetry` project which houses new functionality for serializing logs and traces in OpenTelemetry Protocol format (OTLP) - moved existing stats functionality from `zencore` to `zentelemetry` - adds `TRefCounted<T>` for vtable-less refcounting - adds `MemoryArena` class which allows for linear allocation of memory from chunks - adds `protozero` which is used to encode OTLP protobuf messages
* add ability to abort http requests (#586)Dan Engelbrecht2025-10-171-1/+3
| | | * add abort-check function to httpclient
* clean up http response formatters (#584)Dan Engelbrecht2025-10-162-47/+58
| | | * remove use of 'error:' in zen output which triggers Horde CI
* added Hidden option to oidctoken creation with oidc token exe (#556)Dan Engelbrecht2025-10-061-1/+2
|
* fix for RPC replay issue (wrong content-type) (#536)Stefan Boberg2025-10-021-0/+2
| | | | | likely fall-out from HttpClient refactor. The content type used to be explicit via headers but is now taken from the `IoBuffer` also fixed issue which meant the original request session ID would also not be propagated as intended
* HttpClient support for pluggable back-ends (#532)Stefan Boberg2025-09-301-12/+11
| | | refactored HttpClient to separate out cpr implementation into separate classes, with an abstract base class to allow plugging in multiple implementations in the future
* make cpr a HttpClient implementation detail (#517)Stefan Boberg2025-09-293-71/+114
| | | | | these changes remove cpr from anything which is not `HttpClient` internals. The goal is to eventually replace cpr with a more direct curl interface to eliminate cpr since it's proven problematic due to their development practices which frequently breaks APIs and prevents us from updating vcpkg. But this PR is limited to refactoring existing cpr code to use `HttpClient` instead.
* Added `--oidctoken-exe-unattended` to`zen builds` and `zen oplog-download` ↵Dan Engelbrecht2025-09-221-1/+2
| | | | command to use unattended mode when launching oidc-token.exe (#506)
* use new builds api for oplogs (#464)Dan Engelbrecht2025-08-121-0/+23
| | | | - Improvement: Refactored jupiter oplog export code to reuse builds jupiter wrapper classes - Improvement: If `zen builds`, `zen oplog-import` or `zen oplog-import` command fails due to a http error, the return code for the program will be set to the error/status code
* list build part content (#462)Dan Engelbrecht2025-08-111-1/+2
| | | | | | | | | | | - Feature: Added `zen build ls` option to list the content of a build part(s) - Build source is specified using one of the following options - `--cloud-url` cloud artifact URL to build - `--host` or `--override-host`, `--namespace`, `--bucket` and `--buildid` - `--filestorage`, `--namespace`, `--bucket` and `--buildid` - `--build-part-name` to specify a particular build part(s) in the build - `--wildcard` windows style wildcard (using * and ?) to match file paths to include - `--exclude-wildcard` windows style wildcard (using * and ?) to match file paths to exclude. Applied after --wildcard include filter - Improvement: Added `--quiet` option to zen `builds` commands to suppress non-essential output
* Added config, versioning and logging for pluginsDmytro Ivanov2025-04-221-4/+11
|
* use oidctoken executable to generate auth (#336)Dan Engelbrecht2025-04-022-1/+5
| | | - Feature: `zen builds` auth option `--oidctoken-exe-path` to let zen run the OidcToken executable to get and refresh authentication token
* zen build cache service (#318)Dan Engelbrecht2025-03-261-19/+27
| | | | | | | | | - **EXPERIMENTAL** `zen builds` - Feature: `--zen-cache-host` option for `upload` and `download` operations to use a zenserver host `/builds` endpoint for storing build blob and blob metadata - Feature: New `/builds` endpoint for caching build blobs and blob metadata - `/builds/{namespace}/{bucket}/{buildid}/blobs/{hash}` `GET` and `PUT` method for storing and fetching blobs - `/builds/{namespace}/{bucket}/{buildid}/blobs/putBlobMetadata` `POST` method for storing metadata about blobs - `/builds/{namespace}/{bucket}/{buildid}/blobs/getBlobMetadata` `POST` method for fetching metadata about blobs - `/builds/{namespace}/{bucket}/{buildid}/blobs/exists` `POST` method for checking existance of blobs
* build list filters (#313)Dan Engelbrecht2025-03-191-1/+1
| | | | | - Feature: `zen builds list` command has new options - `--query-path` - path to a .json (json format) or .cbo (compact binary object format) with the search query to use - `--result-path` - path to a .json (json format) or .cbo (compact binary object format) to write output result to, if omitted json format will be output to console
* Build command tweaks (#301)Stefan Boberg2025-03-111-7/+10
| | | | | | - Improvement: Don't chunk up .mp4 files as they generally won't benefit from deduplication or partial in-place-updates - Improvement: Emit build name to console output when downloading a build - Improvement: Added some debug logging - Bugfix: Logging setup would previously not function correctly when not logging to file
* reduced memory churn using fixed_xxx containers (#236)Stefan Boberg2025-03-061-3/+5
| | | | | | * Added EASTL to help with eliminating memory allocations * Applied EASTL to eliminate memory allocations, primarily by using `fixed_vector` et al to use stack allocations / inline struct allocations Reduces memory events in traces by close to a factor of 10 in test scenario (starting editor for project F)
* limit and validate responses before logging the text (#292)Stefan Boberg2025-03-041-1/+47
| | | Improvement: When logging HTTP responses, the body is now sanity checked to ensure it is human readable, and the length of the output is capped to prevent inadvertent log bloat
* improved builds api interface in jupiter (#281)Dan Engelbrecht2025-02-121-3/+1
| | | | | * multipart upload/download iterface in jupiter * review fixes
* jupiter code cleanup (#276)Dan Engelbrecht2025-01-221-0/+29
| | | | | | | * cleanup jupiter * move jupiter files to separate folder * CloudCache -> Jupiter * split up jupiter files * kill redundant JupiterAccessTokenProvider
* move basicfile.h/cpp -> zencore (#273)Dan Engelbrecht2025-01-161-0/+164
| | | | | | move jupiter.h/cpp -> zenutil move packageformat.h/.cpp -> zenhttp zenutil now depends on zenhttp instead of the inverse
* auth fixes (#260)Dan Engelbrecht2024-12-101-1/+2
| | | | * fix so we can replace an openid provider that was read from disk file * fix OidcClient lifetime issues in authmg
* made fmt formatter format function const (#162)Stefan Boberg2024-09-201-2/+2
| | | this appears to be required as of fmt v11