Support creating & editing additional user types (#1962)

* WIP

* Fix contained user password handling

* More user related bug fixes
This commit is contained in:
Karl Burtram
2023-03-23 18:01:55 -07:00
committed by GitHub
parent 5fce03f6cf
commit c3444e5cf5
7 changed files with 224 additions and 122 deletions

View File

@@ -64,6 +64,32 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security
}
}
/// <summary>
/// Test the basic Create User method handler
/// </summary>
// [Test] - needs contained DB
public async Task TestHandleCreateUserWithContainedSqlPassword()
{
using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile())
{
// setup
SecurityService service = new SecurityService();
UserServiceHandlerImpl userService = new UserServiceHandlerImpl();
string databaseName = "CRM";
var connectionResult = await LiveConnectionHelper.InitLiveConnectionInfoAsync(databaseName, queryTempFile.FilePath);
var user = await SecurityTestUtils.CreateUser(
userService,
connectionResult,
DatabaseUserType.Contained,
userName: null,
loginName: null,
databaseName: connectionResult.ConnectionInfo.ConnectionDetails.DatabaseName);
await SecurityTestUtils.DropObject(connectionResult.ConnectionInfo.OwnerUri, SecurityTestUtils.GetUserURN(connectionResult.ConnectionInfo.ConnectionDetails.DatabaseName, user.Name));
}
}
/// <summary>
/// Test the basic Update User method handler
/// </summary>