fix: harden dangling OAuth policy handling and error classification#204
fix: harden dangling OAuth policy handling and error classification#204sergey3bv wants to merge 1 commit into
Conversation
dcadenas
left a comment
There was a problem hiding this comment.
The migration still lets a revoked OAuth row reach permission checks as unrestricted access. Fix the active-authorization checks before merge so clearing policy_id to NULL never becomes the full-access path for revoked rows.
| WHEN oa.revoked_at IS NULL THEN NOW() | ||
| ELSE oa.revoked_at | ||
| END, | ||
| policy_id = NULL, |
There was a problem hiding this comment.
Keep revoked OAuth rows out before any NULL policy branch can allow access.
This migration sets revoked_at and clears dangling policy_id to NULL, but the later origin lookup and signer reload can still evaluate that row as unrestricted access.
Add revoked_at IS NULL to the active OAuth authorization lookup and make signer permission validation reject any refetched OAuth authorization with revoked_at set.
Please cover both the origin-based HTTP validator and signer validation for a revoked policy_id = NULL row, while preserving active NULL-policy access and valid empty-policy access.
Summary
Motivation
Related Issue
Testing
cargo test --workspace --verbosecargo clippy --workspace --all-targets --all-features -- -D warnings -A deprecatedcargo fmt --all -- --checkVisuals