Two microservices(Auth and Auction) running independently. Admin ( aunthenticated by an static api secret ) can create/read/update/delete auctons and users . Users( Authenticated by jwt token ) can make bids on active auctions.
Create a new file named .flaskenv inside microservice/auction_service
Structure should look like this :
-> microservices -> auction_service -> .flaskenv
Set Environment variables in .flaskenv file :
FLASK_APP=app FLASK_DEBUG=True ADMIN_AUTH_KEY=GENERATE YOUR OWN KEY SECRET_KEY==GENERATE YOUR OWN KEY
Like above, create a new file named .flaskenv inside microservice/auth_service
Structure should look like this :
-> microservices -> auth_service -> .flaskenv
Set Environment variables in .flaskenv file :
FLASK_APP=app FLASK_DEBUG=True ADMIN_AUTH_KEY=GENERATE YOUR OWN KEY SECRET_KEY==GENERATE YOUR OWN KEY UNAUTHENTICATED_ROUTES=['/auth/signup','/auth/login']
Run the script in terminal ( Docker-Compose should be installed )
To be Authenticated as Admin and access the Admin API's, create a new header named 'ADMIN_AUTH' and set its value equal to the value of 'ADMIN_AUTH_KEY' in .flaskenv file