Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
d9f09228
Unverified
Commit
d9f09228
authored
2 years ago
by
Patrick Cloke
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove federation client code for groups. (#12563)
parent
053ca5f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/12563.removal
+1
-0
1 addition, 0 deletions
changelog.d/12563.removal
synapse/federation/transport/client.py
+0
-483
0 additions, 483 deletions
synapse/federation/transport/client.py
with
1 addition
and
483 deletions
changelog.d/12563.removal
0 → 100644
+
1
−
0
View file @
d9f09228
Remove support for the non-standard groups/communities feature from Synapse.
This diff is collapsed.
Click to expand it.
synapse/federation/transport/client.py
+
0
−
483
View file @
d9f09228
...
@@ -17,7 +17,6 @@ import logging
...
@@ -17,7 +17,6 @@ import logging
import
urllib
import
urllib
from
typing
import
(
from
typing
import
(
Any
,
Any
,
Awaitable
,
Callable
,
Callable
,
Collection
,
Collection
,
Dict
,
Dict
,
...
@@ -681,488 +680,6 @@ class TransportLayerClient:
...
@@ -681,488 +680,6 @@ class TransportLayerClient:
timeout
=
timeout
,
timeout
=
timeout
,
)
)
async
def
get_group_profile
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
)
->
JsonDict
:
"""
Get a group profile
"""
path
=
_create_v1_path
(
"
/groups/%s/profile
"
,
group_id
)
return
await
self
.
client
.
get_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
update_group_profile
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
content
:
JsonDict
)
->
JsonDict
:
"""
Update a remote group profile
Args:
destination
group_id
requester_user_id
content: The new profile of the group
"""
path
=
_create_v1_path
(
"
/groups/%s/profile
"
,
group_id
)
return
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
get_group_summary
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
)
->
JsonDict
:
"""
Get a group summary
"""
path
=
_create_v1_path
(
"
/groups/%s/summary
"
,
group_id
)
return
await
self
.
client
.
get_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
get_rooms_in_group
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
)
->
JsonDict
:
"""
Get all rooms in a group
"""
path
=
_create_v1_path
(
"
/groups/%s/rooms
"
,
group_id
)
return
await
self
.
client
.
get_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
add_room_to_group
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
room_id
:
str
,
content
:
JsonDict
,
)
->
JsonDict
:
"""
Add a room to a group
"""
path
=
_create_v1_path
(
"
/groups/%s/room/%s
"
,
group_id
,
room_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
update_room_in_group
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
room_id
:
str
,
config_key
:
str
,
content
:
JsonDict
,
)
->
JsonDict
:
"""
Update room in group
"""
path
=
_create_v1_path
(
"
/groups/%s/room/%s/config/%s
"
,
group_id
,
room_id
,
config_key
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
remove_room_from_group
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
room_id
:
str
)
->
JsonDict
:
"""
Remove a room from a group
"""
path
=
_create_v1_path
(
"
/groups/%s/room/%s
"
,
group_id
,
room_id
)
return
await
self
.
client
.
delete_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
get_users_in_group
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
)
->
JsonDict
:
"""
Get users in a group
"""
path
=
_create_v1_path
(
"
/groups/%s/users
"
,
group_id
)
return
await
self
.
client
.
get_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
get_invited_users_in_group
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
)
->
JsonDict
:
"""
Get users that have been invited to a group
"""
path
=
_create_v1_path
(
"
/groups/%s/invited_users
"
,
group_id
)
return
await
self
.
client
.
get_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
accept_group_invite
(
self
,
destination
:
str
,
group_id
:
str
,
user_id
:
str
,
content
:
JsonDict
)
->
JsonDict
:
"""
Accept a group invite
"""
path
=
_create_v1_path
(
"
/groups/%s/users/%s/accept_invite
"
,
group_id
,
user_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
data
=
content
,
ignore_backoff
=
True
)
def
join_group
(
self
,
destination
:
str
,
group_id
:
str
,
user_id
:
str
,
content
:
JsonDict
)
->
Awaitable
[
JsonDict
]:
"""
Attempts to join a group
"""
path
=
_create_v1_path
(
"
/groups/%s/users/%s/join
"
,
group_id
,
user_id
)
return
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
data
=
content
,
ignore_backoff
=
True
)
async
def
invite_to_group
(
self
,
destination
:
str
,
group_id
:
str
,
user_id
:
str
,
requester_user_id
:
str
,
content
:
JsonDict
,
)
->
JsonDict
:
"""
Invite a user to a group
"""
path
=
_create_v1_path
(
"
/groups/%s/users/%s/invite
"
,
group_id
,
user_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
invite_to_group_notification
(
self
,
destination
:
str
,
group_id
:
str
,
user_id
:
str
,
content
:
JsonDict
)
->
JsonDict
:
"""
Sent by group server to inform a user
'
s server that they have been
invited.
"""
path
=
_create_v1_path
(
"
/groups/local/%s/users/%s/invite
"
,
group_id
,
user_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
data
=
content
,
ignore_backoff
=
True
)
async
def
remove_user_from_group
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
user_id
:
str
,
content
:
JsonDict
,
)
->
JsonDict
:
"""
Remove a user from a group
"""
path
=
_create_v1_path
(
"
/groups/%s/users/%s/remove
"
,
group_id
,
user_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
remove_user_from_group_notification
(
self
,
destination
:
str
,
group_id
:
str
,
user_id
:
str
,
content
:
JsonDict
)
->
JsonDict
:
"""
Sent by group server to inform a user
'
s server that they have been
kicked from the group.
"""
path
=
_create_v1_path
(
"
/groups/local/%s/users/%s/remove
"
,
group_id
,
user_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
data
=
content
,
ignore_backoff
=
True
)
async
def
renew_group_attestation
(
self
,
destination
:
str
,
group_id
:
str
,
user_id
:
str
,
content
:
JsonDict
)
->
JsonDict
:
"""
Sent by either a group server or a user
'
s server to periodically update
the attestations
"""
path
=
_create_v1_path
(
"
/groups/%s/renew_attestation/%s
"
,
group_id
,
user_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
data
=
content
,
ignore_backoff
=
True
)
async
def
update_group_summary_room
(
self
,
destination
:
str
,
group_id
:
str
,
user_id
:
str
,
room_id
:
str
,
category_id
:
str
,
content
:
JsonDict
,
)
->
JsonDict
:
"""
Update a room entry in a group summary
"""
if
category_id
:
path
=
_create_v1_path
(
"
/groups/%s/summary/categories/%s/rooms/%s
"
,
group_id
,
category_id
,
room_id
,
)
else
:
path
=
_create_v1_path
(
"
/groups/%s/summary/rooms/%s
"
,
group_id
,
room_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
delete_group_summary_room
(
self
,
destination
:
str
,
group_id
:
str
,
user_id
:
str
,
room_id
:
str
,
category_id
:
str
,
)
->
JsonDict
:
"""
Delete a room entry in a group summary
"""
if
category_id
:
path
=
_create_v1_path
(
"
/groups/%s/summary/categories/%s/rooms/%s
"
,
group_id
,
category_id
,
room_id
,
)
else
:
path
=
_create_v1_path
(
"
/groups/%s/summary/rooms/%s
"
,
group_id
,
room_id
)
return
await
self
.
client
.
delete_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
user_id
},
ignore_backoff
=
True
,
)
async
def
get_group_categories
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
)
->
JsonDict
:
"""
Get all categories in a group
"""
path
=
_create_v1_path
(
"
/groups/%s/categories
"
,
group_id
)
return
await
self
.
client
.
get_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
get_group_category
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
category_id
:
str
)
->
JsonDict
:
"""
Get category info in a group
"""
path
=
_create_v1_path
(
"
/groups/%s/categories/%s
"
,
group_id
,
category_id
)
return
await
self
.
client
.
get_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
update_group_category
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
category_id
:
str
,
content
:
JsonDict
,
)
->
JsonDict
:
"""
Update a category in a group
"""
path
=
_create_v1_path
(
"
/groups/%s/categories/%s
"
,
group_id
,
category_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
delete_group_category
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
category_id
:
str
)
->
JsonDict
:
"""
Delete a category in a group
"""
path
=
_create_v1_path
(
"
/groups/%s/categories/%s
"
,
group_id
,
category_id
)
return
await
self
.
client
.
delete_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
get_group_roles
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
)
->
JsonDict
:
"""
Get all roles in a group
"""
path
=
_create_v1_path
(
"
/groups/%s/roles
"
,
group_id
)
return
await
self
.
client
.
get_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
get_group_role
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
role_id
:
str
)
->
JsonDict
:
"""
Get a roles info
"""
path
=
_create_v1_path
(
"
/groups/%s/roles/%s
"
,
group_id
,
role_id
)
return
await
self
.
client
.
get_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
update_group_role
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
role_id
:
str
,
content
:
JsonDict
,
)
->
JsonDict
:
"""
Update a role in a group
"""
path
=
_create_v1_path
(
"
/groups/%s/roles/%s
"
,
group_id
,
role_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
delete_group_role
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
role_id
:
str
)
->
JsonDict
:
"""
Delete a role in a group
"""
path
=
_create_v1_path
(
"
/groups/%s/roles/%s
"
,
group_id
,
role_id
)
return
await
self
.
client
.
delete_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
update_group_summary_user
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
user_id
:
str
,
role_id
:
str
,
content
:
JsonDict
,
)
->
JsonDict
:
"""
Update a users entry in a group
"""
if
role_id
:
path
=
_create_v1_path
(
"
/groups/%s/summary/roles/%s/users/%s
"
,
group_id
,
role_id
,
user_id
)
else
:
path
=
_create_v1_path
(
"
/groups/%s/summary/users/%s
"
,
group_id
,
user_id
)
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
set_group_join_policy
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
content
:
JsonDict
)
->
JsonDict
:
"""
Sets the join policy for a group
"""
path
=
_create_v1_path
(
"
/groups/%s/settings/m.join_policy
"
,
group_id
)
return
await
self
.
client
.
put_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
data
=
content
,
ignore_backoff
=
True
,
)
async
def
delete_group_summary_user
(
self
,
destination
:
str
,
group_id
:
str
,
requester_user_id
:
str
,
user_id
:
str
,
role_id
:
str
,
)
->
JsonDict
:
"""
Delete a users entry in a group
"""
if
role_id
:
path
=
_create_v1_path
(
"
/groups/%s/summary/roles/%s/users/%s
"
,
group_id
,
role_id
,
user_id
)
else
:
path
=
_create_v1_path
(
"
/groups/%s/summary/users/%s
"
,
group_id
,
user_id
)
return
await
self
.
client
.
delete_json
(
destination
=
destination
,
path
=
path
,
args
=
{
"
requester_user_id
"
:
requester_user_id
},
ignore_backoff
=
True
,
)
async
def
bulk_get_publicised_groups
(
self
,
destination
:
str
,
user_ids
:
Iterable
[
str
]
)
->
JsonDict
:
"""
Get the groups a list of users are publicising
"""
path
=
_create_v1_path
(
"
/get_groups_publicised
"
)
content
=
{
"
user_ids
"
:
user_ids
}
return
await
self
.
client
.
post_json
(
destination
=
destination
,
path
=
path
,
data
=
content
,
ignore_backoff
=
True
)
async
def
get_room_complexity
(
self
,
destination
:
str
,
room_id
:
str
)
->
JsonDict
:
async
def
get_room_complexity
(
self
,
destination
:
str
,
room_id
:
str
)
->
JsonDict
:
"""
"""
Args:
Args:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment