mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-26 01:25:42 -05:00
dSTS Authentication (#1125)
* Refactored Kusto.ServiceLayer to pass ConnectionDetails to DataSourceFactory instead of connection string. Created KustoConnectionDetails to map needed details to KustoClient. * Removed unused ScriptingScriptOperation from KustoServiceLayer. * Created DstsAuthenticationManager and moved logic for getting DstsToken. Updated error message for failing to create KustoConnection. * Removed DstsAuthenticationManager.cs. Refactored DataSourceFactory to retrieve UserToken from ConnectionDetails. * Renamed AzureAccountToken in ConnectionDetails to AccountToken. Changed mapping to KustoConnectionDetails based on the AccountToken. * Removed Kusto.Data reference from ConnectionService and ScriptingListObjectsOperation. Moved creation of KustoConnectionStringBuilder to DataSourceFactory * Added accountToken validation to DataSourceFactory Create. * Renamed KustoConnectionDetails to DataSourceConnectionDetails. Renamed AzureToken to AuthToken.
This commit is contained in:
@@ -10,7 +10,6 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Kusto.Data;
|
||||
using static Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptOptions;
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.Scripting
|
||||
@@ -80,19 +79,15 @@ namespace Microsoft.Kusto.ServiceLayer.Scripting
|
||||
|
||||
protected void ValidateScriptDatabaseParams()
|
||||
{
|
||||
try
|
||||
if (string.IsNullOrWhiteSpace(Parameters.DatabaseName))
|
||||
{
|
||||
var builder = new KustoConnectionStringBuilder(this.Parameters.ConnectionString);
|
||||
throw new ArgumentException(SR.ScriptingParams_ConnectionString_Property_Invalid);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ArgumentException(SR.ScriptingParams_ConnectionString_Property_Invalid, e);
|
||||
}
|
||||
if (this.Parameters.FilePath == null && this.Parameters.ScriptDestination != "ToEditor")
|
||||
if (Parameters.FilePath == null && this.Parameters.ScriptDestination != "ToEditor")
|
||||
{
|
||||
throw new ArgumentException(SR.ScriptingParams_FilePath_Property_Invalid);
|
||||
}
|
||||
else if (this.Parameters.FilePath != null && this.Parameters.ScriptDestination != "ToEditor")
|
||||
if (Parameters.FilePath != null && this.Parameters.ScriptDestination != "ToEditor")
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(this.Parameters.FilePath)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user