This is a simple nest app to allow admins to generate custom access keys to users. This service acts as a middleware of sorts and enforces rate limiting on the access keys. The access keys are stored in a redis datastore and the rate limiting is enforced using custom logic in the access key service. This app works alongside an other app which requires access token management like the token service app.
$ npm install
Follow the instructions here to install redis on your machine.
Create a .env
file in the root of the project and add the following environment variables:
PORT=3000 # Port the app will run on
# NOTE: This must match the PUBSUB channel in the Web3TokenInformationService as well
REDIS_HOST=localhost # Redis host
REDIS_PORT=6379 # Redis port
REDIS_PUBSUB_CHANNEL=access-keys # Redis pubsub channel
# MongoDB related
MONGO_CONNECTION_STRING=mongodb://localhost:27017 # MongoDB connection string
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
NOTE: This collection is for the local environment. The base URL is set to http://localhost:3000
. Change the base URL to the deployed URL if you want to use it in a deployed environment.
Can be found here