mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 21:02:25 +03:00
mas: move org.matrix.cross_signing_reset const from logintypes.go to key_crosssigning.go
This commit is contained in:
parent
80ee52e092
commit
930daa1090
2 changed files with 6 additions and 5 deletions
|
@ -11,5 +11,4 @@ const (
|
||||||
LoginTypeRecaptcha = "m.login.recaptcha"
|
LoginTypeRecaptcha = "m.login.recaptcha"
|
||||||
LoginTypeApplicationService = "m.login.application_service"
|
LoginTypeApplicationService = "m.login.application_service"
|
||||||
LoginTypeToken = "m.login.token"
|
LoginTypeToken = "m.login.token"
|
||||||
LoginTypeCrossSigningReset = "org.matrix.cross_signing_reset"
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -22,6 +22,8 @@ import (
|
||||||
"github.com/matrix-org/util"
|
"github.com/matrix-org/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const CrossSigningResetStage = "org.matrix.cross_signing_reset"
|
||||||
|
|
||||||
type crossSigningRequest struct {
|
type crossSigningRequest struct {
|
||||||
api.PerformUploadDeviceKeysRequest
|
api.PerformUploadDeviceKeysRequest
|
||||||
Auth newPasswordAuth `json:"auth"`
|
Auth newPasswordAuth `json:"auth"`
|
||||||
|
@ -101,7 +103,7 @@ func UploadCrossSigningDeviceKeys(
|
||||||
if !masterKeyUpdatableWithoutUIA {
|
if !masterKeyUpdatableWithoutUIA {
|
||||||
url := ""
|
url := ""
|
||||||
if m := cfg.MSCs.MSC3861; m.AccountManagementURL != "" {
|
if m := cfg.MSCs.MSC3861; m.AccountManagementURL != "" {
|
||||||
url = strings.Join([]string{m.AccountManagementURL, "?action=", authtypes.LoginTypeCrossSigningReset}, "")
|
url = strings.Join([]string{m.AccountManagementURL, "?action=", CrossSigningResetStage}, "")
|
||||||
} else {
|
} else {
|
||||||
url = m.Issuer
|
url = m.Issuer
|
||||||
}
|
}
|
||||||
|
@ -111,11 +113,11 @@ func UploadCrossSigningDeviceKeys(
|
||||||
"dummy",
|
"dummy",
|
||||||
[]authtypes.Flow{
|
[]authtypes.Flow{
|
||||||
{
|
{
|
||||||
Stages: []authtypes.LoginType{authtypes.LoginTypeCrossSigningReset},
|
Stages: []authtypes.LoginType{CrossSigningResetStage},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
authtypes.LoginTypeCrossSigningReset: map[string]string{
|
CrossSigningResetStage: map[string]string{
|
||||||
"url": url,
|
"url": url,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -128,7 +130,7 @@ func UploadCrossSigningDeviceKeys(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// XXX: is it necessary?
|
// XXX: is it necessary?
|
||||||
sessions.addCompletedSessionStage(sessionID, authtypes.LoginTypeCrossSigningReset)
|
sessions.addCompletedSessionStage(sessionID, CrossSigningResetStage)
|
||||||
} else {
|
} else {
|
||||||
if uploadReq.Auth.Type != authtypes.LoginTypePassword {
|
if uploadReq.Auth.Type != authtypes.LoginTypePassword {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue