daisy / epubtest-site

epubtest.org
MIT License
3 stars 0 forks source link

epubtest.org

EPUB reading experience testing: epubtest.org

This is a website and database to record accessibility evaluations of EPUB reading systems.

For developers

Developer getting started guide

Tech notes

Back end: Express + nunjucks + graphql queries

Front end: static HTML + web component enhanced tables

Back end's back end: Postgresql database and a postgraphile db api (graphql)

Code notes

src

actions

Multipart processes, such as:

epub-parser

Parse a test book into a JSON structure

l10n

Experimental

pages

Entire front-end

queries

GraphQL queries. Of note is queries/crudGenerator.js, which generates basic CRUD operation queries, given a few parameters.

routes

Other files

test

Workflow tests; run with mocha.

Caveats, other notes, etc

Postgraphile and column-level grant

Postgraphile does not support column-level grants, which is why there is a separate logins vs users table. Otherwise the login information would be theoretically visible to anyone who could view the user information (which, some of it could be viewable, for example, if the user has chosen to get credited for their work, then the results page must display their creditAs value, so their credits must be publicly accessible).

Since we are controlling database access via the server, no outside querying is allowed, and the pages are tightly controlled. To be forward-thinking, however, the database API was setup with the possibility to one day have more client-side querying supported, therefore security tokens, row level security, and design decisions such as what's described above are in place.

Note that one exception to this lies with the use of "private link" tokens. The server (express layer) verifies specific resource access permissions; the database layer gives blanket (table(s)-wide) read-only permission. If we ever created a public database endpoint, we would have to keep this in mind.

Another exception is the "create temporary token" function, which is right now only called by the server but again, if we ever created a public database endpoint, access to this this should be restricted.

Authentication

Token-based authentication