feat(core): native add-on object-storage mirror (build-signing §4.2) (#3425) #3478
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!3478
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/native-addon-artifact-mirror"
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?
What
build-signing §4.2 — the object-storage mirror that supplies the
:mirrorcallbackServiceRadar.Plugins.NativeAddonImporter.import_entry/4(#3476) takes.ServiceRadar.Plugins.NativeAddonArtifactMirror.mirror_fun/3returns(os, arch, bytes -> {:ok, object_key} | {:error, term}):ServiceRadar.Sync.Client.upload_object(theReleaseArtifactMirrorchannel pattern),native-addons/<addon_id>/<version>/<os>/<arch>/<sha256>.tar.gz, carryingsha256+ addon/os/arch attributes,{object_key, sha256, signature}onAddonPackage.artifacts(the"os/arch"shapeAgentConfigGeneratoralready reads back).Tests
The upload fn is injected (the
ReleaseArtifactMirrorDI pattern), so the key/metadata logic is unit-tested without a channel/DB: key + sha256 + size + attributes, error propagation, and segment sanitization — slashes collapsed, all-dots segments (./..) neutralized so a craftedaddon_id/version/os/archcan't add a path component or escape thenative-addons/prefix.mix test(5/0),mix compile --warnings-as-errors, andmix credo --strictclean.Where §4 stands
import_entry/4(the last piece; mostly registry/HTTP I/O).🤖 Generated with Claude Code
ServiceRadar.Plugins.NativeAddonArtifactMirror.mirror_fun/3 returns the (os, arch, bytes -> {:ok, object_key}) callback NativeAddonImporter.import_entry/4 takes: it uploads each verified per-arch tarball to the datasvc object store via ServiceRadar.Sync.Client.upload_object (the ReleaseArtifactMirror channel pattern) under a deterministic, traversal-safe key native-addons/<addon_id>/<version>/<os>/<arch>/<sha256>.tar.gz, carrying the sha256 + addon/os/arch attributes. The importer records the resolved {object_key, sha256, signature} on AddonPackage.artifacts (the shape AgentConfigGenerator already reads). The upload fn is injectable (mirrors the ReleaseArtifactMirror DI pattern), so the key/metadata logic is unit-tested without a channel/DB: key + sha256 + size + attributes, error propagation, and path-segment sanitization (slashes collapsed, all-dots segments neutralized so a crafted addon_id/version can't add a path component or escape the prefix). mix test (5/0) + --warnings-as-errors + credo --strict clean. Completes §4.2; remaining §4.1 is the web-ng OCI-fetch orchestration that wires fetch+verify -> this mirror -> import_entry/4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>lgtm