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
bb63e7ca
Commit
bb63e7ca
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Add groundwork for new versions of federation APIs
parent
7e41545e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/api/urls.py
+2
-1
2 additions, 1 deletion
synapse/api/urls.py
synapse/federation/transport/client.py
+67
-65
67 additions, 65 deletions
synapse/federation/transport/client.py
synapse/federation/transport/server.py
+4
-2
4 additions, 2 deletions
synapse/federation/transport/server.py
with
73 additions
and
68 deletions
synapse/api/urls.py
+
2
−
1
View file @
bb63e7ca
...
...
@@ -24,7 +24,8 @@ from synapse.config import ConfigError
CLIENT_PREFIX
=
"
/_matrix/client/api/v1
"
CLIENT_V2_ALPHA_PREFIX
=
"
/_matrix/client/v2_alpha
"
FEDERATION_PREFIX
=
"
/_matrix/federation/v1
"
FEDERATION_PREFIX
=
"
/_matrix/federation
"
FEDERATION_V1_PREFIX
=
FEDERATION_PREFIX
+
"
/v1
"
STATIC_PREFIX
=
"
/_matrix/static
"
WEB_CLIENT_PREFIX
=
"
/_matrix/client
"
CONTENT_REPO_PREFIX
=
"
/_matrix/content
"
...
...
This diff is collapsed.
Click to expand it.
synapse/federation/transport/client.py
+
67
−
65
View file @
bb63e7ca
This diff is collapsed.
Click to expand it.
synapse/federation/transport/server.py
+
4
−
2
View file @
bb63e7ca
...
...
@@ -22,7 +22,7 @@ from twisted.internet import defer
import
synapse
from
synapse.api.errors
import
Codes
,
FederationDeniedError
,
SynapseError
from
synapse.api.urls
import
FEDERATION_
PREFIX
as
PREFIX
from
synapse.api.urls
import
FEDERATION_
V1_
PREFIX
from
synapse.http.endpoint
import
parse_and_validate_server_name
from
synapse.http.server
import
JsonResource
from
synapse.http.servlet
import
(
...
...
@@ -227,6 +227,8 @@ class BaseFederationServlet(object):
"""
REQUIRE_AUTH
=
True
PREFIX
=
FEDERATION_V1_PREFIX
# Allows specifying the API version
def
__init__
(
self
,
handler
,
authenticator
,
ratelimiter
,
server_name
):
self
.
handler
=
handler
self
.
authenticator
=
authenticator
...
...
@@ -286,7 +288,7 @@ class BaseFederationServlet(object):
return
new_func
def
register
(
self
,
server
):
pattern
=
re
.
compile
(
"
^
"
+
PREFIX
+
self
.
PATH
+
"
$
"
)
pattern
=
re
.
compile
(
"
^
"
+
self
.
PREFIX
+
self
.
PATH
+
"
$
"
)
for
method
in
(
"
GET
"
,
"
PUT
"
,
"
POST
"
):
code
=
getattr
(
self
,
"
on_%s
"
%
(
method
),
None
)
...
...
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