Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
🥺
conduwuit
Commits
826edc0a
Commit
826edc0a
authored
10 months ago
by
🥺
Committed by
🥺
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
check state_key matches sender user at /send_join
Signed-off-by:
strawberry
<
strawberry@puppygock.gay
>
parent
a5043a38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/api/server_server.rs
+16
-0
16 additions, 0 deletions
src/api/server_server.rs
with
16 additions
and
0 deletions
src/api/server_server.rs
+
16
−
0
View file @
826edc0a
...
...
@@ -1165,6 +1165,22 @@ async fn create_join_event(
));
}
let
state_key
:
OwnedUserId
=
serde_json
::
from_value
(
value
.get
(
"state_key"
)
.ok_or_else
(||
Error
::
BadRequest
(
ErrorKind
::
InvalidParam
,
"PDU does not a state key"
))
?
.clone
()
.into
(),
)
.map_err
(|
_
|
Error
::
BadRequest
(
ErrorKind
::
BadJson
,
"State key is invalid or not a user ID"
))
?
;
if
state_key
!=
sender
{
return
Err
(
Error
::
BadRequest
(
ErrorKind
::
InvalidParam
,
"State key does not match sender user"
,
));
}
ruma
::
signatures
::
hash_and_sign_event
(
services
()
.globals
.server_name
()
.as_str
(),
services
()
.globals
.keypair
(),
...
...
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