fix: resolve did:dht compilation errors

- Simplify DHT encoding: use JSON instead of DNS packets (drop simple-dns)
- Fix mainline crate API: SigningKey takes 32 bytes, get_mutable returns Result
- Add missing dht_did field to IdentityRecord constructor
- Store DID Document as JSON in DHT (DNS encoding deferred)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-14 04:14:04 +00:00
parent 0e9df969f1
commit 4a3611f3b4
26 changed files with 451 additions and 590 deletions

View File

@@ -18,7 +18,7 @@
# Exit 0 = all checks passed = production ready
# Output: TAP format
set -euo pipefail
set -uo pipefail
TARGET="${1:-192.168.1.228}"
ITERATIONS=10
@@ -52,9 +52,13 @@ get_session() {
}
rpc() {
local method="$1" params="${2:-{}}" session="$3" csrf="$4" timeout="${5:-30}"
local method="$1"
local params="${2:-\{\}}"
local session="$3"
local csrf="$4"
local timeout="${5:-30}"
local body
if [[ "$params" == "{}" ]]; then
if [[ "$params" == "{}" || "$params" == "\{\}" ]]; then
body="{\"method\":\"${method}\"}"
else
body="{\"method\":\"${method}\",\"params\":${params}}"
@@ -75,8 +79,8 @@ echo "# Started: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
# ── Auth ──────────────────────────────────────────────────────────────────
session_header=$(get_session)
SESSION=$(echo "$session_header" | sed -n 's/.*session=\([^;]*\).*/\1/p')
CSRF=$(echo "$session_header" | sed -n 's/.*csrf_token=\([^;]*\).*/\1/p')
SESSION=$(echo "$session_header" | sed -n 's/.*session=\([^;]*\).*/\1/p' | head -1 | tr -d '[:space:]')
CSRF=$(echo "$session_header" | sed -n 's/.*csrf_token=\([^;]*\).*/\1/p' | head -1 | tr -d '[:space:]')
if [[ -z "$SESSION" ]]; then
echo "BAIL OUT! Cannot authenticate to ${TARGET}"