Skip to content

Commit 93556fc

Browse files
etrclaude
andcommitted
Correct stale TASK-048 alias comment (auth/405 hooks are functional)
The install_default_alias_hooks_ doc claimed all three aliases are "observation-only stubs ... byte-for-byte identical to v1", describing a superseded design. In the current code the auth and method_not_allowed aliases ARE the dispatch path (the inline apply_auth_short_circuit / 405 branch was removed) — the auth alias is the security boundary. Only not_found is observation-only (empty body; seat kept for PRD-HOOK-REQ-009 hook-count introspection). Comment-only; no behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NpysYDDJac63yz2mZKKiDf
1 parent d8bea8f commit 93556fc

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

src/httpserver/webserver_hooks.hpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,20 @@ static hook_handle make_hook_handle_(detail::webserver_impl* impl,
123123
hook_phase phase,
124124
std::uint64_t slot_id) noexcept;
125125

126-
// TASK-048: install the three default hook-bus aliases at webserver
126+
// TASK-048: install the default hook-bus aliases at webserver
127127
// construction. For each of `not_found_handler`, `method_not_allowed_handler`,
128128
// and `auth_handler` that the user set on the builder, registers a hook
129129
// at the matching phase (route_resolved, before_handler, before_handler).
130-
// The hooks are observation-only stubs whose presence is the alias
131-
// relationship; the existing inline dispatch code continues to consult
132-
// the user-supplied callable, so the on-the-wire behaviour is byte-for-
133-
// byte identical to v1.
130+
//
131+
// These are NOT inert stubs: `auth_handler` and `method_not_allowed_handler`
132+
// are FUNCTIONAL — the hook IS the dispatch path (the old inline
133+
// apply_auth_short_circuit / 405 branch was removed, not duplicated), so
134+
// the auth alias is the security boundary and the method-not-allowed alias
135+
// emits the 405. Only `not_found_handler` is observation-only: its body is
136+
// empty because `route_resolved_ctx` has no mutable response slot (DR-012
137+
// §4.10) and the 404 bytes are produced by webserver_impl::not_found_page;
138+
// the seat still exists so hook-count introspection reflects it
139+
// (PRD-HOOK-REQ-009). On-the-wire behaviour remains identical to v1.
134140
//
135141
// Called once from the webserver ctor body; never re-called. The
136142
// registrations are detach()-ed so they live for the webserver's

0 commit comments

Comments
 (0)