@@ -183,19 +183,13 @@ async def token_middleware(request, handler):
183183 # for now the permissions just reflects that the data can be decoded from token
184184 # the bona fide status is checked against ELIXIR AAI by default or the URL from config
185185 # the bona_fide_status is specific to ELIXIR Tokens
186- dataset_permissions , bona_fide_status = [], ''
187-
188186 # Retrieve GA4GH Passports from /userinfo and process them into dataset permissions and bona fide status
189- bona_fide_status = False
190- dataset_permissions = set ()
191- await check_ga4gh_token (decoded_data , token , bona_fide_status , dataset_permissions )
192-
193- LOG .info (f'Bona fide after: { bona_fide_status } ' )
194- LOG .info (f'Permissions after: { dataset_permissions } ' )
195- controlled_datasets = set ()
187+ dataset_permissions , bona_fide_status = set (), False
188+ dataset_permissions , bona_fide_status = await check_ga4gh_token (decoded_data , token , bona_fide_status , dataset_permissions )
196189 # currently we offer module for parsing GA4GH permissions, but multiple claims and providers can be utilised
197190 # by updating the set, meaning replicating the line below with the permissions function and its associated claim
198191 # For GA4GH DURI permissions (ELIXIR Permissions API 2.0)
192+ controlled_datasets = set ()
199193 controlled_datasets .update (dataset_permissions )
200194 all_controlled = list (controlled_datasets ) if bool (controlled_datasets ) else None
201195 request ["token" ] = {"bona_fide_status" : bona_fide_status ,
0 commit comments