feat: admissible-response hook with relay forwarding#855
Open
Lucifer0x17 wants to merge 12 commits intoimpr/admissiblefrom
Open
feat: admissible-response hook with relay forwarding#855Lucifer0x17 wants to merge 12 commits intoimpr/admissiblefrom
Lucifer0x17 wants to merge 12 commits intoimpr/admissiblefrom
Conversation
ff6a16e to
f48dca1
Compare
Lightweight device that gates HTTP monitor invocations via 1-in-N probabilistic sampling. Reads `sample-rate` from the request message and rolls `rand:uniform(Rate) =:= 1`. If absent, all requests pass.
Add dev_chance.erl as a composable 1-in-N probabilistic gate using the 4-arity default handler pattern.
binary_to_integer/1 throws badarg on a non-integer path. Wrap in try/catch and reject non-positive rates explicitly so callers get a proper error tuple instead of a crash.
Merging of Opts happen inside `hb_http:request` which gets called after the the `multi` flow because of which the Node opts are never in Opts defaulting `http-ref` to be undefined. Hence, Node is funnel down to `is_addmissible` to extract opts
- dev_cache:expected_response extracts `http-reference` from Base, builds a forward body with reference + status-class + event tags - Optional commit_hook_response flag signs the forward body before relay - Fix parallel default in multinode_env test helper
9451fd3 to
a11e66c
Compare
- Title-Case headers introduced over the wire because of HTTP\1 - Normalise at the transport boundary so every codec sees stable keys regardless of peer or proxy. Does not touch signed message content.
b9bfb96 to
5ce84c1
Compare
SPAs served from manifests use absolute asset paths that 404 when the manifest is hit on the root domain. Redirect plain path requests for a manifest TX to its `<b32>.<host>` subdomain so the browser resolves assets correctly.
Decoder required exactly 3 colon-separated parts, crashing on real tags like `topic:`. Parse as first-colon/last-colon bounded instead.
809a895 to
91d86c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dev_cache:expected_responseextractshttp-referencefrom the admissible config and builds a forward body withreference,status-class, andeventtagscommit-hook-responseflag in store config signs the forward body before relayparalleldefault inmultinode_envtest helperContext
This enables the NASA route monitoring flow where gateway responses pass through admissibility checks and then get relayed to a monitor process with the
http-reference(which node responded) andstatus-classfor per-route scoring.Config:
{ "store": [ { "ao-types": "store-module=atom,parallel=atom", "store-module": "hb_store_remote_node", "nodes": [ { "prefix": "https://node-b.arhub.asia", "opts": { "http-reference": "node-b" } }, { "prefix": "https://node-a.arhub.asia", "opts": { "http-reference": "node-a" } } ], "parallel": true, "commit-hook-response": true, "on": { "~cache@1.0": { "admissible-response": [ { "device": "relay@1.0", "path": "call", "method": "POST", "peer": "http://localhost:9001", "relay-path": "/XJywXqtCp8-50ljBShrBqGKMSPb8OAjBuPnl0KFMvRo/push" } ] } } } ] }