MCPcopy Create free account
hub / github.com/bugy/script-server / fetch_user_groups

Method fetch_user_groups

src/auth/auth_gitlab.py:39–64  ·  view source on GitHub ↗
(self, access_token)

Source from the content-addressed store, hash-verified

37 return _OauthUserInfo(user.get('email'), active, user)
38
39 async def fetch_user_groups(self, access_token):
40 args = {
41 'access_token': access_token,
42 'all_available': 'false',
43 'per_page': 100,
44 }
45
46 if self.gitlab_group_search is not None:
47 args['search'] = self.gitlab_group_search
48
49 group_list_future = self.oauth2_request(
50 _OAUTH_GITLAB_GROUPS % self.gitlab_host,
51 **args
52 )
53
54 group_list = await group_list_future
55
56 if group_list is None:
57 return None
58
59 groups = []
60 for group in group_list:
61 if group.get('full_path'):
62 groups.append(group['full_path'])
63
64 return groups

Calls 2

appendMethod · 0.80
getMethod · 0.45

Tested by 2