Skip to content

Releases

v0.2.0 - Access

Choose a tag to compare

@Nikolay-Chillev Nikolay-Chillev released this 03 Nov 17:50
59646fc

Second milestone release: Access. It covers who gets into a workspace and what they may do there:

  • accounts and invitations, from the email to the app;
  • roles and permissions, over the API and in the UI;
  • isolation between customers' workspaces;
  • tokens, sessions and two-factor sign-in.

Environment

  • Twenty 2.52.0, up from 2.48.0, with Postgres, Redis and Mailpit, all still pinned by digest.
  • A second customer: the setup project also creates Other Workspace on http://other.localhost:3000, with its own admin and API key, for the isolation tests (ADR 0001).
  • Nightly run: every night the UI tests also run in Firefox and WebKit, and one Allure report, with history, holds the results of all three browsers.

Framework

  • UI components:
    • the sign-in, invitation and password reset pages, including the code step of two-factor sign-in;
    • the settings, with the members section, the devices on the profile and the two-factor setup;
    • the command menu.
  • Roles: RolesApi makes roles with object, field and other permissions, and API keys with a role. A test's roles and keys are removed after it.
  • Fixtures:
    • signInWithRole gives a new member a role and signs them in through the sign-in page;
    • newMember, guestPage and invitee give a test its own user, a browser without a session and someone to invite;
    • otherWorkspace gives the second customer's workspace;
    • apiFor() and graphqlFor() give the records API with any token.
  • Auth helpers:
    • tokens: sign in for a token pair, renew it, and tamper with a token;
    • two-factor sign-in, with one-time codes made as an authenticator app does (checked against the test values of RFC 6238).
  • Refusals: helpers check a refusal by its code, so the tests of the refusal status (finding #65) are the only ones that depend on it.

Tests: 181

181 tests run on every pull request, 67 more than in v0.1.0. 11 of them are expected failures that pin open findings.

Level Tests
API (REST and GraphQL, email through Mailpit) 119
UI (Chromium on every pull request; Firefox and WebKit every night) 40
Unit tests of the framework 18
Setup: two workspaces, users, API keys 4

What the Access milestone added:

  • Sign-in:
    • sign-in with a password, and a wrong password refused;
    • sign-up without an invitation refused;
    • signing out ends the session and its copies;
    • password reset from the email back into the app, with only the new password working, and a reset link that works once.
  • Invitations:
    • an invited person joins from the email as a Member;
    • an invitation can be resent and removed;
    • a member may not invite.
  • Roles and permissions, over the API:
    • a member works with records, but may not see or change roles and API keys, give themselves the Admin role or add a webhook;
    • roles that may only read an object, may not delete from it, or have no access to it, over REST and GraphQL and through a related record;
    • a hidden field is left out of reads and refused in filters and writes, and a read-only field is refused in writes;
    • the Views permission decides who changes shared views;
    • a revoked API key stops at once; a key cannot get a role meant only for users, nor make keys.
  • Permissions in the UI, in three browsers:
    • a member has only their own settings, even by address;
    • a role that may only read companies sees them, but is offered no way to add, change or delete one;
    • a hidden field is not in the table, its columns or its filters, and its value is not on the record page;
    • a role without the Views permission is not offered to change a shared view.
  • Isolation between workspaces:
    • another workspace's API key cannot read, change or delete this workspace's records by id, nor find, change or delete them through a filter, over REST and GraphQL;
    • this workspace's admin gets no token for the other workspace's address;
    • this workspace's browser session does not open the other workspace's records.
  • Tokens and sessions:
    • an access token with a changed signature, or changed to name another workspace, is refused;
    • an API key stops working once it expires;
    • renewal needs a valid refresh token;
    • logging out the other devices signs those browsers out;
    • a member taken out of the workspace loses access at once.
  • Two-factor sign-in:
    • turned on from the profile with a code from the app;
    • after that, a password alone or a wrong code is refused, and the right code lets the member in.

Findings

The milestone added five findings, all in Twenty itself:

  • Major:
    • a removed invitation still lets the person join while the invite link is on (#54), a risk rather than a plain defect;
    • the sign-in page sometimes stays on its loader for good (#57). The suite reloads the page once, and the report says when it did.
  • Minor:
    • a refusal for lack of permission is 400 over REST, not 403 (#65);
    • a field a role may not see is listed on the record page as an empty field (#68);
    • a two-factor code can be used to sign in more than once (#74).

Seven findings are now reported to Twenty, and three of them are already fixed there:

  • Fixed: the currency code (#30) and phone numbers (#32), in 2.54.0, and the reused two-factor code (#74), after it. Their expected failures will start to pass when the environment moves to those versions.
  • Fixes waiting for review: a fix by another contributor is open for #57, #65 and #68.
  • Open: #34 has no fix yet.

The full list, and what is still being investigated, is in docs/findings.md. For example: whether logging out a device should also revoke the tokens from the same sign-in.

Reports

Next

The Workspace milestone:

  • the kanban board with drag and drop;
  • search with Cmd+K;
  • notes and tasks in the editor, and files;
  • CSV import;
  • custom objects and fields;
  • real-time updates between two users;
  • webhooks;
  • a canary run against the latest Twenty.

Its security checks will cover:

  • markup in the editor and in files;
  • formulas in CSV exports;
  • webhooks sent to internal addresses;
  • security headers and CORS.

v0.1.0 - Foundation and records

Choose a tag to compare

@Nikolay-Chillev Nikolay-Chillev released this 24 Oct 12:21
b666857

First milestone release. It brings:

  • a reproducible Twenty environment;
  • a typed TypeScript and Playwright framework;
  • coverage of the records at the heart of a CRM (companies, people and opportunities) through the REST and GraphQL APIs and the UI.

Environment

  • Containers: Twenty 2.48.0 (server and worker), Postgres 16, Redis 8 and Mailpit run in Docker, all pinned by digest.
  • Start-up: the environment is ready for tests in about 90 seconds. Its health checks need the database and the email queue, not just a running server.
  • Workspaces: one server hosts several workspaces, so isolation between customers can be tested. The suite works in its own workspace at http://qa.localhost:3000 (ADR 0001).
  • Test settings: email goes to Mailpit, and the API and invitation limits are higher. Each change is documented (ADR 0005).

Framework

  • Code checks: strict TypeScript, ESLint with type-aware rules (a missing await fails the lint), Prettier and a pre-commit hook.
  • Setup project: creates the workspace, takes an admin and a member through onboarding, and saves their signed-in browsers and an API key.
  • API clients: REST and GraphQL clients check every response against a Zod contract. GraphQL queries ask for exactly the fields the contract checks.
  • UI components: the sidebar, the record table, the bar of filters, sorts and saved views above it, and the record page.

Tests: 114

The 114 tests include 7 expected failures that pin open findings.

Level Tests
API (REST and GraphQL, email through Mailpit) 85
UI (Playwright; Chromium in CI, Firefox and WebKit locally) 14
Unit tests of the framework 12
Setup: workspace, users, API key 3

What they cover:

  • Records:
    • create, read, update and delete for companies, people and opportunities over REST and GraphQL;
    • relations;
    • validation;
    • Cyrillic, markup and long values;
    • a record saved over one API reads the same over the other.
  • Lists:
    • filters, including Cyrillic case and Latin letters that look Cyrillic;
    • sorting;
    • cursor paging;
    • bulk create, update and delete;
    • trash, restore and permanent delete.
  • UI:
    • each role opens the app signed in;
    • records from the API show in the table;
    • a cell edit reaches the API;
    • Create saves a record;
    • a record opens in the side panel;
    • a person's page links to their company.
  • Views in the UI:
    • a Cyrillic filter and a sort show what the API returns;
    • a saved view keeps its filter and sort after a reload, and the member finds it;
    • a view's filter can be changed;
    • a view can be renamed and deleted.
  • Email: the password reset link arrives in Mailpit.

Findings so far

There are six findings so far, all in Twenty itself:

  • Major:
    • an amount with a currency code that does not exist is saved, and the app hides it (#30);
    • deleting by filter over REST has no limit and is permanent by default (#34).
  • Minor:
    • /healthz reports OK while the database is down (#12);
    • a request without a token gets 403 instead of 401 (#17);
    • raw database errors reach API clients (#31);
    • phone numbers of any length are saved (#32).

The full list, and what is still being investigated, is in docs/findings.md.

Reports

Next

The Access milestone:

  • sign-in and password reset from the email to the app;
  • invitations;
  • roles and permissions over the API and in the UI;
  • sessions;
  • isolation between workspaces;
  • a nightly run in three browsers.