mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-24 17:24:14 -05:00
Add linting for copyright and unused usings (#1416)
* Add linting for copyright and unused usings * Add one more + comment * Enforce in build and fix errors * Fix build
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net.Sockets;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Microsoft.InsightsGenerator
|
||||
{
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Concurrent;
|
||||
using System.Composition;
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.Connection.Contracts
|
||||
{
|
||||
public class RequestSecurityTokenParams
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.Connection.Contracts
|
||||
{
|
||||
public class RequestSecurityTokenResponse
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.Connection.Contracts
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.Connection
|
||||
{
|
||||
public interface IConnectionManager
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Kusto.ServiceLayer.Connection.Contracts;
|
||||
using Microsoft.Kusto.ServiceLayer.LanguageServices;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Contracts
|
||||
{
|
||||
public class DataSourceConnectionDetails
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// <copyright file="KustoQueryUtils.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft. All Rights Reserved.
|
||||
// </copyright>
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// <copyright file="DataSourceUtils.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft. All Rights Reserved.
|
||||
// </copyright>
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using Kusto.Data;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the type of a data source.
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource
|
||||
{
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Threading;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.Kusto.ServiceLayer.Connection.Contracts;
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense
|
||||
{
|
||||
public class ShowDatabaseSchemaResult
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense
|
||||
{
|
||||
public class ShowDatabasesResult
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense
|
||||
{
|
||||
public class ShowFunctionsResult
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Threading;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// <copyright file="KustoDataSource.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft. All Rights Reserved.
|
||||
// </copyright>
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Kusto
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// <copyright file="KustoQueryUtils.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft. All Rights Reserved.
|
||||
// </copyright>
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Column metadata information
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Metadata type enumeration
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Object metadata information
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Database metadata information
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Folder metadata information
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
{
|
||||
public class FunctionMetadata : DatabaseMetadata
|
||||
{
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Kusto.ServiceLayer.Admin.Contracts;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Database metadata information
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Models
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Models
|
||||
{
|
||||
public class ColumnInfo
|
||||
{
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Models
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Models
|
||||
{
|
||||
public class FunctionInfo
|
||||
{
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Models
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Models
|
||||
{
|
||||
public class TableInfo
|
||||
{
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Kusto.Language;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models
|
||||
{
|
||||
public class ColumnsModel
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models
|
||||
{
|
||||
public class TableGroupsModel
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models
|
||||
{
|
||||
public class TablesModel
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models
|
||||
{
|
||||
public class WorkspacesModel
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models;
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Microsoft.Kusto.ServiceLayer.Connection;
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.Kusto.ServiceLayer.Connection;
|
||||
using Microsoft.Kusto.ServiceLayer.Connection.Contracts;
|
||||
using Microsoft.Kusto.ServiceLayer.DataSource;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using Microsoft.SqlTools.ServiceLayer.SqlContext;
|
||||
using Microsoft.Kusto.ServiceLayer.Utility;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts.ExecuteRequests
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.Kusto.ServiceLayer.Workspace.Contracts;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.QueryExecution
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using Microsoft.Kusto.ServiceLayer.DataSource;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.Kusto.ServiceLayer.DataSource;
|
||||
using Microsoft.Kusto.ServiceLayer.Scripting.Contracts;
|
||||
using Microsoft.SqlServer.Management.Sdk.Sfc;
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using Microsoft.SqlServer.Dac;
|
||||
//
|
||||
// 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.Dac;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.Utility
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Globalization;
|
||||
using Microsoft.SqlTools.Hosting.Utility;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// <copyright file="SystemExtensions.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft. All Rights Reserved.
|
||||
// </copyright>
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.Utility
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// <copyright file="ValidationUtils.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft. All Rights Reserved.
|
||||
// </copyright>
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.Utility
|
||||
{
|
||||
|
||||
15
src/Microsoft.SqlTools.Credentials/.editorconfig
Normal file
15
src/Microsoft.SqlTools.Credentials/.editorconfig
Normal file
@@ -0,0 +1,15 @@
|
||||
# See https://github.com/dotnet/roslyn-analyzers/blob/main/.editorconfig for an example on different settings and how they're used
|
||||
|
||||
# Disable checking for correct header for this project - most of the code is borrowed from other projects
|
||||
# which have different style guidelines
|
||||
[*.cs]
|
||||
|
||||
dotnet_diagnostic.IDE0073.severity = none
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = crlf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = false
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
@@ -9,11 +10,11 @@ using Microsoft.SqlTools.ResourceProvider.Core.Extensibility;
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
{
|
||||
/// <summary>
|
||||
/// An account manager has the information of currently logged in user and can authenticate the user
|
||||
/// An account manager has the information of currently logged in user and can authenticate the user
|
||||
/// Implementing classes must add a <see cref="ExportableAttribute" />
|
||||
/// to the class in order to be found by the extension manager,
|
||||
/// and to define the type and category supported
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
public interface IAccountManager : IExportable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -46,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
/// </summary>
|
||||
bool HasLoginDialog
|
||||
{
|
||||
get;
|
||||
get;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,7 +9,7 @@ using System.Threading.Tasks;
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides functionality to authenticate to Azure and discover associated accounts and subscriptions
|
||||
/// Provides functionality to authenticate to Azure and discover associated accounts and subscriptions
|
||||
/// </summary>
|
||||
public interface IAzureAuthenticationManager : IAccountManager
|
||||
{
|
||||
@@ -38,6 +39,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
/// <summary>
|
||||
/// Stores the selected subscriptions given the ids
|
||||
/// </summary>
|
||||
Task<bool> SetSelectedSubscriptionsAsync(IEnumerable<string> subscriptionIds);
|
||||
Task<bool> SetSelectedSubscriptionsAsync(IEnumerable<string> subscriptionIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
@@ -30,6 +31,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
string SubscriptionId
|
||||
{
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
{
|
||||
@@ -16,7 +17,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Display ID
|
||||
/// </summary>
|
||||
@@ -24,6 +25,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
@@ -18,6 +19,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
IAzureUserAccount UserAccount
|
||||
{
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
{
|
||||
@@ -16,7 +17,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if user needs reauthentication
|
||||
/// </summary>
|
||||
@@ -24,6 +25,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
public AuthenticationService()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void InitializeService(IProtocolEndpoint serviceHost)
|
||||
{
|
||||
Logger.Write(TraceEventType.Verbose, "AuthenticationService initialized");
|
||||
}
|
||||
|
||||
|
||||
public async Task<IUserAccount> SetCurrentAccountAsync(Account account, Dictionary<string, AccountSecurityToken> securityTokenMappings)
|
||||
{
|
||||
var authManager = ServiceProvider.GetService<IAzureAuthenticationManager>();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
@@ -13,7 +14,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
/// </summary>
|
||||
public static class CommonUtil
|
||||
{
|
||||
private const int KeyValueNameLength = 1024; // 1024 should be enough for registry key value name.
|
||||
private const int KeyValueNameLength = 1024; // 1024 should be enough for registry key value name.
|
||||
|
||||
//********************************************************************************************
|
||||
/// <summary>
|
||||
@@ -44,7 +45,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
|
||||
//********************************************************************************************
|
||||
/// <summary>
|
||||
/// Throw an exception if a string is null or empty.
|
||||
/// Throw an exception if a string is null or empty.
|
||||
/// </summary>
|
||||
/// <param name="stringVar">string to check</param>
|
||||
/// <param name="stringVarName">the variable or parameter name to display</param>
|
||||
@@ -97,6 +98,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data.Common;
|
||||
@@ -18,7 +19,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
/// Returns true if given exception if any of the inner exceptions is UserNeedsAuthenticationException
|
||||
/// </summary>
|
||||
internal static bool IsUserNeedsReauthenticateException(this Exception ex)
|
||||
{
|
||||
{
|
||||
return ex.IsExceptionType(typeof(UserNeedsAuthenticationException));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
@@ -8,7 +9,7 @@ using System.Runtime.Serialization;
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// The exception is used if any operation fails as a request failed due to an expired token
|
||||
/// The exception is used if any operation fails as a request failed due to an expired token
|
||||
/// </summary>
|
||||
public class ExpiredTokenException : ServiceExceptionBase
|
||||
{
|
||||
@@ -29,11 +30,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ServiceFailedException class with a specified error message
|
||||
/// Initializes a new instance of the ServiceFailedException class with a specified error message
|
||||
/// and a reference to the inner exception that is the cause of this exception.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||
public ExpiredTokenException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
|
||||
@@ -35,11 +35,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||
/// <param name="httpStatusCode">The Http error code. </param>
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||
public ServiceExceptionBase(string message, HttpStatusCode httpStatusCode, Exception innerException = null)
|
||||
: this(message, (int)httpStatusCode, innerException)
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -47,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||
/// <param name="httpStatusCode">The Http error code. </param>
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||
public ServiceExceptionBase(string message, int httpStatusCode, Exception innerException)
|
||||
: base(message, innerException)
|
||||
@@ -57,11 +57,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the AuthenticationFailedException class with a specified error message
|
||||
/// Initializes a new instance of the AuthenticationFailedException class with a specified error message
|
||||
/// and a reference to the inner exception that is the cause of this exception.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||
protected ServiceExceptionBase(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
|
||||
@@ -32,11 +32,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ServiceFailedException class with a specified error message
|
||||
/// Initializes a new instance of the ServiceFailedException class with a specified error message
|
||||
/// and a reference to the inner exception that is the cause of this exception.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||
public ServiceFailedException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
@@ -54,13 +54,13 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of ServiceFailedException by adding the server definition info to the given message
|
||||
/// Creates a new instance of ServiceFailedException by adding the server definition info to the given message
|
||||
/// </summary>
|
||||
internal static ServiceFailedException CreateException(string message, ServerDefinition serverDefinition, Exception innerException)
|
||||
{
|
||||
return new ServiceFailedException(
|
||||
string.Format(CultureInfo.CurrentCulture, message,
|
||||
serverDefinition != null ? serverDefinition.ServerType : string.Empty,
|
||||
string.Format(CultureInfo.CurrentCulture, message,
|
||||
serverDefinition != null ? serverDefinition.ServerType : string.Empty,
|
||||
serverDefinition != null ? serverDefinition.Category : string.Empty), innerException);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
@@ -8,7 +9,7 @@ using System.Runtime.Serialization;
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// The exception is used if any operation fails becauase user needs to reauthenticate
|
||||
/// The exception is used if any operation fails becauase user needs to reauthenticate
|
||||
/// </summary>
|
||||
public class UserNeedsAuthenticationException : ServiceExceptionBase
|
||||
{
|
||||
@@ -29,11 +30,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ServiceFailedException class with a specified error message
|
||||
/// Initializes a new instance of the ServiceFailedException class with a specified error message
|
||||
/// and a reference to the inner exception that is the cause of this exception.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference
|
||||
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||
public UserNeedsAuthenticationException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
|
||||
@@ -68,13 +68,13 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
|
||||
public class ProviderSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Display name of the provider
|
||||
/// Display name of the provider
|
||||
/// </summary>
|
||||
public string DisplayName;
|
||||
|
||||
/// <summary>
|
||||
/// ID of the provider
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
public string Id;
|
||||
/// <summary>
|
||||
/// Settings for the provider itself
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
|
||||
/// </summary>
|
||||
public Account Account { get; set; }
|
||||
/// <summary>
|
||||
/// Per-tenant token mappings. Ideally would be set independently of this call, but for
|
||||
/// Per-tenant token mappings. Ideally would be set independently of this call, but for
|
||||
/// now this allows us to get the tokens necessary to find a server and open a firewall rule
|
||||
/// </summary>
|
||||
public Dictionary<string,AccountSecurityToken> SecurityTokenMappings { get; set; }
|
||||
@@ -47,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
|
||||
/// End of the IP address range
|
||||
/// </summary>
|
||||
public string EndIpAddress { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class CreateFirewallRuleResponse : TokenReliantResponse
|
||||
@@ -61,7 +61,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
|
||||
public class CanHandleFirewallRuleRequest
|
||||
{
|
||||
public static readonly
|
||||
RequestType<HandleFirewallRuleParams, HandleFirewallRuleResponse> Type =
|
||||
RequestType<HandleFirewallRuleParams, HandleFirewallRuleResponse> Type =
|
||||
RequestType<HandleFirewallRuleParams, HandleFirewallRuleResponse>.Create("resource/handleFirewallRule");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -16,8 +17,8 @@ using Microsoft.SqlTools.Utility;
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Default implementation for <see cref="IDatabaseDiscoveryProvider"/> for Azure Sql databases.
|
||||
/// A discovery provider capable of finding Sql Azure databases for a specific Azure user account.
|
||||
/// Default implementation for <see cref="IDatabaseDiscoveryProvider"/> for Azure Sql databases.
|
||||
/// A discovery provider capable of finding Sql Azure databases for a specific Azure user account.
|
||||
/// </summary>
|
||||
|
||||
[Exportable(
|
||||
@@ -35,7 +36,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
public AzureDatabaseDiscoveryProvider()
|
||||
{
|
||||
// Duplicate the exportable attribute as at present we do not support filtering using extensiondescriptor.
|
||||
// The attribute is preserved in order to simplify ability to backport into existing tools
|
||||
// The attribute is preserved in order to simplify ability to backport into existing tools
|
||||
Metadata = new ExportableMetadata(
|
||||
ServerTypes.SqlServer,
|
||||
Categories.Azure,
|
||||
@@ -90,9 +91,9 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the databases for given connection info.
|
||||
/// Returns the databases for given connection info.
|
||||
/// The connection info should be used to make the connection for getting databases not the account manager
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
//public async Task<ServiceResponse<DatabaseInstanceInfo>> GetDatabaseInstancesAsync(UIConnectionInfo uiConnectionInfo, CancellationToken cancellationToken)
|
||||
//{
|
||||
// ServiceResponse<DatabaseInstanceInfo> result = null;
|
||||
@@ -109,7 +110,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
|
||||
/// <summary>
|
||||
/// Returns the databases for given server name. Using the account manager to get the databases
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
public async Task<ServiceResponse<DatabaseInstanceInfo>> GetDatabaseInstancesAsync(string serverName, CancellationToken cancellationToken)
|
||||
{
|
||||
ServiceResponse<DatabaseInstanceInfo> result = null;
|
||||
@@ -120,7 +121,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
//if connection is passed, we need to search all subscriptions not selected ones
|
||||
IEnumerable<IAzureUserAccountSubscriptionContext> subscriptions = await GetSubscriptionsAsync(string.IsNullOrEmpty(serverName));
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
{
|
||||
result = await AzureUtil.ExecuteGetAzureResourceAsParallel((object)null, subscriptions, serverName, cancellationToken,
|
||||
GetDatabaseForSubscriptionAsync);
|
||||
}
|
||||
@@ -159,7 +160,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
get
|
||||
{
|
||||
return (_azureAccountManager = _azureAccountManager ?? GetService<IAzureAuthenticationManager>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -206,11 +207,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
|
||||
/// <summary>
|
||||
/// There was a wired nullReferencedException was running the tasks parallel. It only got fixed when I put the getting from cache insed an async method
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private Task<ServiceResponse<DatabaseInstanceInfo>> GetFromCacheAsync(string key)
|
||||
{
|
||||
return Task.Factory.StartNew(() => _cache.Get(key));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of Azure sql databases for given subscription
|
||||
@@ -235,7 +236,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
else if (shouldFilter)
|
||||
{
|
||||
//we should filter the result because the cached data includes databases for all servers
|
||||
result = new ServiceResponse<DatabaseInstanceInfo>(result.Data.Where(x => x.ServerInstanceInfo.FullyQualifiedDomainName == serverName),
|
||||
result = new ServiceResponse<DatabaseInstanceInfo>(result.Data.Where(x => x.ServerInstanceInfo.FullyQualifiedDomainName == serverName),
|
||||
result.Errors);
|
||||
}
|
||||
|
||||
@@ -243,7 +244,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
if (!shouldFilter && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
result = _cache.UpdateCache(key, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -261,7 +262,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
CancellationToken cancellationToken, CancellationToken internalCancellationToken)
|
||||
{
|
||||
ServiceResponse<DatabaseInstanceInfo> result = null;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if (!cancellationToken.IsCancellationRequested && !internalCancellationToken.IsCancellationRequested)
|
||||
@@ -295,7 +296,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
return result ?? new ServiceResponse<DatabaseInstanceInfo>();
|
||||
}
|
||||
|
||||
private async Task<ServiceResponse<DatabaseInstanceInfo>> GetDatabasesForSubscriptionServersAsync(IAzureResourceManagementSession session,
|
||||
private async Task<ServiceResponse<DatabaseInstanceInfo>> GetDatabasesForSubscriptionServersAsync(IAzureResourceManagementSession session,
|
||||
IList<IAzureSqlServerResource> filteredServersList, CancellationToken cancellationToken)
|
||||
{
|
||||
ServiceResponse<DatabaseInstanceInfo> result = null;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -43,7 +44,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
result = await AzureUtil.ExecuteGetAzureResourceAsParallel(_session, serverResources, null, cancellationToken, GetDatabasesForServerFromService);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<ServiceResponse<DatabaseInstanceInfo>> GetDatabasesForServerFromService(
|
||||
IAzureResourceManagementSession session,
|
||||
@@ -108,7 +109,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
|
||||
/// <summary>
|
||||
/// Converts the resource to DatabaseInstanceInfo
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private DatabaseInstanceInfo ConvertToModel(ServerInstanceInfo serverInstanceInfo, IAzureResource azureResource)
|
||||
{
|
||||
DatabaseInstanceInfo databaseInstance = new DatabaseInstanceInfo(serverInstanceInfo)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -12,11 +13,11 @@ using Microsoft.SqlTools.ResourceProvider.Core.Extensibility;
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Default implementation for <see cref="IServerDiscoveryProvider"/> for Azure Sql servers.
|
||||
/// A discovery provider capable of finding Sql Azure servers for a specific Azure user account.
|
||||
/// Default implementation for <see cref="IServerDiscoveryProvider"/> for Azure Sql servers.
|
||||
/// A discovery provider capable of finding Sql Azure servers for a specific Azure user account.
|
||||
/// </summary>
|
||||
[Exportable(
|
||||
ServerTypes.SqlServer,
|
||||
ServerTypes.SqlServer,
|
||||
Categories.Azure,
|
||||
typeof(IServerDiscoveryProvider),
|
||||
"Microsoft.SqlServer.ConnectionServices.Azure.AzureServerDiscoveryProvider")]
|
||||
@@ -28,7 +29,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
public AzureSqlServerDiscoveryProvider()
|
||||
{
|
||||
// Duplicate the exportable attribute as at present we do not support filtering using extensiondescriptor.
|
||||
// The attribute is preserved in order to simplify ability to backport into existing tools
|
||||
// The attribute is preserved in order to simplify ability to backport into existing tools
|
||||
Metadata = new ExportableMetadata(
|
||||
ServerTypes.SqlServer,
|
||||
Categories.Azure,
|
||||
@@ -120,6 +121,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
_azureAccountManager = value as IAzureAuthenticationManager;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
@@ -12,7 +13,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
public class DatabaseInstanceInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Default constructor to initialize the instance
|
||||
/// Default constructor to initialize the instance
|
||||
/// </summary>
|
||||
/// <param name="serverInstanceInfo"></param>
|
||||
public DatabaseInstanceInfo(ServerInstanceInfo serverInstanceInfo)
|
||||
@@ -34,7 +35,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
/// </summary>
|
||||
public ServerInstanceInfo ServerInstanceInfo
|
||||
{
|
||||
get;
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using Microsoft.SqlTools.ResourceProvider.Core.Authentication;
|
||||
@@ -11,7 +12,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
/// A session used by <see cref="IAzureResourceManager" />. Includes all the clients that the resource management needs to get ther resources
|
||||
/// </summary>
|
||||
public interface IAzureResourceManagementSession : IDisposable
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// Closes the session
|
||||
/// </summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
@@ -24,7 +25,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
/// <returns>The list of databases</returns>
|
||||
Task<IEnumerable<IAzureResource>> GetAzureDatabasesAsync(
|
||||
IAzureResourceManagementSession azureResourceManagementSession,
|
||||
string resourceGroupName,
|
||||
string resourceGroupName,
|
||||
string serverName);
|
||||
|
||||
/// <summary>
|
||||
@@ -43,8 +44,8 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
/// <param name="firewallRuleRequest">Firewall rule request including the name and IP address range</param>
|
||||
/// <returns></returns>
|
||||
Task<FirewallRuleResponse> CreateFirewallRuleAsync(
|
||||
IAzureResourceManagementSession azureResourceManagementSession,
|
||||
IAzureSqlServerResource azureSqlServer,
|
||||
IAzureResourceManagementSession azureResourceManagementSession,
|
||||
IAzureSqlServerResource azureSqlServer,
|
||||
FirewallRuleRequest firewallRuleRequest
|
||||
);
|
||||
|
||||
@@ -52,7 +53,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets all subscription contexts under a specific user account. Queries all tenants for the account and uses these to log in
|
||||
/// Gets all subscription contexts under a specific user account. Queries all tenants for the account and uses these to log in
|
||||
/// and retrieve subscription information as needed
|
||||
/// <param name="userAccount">Account whose subscriptions should be queried</param>
|
||||
/// </summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
@@ -11,7 +12,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Fully qualified domain name
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
string FullyQualifiedDomainName
|
||||
{
|
||||
get;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,10 +9,10 @@ using System.Threading.Tasks;
|
||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a class as cachable
|
||||
/// </summary>
|
||||
/// Defines a class as cachable
|
||||
/// </summary>
|
||||
public interface ICacheable<T>
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// Clears the cache for current user
|
||||
/// </summary>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user