Skip to content

feat: add logging policy controls#128

Merged
vishalanandl177 merged 1 commit into
mainfrom
SCRUM-11-P0-Implement-policy-and-logging-gate
Jul 4, 2026
Merged

feat: add logging policy controls#128
vishalanandl177 merged 1 commit into
mainfrom
SCRUM-11-P0-Implement-policy-and-logging-gate

Conversation

@vishalanandl177

Copy link
Copy Markdown
Owner

No description provided.

@vishalanandl177
vishalanandl177 merged commit 73db013 into main Jul 4, 2026
6 checks passed
@vishalanandl177
vishalanandl177 deleted the SCRUM-11-P0-Implement-policy-and-logging-gate branch July 4, 2026 12:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1286b502a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread drf_api_logger/policy.py
Comment on lines +72 to +74
log = _as_bool(mapping.get("log"), base.log)
database = _as_bool(mapping.get("database"), base.database)
signal = _as_bool(mapping.get("signal"), base.signal)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore sinks when re-enabling logging

When a base/default policy or earlier rule sets log: False, __post_init__ also turns database and signal off. A later, more-specific rule or callable that returns only {"log": True} then inherits those disabled sinks here, so the middleware passes the not policy_decision.log check but writes to neither the database nor the signal. This breaks common deny-by-default/allow-specific configurations unless every allow rule also remembers to set both sinks back to True.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant