From 66b8d951557441a7b0750733e43d2f0760bad0a0 Mon Sep 17 00:00:00 2001 From: "Kacper Kowalik (Xarthisius)" Date: Tue, 15 Mar 2022 14:20:48 -0500 Subject: [PATCH] Only add new globus scopes during plugin load Fixes #534 (for now...) --- server/__init__.py | 4 ++++ server/lib/deriva/auth.py | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/server/__init__.py b/server/__init__.py index 173d0db6..2fed57d4 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -19,6 +19,7 @@ from girder.exceptions import GirderException from girder.models.model_base import ValidationException from girder.models.notification import Notification, ProgressState +from girder.models.setting import Setting from girder.models.user import User from girder.plugins.jobs.constants import JobStatus from girder.plugins.jobs.models.job import Job as JobModel @@ -494,6 +495,9 @@ def store_other_globus_tokens(event): def load(info): + from girder.plugins.oauth.providers.globus import Globus + deriva_scopes = Setting().get(PluginSettings.DERIVA_SCOPES) + Globus.addScopes(list(deriva_scopes.values())) info['apiRoot'].wholetale = wholeTale() info['apiRoot'].instance = Instance() tale = Tale() diff --git a/server/lib/deriva/auth.py b/server/lib/deriva/auth.py index 957e0a80..2e6e23a0 100644 --- a/server/lib/deriva/auth.py +++ b/server/lib/deriva/auth.py @@ -1,12 +1,7 @@ from girder.models.setting import Setting -from ...constants import PluginSettings, DEFAULT_DERIVA_SCOPE +from ...constants import PluginSettings from ..verificator import Verificator -from girder.plugins.oauth.providers.globus import Globus - - -Globus.addScopes([DEFAULT_DERIVA_SCOPE]) - class DerivaVerificator(Verificator): def __init__(self, resource_server=None, key=None, user=None, url=None):