Skip to content

Proxy server database

Dmytro Titov edited this page Dec 2, 2020 · 2 revisions

The proxy server needs PostgreSQL database in order to store/retrieve username mappings (ELIXIR AAI ID to CEGA ID). This is a temporary solution before ELIXIR AAI tokens start to incorporate CEGA linked identities.

This PostgreSQL database is ordered from USIT. It's located outside TSD (because it doesn't store any sensitive information). The schema is very simple and can be populated using the following bash-script:

#!/bin/bash
set -e

psql -v ON_ERROR_STOP=1 --username "$$POSTGRES_USER" --dbname "$$POSTGRES_DB" <<-EOSQL
CREATE TABLE IF NOT EXISTS mapping
(
    ega_id          VARCHAR NOT NULL,
    elixir_id       VARCHAR NOT NULL,
    PRIMARY KEY (ega_id),
    UNIQUE (ega_id, elixir_id)
);
EOSQL