Skip to content

Invitations

  • [E] Nobody registers without an invitation. The invitation code of version 1 is gone.
  • [E] The admin enters an e-mail address in the admin panel; an invitation mail with a link goes out through SMTP (nodemailer). The SMTP settings are environment variables, the password a secret file.
  • [E] The link is valid once and for 7 days (NOVA_INVITE_DAYS), bound to the address: the account gets that address, it cannot be changed at the registration.
  • [E] The admin can also copy the link, for example when no mail arrives or no SMTP is set up. The admin sees the open invitations and can revoke them.
  • [V] The token is 32 random bytes; only its SHA-256 is stored. So the link is shown only right after it is created; a lost link means a new invitation.
  • [V] The token travels in the fragment (/#invite=…): browsers never send it to a server or in a Referer, and the page removes it from the address bar at once.
  • [V] A new invitation for an address revokes its open one. An address that already has an account cannot be invited.
  • [V] If the mail fails, the invitation stays valid and the admin gets the link with a message; the failure is logged.
  • [V] The operator command nova invite <address> creates the first invitation of a fresh instance (there is no admin yet who could invite).
  • [V] The check of a token and the registration are rate-limited like the login.
  • [V] A name never holds a bidirectional override, isolate or mark (U+202A–202E, U+2066–2069, U+200E, U+200F), a zero-width or invisible character (U+200B–200D, U+2060, U+FEFF), a soft hyphen (U+00AD), a line or paragraph separator (U+2028, U+2029) or a C1 control (U+0080–009F): clean() drops them from every single-line text, cleanLines() from the text of a message (it keeps the zero-width joiner and non-joiner for emoji and some scripts, and turns a separator into a line break). A name that is empty after that is refused as too short. Two names are one name when their key is the same (name-key.ts: NFKC, invisible characters removed, full case folding), so „Émile“ and „émile“, „Straße“ and „STRASSE“ or a name in full-width letters is taken; the check reads all names and needs no schema change (#618). A look-alike of another script (Cyrillic „а“) is still a new name: that needs a table of confusables and is a proposal, not built. nova names lists the names that exist and hold a hidden character or are one name; it changes nothing.

Unit tests for tokens, expiry, revocation, address binding; HTTP tests for the API with a mailer double; E2E for link, single use, fragment removal and the copy path; the Compose smoke test sends a real mail to Mailpit and registers with its link.