contract connector · 40-connector.md · 41-secrets.md · 42-drive-extensions.md · guide · card
Drive extensions
Connector implementers use these extensions to capture Picker-selected files and structured Sheets rows, track Drive changes and enforce domain-approved access.
drive-picks
Files a principal selects through Picker, the selection position, and the rows a tenant connection stores.
picker-sourceThegdrive-pickssource servesfilesandpageswithdrive-oauthanddrive-page-grainfor files selected through Picker.file-selectionOngdrive-picksandgdrive-sheet,file_idsselects distinct individual files without a folder root;folder_idandfolder_idsare absent.file-selection-limitfile_idsholds at most 128 entries.file-selection-invalidtestAn empty, repeated or mixedfile_idsselection, or one exceedingfile-selection-limit, raisesConnectorDriveFilesInvalidbefore a Drive request.Why
because an ambiguous selection cannot establish which files a later tombstone withdrawsfile-accesstestThe source validates each selected file with the bound credential. An uncaptured inaccessible or trashed id, non-file id, or file outside configureddrive_idraisesConnectorDriveFileRejectedwithout landing rows or advancing position.Why
because an inaccessible picker id cannot count as a complete selectionfile-revokedtestWhen a captured file becomes inaccessible or trashed under a valid credential, the source tombstones its file and pages once. The position adds its id to the withdrawn set. Authentication and transient failures advance no position.file-withdrawntestA withdrawn id stays selected without refusing later fires. A fire finding the file inaccessible stores nothing for that file. When access returns, the source captures the file as new and removes its id from the withdrawn set.export-limittestIf Drive answers a picked file’s export with403 exportSizeLimitExceeded, the source appliesdrive-export-limit. The file id stays outside the withdrawn set, and itsfilesrow receives no tombstone.Why
because Drive refuses that export on every fire while the principal still reads the file, and a tombstone withdraws a file nobody revokedfile-positionThe position binds sortedfile_idsand mode; changing either rereads retained files, and a complete read tombstones deselected files and their pages.row-scopeA connection-bound run stamps its Drivefilesandpagesrows and tombstones with the admittedtenantandprincipal. The source supplies neither value.row-identityA connection-bound Drive row and position key include connection identity besidefile_id. Connections selecting the same file keep separate rows and positions.
unsettled: Does Picker selection of a folder under drive.file grant the app access to its descendant files? owner: connector affects: connector.drive-picks
Scenarios
connector.drive-picks.file-selection-invalid: WHENfile_idsrepeats one id or appears besidefolder_id, THEN validation raisesConnectorDriveFilesInvalidbefore any request.connector.drive-picks.file-access: WHEN a picked id is inaccessible to the bound credential, THENConnectorDriveFileRejectedcommits neither rows nor position.connector.drive-picks.file-access: WHEN a picked file lies in another Shared Drive than the configureddrive_id, THENConnectorDriveFileRejectedcommits neither rows nor position.connector.drive-picks.file-revoked: WHEN a captured file loses access under a valid credential, THEN its file and pages receive tombstones before the selection position advances.connector.drive-picks.file-revoked: WHEN two fires follow a captured file’s revocation, THEN the first lands its tombstone, the second lands none, and both keep the other picked files in the position.connector.drive-picks.file-withdrawn: WHEN a withdrawn file becomes readable again, THEN the next fire lands its captured row and the position holds it outside the withdrawn set.connector.drive-picks.export-limit: WHEN a captured Sheet’s new version exceeds Drive’s export limit, THEN itsfilesrow landsskippedrather thanremoved, and the position keeps it.connector.drive-picks.file-position: WHEN a file id leaves a complete selection, THEN its file row and prior pages land tombstones.connector.drive-picks.row-scope: WHEN two tenants select the same file id, THEN each landed row carries only its admitted tenant and principal.
drive-sheet
Google Sheets capture as structured rows, separate from PDF page capture.
source-nameThegdrive-sheetsource servesrowsand sharesdrive-oauthandfile-selectionwithout changing thegdrivesource’sfilesandpagestables.export-formatA Google Sheet selected for structured capture exports as XLSX; CSV contains only the first sheet.sheet-identityEach landed spreadsheet row carriesfile_id, sheet id, sheet name, source row number, connection identity,tenantandprincipal.row-keyA spreadsheet row key combines connection identity, file id, sheet id and source row number. A complete recapture tombstones keys absent from the captured workbook.cell-valuesThe row preserves each cell’s typed value and its column position; an empty cell is distinct from a missing row.formula-valueThe source stores a formula cell’s exported result and records that the cell contains a formula. Contextful does not evaluate the formula.export-refusalA workbook whose export exceedsdrive-file-caplands a named skipped file row and no partial spreadsheet rows.Why
because a truncated workbook cannot establish row identity or removalexport-limitWhenexport-limitrejects a workbook export, the source stores a named skipped file row and retains prior spreadsheet rows and keys. Onlyfile-revokedtombstones a selected workbook.Why
because an export over Drive’s size limit leaves the workbook readable, so its rows still describe the principal’s file
Scenarios
connector.drive-sheet.sheet-identity: WHEN a workbook has two sheets with row 3 on each, THEN their landed keys differ by sheet id.connector.drive-sheet.row-key: WHEN a complete recapture removes a row, THEN the old row key receives a tombstone.connector.drive-sheet.export-limit: WHEN a captured workbook’s next export answers403 exportSizeLimitExceeded, THEN no spreadsheet row of it receives a tombstone.
drive-changes
Change cursors and complete listings of a selected Drive corpus.
initial-tokenBefore the initial full listing, the source obtains a start page token. The source commits the token with the complete listing, preserving replay of changes during listing.cursor-scopeThe cursor binds the connection, credential principal, declared drive, selected roots or file ids, and capture mode. A changed binding starts a complete listing.page-commitA change read follows everynextPageTokenand advances tonewStartPageTokenonly after the resulting rows and removals commit.selection-filterThe source admits a changed file only when its current ancestry or id satisfies the bound selection. Moving outside the selection produces tombstones.removed-fileFor a removal change, the source withdraws the file and pages only after establishing that the selected file is absent or inaccessible.invalid-tokenIf Drive rejects or expires a change token, the source starts a complete selected listing. The incomplete change response advances no removals.Why
because a missing change interval cannot prove the retained files still satisfy the selection
Scenarios
connector.drive-changes.page-commit: WHEN a change response has another page, THEN the committed cursor does not skip that page.connector.drive-changes.invalid-token: WHEN Drive rejects the cursor, THEN a complete walk reconciles removals before a new token commits.
drive-domain-auth
Organization-approved Drive access and the principal whose authority each request carries.
delegation-grantDomain-wide delegation requires an operator-declared Workspace domain, authorized service account and approved scope set bound to the connection.impersonated-principalEvery delegated Drive request names one admitted Workspace user as its subject; the row and permission sweep retain that subject’s identity.domain-boundaryA delegated request for a subject outside its declared domain raisesConnectorDriveDomainRejectedbefore token minting.Why
because administrator approval for one domain conveys no authority over anotherorganization-exportA sanctioned organization-wide export declares its scope and disclosure posture explicitly; delegated user reads do not imply that export.
Scenarios
connector.drive-domain-auth.domain-boundary: WHEN a connection names a user outside its approved domain, THENConnectorDriveDomainRejectedprecedes any Google request.