feat(hero): wire hero_proc_log, HERO_SOCKET_DIR, 0660 perms, claim auth #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_hero_primitives"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
hero_proc_sdk::HeroLoggersources (hero_livekit_server,hero_livekit_ui).HERO_SOCKET_DIRperhero_sockets§7.1 (UI, examples, Makefile).bind_unix_sockethelper that chmodsui.sockto0660after bind (hero_sockets§2 + §7.2)./rpcproxy forwardsX-Hero-Context,X-Hero-Claims,X-Forwarded-Prefixto the backendrpc.sock.AuthorizedOsisLivekitwrapper enforces claim-based authorization on privilegedLiveKitService.*methods perherolib_openrpc_authorizepattern matching; read methods stay open. The server registers the wrapper viaregister_domaininstead ofregister::<OsisLivekit>.authz.rscover rule-matching, trusted-mode bypass, and authorization branches.Related Issue
Closes #13
Changes
Workspace + Cargo manifests
Cargo.toml— addedhero_proc_sdk(git, development branch) to[workspace.dependencies].crates/hero_livekit_server/Cargo.toml— addedhero_proc_sdk.crates/hero_livekit_ui/Cargo.toml— addedhero_proc_sdk; removedtracing-subscriber.UI binary —
crates/hero_livekit_ui/src/main.rsSERVICE_SOCKET/UI_SOCKETconstants replaced withHERO_SOCKET_DIRresolver.serve_unixaccept loop replaced withbind_unix_sockethelper (0660 chmod).tracing_subscriberinit removed;HeroLogger::new("hero_livekit_ui").await?owns startup logging.rpc_proxy_handler+forward_rpcread and inject the three Hero headers.Server binary —
crates/hero_livekit_server/src/main.rsHeroLogger::new("hero_livekit_server").await?at startup.OServer::run_cliclosure hand-constructsOsisLivekitviaOsisDomainInit::create, wraps inAuthorizedOsisLivekit, registers viaregister_domain.Authorization wrapper —
crates/hero_livekit_server/src/livekit/server/authz.rs(new, 300 LoC)AuthorizedOsisLivekit(Arc<OsisLivekit>, Arc<HeroLogger>)implementingOsisAppRpcHandler.livekitservice.{install, configure, start, stop, restart, create_room, delete_room, remove_participant}.["admin", "admin.*", "hero_livekit.admin", "hero_livekit.*"].X-Hero-Claims= trusted mode (full access) perhero_context§4.3.HeroLogger(authzcomponent) and returnRpcError::Operation("PermissionDenied: ...").Examples, Makefile, docs
examples/basic_usage.rsandexamples/health.rs—SOCKET_PATHconst +dirs::home_dir()resolver replaced withHERO_SOCKET_DIR/HOMEcascade.Makefile—SOCKET_DIR := $(HERO_SOCKET_DIR)/hero_livekit;export HERO_SOCKET_DIR.README.md,docs/api.md,docs/architecture.md,docs/configuration.md,docs/ui.md— literal paths replaced with$HERO_SOCKET_DIR/hero_livekit/..., default-fallback note added.Test Results
cargo check --workspace— PASScargo test --workspace— 30 passed, 0 failed, 3 ignored (pre-existing rustdoc examples)authz.rs(rule_matches_*,privileged_methods_have_rules,open_methods_have_no_rules,trusted_mode_bypasses_rules,empty_rules_authorizes_any_context,matching_claim_authorizes,non_matching_claim_denies,empty_claim_list_denies).Compatibility
HERO_SOCKET_DIRis the only new env var; when unset, resolved paths match previous defaults exactly, so existing.claude/settings.jsonallowlist entries continue to work.HERO_SOCKET_DIRmust reapprove commands referencing the new paths.Out of scope
HERO_SOCKET_DIR-agnostic parallel block in.claude/settings.json— additive, non-blocking.