Skip to content
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

WIP: MSC3861: MAS support #3493

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ba542fe
mas: added /auth_issuer endpoint
mdnight Dec 21, 2024
2c47959
mas: added username_available endpoint
mdnight Dec 22, 2024
e1dfe62
mas: rename msc2965 to msc3861
mdnight Dec 22, 2024
150be58
mas: added localpart_external_ids table
mdnight Dec 24, 2024
63a199c
mas: first successful attempt of login with via mas
mdnight Dec 29, 2024
9d9841d
mas: added "admin's replacement without uia" endpoint
mdnight Dec 30, 2024
4f406e2
minor goimports fix
mdnight Dec 30, 2024
b950703
mas: return correct http code
mdnight Dec 30, 2024
9ebcebe
another goimports fix
mdnight Dec 30, 2024
be8d490
mas: implemented PUT /admin/v2/users/{userID} endpoint
mdnight Dec 30, 2024
524f65c
mas: add AccountTypeOIDCService
mdnight Dec 30, 2024
ff63e7f
mas: modify PUT /profile/{userID}/displayname endpoint
mdnight Dec 30, 2024
bf310d5
drop primary key constraint from userapi_devices.access_token
mdnight Dec 31, 2024
f4ff426
mas: refactor admin user device handler
mdnight Jan 1, 2025
803cce8
mas: added admin's delete devices endpoint
mdnight Jan 1, 2025
7ffb2c1
mas: minor fixes in cross_signing_keys_table files
mdnight Jan 5, 2025
c06e0aa
refactor logger calls
mdnight Jan 5, 2025
48f3cd3
mas: added /admin/v1/deactivate/{userID} endpoint
mdnight Jan 5, 2025
9b064b1
minor refactoring
mdnight Jan 5, 2025
cc7deb2
mas: added support of msc3861 to /keys/device_signing/upload endpoint
mdnight Jan 5, 2025
5cffc2c
mas: fix displayname handling
mdnight Jan 6, 2025
811a504
mas: handle 3pids from mas
mdnight Jan 6, 2025
17576cc
mas: acced msc3861 config example to the dendrite-sample.yaml
mdnight Jan 7, 2025
e943ba5
mas: fail if conflicts in config occur
mdnight Jan 7, 2025
7eec60e
mas: reorganise endpoints
mdnight Jan 7, 2025
fb15db7
unit tests fix
mdnight Jan 8, 2025
b44a79c
Bump golang version
mdnight Jan 8, 2025
7311d3e
more fixes
mdnight Jan 8, 2025
0990676
linter fixes
mdnight Jan 9, 2025
1afe2b9
fix cross_signing_keys_table
mdnight Jan 9, 2025
244021d
deleted test cases TestDevices/sqlite/dupe_token
mdnight Jan 9, 2025
78457f3
++
mdnight Jan 9, 2025
80ee52e
fix syncapi tests
mdnight Jan 9, 2025
930daa1
mas: move org.matrix.cross_signing_reset const from logintypes.go to …
mdnight Jan 10, 2025
0be9b3c
syncapi_test.go fix
mdnight Jan 10, 2025
4cde3ba
mas: add missing migration for adding x-signing updatable_without_uia…
mdnight Jan 10, 2025
5ea033d
mas: remove enabled field from msc3861 config + remove some incorrect…
mdnight Jan 10, 2025
5fd654f
Add TestMakeServiceAdminAPI
mdnight Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mas: add AccountTypeOIDCService
  • Loading branch information
mdnight committed Dec 30, 2024
commit 524f65cb0c036c7128a7f47a12c494b85c3a07b0
5 changes: 2 additions & 3 deletions setup/mscs/msc3861/msc3861_user_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (m *MSC3861UserVerifier) VerifyUserFromRequest(req *http.Request) (*api.Dev

// Do not record requests from MAS using the virtual `__oidc_admin` user.
if token != m.cfg.AdminToken {
// TODO: not sure which exact data we should record here. See the link for reference
// XXX: not sure which exact data we should record here. See the link for reference
// https://github.com/element-hq/synapse/blob/develop/synapse/api/auth/base.py#L365
}

Expand Down Expand Up @@ -156,7 +156,6 @@ func (m *MSC3861UserVerifier) getUserByAccessToken(ctx context.Context, token st
// XXX: This is a temporary solution so that the admin API can be called by
// the OIDC provider. This will be removed once we have OIDC client
// credentials grant support in matrix-authentication-service.
logger.Info("Admin token used")
// XXX: that user doesn't exist and won't be provisioned.
adminUser, err := createUserID("__oidc_admin", m.serverName)
if err != nil {
Expand All @@ -165,7 +164,7 @@ func (m *MSC3861UserVerifier) getUserByAccessToken(ctx context.Context, token st
return &requester{
UserID: adminUser,
Scope: []string{"urn:synapse:admin:*"},
Device: &api.Device{UserID: adminUser.Local(), AccountType: api.AccountTypeAdmin},
Device: &api.Device{UserID: adminUser.Local(), AccountType: api.AccountTypeOIDCService},
}, nil
}

Expand Down
2 changes: 2 additions & 0 deletions userapi/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ const (
AccountTypeAdmin AccountType = 3
// AccountTypeAppService indicates this is an appservice account
AccountTypeAppService AccountType = 4
// AccountTypeOIDC indicates this is an account belonging to Matrix Authentication Service (MAS)
AccountTypeOIDCService AccountType = 5
)

type QueryPushersRequest struct {
Expand Down