November 2019
Intermediate to advanced
408 pages
9h 56m
English
For the POSTGRES_PASSWORD environment variable, we don't need to change anything. It was already an environment variable and the code was extracting it from there.
But for the secrets stored as files, we need to retrieve them from the proper location. The secrets stored as files are the key to signing the authentication headers. The public file is required in all the microservices, and the private key only in the Users Backend.
Now, let's take a look at the config.py file for the Users Backend:
import osPRIVATE_KEY = ...PUBLIC_KEY = ...PUBLIC_KEY_PATH = '/opt/keys/public_key.pub'PRIVATE_KEY_PATH = '/opt/keys/private_key.pem'if os.path.isfile(PUBLIC_KEY_PATH): with open(PUBLIC_KEY_PATH) as fp: PUBLIC_KEY ...
Read now
Unlock full access