feat: add direct Puzzel client-credentials auth for demo - #9
Draft
nicomiguelino wants to merge 1 commit into
Draft
feat: add direct Puzzel client-credentials auth for demo#9nicomiguelino wants to merge 1 commit into
nicomiguelino wants to merge 1 commit into
Conversation
- Adds client_id/client_secret settings so the app can authenticate directly with Puzzel - Adds a temporary script (bin/) for creating demo Edge App instances
There was a problem hiding this comment.
Pull request overview
This PR adds a demo-oriented authentication path where the Edge App can exchange Puzzel client_id/client_secret for an access token (client-credentials flow), alongside a helper script to quickly create/configure demo instances.
Changes:
- Added client-credentials token exchange (including in-memory caching) with fallback to existing broker-token logic.
- Extended test coverage for the new client-credentials behavior and caching.
- Updated manifests/docs and introduced a helper script for initializing demo instances with Puzzel credentials.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/credentials.ts | Implements client-credentials exchange + caching; adjusts fallback behavior. |
| src/credentials.test.ts | Adds tests for client-credentials priority, caching, and fallback. |
| src/constants.ts | Adds the Puzzel token endpoint constant. |
| screenly.yml | Adds app id and new client_id / client_secret settings. |
| screenly_qc.yml | Mirrors new client_id / client_secret settings for QC. |
| README.md | Documents configuring client_id / client_secret via CLI. |
| bin/initialize-puzzel-app-instance | Adds a helper script to create/configure demo instances in one step. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
110
to
115
| const cached = readEdgeAppCache<CachedCredentials>( | ||
| CACHE_NAMESPACE, | ||
| 'credentials', | ||
| ) | ||
| return cached?.accessToken ?? '' | ||
| return cached?.accessToken ?? devAccessToken | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
client_id/client_secretsettings so the Edge App can exchange them directly for a Puzzel access token.bin/initialize-puzzel-app-instance— a temporary helper script for creating demo Edge App instances and setting their Puzzel credentials in one step. Not intended to be a long-term part of this repo.