Documentation
¶
Overview ¶
Package bundle defines the single source of truth for which files may appear inside a deploy bundle. Both the CLI zipper and the server extractor call Inspect with the same Rules so client-side and server-side enforcement cannot drift.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DigestZipReader ¶ added in v0.5.6
DigestZipReader computes a stable content digest over the accepted entries of a deploy bundle. Client (CLI) and server compute it from the same produced zip so the two cannot drift.
Definition: apply Rules.Inspect to every entry.
- FilterAccept regular file -> contributes (name, execBit, sha256(body)).
- FilterSkipCacheDir -> ignored (matches extractor behavior).
- any FilterReject* -> hard error (the live bundle rejects it too).
Directory entries never contribute. Entries are sorted by name; the digest is sha256 over a length-prefixed serialization so no field boundary is ambiguous. A duplicate accepted name is a hard error.
Types ¶
type FilterDecision ¶
type FilterDecision int
FilterDecision is the per-entry classification produced by Rules.Inspect.
const ( // FilterAccept: include in the bundle. FilterAccept FilterDecision = iota // FilterSkipCacheDir: known build/VCS cache; omit silently, not an error. FilterSkipCacheDir // FilterRejectDataDir: first segment is exactly "data" — reserved by the // platform for the persistent data mount. Hard error. FilterRejectDataDir // FilterRejectDatasetDir: first segment is "datasets" or // ".shinyhub-data" — reserved namespaces for data shipped via push. FilterRejectDatasetDir // FilterRejectExtension: data-format file (parquet, duckdb, sqlite, …). FilterRejectExtension // FilterRejectFileSize: single file exceeds Rules.MaxFileBytes. FilterRejectFileSize )
func (FilterDecision) String ¶
func (d FilterDecision) String() string
String renders a decision for log/error messages.
type Rules ¶
type Rules struct {
MaxFileBytes int64 `json:"maxFileBytes"`
CacheDirs []string `json:"cacheDirs"`
DataExtensions []string `json:"dataExtensions"`
// MaxBundleBytes is informational for clients (UI shows it, server
// re-asserts via Storage.MaxBundleMB at the multipart boundary).
MaxBundleBytes int64 `json:"maxBundleBytes"`
}
Rules is the per-bundle policy. Total bundle size is enforced separately at the multipart layer because per-entry inspection cannot know it.