validateOrganization

fun validateOrganization(normalizedOrganization: String, validation: LegalNameValidator.Validation)

The validation function validates a string for use as the organization attribute of a name, which includes additional constraints over basic name attribute checks. It applies the following additional rules:

  • Must be normalized (as per the normalize function).

  • Length must be 255 characters or shorter.

  • No blacklisted words like "node", "server".

  • Must consist of at least three letters.

Full validation (typically this is only done for names the Doorman approves) adds:

  • Restrict names to Latin scripts for now to avoid right-to-left issues, debugging issues when we can't pronounce names over the phone, and character confusability attacks.

  • Must start with a capital letter.

  • No commas or equals signs.

  • No dollars or quote marks, we might need to relax the quote mark constraint in future to handle Irish company names.

Throws

if the name does not meet the required rules. The message indicates why not.