4.5.0
This Version adds support for PostgreSQL databases. Optional JWT authentication was also added, configurable from config.json or via environment variables FACEPHI_BACKEND1N_REST_*.
There are no contract changes in the endpoints. Nor has the previous MongoDB support been altered. The decision on which database technology the service will use will be made when it starts, based on the connection string:
# Accepted MongoDB prefixes.
# mongodb://
# mongodb+srv://
export DATABASE_CONNECT_STRING=mongodb://user:pass@localhost:32902/?directConnection=true&serverSelectionTimeoutMS=5000
# Accepted PostgreSQL prefixes.
# postgres://
# postgresql://
export DATABASE_CONNECT_STRING=postgresql://user:pass@localhost:32903/db_backendAbout the databases
In the case of MongoDB, the service itself will create a database named db-backend, if it does not already exist. It will host two collections:
mediato store images.patternsto store biometric patterns.
The PostgreSQL case differs slightly. A DB named db_backend must have been created beforehand by the system administrator. PostgreSQL makes it difficult to create databases from the client itself. An example of the prior commands the administrator should run would be:
sudo -u postgres psql -c "CREATE ROLE backend1n WITH LOGIN PASSWORD 'backend1n';"
sudo -u postgres psql -c "CREATE DATABASE db_backend OWNER backend1n;"
sudo -u postgres psql -d db_backend -c "GRANT ALL ON SCHEMA public TO backend1n;"Inside the PostgreSQL DB, the service will create two tables, just as it did with MongoDB:
mediato store images.patternsto store biometric patterns.
Important: The connection strings must include the user/password information or any additional information that allows the service access with read/write permissions.
Added
Optional JWT authentication, configurable from
config.jsonor via environment variablesFACEPHI_BACKEND1N_REST_*.Database support
PostgreSQL.Coverage of integration tests for public and protected endpoints when JWT authentication is enabled.
Coverage of integration tests for the MongoDB and PostgreSQL backends.
Last updated