Saltar al contenido principal

@falkenslab/pseudonym

Classes​

ClassDescription
PseudonymErrorSomething a person can fix (a lost key, an unknown alias), with a message saying how.

Interfaces​

InterfaceDescription
IdentifiersWhat names a person in a service. Pass every one you have; the strongest present makes the alias.
PersonA person as a caller knows them in one service.
RedactedWhat redact() returns: the text safe to send, and how many replacements of each kind it made.
RedactOptionsOptions of redact().

Type Aliases​

Type AliasDescription
CountryAn ISO 3166 code of a country in COUNTRIES, for redact()'s countries option.

Variables​

VariableDescription
COUNTRIESCountries whose national ids and phones can be redacted.

Functions​

FunctionDescription
keyFingerprintA short code of the key (8 base32 characters of its HKDF-SHA256 "pseudonym/fingerprint" subkey), to check that two machines share it. It reveals nothing about the key. Creates the key on first use.
redactFree text with the directory's people in service replaced by their aliases (full names, case and accent insensitive; a first name alone only when one person has it and the text capitalizes it), then contact and identity data replaced by placeholders such as [EMAIL_1] or [US_SSN_1], the same value the same placeholder within the call: emails, payment cards and IBANs always; national ids and phones of the countries asked for (Spain by default), each checked with its check digit or impossible ranges. Street addresses, birth dates and people outside the directory are not detected. The result carries counts, never the values replaced. Throws a PseudonymError for an unknown country.
rememberThe alias of a person. A person already in the directory for that service keeps their first alias, even if an identifier changed; someone new gets one computed from their strongest identifier.
resolveThe service user id behind an alias, for a write tool that receives an alias from the model. Follows links. Keep the result on your side: it's for calling your own service, never for the model.