mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 21:32:23 +03:00
deleted test cases TestDevices/sqlite/dupe_token
these testcases are irrelevant msc3861 because access tokens are supposed to come from mas and access_token field is not used at all
This commit is contained in:
parent
1afe2b90ea
commit
244021dc05
2 changed files with 2 additions and 11 deletions
|
@ -306,6 +306,8 @@ func (a *UserInternalAPI) PerformDeviceCreation(ctx context.Context, req *api.Pe
|
||||||
"device_id": req.DeviceID,
|
"device_id": req.DeviceID,
|
||||||
"display_name": req.DeviceDisplayName,
|
"display_name": req.DeviceDisplayName,
|
||||||
}).Info("PerformDeviceCreation")
|
}).Info("PerformDeviceCreation")
|
||||||
|
// TODO: Since we have deleted access_token's unique constraint from the db,
|
||||||
|
// we probably should check its uniqueness if msc3861 is disabled
|
||||||
dev, err := a.DB.CreateDevice(ctx, req.Localpart, serverName, req.DeviceID, req.AccessToken, req.DeviceDisplayName, req.IPAddr, req.UserAgent)
|
dev, err := a.DB.CreateDevice(ctx, req.Localpart, serverName, req.DeviceID, req.AccessToken, req.DeviceDisplayName, req.IPAddr, req.UserAgent)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -445,8 +445,6 @@ func TestAccountData(t *testing.T) {
|
||||||
func TestDevices(t *testing.T) {
|
func TestDevices(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
dupeAccessToken := util.RandomString(8)
|
|
||||||
|
|
||||||
displayName := "testing"
|
displayName := "testing"
|
||||||
|
|
||||||
creationTests := []struct {
|
creationTests := []struct {
|
||||||
|
@ -468,15 +466,6 @@ func TestDevices(t *testing.T) {
|
||||||
name: "explicit local user",
|
name: "explicit local user",
|
||||||
inputData: &api.PerformDeviceCreationRequest{Localpart: "test2", ServerName: "test", AccessToken: util.RandomString(8), NoDeviceListUpdate: true},
|
inputData: &api.PerformDeviceCreationRequest{Localpart: "test2", ServerName: "test", AccessToken: util.RandomString(8), NoDeviceListUpdate: true},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "dupe token - ok",
|
|
||||||
inputData: &api.PerformDeviceCreationRequest{Localpart: "test3", ServerName: "test", AccessToken: dupeAccessToken, NoDeviceListUpdate: true},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "dupe token - not ok",
|
|
||||||
inputData: &api.PerformDeviceCreationRequest{Localpart: "test3", ServerName: "test", AccessToken: dupeAccessToken, NoDeviceListUpdate: true},
|
|
||||||
wantErr: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "test3 second device", // used to test deletion later
|
name: "test3 second device", // used to test deletion later
|
||||||
inputData: &api.PerformDeviceCreationRequest{Localpart: "test3", ServerName: "test", AccessToken: util.RandomString(8), NoDeviceListUpdate: true},
|
inputData: &api.PerformDeviceCreationRequest{Localpart: "test3", ServerName: "test", AccessToken: util.RandomString(8), NoDeviceListUpdate: true},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue