verify: use crypto.hash_file, fix io_ scope and naming #10
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-module-manager#10
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?
Findings
1. sha256_file reimplements daw.common.crypto.hash_file
sha256_file()in verify.lua duplicates the OS-detection logicfrom
daw.common.cryptoincluding the sha256sum vs sha256 check.daw.common.crypto.hash_file()already handles this correctly.Fix: remove
sha256_file(), addrequire("daw.common.crypto"),replace calls with
crypto.hash_file(path).Note:
crypto.hash_filereturns"sha256:<hex>"-- the comparisonagainst
entry.sha256in the manifest loop must be adjustedaccordingly (strip prefix or store with prefix in manifest).
2. io_ at module level
local io_ = dawio.new()is created at module level.Handle injection via
sys.new(opts)not possible.Should be created per function call or passed as parameter.
Rename to
outfor consistency with all other files.3. _NAME declared after requires
Minor consistency issue -- should be declared before the require block.
Acceptance Criteria
sha256_fileremoved, replaced withdaw.common.crypto.hash_file"sha256:<hex>"prefixio_replaced with per-callout, renamed consistently_NAMEmoved before requires