-
-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Appservice Can't set alias #2009
Comments
In sytest, which is probably why this isn't possible. |
I went through the code and found some relevant stuff (I might be wrong as not familiar with When the
|
if roomAlias != "" { | |
aliasReq := roomserverAPI.SetRoomAliasRequest{ | |
Alias: roomAlias, | |
RoomID: roomID, | |
UserID: userID, | |
} | |
var aliasResp roomserverAPI.SetRoomAliasResponse | |
err = rsAPI.SetRoomAlias(req.Context(), &aliasReq, &aliasResp) | |
if err != nil { |
While there's a request to set alias after room is created:
- We only check if alias is exclusive.
- Even the Appservice having exclusive access cannot set the alias
dendrite/src/github.com/matrix-org/dendrite/clientapi/routing/directory.go
Lines 116 to 129 in 63ec8a4
// Check that the alias does not fall within an exclusive namespace of an // application service for _, appservice := range cfg.Derived.ApplicationServices { if userNamespaces, ok := appservice.NamespaceMap["users"]; ok { for _, namespace := range userNamespaces { if namespace.Exclusive && namespace.RegexpObject.MatchString(alias) { return util.JSONResponse{ Code: http.StatusBadRequest, JSON: jsonerror.ASExclusive("Alias is reserved by an application service"), } } } } }
Psuedo Code for fix:
alias_owner = getExclusiveOwner(alias)
if alias_owner == None:
proceed and create the alias
else:
if alias_owner != appservice_who_sent_the_request:
return AliasIsExclusive() # shouldn't create alias
else:
proceed and create the alias
(Similar thing should be confirmed for other namespaces, namely user
and room_id
Same as #661 which is closed but I can still reproduce the issue.
Background information
Description
Appservice can't set alias in it's own namespace.
Request fails with error message:
Alias is reserved by an application service
Steps to reproduce
Logs
Can't find anything relevant in debug logs.
The text was updated successfully, but these errors were encountered: