Skip to content

feat(import): add ScreenCloud (GraphQL) provider to the import framework - #3145

Merged
vpetersson merged 2 commits into
masterfrom
feat/import-content-screencloud
Jul 8, 2026
Merged

feat(import): add ScreenCloud (GraphQL) provider to the import framework#3145
vpetersson merged 2 commits into
masterfrom
feat/import-content-screencloud

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

Stacked on #3144 (Yodeck import). Adds the second provider in the import series and the shared ingest layer that makes further providers small.

Base branch: feat/import-content-yodeck — review after #3144. Will retarget to master once #3144 merges.

Description

  • Shared ingest layer (ingest.py + http.py): the provider-agnostic download → CreateAssetSerializerV2 → idempotency logic and the neutral (non-Anthias) HTTP session are extracted out of the Yodeck provider so every provider reuses them. Yodeck now delegates to them; behaviour is unchanged and its tests still pass.
  • ScreenCloud provider (GraphQL): validates a token, pages allFiles (images/videos by mimetype) and allLinks, and imports each via the same ImportProvider interface, wizard, and CLI. Namespaced remote ids (file: / link:) route import_item. Regional endpoint via an optional eu:/us: token prefix.
  • Non-portable content filter (as requested): only STANDARD ScreenCloud links import (INTERNAL/CLOUD skipped); only image/video files (audio/documents skipped); allApps/allEmbeds are never queried. Yodeck likewise skips webpage media that resolves to Yodeck-hosted apps/widgets.
  • Download auth scoping: the API token is attached only when the download stays on the provider's host — never forwarded to a pre-signed CDN original (also applied to Yodeck via the shared layer).
  • Unit tests for the ScreenCloud provider (GraphQL mocked; no network).

Follow-ups (isolated, flagged in screencloud.py): the production regional hostnames, the fileById/linkById field names, and which FileOutput is the durable original vs a thumbnail are behind a ScreenCloud login — to be confirmed against a live token; the resolution points are isolated for a localized change.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

🤖 Generated with Claude Code

@vpetersson
vpetersson requested a review from a team as a code owner July 8, 2026 06:58
@vpetersson vpetersson self-assigned this Jul 8, 2026
@vpetersson
vpetersson requested a review from Copilot July 8, 2026 06:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a second content-import provider (ScreenCloud via GraphQL) and extracts the provider-agnostic “download → CreateAssetSerializerV2 → idempotency” logic into a shared ingest layer so future providers can stay small and consistent with the existing asset creation pipeline.

Changes:

  • Introduces a shared import ingest module (ingest.py) and neutral outbound session helper (http.py).
  • Refactors the existing Yodeck provider to delegate file/webpage ingestion and idempotency to the shared ingest layer.
  • Adds a new ScreenCloud (Studio) GraphQL provider plus unit tests, and registers it in the provider registry.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/anthias_server/lib/integrations/yodeck.py Refactors Yodeck provider to reuse shared ingest helpers for URL selection, windows, idempotency, and asset creation.
src/anthias_server/lib/integrations/screencloud.py Adds new ScreenCloud GraphQL provider (token validation, pagination, link/file import) using shared ingest layer.
src/anthias_server/lib/integrations/registry.py Registers the new screencloud provider in the import provider registry.
src/anthias_server/lib/integrations/ingest.py Adds shared provider-agnostic ingestion (download with auth scoping + serializer-based asset creation + idempotency stamping).
src/anthias_server/lib/integrations/http.py Adds shared “neutral UA” requests.Session factory for import providers.
src/anthias_server/api/tests/test_screencloud_import.py Adds unit tests for ScreenCloud provider (GraphQL mocked; verifies filters, idempotency, and download auth scoping).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/anthias_server/lib/integrations/screencloud.py
Comment thread src/anthias_server/lib/integrations/screencloud.py
Comment thread src/anthias_server/lib/integrations/screencloud.py
- extract provider-agnostic download/create/idempotency into ingest.py and
  a shared neutral-UA session (http.py); Yodeck now delegates to them
- add a GraphQL-backed ScreenCloud provider (allFiles + allLinks), reusing
  the same interface, wizard, and CLI as Yodeck
- filter non-portable content: import only STANDARD ScreenCloud links
  (skip INTERNAL/CLOUD) and image/video files (skip audio/documents)
- scope download auth to the file's host so a token is never forwarded to
  a pre-signed CDN original
- unit tests for the ScreenCloud provider

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson force-pushed the feat/import-content-screencloud branch from 6132621 to c63fdcc Compare July 8, 2026 08:29
@vpetersson
vpetersson changed the base branch from feat/import-content-yodeck to master July 8, 2026 08:30
- restrict ingest.first_http_url to http(s) (validate_url accepts rtsp)
- sanitise download extensions to safe .<alnum> (path-traversal guard)
- surface GraphQL list errors as transport errors so list_media yields a
  controlled 502, not a 500
- import requests; reword the internal-link skip reason

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson force-pushed the feat/import-content-screencloud branch from c63fdcc to b8f83fd Compare July 8, 2026 08:32
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@vpetersson
vpetersson merged commit 6cc1bcb into master Jul 8, 2026
9 checks passed
@vpetersson
vpetersson deleted the feat/import-content-screencloud branch July 8, 2026 08:53
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.

2 participants