Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
a3e332af
Commit
a3e332af
authored
9 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Don't bail out of joining if we encounter a rejected event
parent
46780551
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
scripts-dev/check_auth.py
+1
-1
1 addition, 1 deletion
scripts-dev/check_auth.py
synapse/handlers/federation.py
+20
-13
20 additions, 13 deletions
synapse/handlers/federation.py
with
21 additions
and
14 deletions
scripts-dev/check_auth.py
+
1
−
1
View file @
a3e332af
...
@@ -38,7 +38,7 @@ def check_auth(auth, auth_chain, events):
...
@@ -38,7 +38,7 @@ def check_auth(auth, auth_chain, events):
print
"
Failed:
"
,
e
.
event_id
,
e
.
type
,
e
.
state_key
print
"
Failed:
"
,
e
.
event_id
,
e
.
type
,
e
.
state_key
print
"
Auth_events:
"
,
auth_events
print
"
Auth_events:
"
,
auth_events
print
ex
print
ex
print
json
.
dumps
(
e
.
get_dict
(),
sort_keys
=
True
,
indent
=
4
)
#
print json.dumps(e.get_dict(), sort_keys=True, indent=4)
# raise
# raise
print
"
Success:
"
,
e
.
event_id
,
e
.
type
,
e
.
state_key
print
"
Success:
"
,
e
.
event_id
,
e
.
type
,
e
.
state_key
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/federation.py
+
20
−
13
View file @
a3e332af
...
@@ -649,8 +649,6 @@ class FederationHandler(BaseHandler):
...
@@ -649,8 +649,6 @@ class FederationHandler(BaseHandler):
# FIXME
# FIXME
pass
pass
self
.
_check_auth_tree
(
auth_chain
,
event
)
event_stream_id
,
max_stream_id
=
yield
self
.
_persist_auth_tree
(
event_stream_id
,
max_stream_id
=
yield
self
.
_persist_auth_tree
(
auth_chain
,
state
,
event
auth_chain
,
state
,
event
)
)
...
@@ -1001,7 +999,16 @@ class FederationHandler(BaseHandler):
...
@@ -1001,7 +999,16 @@ class FederationHandler(BaseHandler):
is_new_state
=
(
not
outliers
and
not
backfilled
),
is_new_state
=
(
not
outliers
and
not
backfilled
),
)
)
def
_check_auth_tree
(
self
,
auth_events
,
event
):
@defer.inlineCallbacks
def
_persist_auth_tree
(
self
,
auth_events
,
state
,
event
):
events_to_context
=
{}
for
e
in
auth_events
:
ctx
=
yield
self
.
state_handler
.
compute_event_context
(
e
,
outlier
=
True
,
)
events_to_context
[
e
.
event_id
]
=
ctx
e
.
internal_metadata
.
outlier
=
True
event_map
=
{
event_map
=
{
e
.
event_id
:
e
e
.
event_id
:
e
for
e
in
auth_events
for
e
in
auth_events
...
@@ -1021,17 +1028,17 @@ class FederationHandler(BaseHandler):
...
@@ -1021,17 +1028,17 @@ class FederationHandler(BaseHandler):
if
create_event
:
if
create_event
:
a
[(
EventTypes
.
Create
,
""
)]
=
create_event
a
[(
EventTypes
.
Create
,
""
)]
=
create_event
self
.
auth
.
check
(
e
,
auth_events
=
a
)
try
:
self
.
auth
.
check
(
e
,
auth_events
=
a
)
except
AuthError
:
logger
.
warn
(
"
Rejecting %s because %s
"
,
event
.
event_id
,
e
.
msg
)
@defer.inlineCallbacks
if
e
==
event
:
def
_persist_auth_tree
(
self
,
auth_events
,
state
,
event
):
raise
events_to_context
=
{}
events_to_context
[
e
.
event_id
].
rejected
=
RejectedReason
.
AUTH_ERROR
for
e
in
auth_events
:
ctx
=
yield
self
.
state_handler
.
compute_event_context
(
e
,
outlier
=
True
,
)
events_to_context
[
e
.
event_id
]
=
ctx
e
.
internal_metadata
.
outlier
=
True
yield
self
.
store
.
persist_events
(
yield
self
.
store
.
persist_events
(
[
[
...
...
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