Skip to content

Add access control features with AccessClient and AccessGate models#459

Open
RodriSanchez1 wants to merge 184 commits into
masterfrom
feature/cboard-access
Open

Add access control features with AccessClient and AccessGate models#459
RodriSanchez1 wants to merge 184 commits into
masterfrom
feature/cboard-access

Conversation

@RodriSanchez1

@RodriSanchez1 RodriSanchez1 commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

This PR introduces a full access control system for "Cboard Access" — a subscription-based feature that lets institutions (clients) share AAC boards with end users via a shareable QR code / URL. The main additions are:

  • AccessClient model (institution, subscription, branding)
  • AccessGate model (code → linked board tree)
  • Board.accessGateCode field + partial index
  • Public endpoints: GET /access/clients/all, GET /access/:clientSlug/:gateCode
  • Admin endpoints: CRUD for clients/gates behind Bearer + admin scope
  • Integration tests covering all admin endpoints and the public access flow
  • Offline QR code generator script (no npm dependency, uses vendored qrcodegen)

magush27 and others added 30 commits March 31, 2026 20:17
Add accessCode field to Board model schema
…Id inclusion and optimize board count retrieval
RodriSanchez1 and others added 21 commits April 22, 2026 16:48
The nested field was named client inside the AccessClient model,
making references like client.client.name awkward to read. Renaming
to contact removes the duplication.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The create endpoint accepted an accessGate field whose value was a code
string, making it easy to confuse with the full AccessGate object returned
in the response. Renaming the input field to accessGateCode makes the
distinction explicit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…try block

Co-authored-by: Copilot <copilot@github.com>
… for consistency; update Swagger definitions and tests accordingly
…ensuring non-blocking responses and consistent timestamps

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 the “Cboard Access” feature set to the API, introducing institution-backed clients and shareable access gates (code → board tree) with public endpoints for end-user access, admin CRUD endpoints protected by Bearer+admin scope, supporting test coverage, and an offline QR code generator script.

Changes:

  • Added AccessClient / AccessGate models and an accessGateCode field + partial index on Board.
  • Implemented new public and admin access-control endpoints and documented them in Swagger.
  • Added integration tests plus Postman assets and a standalone QR PNG generator (vendored QR lib).

Reviewed changes

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

Show a summary per file
File Description
api/controllers/access.js Implements public access flow + admin CRUD/stats and board discovery/marking logic.
api/controllers/board.js Updates public-board listing to exclude boards associated with an access gate code.
api/models/AccessClient.js Adds the institution/subscription model.
api/models/AccessGate.js Adds the access gate model (code, root board, linked boards, analytics counters).
api/models/Board.js Adds accessGateCode field and a partial index for lookup efficiency.
api/swagger/swagger.yaml Documents new endpoints and new schemas for Access clients/gates and accessGateCode.
test/controllers/access.js New integration tests covering admin endpoints + public access flow/analytics.
test/controllers/board.js Adds tests for accessGateCode normalization and public listing exclusion behavior.
test/helper.js Extends helpers to return email and allow board creation with a specific email.
test/postman/CboardAccess.README.md Adds usage documentation for a new Postman collection.
test/postman/CboardAccess.collection.json Adds Postman collection for public/admin endpoint testing.
scripts/qr-generator/generate-qr.js Adds offline QR generator (PNG output) for access URLs.
scripts/qr-generator/qrcodegen-v1.8.0-es6.js Vendors QR library source used by the generator script.
.circleci/config.yml Adds a new qa-image job/workflow path for building/pushing a QA image.

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

Comment thread .circleci/config.yml Outdated
Comment thread .circleci/config.yml Outdated
Comment thread api/controllers/board.js Outdated
Comment thread api/controllers/access.js
Comment thread api/controllers/access.js
Comment thread api/swagger/swagger.yaml
Comment thread test/helper.js
Comment thread test/helper.js
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.

3 participants