mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Make userapi responsible for checking access tokens (#1133)
* Make userapi responsible for checking access tokens There's still plenty of dependencies on account/device DBs, but this is a start. This is a breaking change as it adds a required config value `listen.user_api`. * Cleanup * Review comments and test fix
This commit is contained in:
parent
57b7fa3db8
commit
9c77022513
66 changed files with 421 additions and 400 deletions
|
@ -29,6 +29,7 @@ import (
|
|||
"github.com/matrix-org/dendrite/internal/config"
|
||||
"github.com/matrix-org/dendrite/internal/eventutil"
|
||||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
userapi "github.com/matrix-org/dendrite/userapi/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
||||
|
@ -85,7 +86,7 @@ var (
|
|||
// can be emitted.
|
||||
func CheckAndProcessInvite(
|
||||
ctx context.Context,
|
||||
device *authtypes.Device, body *MembershipRequest, cfg *config.Dendrite,
|
||||
device *userapi.Device, body *MembershipRequest, cfg *config.Dendrite,
|
||||
rsAPI api.RoomserverInternalAPI, db accounts.Database,
|
||||
membership string, roomID string,
|
||||
evTime time.Time,
|
||||
|
@ -136,7 +137,7 @@ func CheckAndProcessInvite(
|
|||
// Returns an error if a check or a request failed.
|
||||
func queryIDServer(
|
||||
ctx context.Context,
|
||||
db accounts.Database, cfg *config.Dendrite, device *authtypes.Device,
|
||||
db accounts.Database, cfg *config.Dendrite, device *userapi.Device,
|
||||
body *MembershipRequest, roomID string,
|
||||
) (lookupRes *idServerLookupResponse, storeInviteRes *idServerStoreInviteResponse, err error) {
|
||||
if err = isTrusted(body.IDServer, cfg); err != nil {
|
||||
|
@ -205,7 +206,7 @@ func queryIDServerLookup(ctx context.Context, body *MembershipRequest) (*idServe
|
|||
// Returns an error if the request failed to send or if the response couldn't be parsed.
|
||||
func queryIDServerStoreInvite(
|
||||
ctx context.Context,
|
||||
db accounts.Database, cfg *config.Dendrite, device *authtypes.Device,
|
||||
db accounts.Database, cfg *config.Dendrite, device *userapi.Device,
|
||||
body *MembershipRequest, roomID string,
|
||||
) (*idServerStoreInviteResponse, error) {
|
||||
// Retrieve the sender's profile to get their display name
|
||||
|
@ -329,7 +330,7 @@ func checkIDServerSignatures(
|
|||
func emit3PIDInviteEvent(
|
||||
ctx context.Context,
|
||||
body *MembershipRequest, res *idServerStoreInviteResponse,
|
||||
device *authtypes.Device, roomID string, cfg *config.Dendrite,
|
||||
device *userapi.Device, roomID string, cfg *config.Dendrite,
|
||||
rsAPI api.RoomserverInternalAPI,
|
||||
evTime time.Time,
|
||||
) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue