Google Drive Port
This is the Harbor reference integration for the Google Drive API.
Google Drive Port
Purpose
This is the Harbor reference integration for the Google Drive API.
Use it when:
- building Google Drive actions in Harbor
- extending the Dock / Hub Google Drive entry
- teaching Codex or OpenClaw how to map a storage API into Harbor Ports and Harbor Actions without turning Harbor into a generic file proxy
Harbor Port worksheet
Product
- Product: Google Drive API
- Publisher slug:
google - Publisher name:
Google - Category:
Storage - Tags:
google,drive,storage,files,productivity
Safe Harbor Port metadata
- Kind:
http_api - Label:
Google Drive API - Description:
Google Drive API connection managed locally through Harbor. - Base URL:
https://www.googleapis.com/ - Auth mode:
header_token - Auth header name:
Authorization - Auth token prefix:
Bearer
Hidden local config
authToken
Harbor stores the token locally only. Dock / Hub manifests must never contain it.
Harbor action design notes
Google Drive is a good Harbor fit today when we combine fixed routes with Harbor's Action Model for typed query parameters.
Good Harbor Google Drive actions:
- stable
GETroutes for file listing, file metadata, Drive search, shared drive reads, permissions, and change tokens - explicit
POSTroutes for folder creation or file copy flows - Action Model
input.path,input.query, andinput.bodyenvelopes instead of raw query-string editing requestBodyMode: "none"for readsrequestBodyMode: "json"for bounded writesresultMode: "json_summary"for all starter actions- bounded path templates like
/drive/v3/files/{fileId}when a concrete Drive item must be targeted
Avoid for now:
- upload flows that depend on
uploadTypequery parameters or media uploads - computed provider query builders like structured Drive-search-to-
qtranslation, which are planned after basic typed query support - giant sharing-management surfaces with broad mutation options
- automatic publish of write actions
Starter Google Drive actions
Automatic read actions
list-files->GET /drive/v3/filesget-file-metadata->GET /drive/v3/files/{fileId}search-files->GET /drive/v3/fileslist-shared-drives->GET /drive/v3/drivesget-shared-drive->GET /drive/v3/drives/{driveId}get-start-page-token->GET /drive/v3/changes/startPageTokenlist-file-permissions->GET /drive/v3/files/{fileId}/permissions
Approval-friendly write actions
create-folder->POST /drive/v3/filescopy-file->POST /drive/v3/files/{fileId}/copy
Why these actions
These routes fit Harbor's current safe model well because they:
- stay under one fixed Google API origin
- use fixed paths or small explicit path templates relative to the Harbor Port
- keep query parameters typed and reviewable through Harbor's Action Model
- keep hidden auth entirely local to Harbor Node
- avoid arbitrary full URL editing and raw query-string injection
- can be reviewed as named capabilities before publish
Action Model notes
For Google Drive actions, Harbor stores explicit path templates and typed parameter metadata such as:
/drive/v3/files/{fileId}/drive/v3/drives/{driveId}/drive/v3/files/{fileId}/permissions/drive/v3/files/{fileId}/copy
At execution time, callers supply values by location:
input.pathfor path placeholdersinput.queryfor typed query parametersinput.bodyfor JSON write payloads
Example file metadata request:
{
"path": {
"fileId": "1abcExampleDriveFileId"
}
}
Example Drive search request:
{
"query": {
"q": "name contains 'invoice' and trashed = false",
"pageSize": 25,
"orderBy": "modifiedTime desc"
}
}
Harbor fills path placeholders safely, validates query values against the stored action schema, applies static query defaults such as supportsAllDrives, and then sends the assembled request to Google Drive.
Suggested operator workflow
- Import the Google Drive Dock entry from Dock / Hub.
- Configure the local Google bearer token in Harbor Node.
- Use low-risk file and shared drive read actions first.
- Keep
create-folderandcopy-fileonrequire_approvalunless there is a very deliberate local policy reason not to. - Add more drafts when the query parameters can be typed and reviewed safely.
Suggested agent workflow
- Inspect the existing Google Drive Harbor Port.
- Inspect live actions and drafts.
- Propose additional fixed-path or bounded path-template actions, plus typed query params where Harbor can model them safely.
- Validate and test drafts.
- Request publish instead of self-publishing unless Harbor explicitly allows it.
Agents should never:
- ask Harbor for the stored token
- edit hidden Google Drive auth
- widen Google Drive into a generic arbitrary proxy
- add raw query-string escape hatches instead of typed Action Model query parameters
Current update strategy
For now, Google Drive updates are manual:
- update the Dock / Hub Google Drive integration document in
apps/hub/catalog/integrations/google/drive.json - bump the manifest version when the action set changes materially
- re-import into Harbor or create new drafts from the updated Dock entry
Future options such as computed Drive query builders or upload-specific action support are intentionally deferred until Harbor has clearer provider-adapter and upload semantics.
Official reference starting points
- Google Drive API reference root:
https://developers.google.com/workspace/drive/api/reference/rest - Files list:
https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list - Files get:
https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get - Files create:
https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create - Files copy:
https://developers.google.com/workspace/drive/api/reference/rest/v3/files/copy - Drives list:
https://developers.google.com/workspace/drive/api/reference/rest/v3/drives/list - Drives get:
https://developers.google.com/workspace/drive/api/reference/rest/v3/drives/get - Changes get start page token:
https://developers.google.com/workspace/drive/api/reference/rest/v3/changes/getStartPageToken - Permissions list:
https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/list