From 05521303c8f8a8ddb72c27c92e09db19e4a902f3 Mon Sep 17 00:00:00 2001 From: DavidCroftDKFZ <46788708+DavidCroftDKFZ@users.noreply.github.com> Date: Tue, 21 Oct 2025 15:50:43 +0200 Subject: [PATCH] Directory sync: token login and cron change The Directory team have requested that we allow token login to the Directory, where a user uses LSAAI credentials to obtain a token from the Directory, and then uses this to authenticate Directory sync. This has been implemented via an environment variable, in an analogous way to the already existing username/password method. The default start time for the Directory sync has been shifted to 22:30, to prevent conflicts with the Bridgehead auto-update. Relevant changes have been made to the documentation. --- README.md | 13 ++++++++++--- bbmri/modules/directory-sync-compose.yml | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cfc4434..7d52d1d 100644 --- a/README.md +++ b/README.md @@ -318,6 +318,12 @@ To enable it, you will need to explicitly set the username and password variable DS_DIRECTORY_USER_NAME=your_directory_username DS_DIRECTORY_USER_PASS=your_directory_password ``` +Alternatively, if you have obtained a token from the Directory, you can insert the following into the configuration file: +``` +DS_DIRECTORY_USER_TOKEN=your_directory_token +``` +If you don't supply any authentification information (either login credentials or a token), Directory sync will not start. + Please contact your National Node or Directory support (directory-dev@helpdesk.bbmri-eric.eu) to obtain these credentials. The following environment variables can be used from within your config file to control the behavior of Directory sync: @@ -325,12 +331,13 @@ The following environment variables can be used from within your config file to | Variable | Purpose | Default if not specified | |:-----------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------| | DS_DIRECTORY_URL | Base URL of the Directory | https://directory-backend.molgenis.net | -| DS_DIRECTORY_USER_NAME | User name for logging in to Directory **Mandatory** | | -| DS_DIRECTORY_USER_PASS | Password for logging in to Directory **Mandatory** | | +| DS_DIRECTORY_USER_NAME | User name for logging in to Directory | | +| DS_DIRECTORY_USER_PASS | Password for logging in to Directory | | +| DS_DIRECTORY_USER_TOKEN | Token for logging in to Directory | | | DS_DIRECTORY_DEFAULT_COLLECTION_ID | ID of collection to be used if not in samples | | | DS_DIRECTORY_ALLOW_STAR_MODEL | Set to 'True' to send star model info to Directory | True | | DS_FHIR_STORE_URL | URL for FHIR store | http://bridgehead-bbmri-blaze:8080 | -| DS_TIMER_CRON | Execution interval for Directory sync, [cron](https://crontab.guru) format | 0 22 * * * | +| DS_TIMER_CRON | Execution interval for Directory sync, [cron](https://crontab.guru) format | 30 22 * * * | | DS_IMPORT_BIOBANKS | Set to 'True' to import biobank metadata from Directory | True | | DS_IMPORT_COLLECTIONS | Set to 'True' to import collection metadata from Directory | True | diff --git a/bbmri/modules/directory-sync-compose.yml b/bbmri/modules/directory-sync-compose.yml index 834dd92..b574c4a 100644 --- a/bbmri/modules/directory-sync-compose.yml +++ b/bbmri/modules/directory-sync-compose.yml @@ -7,7 +7,8 @@ services: DS_DIRECTORY_URL: ${DS_DIRECTORY_URL:-https://directory.bbmri-eric.eu} DS_DIRECTORY_USER_NAME: ${DS_DIRECTORY_USER_NAME} DS_DIRECTORY_USER_PASS: ${DS_DIRECTORY_USER_PASS} - DS_TIMER_CRON: ${DS_TIMER_CRON:-0 22 * * *} + DS_DIRECTORY_USER_TOKEN: ${DS_DIRECTORY_USER_TOKEN} + DS_TIMER_CRON: ${DS_TIMER_CRON:-30 22 * * *} DS_DIRECTORY_ALLOW_STAR_MODEL: ${DS_DIRECTORY_ALLOW_STAR_MODEL:-true} DS_DIRECTORY_MOCK: ${DS_DIRECTORY_MOCK} DS_DIRECTORY_DEFAULT_COLLECTION_ID: ${DS_DIRECTORY_DEFAULT_COLLECTION_ID}