Skip to content

feat(import): add piSignage (REST) provider to the import framework - #3148

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

feat(import): add piSignage (REST) provider to the import framework#3148
vpetersson merged 2 commits into
masterfrom
feat/import-content-pisignage

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

Stacked on #3146 (OptiSigns). Fourth provider in the import series.

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

Description

  • piSignage provider (REST): imports images and videos from a hosted piSignage account, over the same ImportProvider interface, wizard, and CLI as the others.
  • Auth: piSignage is per-account on a subdomain and authenticates by exchanging credentials for a JWT (POST /session) sent as x-access-token. Because both the subdomain and login are needed, the operator's token is subdomain:email:password.
  • Content + filter: lists the account's uploaded files (GET /files), imports image/video, skips audio. (Web-link assets aren't part of /files; noted as a follow-up.)
  • Download: media is served from the same host as the API, so the token is attached to the download — the shared ingest auth-scoping handles this (token attached only for the matching host).
  • Unit tests (no network).

Follow-ups (flagged in pisignage.py): confirm the path → download-URL mapping and whether the media host needs the token, against a live hosted account; web-link assets aren't imported.

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

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 piSignage (REST) import provider to Anthias’ existing import framework, wiring it into the provider registry and covering the behavior with unit tests (no network).

Changes:

  • Implement PiSignageProvider to authenticate via POST /session (JWT in x-access-token), list media via GET /files, and import image/video assets via the shared ingest layer.
  • Register the provider in the integrations registry so it’s discoverable by the API/wizard/CLI.
  • Add unit tests validating token parsing/login, listing classification, idempotent import behavior, and same-host download auth header attachment.

Reviewed changes

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

File Description
src/anthias_server/lib/integrations/registry.py Registers PiSignageProvider in the import provider registry.
src/anthias_server/lib/integrations/pisignage.py New REST provider implementation for piSignage (token parsing, login, listing, per-item import).
src/anthias_server/api/tests/test_pisignage_import.py Unit tests for piSignage provider behavior with mocked session/network.

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

Comment thread src/anthias_server/lib/integrations/pisignage.py
Comment thread src/anthias_server/lib/integrations/pisignage.py
Comment thread src/anthias_server/lib/integrations/pisignage.py Outdated
- add a piSignage provider over the shared ImportProvider interface,
  reusing the ingest/http layer, wizard, and CLI
- per-subdomain host + credential login (POST /session -> JWT, sent as
  x-access-token); operator token is "subdomain:email:password"
- import image/video files from GET /files (skip audio); download from the
  same host with the token attached (scoped by ingest)
- unit tests (no network)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson changed the base branch from feat/import-content-optisign to master July 8, 2026 08:42
- encode the filename as a single path segment (quote safe='')
- normalise the media path to one leading slash before building the URL
- coerce dbdata names to str so the files-list de-dupe is reliable

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson force-pushed the feat/import-content-pisignage branch from 445a8dd to 656d7a5 Compare July 8, 2026 08:42
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

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