mirror of
https://github.com/bitwarden/server.git
synced 2025-04-06 13:38:13 -05:00
[EC-1003] feat: remove externalId
from PUT/POST (#2589)
This commit is contained in:
parent
6514bdbb7e
commit
55cc022d9b
@ -10,8 +10,6 @@ public class GroupRequestModel
|
|||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
public bool? AccessAll { get; set; }
|
public bool? AccessAll { get; set; }
|
||||||
[StringLength(300)]
|
|
||||||
public string ExternalId { get; set; }
|
|
||||||
public IEnumerable<SelectionReadOnlyRequestModel> Collections { get; set; }
|
public IEnumerable<SelectionReadOnlyRequestModel> Collections { get; set; }
|
||||||
public IEnumerable<Guid> Users { get; set; }
|
public IEnumerable<Guid> Users { get; set; }
|
||||||
|
|
||||||
@ -27,7 +25,6 @@ public class GroupRequestModel
|
|||||||
{
|
{
|
||||||
existingGroup.Name = Name;
|
existingGroup.Name = Name;
|
||||||
existingGroup.AccessAll = AccessAll.Value;
|
existingGroup.AccessAll = AccessAll.Value;
|
||||||
existingGroup.ExternalId = ExternalId;
|
|
||||||
return existingGroup;
|
return existingGroup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ public class GroupsControllerTests
|
|||||||
await sutProvider.GetDependency<ICreateGroupCommand>().Received(1).CreateGroupAsync(
|
await sutProvider.GetDependency<ICreateGroupCommand>().Received(1).CreateGroupAsync(
|
||||||
Arg.Is<Group>(g =>
|
Arg.Is<Group>(g =>
|
||||||
g.OrganizationId == organization.Id && g.Name == groupRequestModel.Name &&
|
g.OrganizationId == organization.Id && g.Name == groupRequestModel.Name &&
|
||||||
g.AccessAll == groupRequestModel.AccessAll && g.ExternalId == groupRequestModel.ExternalId),
|
g.AccessAll == groupRequestModel.AccessAll),
|
||||||
organization,
|
organization,
|
||||||
Arg.Any<IEnumerable<CollectionAccessSelection>>(),
|
Arg.Any<IEnumerable<CollectionAccessSelection>>(),
|
||||||
Arg.Any<IEnumerable<Guid>>());
|
Arg.Any<IEnumerable<Guid>>());
|
||||||
@ -38,7 +38,6 @@ public class GroupsControllerTests
|
|||||||
Assert.Equal(groupRequestModel.Name, response.Name);
|
Assert.Equal(groupRequestModel.Name, response.Name);
|
||||||
Assert.Equal(organization.Id.ToString(), response.OrganizationId);
|
Assert.Equal(organization.Id.ToString(), response.OrganizationId);
|
||||||
Assert.Equal(groupRequestModel.AccessAll, response.AccessAll);
|
Assert.Equal(groupRequestModel.AccessAll, response.AccessAll);
|
||||||
Assert.Equal(groupRequestModel.ExternalId, response.ExternalId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
@ -57,7 +56,7 @@ public class GroupsControllerTests
|
|||||||
await sutProvider.GetDependency<IUpdateGroupCommand>().Received(1).UpdateGroupAsync(
|
await sutProvider.GetDependency<IUpdateGroupCommand>().Received(1).UpdateGroupAsync(
|
||||||
Arg.Is<Group>(g =>
|
Arg.Is<Group>(g =>
|
||||||
g.OrganizationId == organization.Id && g.Name == groupRequestModel.Name &&
|
g.OrganizationId == organization.Id && g.Name == groupRequestModel.Name &&
|
||||||
g.AccessAll == groupRequestModel.AccessAll && g.ExternalId == groupRequestModel.ExternalId),
|
g.AccessAll == groupRequestModel.AccessAll),
|
||||||
Arg.Is<Organization>(o => o.Id == organization.Id),
|
Arg.Is<Organization>(o => o.Id == organization.Id),
|
||||||
Arg.Any<IEnumerable<CollectionAccessSelection>>(),
|
Arg.Any<IEnumerable<CollectionAccessSelection>>(),
|
||||||
Arg.Any<IEnumerable<Guid>>());
|
Arg.Any<IEnumerable<Guid>>());
|
||||||
@ -66,6 +65,5 @@ public class GroupsControllerTests
|
|||||||
Assert.Equal(groupRequestModel.Name, response.Name);
|
Assert.Equal(groupRequestModel.Name, response.Name);
|
||||||
Assert.Equal(organization.Id.ToString(), response.OrganizationId);
|
Assert.Equal(organization.Id.ToString(), response.OrganizationId);
|
||||||
Assert.Equal(groupRequestModel.AccessAll, response.AccessAll);
|
Assert.Equal(groupRequestModel.AccessAll, response.AccessAll);
|
||||||
Assert.Equal(groupRequestModel.ExternalId, response.ExternalId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user