reserved-email-addresses-list
Advanced tools
Comparing version 0.0.4 to 0.0.5
{ | ||
"name": "reserved-email-addresses-list", | ||
"description": "List of 1250+ email addresses reserved for security concerns", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -41,3 +41,4 @@ "bugs": { | ||
"files": [ | ||
"index.json" | ||
"index.json", | ||
"admin-list.json" | ||
], | ||
@@ -44,0 +45,0 @@ "homepage": "https://github.com/forwardemail/reserved-email-addresses-list", |
@@ -43,14 +43,23 @@ # reserved-email-addresses-list | ||
It is also highly recommended that you check for strict equality, starts with, and ends with comparisons as well. | ||
It is also highly recommended that you check for strict equality, and for a list of admin-related usernames, you should check for strict equality, starts with, or ends with comparisons as well. | ||
```js | ||
const reservedEmailAddressesList = require('reserved-email-addresses-list'); | ||
const reservedAdminList = require('reserved-email-addresses-list/admin-list.json'); | ||
const str = 'Admin***!!!'.toLowerCase().replace(/[^0-9a-z]/g, ''); | ||
const reservedMatch = reservedEmailAddressesList.find( | ||
addr => addr === str || str.startsWith(addr) || str.endsWith(addr) | ||
); | ||
let reservedMatch = reservedEmailAddressesList.find(addr => addr === str); | ||
if (!reservedMatch) | ||
reservedMatch = reservedAdminList.find( | ||
addr => addr === str || str.startsWith(addr) || str.endsWith(addr) | ||
); | ||
if (reservedMatch) | ||
throw new Error( | ||
`User must be a domain admin to create an alias with a reserved word (see the page on <a target="_blank" rel="noopener" href="${config.urls.web}/reserved-email-addresses">Reserved Email Addresses</a>).` | ||
); | ||
if (reservedMatch) | ||
throw new Error(`${str} matched a reserved email address of ${match}`); | ||
@@ -74,2 +83,3 @@ ``` | ||
* <https://help.salesforce.com/articleView?id=pardot_admin_role_based_email_address.htm&type=5> | ||
* <https://www.entrustdatacard.com/blog/2015/march/what-happened-with-livefi> | ||
@@ -76,0 +86,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21366
5
1260
102