API Reference — Surfaces¶
Built-in injectable surfaces.
Note
OneDriveSurface requires the onedrive extra: pip install "rampart[onedrive]".
surfaces
¶
Built-in injection surfaces for common platforms.
OneDriveSurface
¶
OneDriveSurface(
*,
graph_client,
drive_id,
folder_path,
indexing_delay=DEFAULT_INDEXING_DELAY,
)
Injects payloads into a specific OneDrive location.
The surface is fully configured at construction — drive ID,
credentials, and target folder path. The inject() method takes
only a payload, keeping the injection signature universal
across all surfaces.
Uses the Microsoft Graph API (/drives/{drive_id}/...) for
file operations. Requires an authenticated GraphServiceClient
from msgraph-sdk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph_client
|
GraphServiceClient
|
An authenticated |
required |
drive_id
|
str
|
The OneDrive drive identifier. |
required |
folder_path
|
str
|
Target folder path within the drive
(e.g., |
required |
indexing_delay
|
float
|
Seconds to wait after upload for the agent to see the content. OneDrive indexing is typically fast but depends on the consuming application. |
DEFAULT_INDEXING_DELAY
|
Initialize with Graph client and OneDrive location.
Source code in rampart/surfaces/onedrive.py
inject
¶
Prepare an injection into the configured OneDrive folder.
Returns an InjectionHandle — enter it as an async context manager to activate the injection, exit to clean up.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Payload
|
The content to inject. |
required |
Returns:
| Type | Description |
|---|---|
_OneDriveInjection
|
An |
Source code in rampart/surfaces/onedrive.py
upload_async
async
¶
Upload payload content to OneDrive. Returns the item ID.
Uses the small-file upload endpoint
(PUT .../root:/{path}:/content), which supports files
up to 4 MiB.
Raises:
| Type | Description |
|---|---|
ValueError
|
If a binary payload has no artifact path, or if the payload exceeds the 4 MiB small-upload limit. |
InfrastructureError
|
If Graph returns no |
Source code in rampart/surfaces/onedrive.py
delete_async
async
¶
Delete a file from OneDrive by item ID.
Source code in rampart/surfaces/onedrive.py
| Python | |
|---|---|