Skip to content

[chatgpt] Add Google Drive access policy Admin API example - #3048

Draft
hmittal-oai wants to merge 1 commit into
mainfrom
dev/hmittal/google-drive-allowlist-admin-api
Draft

[chatgpt] Add Google Drive access policy Admin API example#3048
hmittal-oai wants to merge 1 commit into
mainfrom
dev/hmittal/google-drive-allowlist-admin-api

Conversation

@hmittal-oai

Copy link
Copy Markdown
Contributor

Summary

Add a guide and Python standard-library CLI for managing Google Drive access through the ChatGPT workspace Admin API, following the SharePoint example in #3032. The example covers shared-drive ID and root-URL inputs, CSV/text imports, dry-run previews, full replacements, additions/removals, and independent My Drive access.

Make null (all shared drives), [] (no shared drives), and a selected allowlist explicit. Require confirmation for resetting restrictions or blocking every shared drive, reject malformed and empty imports, verify root URLs with Google Drive, and retry reads only. Register the guide in registry.yaml using the existing author slug.

This is a draft pending availability of the Google Drive policy endpoint and enforcement for supported workspaces. The guide explains that a successful configuration request alone does not establish enforcement and that concurrent administrator saves can overwrite changes.

Motivation

Workspace administrators need a reusable example for managing shared-drive and My Drive controls at scale. Google Drive uses full replacement and distinct all/none semantics, so its workflow needs a dedicated example rather than adapting the SharePoint commands unchanged.

Validation

  • python3 -B -m unittest discover -s examples/chatgpt/google_drive_access -p 'test_*.py' -v — 31 tests passed with mocked Google Drive and ChatGPT Admin API responses.
  • ruff check examples/chatgpt/google_drive_access
  • ruff format --check examples/chatgpt/google_drive_access
  • CLI --help and Python 3.10 syntax validation.
  • Registry JSON-schema validation; unique path/slug, matching title, and local links verified.
  • .github/scripts/check_notebooks.py — no changed notebooks.
  • Repository docs-editor review — no remaining findings.
  • No live Google Drive or ChatGPT Admin API requests were made. Live endpoint validation remains pending.

For new content

  • I have added a new entry in registry.yaml so that the guide renders on the cookbook website. The existing hmittal-oai author slug uses GitHub-profile attribution.
  • I have conducted a self-review based on the contribution guidelines:
    • Relevance: This demonstrates a ChatGPT workspace Admin API workflow for enterprise administrators.
    • Uniqueness: It complements the SharePoint example with Google Drive's replacement semantics and separate My Drive control.
    • Spelling and Grammar: The guide passed editorial review.
    • Clarity: Setup, previews, updates, and troubleshooting are documented in execution order.
    • Correctness: The example passed its mocked offline tests and local validation; live endpoint validation is explicitly pending.
    • Completeness: The guide includes credentials, source references, API semantics, rollout prerequisites, and concurrency/retry limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant