Repository navigation
feat(blockchain): owner-only nas-credentials action - #250
Merged
Merged
Conversation
Returns the device's Samba NAS credentials (written by fula-ota's nas-credentials.sh to /internal/nas/credentials.json) to the blox owner over the existing signed libp2p channel, so the fxblox-web app can show them. - Owner only: added to the actionAuth case in authorized(); delegated peers in authorizedPeers are excluded. No change to request signing or verification. - The request carries blox_peer_id, which must equal this blox's kubo peer ID, so an owner-signed request cannot be replayed to another blox. - 4 KiB read cap, Cache-Control: no-store, never logs the password. Statuses: 200 ok, 404 not_provisioned, 400 bad_request / blox_peer_mismatch, 503 unavailable, 500 malformed / error. - Tests: authorization matrix, every handler branch, and an end-to-end run through serveProxy (owner-signed 200; unsigned, delegated and stranger 401). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E9tV7663sXt1NFiCzM47wy
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
Adds an owner-only libp2p action
nas-credentialsthat returns the blox's Samba NAS credentials (written by fula-ota'snas-credentials.shto/internal/nas/credentials.json) so fxblox-web-app can show them to the owner.actionAuthcase inauthorized(); delegated peers are excluded. No change to request signing or verification.blox_peer_id, which must equal this blox's kubo peer ID, so an owner-signed request cannot be replayed to another blox.Cache-Control: no-store, never logs the password. Statuses: 200 ok, 404 not_provisioned, 400 bad_request / blox_peer_mismatch, 503 unavailable, 500 malformed / error.NasCredentialsfor app/SDK callers.Testing
go vet ./blockchain/clean;go test ./blockchain/ -run NasCredentialspasses: authorization matrix, every handler branch, and an end-to-end run throughserveProxy(owner-signed 200; unsigned, delegated and stranger 401). linux/arm64 build passes.nas-credentials); the password never appears in the logs. The owner-signed success path needs the app owner's key, so it is covered by the unit tests.Companion change: functionland/fula-ota (Samba LAN NAS + credentials file). fula-ota's release CI builds go-fula from this repo's
main.🤖 Generated with Claude Code
https://claude.ai/code/session_01E9tV7663sXt1NFiCzM47wy