Skip to content

feat: add direct Puzzel client-credentials auth for demo - #9

Draft
nicomiguelino wants to merge 1 commit into
developmentfrom
feat/demo-client-credentials-auth
Draft

feat: add direct Puzzel client-credentials auth for demo#9
nicomiguelino wants to merge 1 commit into
developmentfrom
feat/demo-client-credentials-auth

Conversation

@nicomiguelino

Copy link
Copy Markdown
Contributor

Summary

  • Adds client_id/client_secret settings so the Edge App can exchange them directly for a Puzzel access token.
  • Adds 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.

- 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
Copilot AI lite review requested due to automatic review settings August 21, 2026 19:03
@nicomiguelino nicomiguelino self-assigned this Aug 21, 2026
@nicomiguelino
nicomiguelino marked this pull request as draft August 21, 2026 19:03

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

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 thread src/credentials.ts
Comment on lines 110 to 115
const cached = readEdgeAppCache<CachedCredentials>(
CACHE_NAMESPACE,
'credentials',
)
return cached?.accessToken ?? ''
return cached?.accessToken ?? devAccessToken
}
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