Skip to main content

Module content

Module content 

Source

Constants§

MAX_DB_CONTENT
Content that exceeds this size is never mirrored back into the database; it lives only in the content store.

Functions§

content_dir
Directory holding all bulk content (full reports, long finding evidence). Relative paths stored in the database are resolved against this.
is_content_rel
Ensure a path is a content-store-relative path (sanity check).
is_short
True if the content is “short stuff” that can stay in the database.
read_content
Read a content-store file back.
resolve_path
Resolve a content-store relative path to an absolute filesystem path.
short_excerpt
Truncate a string to at most max characters for storage as a short DB field; the full content should already be in the content store.
store_content
Store content in the content store, content-addressed by sha256. Returns (hash, relative_path) where relative_path is relative to the config dir.
store_or_excerpt
Store long content in the content store and keep only a short excerpt in the database. Returns (db_value, detail_path); for short content the value is the full content and detail_path is None.