Skip to content

feat(files): the five public-file endpoints for Python, plus the Files route tests - #2

Merged
Domantas merged 3 commits into
mainfrom
test/files/SDK-2
Sep 15, 2026
Merged

Domantas merged 3 commits into
mainfrom
test/files/SDK-2

Conversation

@Domantas

Copy link
Copy Markdown
Contributor

Adds the five public-file addresses that slice PUB opened in the gateway (make a file or a folder public, make them private again, and read a public file without signing in) to the Python SDK, together with the two new file fields public_url and is_public, and the documentation page that goes with them. get_public_file deliberately sends no Authorization header even when the client it is called on is signed in. It also carries slice SDK's commit, which was never merged on its own: the missing test_files_integration method, the first real Files route tests, and the API Files documentation page.

Test evidence — run in the worktree after rebasing on origin/main:

  • uv run pytest — 595 tests passed, 0 failed.
  • make typecheck (mypy over src) — Success: no issues found in 36 source files.

10 files changed, 873 insertions, 2 deletions. The rebase was clean, no conflicts.

Report: docs/tasks/sdk-2-pull-requests.md in norbix-code/cli, landing with the CLI pull request of this set.

🤖 Generated with Claude Code

Domantas and others added 3 commits September 15, 2026 12:29
…he API Files docs page

- hub/files.py had no test_files_integration (POST /files/integrations/test).
  The shared contract already has it, so the generated module was out of date;
  added sync and async in the same shape the generator produces.
- The generated Files tests only check the HTTP verb and that the address starts
  with https, so a method pointed at the wrong path would still pass. Adds
  tests/test_files_routes.py: one case per endpoint (12 hub, 8 public API) that
  checks the path itself and the values sent.
- docs/api/files.md did not exist. docs/hub/files.md was missing
  get_folder_files, get_file and test_files_integration. Both fixed, with the
  module counts in the two index pages.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Slice PUB gave the gateway public file links. This brings them into the
Python SDK, sync and async:

- hub.files.make_file_public / make_file_private / make_folder_public /
  make_folder_private
- api.files.get_public_file — sends NO Authorization header and gives back
  the file's raw bytes

Two transport additions the public link needs to work at all:

- response_type="binary". send() parsed every body as JSON, so a method that
  answers with a file could only ever hand back its text. download_file_api
  has the same blind spot today — reported, not fixed here.
- follow_redirects. httpx does not follow redirects by default, so when the
  provider signs its own link (S3, Azure, Google Cloud) the 302 came back as
  an empty body and looked like an empty file. One test pins this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The SDK coverage matrix (sdks/tests/coverage/build_matrix.py) decides
"implemented" by searching each SDK's source for the gateway's route string,
verbatim and case-sensitive. The gateway declares the public file link as
/{version}/files/public/{PublicId}/{Name*}; this SDK writes {publicId}/{name},
so the endpoint read as missing even though the method is there and tested.

The route is now written out next to the method exactly as the gateway spells
it. That is also the thing a reader wants when checking the two agree
(knowledge.md K23 — an SDK is only covered when its routes are compared
against the gateway's).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Domantas
Domantas merged commit a13a511 into main Sep 15, 2026
1 check failed
@Domantas
Domantas deleted the test/files/SDK-2 branch September 15, 2026 12:24
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