Add API key and platform migration support#183
Conversation
…d-api-key-migration # Conflicts: # src/Migration/Destinations/Appwrite.php # src/Migration/Sources/Appwrite.php
Greptile SummaryThis PR introduces two new resource types —
Confidence Score: 3/5Not safe to merge until the null-coalescing gap in Two defects on the hot path make this risky: every API key with no expiry date or no usage history will throw a
Important Files Changed
Reviews (6): Last reviewed commit: "Query keys by resourceInternalId/resourc..." | Re-trigger Greptile |
Source uses Project SDK (listKeys with cursor pagination); destination writes keys directly via dbForPlatform, matching the platform pattern.
$this->headers/endpoint/key were only read by the inherited call() method which the destination no longer invokes. STATUS_ERROR is never set inside createPlatform/createApiKey (they throw), so the guard only needs SKIPPED.
Reverting the wider cleanup — those properties are part of the inherited Target surface, not the headers issue under review.
Matches the existing platform pattern. Source-side SDK Key model doesn't expose $permissions today so this is [] in practice (same as platforms), but the hook is in place for when source can populate it.
SDK strips $permissions from Key responses so we can't copy from source; match the upstream createKey controller default since dbForPlatform.keys is gated by endpoint scope, not document perms.
Drop the endpoint-scope tangent — the comment is about why we picked this value, not about whether doc perms get enforced.
projectInternalId is a written-but-not-queryable legacy column on the keys collection (upstream filter uses resourceInternalId + resourceType). Mirror that here so the duplicate-check find() doesn't error out.
Summary
ApiKeyresource, source export via console headers, destination import).Platformresource).feat-platform-db-access(PR Add platform migration support #154), which switches platform listing/export from console-key HTTP calls to theProjectSDK service withbuildQueries.Notes
projectService->listPlatforms/exportPlatforms($batchSize).exportWithConsoleHeaderswrapper.Test plan
composer install && composer test(vendor not present in worktree — please run locally)composer lint && composer formatreporttotals forapiKeyandplatformresource types