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
d45e2302
Commit
d45e2302
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Plain Diff
Merge branch 'signature_failures' of github.com:matrix-org/synapse into federation_client_retries
parents
ae46f10f
650e32d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/api/auth.py
+6
-6
6 additions, 6 deletions
synapse/api/auth.py
synapse/handlers/federation.py
+3
-1
3 additions, 1 deletion
synapse/handlers/federation.py
synapse/state.py
+6
-2
6 additions, 2 deletions
synapse/state.py
with
15 additions
and
9 deletions
synapse/api/auth.py
+
6
−
6
View file @
d45e2302
...
...
@@ -358,7 +358,7 @@ class Auth(object):
def
add_auth_events
(
self
,
builder
,
context
):
yield
run_on_reactor
()
auth_ids
=
self
.
compute_auth_events
(
builder
,
context
)
auth_ids
=
self
.
compute_auth_events
(
builder
,
context
.
current_state
)
auth_events_entries
=
yield
self
.
store
.
add_event_hashes
(
auth_ids
...
...
@@ -372,26 +372,26 @@ class Auth(object):
if
v
.
event_id
in
auth_ids
}
def
compute_auth_events
(
self
,
event
,
c
ontext
):
def
compute_auth_events
(
self
,
event
,
c
urrent_state
):
if
event
.
type
==
EventTypes
.
Create
:
return
[]
auth_ids
=
[]
key
=
(
EventTypes
.
PowerLevels
,
""
,
)
power_level_event
=
context
.
current_state
.
get
(
key
)
power_level_event
=
current_state
.
get
(
key
)
if
power_level_event
:
auth_ids
.
append
(
power_level_event
.
event_id
)
key
=
(
EventTypes
.
JoinRules
,
""
,
)
join_rule_event
=
context
.
current_state
.
get
(
key
)
join_rule_event
=
current_state
.
get
(
key
)
key
=
(
EventTypes
.
Member
,
event
.
user_id
,
)
member_event
=
context
.
current_state
.
get
(
key
)
member_event
=
current_state
.
get
(
key
)
key
=
(
EventTypes
.
Create
,
""
,
)
create_event
=
context
.
current_state
.
get
(
key
)
create_event
=
current_state
.
get
(
key
)
if
create_event
:
auth_ids
.
append
(
create_event
.
event_id
)
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/federation.py
+
3
−
1
View file @
d45e2302
...
...
@@ -842,7 +842,9 @@ class FederationHandler(BaseHandler):
logger
.
debug
(
"
Different auth: %s
"
,
different_auth
)
# 1. Get what we think is the auth chain.
auth_ids
=
self
.
auth
.
compute_auth_events
(
event
,
context
)
auth_ids
=
self
.
auth
.
compute_auth_events
(
event
,
context
.
current_state
)
local_auth_chain
=
yield
self
.
store
.
get_auth_chain
(
auth_ids
)
try
:
...
...
This diff is collapsed.
Click to expand it.
synapse/state.py
+
6
−
2
View file @
d45e2302
...
...
@@ -103,7 +103,9 @@ class StateHandler(object):
context
.
state_group
=
None
if
hasattr
(
event
,
"
auth_events
"
)
and
event
.
auth_events
:
auth_ids
=
zip
(
*
event
.
auth_events
)[
0
]
auth_ids
=
self
.
hs
.
get_auth
().
compute_auth_events
(
event
,
context
.
current_state
)
context
.
auth_events
=
{
k
:
v
for
k
,
v
in
context
.
current_state
.
items
()
...
...
@@ -149,7 +151,9 @@ class StateHandler(object):
event
.
unsigned
[
"
replaces_state
"
]
=
replaces
.
event_id
if
hasattr
(
event
,
"
auth_events
"
)
and
event
.
auth_events
:
auth_ids
=
zip
(
*
event
.
auth_events
)[
0
]
auth_ids
=
self
.
hs
.
get_auth
().
compute_auth_events
(
event
,
context
.
current_state
)
context
.
auth_events
=
{
k
:
v
for
k
,
v
in
context
.
current_state
.
items
()
...
...
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