For the complete documentation index, see llms.txt. This page is also available as Markdown.

4.5.0

In this Version, support for PostgreSQL databases has been added. 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. The previous MongoDB support has also not been altered. The decision about which database technology the service will use will be made at startup, 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_backend

About the databases

In the case of MongoDB, the service itself will create a database called db-backend, if it does not already exist. It will host two collections in it:

  • media for storing images.

  • patterns for storing biometric patterns.

The PostgreSQL case is slightly different. A database with the name db_backend must have been created previously by the system administrator. PostgreSQL makes creating databases from the client itself difficult. An example of the preliminary 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;"

Within the PostgreSQL database, the service will create two tables, just as it did with MongoDB:

  • media for storing images.

  • patterns for storing biometric patterns.

Important: The connection strings must include the username/password information or any additional information that allows the service access with read/write permissions.

Added

  • Optional JWT authentication, configurable from config.json or via environment variables FACEPHI_BACKEND1N_REST_*.

  • Database support PostgreSQL.

  • Integration test coverage for public and protected endpoints when JWT authentication is enabled.

  • Integration test coverage for the MongoDB and PostgreSQL backends.

Last updated