Skip to content

[log] Add debug logging to DIFC policy helper functions#6501

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
log/difc-log-helpers-9b850eace7e037e4
Draft

[log] Add debug logging to DIFC policy helper functions#6501
github-actions[bot] wants to merge 1 commit into
mainfrom
log/difc-log-helpers-9b850eace7e037e4

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Adds logDifcLog debug logging calls to three helper functions in internal/server/difc_log.go that previously had no debug logging:

  • isSingularReadTool: logs the tool name and whether it's classified as a singular-read tool (vs. collection tool)
  • buildDIFCSingleItemFilteredError: logs the item description, policy label, and reason before constructing the filtered-resource error
  • difcPolicyLabel: logs violation counts (secrecy, integrity, total) when determining the human-readable policy label

These helpers are called during DIFC filtering decisions and the new debug log lines make it easier to trace policy outcomes when DEBUG=server:difc_log is set.

Changes

  • File: internal/server/difc_log.go
  • Reuses existing var logDifcLog = logger.New("server:difc_log") logger
  • 5 new logDifcLog.Printf calls (3–7 target range)
  • No test files modified
  • No side effects in log arguments

Validation

  • go build ./...
  • go test ./internal/server/

Generated by Go Logger Enhancement · sonnet46 11.3M ·

Add logDifcLog calls to three helper functions that previously had no
debug logging:

- isSingularReadTool: log the tool name and classification result
- buildDIFCSingleItemFilteredError: log description, policy label, and
  reason before constructing the error
- difcPolicyLabel: log secrecy/integrity violation counts and total

These helpers drive DIFC policy decisions and benefit from debug output
when troubleshooting access-control behaviour.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants