Repository navigation
Drive: Google's own Drive API through the connection, not its broker's actions - #64
Merged
Merged
Conversation
…s actions Browsing, folder checks, deleting and downloading now call the Drive API through the connection (@clawnify/connections 0.7.0: rawRequest, rawFile), signed by the broker, so the code is the same whoever holds the credential. A download is one answer of at most 250 MB. A bigger footage clip comes by its shared link, as before; a bigger file imported into the media library still takes the broker's download action, the one call left as an action, since nothing reads a library import in pieces. A file coming in by pieces now reads a piece the shared link refuses through the connection. Live, Drive refused a 15 GB file's shared-link ranges past about 4 GB read while its API still served them, so the clip would otherwise wait for a day.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
OpenVideo's Drive calls now go to Google's own Drive API through the org's connection: the broker signs each request, and the app never holds a token. That replaces the broker's action catalogue (
*_FIND_FILE,*_GET_FILE_METADATA,*_DOWNLOAD_FILE,*_DELETE_FOLDER_OR_FILE), so the code is the same whoever holds the credential. It needs@clawnify/connections0.7.0 (rawRequest,rawFile).FIND_FILEGET /files?q=… '<folder>' in parents …, across shared drivesGET_FILE_METADATAGET /files/{id}?fields=name,parents; a 404 is "not visible", not an errorDELETE /files/{id}DOWNLOAD_FILEGET /files/{id}?alt=media→ a link to the bytes (rawFile)DOWNLOAD_FILE, up to the broker's disk (about 3.4 GB)DOWNLOAD_FILEDOWNLOAD_FILE, the one action left: nothing reads a library import in piecesOne API, two bases. Both connection types reach the same API, but their bases differ. Google Drive's base ends in
/drive/v3, so the path is/files; Google Super's is the googleapis.com root, so the path is/drive/v3/files.Size is checked first. A download asks for the file's size before anything else: the broker fetches a whole file into its own storage before refusing one over 250 MB.
A piece the shared link refuses comes through the connection
A file coming in by pieces (#61) now reads a piece from the connection when Drive refuses it on the shared link. Live today:
206, exactcontent-range.Without this, those clips wait up to a day. The shared link stays first, because it is faster and costs no broker call. Once the connection has served a piece, the rest of that delivery reads from it.
Tests
test/drive.test.ts, new, 11 tests through the real SDK:test/relay.test.ts:pnpm-workspace.yamlgains aminimumReleaseAgeExcludefor@clawnify/connections@0.7.0, which pnpm 11 added: the version was published today, and it is our own package.