Skip to content

Commit

Permalink
change auth to more general req_meta
Browse files Browse the repository at this point in the history
  • Loading branch information
datamel committed Dec 16, 2021
1 parent 89127e0 commit 7dfc98b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cylc/uiserver/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,16 @@ async def service(self, info, *m_args):

async def nodes_mutator(self, info, *m_args):
"""Mutate node items of associated workflows."""
req_meta = {}
_, _, w_args, _ = m_args
w_ids = [
flow[WORKFLOW].id
for flow in await self.get_workflows_data(w_args)]
if not w_ids:
return [{
'response': (False, 'No matching workflows')}]
auth_user = info.context.get('current_user', 'unknown user')
req_meta['auth_user'] = info.context.get(
'current_user', 'unknown user')

# Pass the multi-node request to the workflow GraphQL endpoints
_, variables, _, _ = info.context.get('graphql_params')
Expand All @@ -248,5 +250,5 @@ async def nodes_mutator(self, info, *m_args):
}
multi_args = {w_id: graphql_args for w_id in w_ids}
return await self.workflows_mgr.multi_request(
'graphql', w_ids, multi_args=multi_args, auth_user=auth_user
'graphql', w_ids, multi_args=multi_args, req_meta=req_meta
)

0 comments on commit 7dfc98b

Please sign in to comment.