Skip to content

feat(import): add Xibo CMS (REST) provider to the import framework - #3149

Merged
vpetersson merged 4 commits into
masterfrom
feat/import-content-xibo
Jul 8, 2026
Merged

feat(import): add Xibo CMS (REST) provider to the import framework#3149
vpetersson merged 4 commits into
masterfrom
feat/import-content-xibo

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

Stacked on #3148 (piSignage). Fifth provider in the import series.

Base branch: feat/import-content-pisignage — review after the earlier PRs. Retarget to master as the stack merges.

Description

  • Xibo provider (REST, Xibo CMS API): imports images and videos from a CMS library over the same ImportProvider interface, wizard, and CLI.
  • Auth: OAuth2 client-credentials — an API application's client_id/client_secret are exchanged for a Bearer token at POST /api/authorize/access_token. Per-CMS host, so the operator token is cms-host:client_id:client_secret.
  • Content + filter: lists GET /library, imports mediaType image/video, skips everything else (audio, documents, module widgets).
  • Download: /library/download/{mediaId}/{type} on the CMS host — the Bearer token is attached (shared ingest auth-scoping).
  • Unit tests (no network).

Follow-ups (flagged in xibo.py): Xibo web pages are layout widgets, not library media, so aren't imported; confirm the download-path shape against a live CMS.

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 07:41
@vpetersson vpetersson self-assigned this Jul 8, 2026
@vpetersson
vpetersson requested a review from Copilot July 8, 2026 07:42

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 new Xibo CMS (REST) implementation of the existing import-provider framework, enabling operators to browse and import Xibo library media (images/videos) via the same wizard/CLI surface as other providers in the import series.

Changes:

  • Introduces XiboProvider with OAuth2 client-credentials auth, paginated /library listing, and same-host authenticated downloads.
  • Registers the new provider in the integrations registry so it appears in Settings/Wizard and is available via the provider lookup API.
  • Adds unit tests covering token parsing, auth, listing classification, registry wiring, and import/download header attachment (no network).

Reviewed changes

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

File Description
src/anthias_server/lib/integrations/xibo.py New Xibo REST import provider (auth, list, import/download).
src/anthias_server/lib/integrations/registry.py Registers XiboProvider in the provider registry.
src/anthias_server/api/tests/test_xibo_import.py Unit tests for Xibo provider behavior and registry integration.

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

Comment thread src/anthias_server/lib/integrations/xibo.py Outdated
Comment thread src/anthias_server/lib/integrations/xibo.py Outdated
@vpetersson
vpetersson force-pushed the feat/import-content-xibo branch from 10f41f6 to d32213e Compare July 8, 2026 08:16
@vpetersson
vpetersson force-pushed the feat/import-content-pisignage branch from 445a8dd to 656d7a5 Compare July 8, 2026 08:42
vpetersson and others added 3 commits July 8, 2026 08:48
- add a Xibo provider over the shared ImportProvider interface, reusing
  the ingest/http layer, wizard, and CLI
- OAuth2 client-credentials against a per-CMS host; operator token is
  "cms-host:client_id:client_secret"
- import image/video from GET /library (skip everything else); download
  from the same host with the Bearer token attached (scoped by ingest)
- unit tests (no network)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- accept a whitespace-separated "<cms-url> <client_id> <client_secret>"
  token so a self-hosted CMS URL with a scheme/port/sub-path works, not
  just Xibo Cloud hostnames
- scope the download auth to the CMS host:port
- tests for cloud + self-hosted-with-port token parsing

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- align the docstring with the actual /api/library/download path
- build the download URL from the normalised media_type so API casing
  variance can't produce a wrong URL

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson changed the base branch from feat/import-content-pisignage to master July 8, 2026 08:48
- move the json/stream response fakes into the shared test-helper module
  (Yodeck / piSignage / Xibo were each copy-pasting them) — clears the
  SonarCloud new-code duplication gate
- use the parsed client id/secret in the Xibo self-hosted token test
  (S1481)

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

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@vpetersson
vpetersson merged commit 345e39a into master Jul 8, 2026
9 checks passed
@vpetersson
vpetersson deleted the feat/import-content-xibo 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