2017 © Pedro Peláez
 

library subdomain-blacklist

Common words that your users shouldn't use when setting up accounts.

image

michaldudek/subdomain-blacklist

Common words that your users shouldn't use when setting up accounts.

  • Sunday, June 7, 2015
  • by michaldudek
  • Repository
  • 5 Watchers
  • 14 Stars
  • 117 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Subdomain Blacklist

List of common words that your users shouldn't use when setting up accounts., (*1)

Build Status SensioLabsInsight HHVM Status, (*2)

When your app or service allows users to access their accounts using subdomains, e.g. michaldudek.myapp.com, it is useful to block some words so they don't take away a subdomain you'd want to use in the future or worse, try to trick your other users into believing they represent you (e.g. legal.myapp.com or support.myapp.com)., (*3)

Apart from the blacklist, the goal of this repository is to provide code in various languages that validates a username against the list., (*4)

Note that the goal of this library IS NOT to validate domain name. You still have to check whether or not the given username makes a valid subdomain., (*5)

Acknowledgement

The idea and the list was originally taken from Sandeep Shetty., (*6)

Spec

Implementation MUST have a method/function called validate which takes a single string argument., (*7)

The validate method/function MUST return a boolean value., (*8)

Before a string is validates it MUST be normalized. Normalization of the string MUST:, (*9)

  • remove any suffixed digits,
  • change case to lowercase,
  • remove a single s character if the string ends with an s.

addToList

Implementation CAN contain addToList (or add_to_list if more appropriate for the language) method/function that will add other items to the blacklist., (*10)

addToList method/function MUST accept single string argument., (*11)

addToList method/function CAN accept an array of strings as a single argument., (*12)

Before a string item is added to the blacklist via addToList method/function the default blacklist MUST be loaded., (*13)

Before a string item is added to the blacklist it MUST be normalized with the rules above., (*14)

getList

Implementation CAN contain getList (or get_list if more appropriate for the language) method/function that will return the blacklist., (*15)

Using and Languages

For more information about how to use this list in your specific language, please refer to README.md file in the language's folder., (*16)

Currently supported:, (*17)

  • php - more info - $ composer require michaldudek/subdomain-blacklist dev-master

Planned:, (*18)

  • JavaScript (node.js)
  • JavaScript (browser)
  • Go
  • Ruby
  • Python

You are welcome to add support for other languages., (*19)

Contributing

At this moment pull requests with support for various languages are most welcome., (*20)

If you add a language support make sure to cover it with appropriate tests., (*21)

Also if you think some words should be added to the list either open an issue or do a PR., (*22)

If you are editing a code please make sure to adhere to common patterns and rules in that language., (*23)

See more in each languages specific README.md file in their appropriate directory., (*24)

The Versions

07/06 2015

dev-master

9999999-dev

Common words that your users shouldn't use when setting up accounts.

  Sources   Download

MIT

by Michał Dudek

user domain account username

07/06 2015

0.9.1

0.9.1.0

Common words that your users shouldn't use when setting up accounts.

  Sources   Download

MIT

by Michał Dudek

user domain account username

05/11 2014

0.9.0

0.9.0.0

Common words that your users shouldn't use when setting up accounts.

  Sources   Download

MIT

by Michał Dudek

user domain account username