feat(backend): implement binary download with dynamic sensor UUID inj…#124
Open
soorya38 wants to merge 3 commits into
Open
feat(backend): implement binary download with dynamic sensor UUID inj…#124soorya38 wants to merge 3 commits into
soorya38 wants to merge 3 commits into
Conversation
…ection - Implemented [downloadBinaryHandler](cci:1://file:///Users/sooryaakilesh/test/open-source-contributions/ochi/backend/handlers.go:347:0-391:1) to serve sensor binaries. - Added [IndexReplace](cci:1://file:///Users/sooryaakilesh/test/open-source-contributions/ochi/backend/utils.go:18:0-26:1) utility for efficient byte slice substitution. - Injects a unique UUID into the binary by replacing the placeholder on download. - Registered endpoint. - Added unit tests to verify UUID replacement and content integrity. Related issue: honeynet#95
glaslos
requested changes
Jan 19, 2026
Signed-off-by: soorya38 <csasoorya@gmail.com>
Author
|
@glaslos can you re-review ? |
glaslos
requested changes
Jan 21, 2026
Signed-off-by: soorya38 <csasoorya@gmail.com>
Author
|
@glaslos can you re-review ? |
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.
This PR introduces a new endpoint that serves sensor binaries with a unique UUID injected at download time. Each downloaded sensor binary is modified on the fly to embed a freshly generated UUID, ensuring every sensor instance has a distinct identity for tracking and management.
Related issue: #95
Changes
backend/utils.goIndexReplacehelper function to efficiently replace byte sequences within binary data.backend/handlers.goImplemented
downloadBinaryHandler, which:osandarchparameters(expects path format:
bin/sensor-{os}-{arch})(
00000000-0000-0000-0000-000000000000) inside the binarybackend/routes.goGET /download/:os/:archbackend/server_test.goAdded
TestDownloadBinaryHandlerto validate:Verification
Added unit test
TestDownloadBinaryHandlerthat:Ran:
go test -v ./backend/...