Skip to content

Commit 2fda01a

Browse files
committed
crowd: Add info about new method
1 parent ba68439 commit 2fda01a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

atlassian/crowd.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,17 @@ def memberships(self):
271271
"""
272272
Retrieves full details of all group memberships, with users and nested groups.
273273
See: https://docs.atlassian.com/atlassian-crowd/5.3.1/REST/#usermanagement/1/group-getAllMemberships
274+
Retrieves full details of all group memberships, with users and nested groups.
275+
This resource is optimised for streaming XML responses, and does not support JSON responses.
274276
:return: All membership mapping dict
275277
"""
276278
path = self._crowd_api_url("usermanagement", "group/membership")
277-
headers = {'Accept': 'application/xml'}
279+
headers = {"Accept": "application/xml"}
278280
response = self.get(path, headers=headers, advanced_mode=True)
279281
root = etree.fromstring(response.content)
280282
memberships = {}
281-
for member in root.xpath('//membership'):
282-
group = member.get('group')
283-
users = [user.get('name') for user in member.xpath('./users/user')]
283+
for member in root.xpath("//membership"):
284+
group = member.get("group")
285+
users = [user.get("name") for user in member.xpath("./users/user")]
284286
memberships[group] = users
285287
return memberships

requirements-dev.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ python-magic
1414
# On October 4, 2022 importlib-metadata released importlib-metadata 5.0.0 and in version 5.0.0
1515
# They have Deprecated EntryPoints and that's why you are facing this error.
1616
importlib-metadata<=4.13.0
17-
# Add this package to search string in json
18-
jmespath
17+

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ six
44
oauthlib
55
requests_oauthlib
66
requests-kerberos==0.14.0
7+
# Add this package to search string in json
78
jmespath
89
beautifulsoup4
910
lxml

0 commit comments

Comments
 (0)