remove authentication from hero_embedder #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
INFO: HERO_SECRET not set — RPC authentication disabled.
its all naked USD socket
see
/hero_crates_best_practices_check
and
/hero_proc_openrpc
Implementation Spec for Issue #14: remove authentication from hero_embedder
Objective
Remove all JWT/
HERO_SECRETauthentication logic fromhero_embedder_serverand its supporting library. The server runs exclusively on a Unix Domain Socket (UDS), so OS-level access controls provide the only security boundary needed.Requirements
HERO_SECRET.authmodule fromhero_embedder_libentirely (file + module declaration).jsonwebtokencrate from allCargo.tomlfiles.dotenvcrate (its only use was loadingHERO_SECRET).HERO_SECRET/HERO_AUTH_URLentries from.env.exampleandREADME.md.docs/AUTHENTICATION.mdandcrates/hero_embedder_lib/tests/auth_test.sh.cargo checkafter changes.Files to Modify/Create
crates/hero_embedder_server/src/main.rs— remove auth guard injsonrpc_handler, startup log,validate_admin_from_headersfunction,JwtValidatorimport,headersparam,dotenv::dotenv()callcrates/hero_embedder_lib/src/auth.rs— DELETE entire filecrates/hero_embedder_lib/src/lib.rs— removepub mod auth;crates/hero_embedder_lib/Cargo.toml— removejsonwebtokenanddotenvdepscrates/hero_embedder_server/Cargo.toml— removedotenvdepCargo.toml(workspace root) — removejsonwebtokenanddotenvworkspace depsdocs/AUTHENTICATION.md— DELETEcrates/hero_embedder_lib/tests/auth_test.sh— DELETE.env.example— removeHERO_SECRETandHERO_AUTH_URLentriesREADME.md— removeHERO_SECRETandHERO_AUTH_URLtable rowsImplementation Plan
Step 1: Edit
crates/hero_embedder_server/src/main.rsuse auth::JwtValidatorimportvalidate_admin_from_headersfunctionHERO_SECRETenv check + log messagejsonrpc_handlerheaders: axum::http::HeaderMapparameter fromjsonrpc_handlerdotenv::dotenv().ok();call frommain()Dependencies: none
Step 2: Delete
crates/hero_embedder_lib/src/auth.rsDependencies: none (parallel with Step 1)
Step 3: Edit
crates/hero_embedder_lib/src/lib.rspub mod auth;lineDependencies: Step 2
Step 4: Edit all
Cargo.tomlfilesjsonwebtokenanddotenvfromcrates/hero_embedder_lib/Cargo.tomldotenvfromcrates/hero_embedder_server/Cargo.tomljsonwebtokenanddotenvworkspace deps from rootCargo.tomlDependencies: none (parallel with Step 1 and 2)
Step 5: Delete docs and test files, update
.env.exampleandREADME.mddocs/AUTHENTICATION.mdcrates/hero_embedder_lib/tests/auth_test.shHERO_SECRET/HERO_AUTH_URLfrom.env.exampleHERO_SECRET/HERO_AUTH_URLrows fromREADME.mdDependencies: none (parallel)
Step 6: Verify compilation
cargo check --workspaceDependencies: Steps 1–5
Acceptance Criteria
cargo check --workspacepasses with zero errorsHERO_SECRETanywhere in the repoauth.rsdeleteddocs/AUTHENTICATION.mddeletedAuthorizationheaderNotes
hero_embedder_proxyhas a comment "// Step 3: Forward to upstream (pass through auth headers)" — no logic to remove, just an English comment. Can optionally simplify wording.mcp_docs.htmlalready states "No authentication required" — no changes needed.openrpc.jsonfiles have no auth-related fields — no changes needed.Implementation Complete
Changes Made
All authentication logic has been removed from
hero_embedder.Files modified:
crates/hero_embedder_server/src/main.rs— removedJwtValidatorimport,validate_admin_from_headersfunction,HERO_SECRETstartup log, auth guard injsonrpc_handler,headersparam, anddotenv::dotenv()callcrates/hero_embedder_lib/src/lib.rs— removedpub mod auth;module declarationcrates/hero_embedder_lib/Cargo.toml— removedjsonwebtokenanddotenvdependenciescrates/hero_embedder_server/Cargo.toml— removeddotenvdependencyCargo.toml(workspace root) — removedjsonwebtoken = "9"anddotenv = "0.15"workspace depsREADME.md— removedHERO_SECRETandHERO_AUTH_URLrows from env vars tableFiles deleted:
crates/hero_embedder_lib/src/auth.rs(entire JWT auth module)docs/AUTHENTICATION.mdcrates/hero_embedder_lib/tests/auth_test.sh.env.example(was onlyHERO_SECRET/HERO_AUTH_URL, now empty and deleted)Build Status
cargo check --workspace— ✅ clean, zero errors, zero warningsResult
The RPC server now accepts all requests on the Unix Domain Socket without any authentication checks. No
HERO_SECRETenvironment variable is needed or consulted. The misleading startup log message is gone.State string fix committed:
02ec72eThe
wait_for_healthyloop was checking for state "ok" which never exists in hero_proc (correct value is "running"). Similarlywait_for_haltedchecked for "halted" instead of "success"/"exited". This causedmake runto always timeout even when the service started successfully.Browse:
02ec72e