// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using Microsoft.SqlServer.DataCollection.Common.Contracts.OperationsInfrastructure; using Microsoft.SqlTools.Hosting.Protocol.Contracts; using System.Collections.Generic; namespace Microsoft.SqlTools.Migration.Contracts { /// /// Represents the steps in login migration. /// public enum LoginMigrationStep { /// /// Run pre-migration validations /// StartValidations, /// /// Step to hash passwords and migrate logins /// MigrateLogins, /// /// Step to establish users and logins from source to target /// EstablishUserMapping, /// /// Step to migrate server roles /// MigrateServerRoles, /// /// Step to establish roles /// EstablishServerRoleMapping, /// /// Step to map all the grant/deny permissions for logins /// SetLoginPermissions, /// /// Step to map all server roles grant/deny permissions /// SetServerRolePermissions } public class StartLoginMigrationParams { /// /// Connection string to connect to source /// public string SourceConnectionString { get; set; } /// /// Connection string to connect to target /// public string TargetConnectionString { get; set; } /// /// List of logins to migrate /// public List LoginList { get; set; } /// /// Azure active directory domain name (required for Windows Auth) /// public string AADDomainName{ get; set; } } public class LoginMigrationResult { /// /// Start time of the assessment /// public IDictionary> ExceptionMap { get; set; } /// /// The login migration step that just completed /// public LoginMigrationStep CompletedStep { get; set; } /// /// How long this step took /// public string ElapsedTime{ get; set; } } public class StartLoginMigrationRequest { public static readonly RequestType Type = RequestType.Create("migration/startloginmigration"); } public class ValidateLoginMigrationRequest { public static readonly RequestType Type = RequestType.Create("migration/validateloginmigration"); } public class MigrateLoginsRequest { public static readonly RequestType Type = RequestType.Create("migration/migratelogins"); } public class EstablishUserMappingRequest { public static readonly RequestType Type = RequestType.Create("migration/establishusermapping"); } public class MigrateServerRolesAndSetPermissionsRequest { public static readonly RequestType Type = RequestType.Create("migration/migrateserverrolesandsetpermissions"); } public class LoginMigrationNotification { public static readonly EventType Type = EventType.Create("migration/loginmigrationnotification"); } }