This is a proof of concept of an MSISDN Gateway server that takes a phone number and register it using an SMS validation mechanism.
- The client sends a request to
/register
.
-- The server chooses the verification process based on MSISDN, MCC and MNC codes and returns a session token and a verify endpoint.
- The client sends a request to
/sms/verify
(the verify endpoint).
-- The server sends a SMS text message containing a pin code, and returns the number that was used to send it (the phone number of the server, useful for silent SMS catch)
- The client sends a request to verify the pin code (to
/sms/verify_code
) with the session token and the pin code and gets back a BrowserID certificate. - If needed, the client can also ask for a new pin code using the
/sms/resend_code
URL and its sessionToken. - Finally the client can unregister itself using the
/unregister
URL and its sessionToken.
You will need to have redis-server installed:
apt-get install redis-server
Assuming you have brew installed, use it to install redis:
brew install redis
If you need to restart it (after configuration update):
brew services restart redis
Then clone the loop server and install its dependencies:
git clone https://github.com/mozilla-services/msisdn-gateway.git
cd msisdn-gateway && make install
You can create your configuration file in config/{NODE_ENV}.json
You need to generate the BrowserId keys by running ./bin/generate-keypair
and
add them to your configuration file.
development
is the default environment.
make runserver
is equivalent to:
NODE_ENV=development make runserver
To run DynamoDB tests you will need to install and run fake_dynamo or ddbmock
FakeDynamo needs ruby, ruby-dev(el) and rubygems.
make test
make update-l10n
And for automated scripts:
make update-l10n NOVERIFY=yes
usage = nbUsers * 1216 + 600000 (bytes)
- For 3.5M users 4 GB
- For 10M users 12 GB
The biggest AWS Elasticache Redis virtual machine is 68GB large so if we want to handle more that 60M users we will probably want to do some sharding to have one redis for MSISDN validation and another one for hawkSession management.
- 600000 bytes is the size of an empty redis-server.
- 1216 bytes is the fixed size of a given user including:
- It's hawkSessionToken
- It's code validation related data
- It's MSISDN related data
The /unregister endpoint drops everything about a user.
You should report bugs/issues or feature requests via Github Issues
The MSISDN Gateway code is released under the terms of the
Mozilla Public License v2.0. See the
LICENSE
file at the root of the repository.