Repository navigation
fix: preserve conversation source ownership - #5008
Israeltheminer wants to merge 1 commit into
Conversation
4b44763 to
921ae45
Compare
921ae45 to
45fe1f6
Compare
|
Thank you for the report and the patch. This PR is being closed in a cleanup of old PRs: the branch is 521 commits behind The approach was checked against the current code on 2026-11-02, so that a new attempt can start from what turned up:
|
An API-mirrored conversation recorded the identity of the key that first sent it and refused every other identity. A key made for a team or the organization authenticates as a service identity of its own, so replacing it stranded the mirrors and the replies queued for them (INTEGRATION_NOT_OWNED), with no way to hand them over. A mirror now belongs to the integration that created it, which is whom the key belongs to. A person's own key and a key made for a member act as that person. A key made for a team or the organization acts for it, so its replacement continues the mirror, lists it and claims the replies queued before the swap. A key of anyone else is still refused. A project's key never reaches these routes. Two keys made for the same team or organization are one integration and share their mirrors; the spec rule, the API reference (EN, DE, FR) and the OpenAPI descriptions say so. Migration 0235 adds the owner to the bindings. It fills it from api_key_owners, within the binding's organization, for the keys made for a team or the organization (every other binding belongs to its user, as it always did) and keeps a trigger that fills it for the rows the previous image inserts during a roll. It takes the number above both release lines. The mirror functions take an IntegrationViewer whose owner is required, so a caller cannot fall back to the key's own identity and strand the mirrors again. Builds on #5008 by Israeltheminer, which found the cause and the shape of the fix. Three things differ from it: a member's key maps to the person, as the backfill stores it, instead of an owner kind no row carries, which left that key reading none of its own mirrors; the backfill matches the key's organization; and the rotation, the roll and the backfill are proved on a real Postgres in the conversation API lane, which fails on the code before this change. Fixes #5007
|
Update, now that the fix is in: it is on the stable What differs from this branch:
One decision came with it: every key made for the same team or the organization is one integration and shares its mirrors, because Tale cannot tell a replacement key from a second one. Integrations that must stay apart need different teams or members. That limit is written into CONV-R14 and the API reference. The branch |
An API-mirrored conversation recorded the identity of the key that first sent it and refused every other identity. A key made for a team or the organization authenticates as a service identity of its own, so replacing it stranded the mirrors and the replies queued for them (INTEGRATION_NOT_OWNED), with no way to hand them over. A mirror now belongs to the integration that created it, which is whom the key belongs to. A person's own key and a key made for a member act as that person. A key made for a team or the organization acts for it, so its replacement continues the mirror, lists it and claims the replies queued before the swap. A key of anyone else is still refused. A project's key never reaches these routes. Two keys made for the same team or organization are one integration and share their mirrors; the spec rule, the API reference (EN, DE, FR) and the OpenAPI descriptions say so. Migration 0235 adds the owner to the bindings. It fills it from api_key_owners, within the binding's organization, for the keys made for a team or the organization (every other binding belongs to its user, as it always did) and keeps a trigger that fills it for the rows the previous image inserts during a roll. It takes the number above both release lines. The mirror functions take an IntegrationViewer whose owner is required, so a caller cannot fall back to the key's own identity and strand the mirrors again. Builds on #5008 by Israeltheminer, which found the cause and the shape of the fix. Three things differ from it: a member's key maps to the person, as the backfill stores it, instead of an owner kind no row carries, which left that key reading none of its own mirrors; the backfill matches the key's organization; and the rotation, the roll and the backfill are proved on a real Postgres in the conversation API lane, which fails on the code before this change. Fixes #5007
Closes #5007
Problem
Conversation API bindings stored the service-user identity minted for one API key. Rotating an organization, team, project, or delegated-member key therefore made existing sources fail with
INTEGRATION_NOT_OWNED, including deliveries queued before the rotation.Fix
Validation
git diff --checkpassed