Expand description
Read and download log of restricted groups (#151, step 4).
Only groups whose need-to-know policy has read_log write here, so the
volume stays bounded and nothing is logged for other groups. The log is
separate from the audit log, which records changes. An entry says who
viewed or downloaded what, through which channel, from which address.
Repeated reads of the same object by the same user through the same
channel within COLLAPSE_MINUTES are one entry, so a resumed or ranged
download (many requests) is logged once.
What is logged: item and revision pages (and the same data over the REST
API), file downloads, Pack and Go, BOM exports, the desktop app’s Get
(Kind::Workset) and the read tools of MCP clients and the built-in
assistant that name an item (record_tool_read). Lists and searches
are not logged, in no channel.
Structs§
- Access
Ctx - Channel and client address of the request, set by the extractor
auth::AccessCtx. - Entry
- One entry of the log.
- Filter
- Filter of
list. - Filter
Query - The filter as a query string sends it (REST API and the log page): every
field optional, empty = not set. Times are RFC 3339 or a date
(
YYYY-MM-DD, UTC); a dateuntilincludes that whole day. - Page
- One page of the log.
- Subject
- An object that was read.
Enums§
Constants§
- COLLAPSE_
MINUTES - Reads of one object within this window are logged once.
- MAX_
LIST - Most entries one listing returns.
Functions§
- list
- The log of a group, newest first (managers of the group and administrators; a group the actor may not know answers “not found”).
- page
- Like
list, with the cursor of the next page. - project_
id_ by_ code - The id of a group by its code, for the CLI (no actor).
- project_
of_ file - The group of a file (through its revision and item).
- purge
- Deletes old entries (the
teamcraft access-log purgecommand; no actor, the operator of the server). - record
- Logs a read when the object’s group logs reads. Without a group, or when the group does not log, nothing is written. A failing write is an error: a download of a logged group that cannot be logged does not happen.
- record_
revision - Logs a read of a revision (its page, package or BOM export).
- record_
structure - Logs the read of a whole structure (Pack and Go, BOM export): one entry per
group of the structure that logs, labelled with the first revision of that
group.
revision_idsholds the root and every revision of the tree. - record_
tool_ read - Logs a read tool of an MCP client or the built-in assistant that named an
item (
item, asPRT-000012orPRT-000012/B, plus an optionalrevision): one view of the item per tool, labelled with what the tool was asked for. Write tools, tools without an item (searches, lists, change orders) and items the actor may not see log nothing. The tool name is the entry’s detail (read_file_textadds the file).