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
5e88a09a
Commit
5e88a09a
authored
9 years ago
by
Kegan Dougal
Browse files
Options
Downloads
Patches
Plain Diff
Add same user_id char checks as registration.
parent
cf1fa59f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/appservice.py
+7
-1
7 additions, 1 deletion
synapse/storage/appservice.py
with
7 additions
and
1 deletion
synapse/storage/appservice.py
+
7
−
1
View file @
5e88a09a
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
logging
import
logging
import
urllib
import
yaml
import
yaml
from
simplejson
import
JSONDecodeError
from
simplejson
import
JSONDecodeError
import
simplejson
as
json
import
simplejson
as
json
...
@@ -209,7 +210,12 @@ class ApplicationServiceStore(SQLBaseStore):
...
@@ -209,7 +210,12 @@ class ApplicationServiceStore(SQLBaseStore):
if
not
isinstance
(
as_info
.
get
(
field
),
basestring
):
if
not
isinstance
(
as_info
.
get
(
field
),
basestring
):
raise
KeyError
(
"
Required string field:
'
%s
'"
,
field
)
raise
KeyError
(
"
Required string field:
'
%s
'"
,
field
)
user
=
UserID
(
as_info
[
"
sender_localpart
"
],
self
.
hostname
)
localpart
=
as_info
[
"
sender_localpart
"
]
if
urllib
.
quote
(
localpart
)
!=
localpart
:
raise
ValueError
(
"
sender_localpart needs characters which are not URL encoded.
"
)
user
=
UserID
(
localpart
,
self
.
hostname
)
user_id
=
user
.
to_string
()
user_id
=
user
.
to_string
()
# namespace checks
# namespace checks
...
...
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