From 79c2ecbd8101076e102d13788216e4451ebe6ce8 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 5 Jun 2023 17:11:28 +0200 Subject: [PATCH] add ID_FEDERATED --- ereuse_devicehub/config.py | 1 + ereuse_devicehub/resources/device/models.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ereuse_devicehub/config.py b/ereuse_devicehub/config.py index 3df4ee25..5766156a 100644 --- a/ereuse_devicehub/config.py +++ b/ereuse_devicehub/config.py @@ -97,6 +97,7 @@ class DevicehubConfig(Config): MAIL_DEFAULT_SENDER = config('MAIL_DEFAULT_SENDER', '') API_DLT = config('API_DLT', None) API_DLT_TOKEN = config('API_DLT_TOKEN', None) + ID_FEDERATED = config('ID_FEDERATED', None) """Definition of oauth jwt details.""" OAUTH2_JWT_ENABLED = config('OAUTH2_JWT_ENABLED', False) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 0c1d32a4..06e0994b 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -972,6 +972,9 @@ class Device(Thing): if isinstance(c, DataStorage): c.register_dlt() + if app.config('ID_FEDERATED'): + api.add_service(self.chid, 'devicehub', app.config('ID_FEDERATED'), '', '') + def unreliable(self): self.user_trusts = False i = 0