feat: add ResourceDeleted annotation#1010
Conversation
General PR Review: feat: add ResourceDeleted annotationBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryScanned the full PR diff for security and correctness. This is a purely additive change: a new Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. |
Add a ResourceDeleted annotation that a connector can attach to a Grant or Revoke response when the operation deleted a resource downstream as a side effect (e.g. revoking a user's last role deletes the user account). This lets ConductorOne mark the account deleted immediately instead of waiting for the next full sync. - proto/c1/connector/v2/annotation_resource_deleted.proto (+ generated pb) - pkg/types/resource/deleted.go: NewResourceDeleted / AppendResourceDeleted Refs FDE-296 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
eeea4ad to
d98fde6
Compare
What
Adds a
ResourceDeletedannotation a connector can attach to a Grant or Revoke response when the operation deleted a resource in the downstream system as a side effect.Canonical case: revoking a principal's last role causes the app to delete the underlying account. Today C1 only learns of the deletion at the next full sync (~1h), which blocks an immediate re-grant. With this annotation the connector reports the deletion inline so C1 can mark the account deleted right away — no sync wait. Mirrors the existing
GrantReplacedannotation mechanics.Changes
proto/c1/connector/v2/annotation_resource_deleted.proto—ResourceDeleted { ResourceId resource_id = 1 }(required), doc comment modeled onannotation_grant_replaced.protopb/c1/connector/v2/annotation_resource_deleted{.pb,.pb.validate,_protoopaque.pb}.goviabuf generatepkg/types/resource/deleted.go—NewResourceDeleted/AppendResourceDeleted, mirroringpkg/types/grant/replaced.goConsumers
principal_deleted_check— feat: report side-effect principal deletion from revoke baton-sql#141🤖 Generated with Claude Code