Skip to content

Migrate from APIHarnessV2 to CustomStorage service class#120

Draft
mraible wants to merge 5 commits intomainfrom
chore/use-custom-storage-service-class
Draft

Migrate from APIHarnessV2 to CustomStorage service class#120
mraible wants to merge 5 commits intomainfrom
chore/use-custom-storage-service-class

Conversation

@mraible
Copy link
Copy Markdown
Contributor

@mraible mraible commented Mar 31, 2026

Replaces APIHarnessV2 (Uber class) with CustomStorage (service class) for all collection CRUD operations across the three function handlers.

The Falcon Foundry Functions Editor parses from falconpy import CustomStorage to auto-detect required OAuth scopes (custom-storage:read, custom-storage:write). It cannot parse the Uber class .command() pattern, which means apps using APIHarnessV2 require manual scope configuration.

Changes per function:

  • csv-import/main.pyAPIHarnessV2().command("PutObject", ...)CustomStorage(ext_headers=...).PutObject(...)
  • log-event/main.py — Same migration for PutObject and SearchObjects calls
  • process-events/main.py — Same migration for SearchObjects, GetObject, and PutObject calls

The ext_headers constructor parameter replaces per-request headers kwargs, applying the X-CS-APP-ID header to all requests from the client instance. Response shapes and behavior are unchanged.

Draft because the associated blog post needs updating to match the new patterns.

Replace the generic APIHarnessV2 uber-class with the purpose-built
CustomStorage service class for all collection CRUD operations. This
uses ext_headers at construction time instead of passing headers on
every call, and calls methods directly (PutObject, GetObject,
SearchObjects) instead of routing through .command().
@mraible mraible requested a review from a team March 31, 2026 20:27
mraible added 3 commits March 31, 2026 14:48
Add verifyWorkflowExecutionCompleted() that polls the execution status
page until terminal state, catching function failures that were
previously invisible. Add extension interaction test that saves
preferences to exercise collection write path end-to-end.
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