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
eb10e7d3
Commit
eb10e7d3
authored
11 months ago
by
🥺
Committed by
🥺
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(appservices): don't perform identity assertion when auth is optional
Signed-off-by:
strawberry
<
strawberry@puppygock.gay
>
parent
456a3f93
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
src/api/ruma_wrapper/axum.rs
+5
-4
5 additions, 4 deletions
src/api/ruma_wrapper/axum.rs
with
5 additions
and
4 deletions
src/api/ruma_wrapper/axum.rs
+
5
−
4
View file @
eb10e7d3
...
@@ -132,7 +132,7 @@ async fn from_request(req: Request<axum::body::Body>, _state: &S) -> Result<Self
...
@@ -132,7 +132,7 @@ async fn from_request(req: Request<axum::body::Body>, _state: &S) -> Result<Self
"Unknown access token."
,
"Unknown access token."
,
))
))
},
},
(
AuthScheme
::
AccessToken
|
AuthScheme
::
AccessTokenOptional
,
Token
::
Appservice
(
info
))
=>
{
(
AuthScheme
::
AccessToken
,
Token
::
Appservice
(
info
))
=>
{
let
user_id
=
query_params
let
user_id
=
query_params
.user_id
.user_id
.map_or_else
(
.map_or_else
(
...
@@ -156,9 +156,10 @@ async fn from_request(req: Request<axum::body::Body>, _state: &S) -> Result<Self
...
@@ -156,9 +156,10 @@ async fn from_request(req: Request<axum::body::Body>, _state: &S) -> Result<Self
(
Some
(
user_id
),
None
,
None
,
Some
(
*
info
))
(
Some
(
user_id
),
None
,
None
,
Some
(
*
info
))
},
},
(
AuthScheme
::
None
|
AuthScheme
::
AppserviceToken
,
Token
::
Appservice
(
info
))
=>
{
(
(
None
,
None
,
None
,
Some
(
*
info
))
AuthScheme
::
None
|
AuthScheme
::
AccessTokenOptional
|
AuthScheme
::
AppserviceToken
,
},
Token
::
Appservice
(
info
),
)
=>
(
None
,
None
,
None
,
Some
(
*
info
)),
(
AuthScheme
::
AccessToken
,
Token
::
None
)
=>
{
(
AuthScheme
::
AccessToken
,
Token
::
None
)
=>
{
return
Err
(
Error
::
BadRequest
(
ErrorKind
::
MissingToken
,
"Missing access token."
));
return
Err
(
Error
::
BadRequest
(
ErrorKind
::
MissingToken
,
"Missing access token."
));
},
},
...
...
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