mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -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:
345
.editorconfig
Normal file
345
.editorconfig
Normal file
@@ -0,0 +1,345 @@
|
|||||||
|
# See https://github.com/dotnet/roslyn-analyzers/blob/main/.editorconfig for an example on different settings and how they're used
|
||||||
|
|
||||||
|
# Remove the line below if you want to inherit .editorconfig settings from higher directories
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Autogenerated string files, don't enforce certain styles on them
|
||||||
|
[sr.cs]
|
||||||
|
|
||||||
|
dotnet_diagnostic.IDE0005.severity = none
|
||||||
|
dotnet_diagnostic.IDE0073.severity = none
|
||||||
|
|
||||||
|
# C# files
|
||||||
|
[*.cs]
|
||||||
|
|
||||||
|
dotnet_analyzer_diagnostic.severity = error
|
||||||
|
|
||||||
|
# Errors flagged when this file was added. These should be
|
||||||
|
# investigated and either fixed or marked as acceptable with
|
||||||
|
# a reason why
|
||||||
|
dotnet_diagnostic.IDE0018.severity = none
|
||||||
|
dotnet_diagnostic.CA1829.severity = none
|
||||||
|
dotnet_diagnostic.CA1806.severity = none
|
||||||
|
dotnet_diagnostic.IDE0078.severity = none
|
||||||
|
dotnet_diagnostic.IDE0019.severity = none
|
||||||
|
dotnet_diagnostic.CA1309.severity = none
|
||||||
|
dotnet_diagnostic.CA2249.severity = none
|
||||||
|
dotnet_diagnostic.CA2251.severity = none
|
||||||
|
dotnet_diagnostic.CA1310.severity = none
|
||||||
|
dotnet_diagnostic.CA1305.severity = none
|
||||||
|
dotnet_diagnostic.CA1707.severity = none
|
||||||
|
dotnet_diagnostic.IDE0009.severity = none
|
||||||
|
dotnet_diagnostic.IDE0045.severity = none
|
||||||
|
dotnet_diagnostic.CA1304.severity = none
|
||||||
|
dotnet_diagnostic.IDE0002.severity = none
|
||||||
|
dotnet_diagnostic.CA2208.severity = none
|
||||||
|
dotnet_diagnostic.IDE0090.severity = none
|
||||||
|
dotnet_diagnostic.IDE0047.severity = none
|
||||||
|
dotnet_diagnostic.IDE0051.severity = none
|
||||||
|
dotnet_diagnostic.IDE1000.severity = none
|
||||||
|
dotnet_diagnostic.CA1834.severity = none
|
||||||
|
dotnet_diagnostic.IDE0066.severity = none
|
||||||
|
dotnet_diagnostic.IDE0007.severity = none
|
||||||
|
dotnet_diagnostic.IDE0008.severity = none
|
||||||
|
dotnet_diagnostic.IDE0055.severity = none
|
||||||
|
dotnet_diagnostic.IDE0044.severity = none
|
||||||
|
dotnet_diagnostic.IDE0057.severity = none
|
||||||
|
dotnet_diagnostic.CA2101.severity = none
|
||||||
|
dotnet_diagnostic.CA1068.severity = none
|
||||||
|
dotnet_diagnostic.CA1069.severity = none
|
||||||
|
dotnet_diagnostic.IDE0059.severity = none
|
||||||
|
dotnet_diagnostic.CA1010.severity = none
|
||||||
|
dotnet_diagnostic.CA1001.severity = none
|
||||||
|
dotnet_diagnostic.CA1036.severity = none
|
||||||
|
dotnet_diagnostic.CA5369.severity = none
|
||||||
|
dotnet_diagnostic.CA2245.severity = none
|
||||||
|
dotnet_diagnostic.CA1507.severity = none
|
||||||
|
dotnet_diagnostic.CA1845.severity = none
|
||||||
|
dotnet_diagnostic.IDE0025.severity = none
|
||||||
|
dotnet_diagnostic.xUnit2000.severity = none
|
||||||
|
dotnet_diagnostic.xUnit2012.severity = none
|
||||||
|
dotnet_diagnostic.xUnit1013.severity = none
|
||||||
|
dotnet_diagnostic.CA1711.severity = none
|
||||||
|
dotnet_diagnostic.IDE0027.severity = none
|
||||||
|
dotnet_diagnostic.IDE0021.severity = none
|
||||||
|
dotnet_diagnostic.CA1822.severity = none
|
||||||
|
dotnet_diagnostic.CA2201.severity = none
|
||||||
|
dotnet_diagnostic.CA1051.severity = none
|
||||||
|
dotnet_diagnostic.IDE0004.severity = none
|
||||||
|
dotnet_diagnostic.CA1838.severity = none
|
||||||
|
dotnet_diagnostic.IDE0075.severity = none
|
||||||
|
dotnet_diagnostic.CA1825.severity = none
|
||||||
|
dotnet_diagnostic.CA1816.severity = none
|
||||||
|
dotnet_diagnostic.CA1827.severity = none
|
||||||
|
dotnet_diagnostic.CA1720.severity = none
|
||||||
|
dotnet_diagnostic.CA1805.severity = none
|
||||||
|
dotnet_diagnostic.CA1725.severity = none
|
||||||
|
dotnet_diagnostic.CA2231.severity = none
|
||||||
|
dotnet_diagnostic.CA2016.severity = none
|
||||||
|
dotnet_diagnostic.CA1826.severity = none
|
||||||
|
dotnet_diagnostic.CA1835.severity = none
|
||||||
|
dotnet_diagnostic.CA1716.severity = none
|
||||||
|
dotnet_diagnostic.CA1708.severity = none
|
||||||
|
dotnet_diagnostic.CA1000.severity = none
|
||||||
|
dotnet_diagnostic.CA2211.severity = none
|
||||||
|
dotnet_diagnostic.CA1041.severity = none
|
||||||
|
dotnet_diagnostic.CA1715.severity = none
|
||||||
|
dotnet_diagnostic.IDE1006.severity = none
|
||||||
|
dotnet_diagnostic.CA1846.severity = none
|
||||||
|
dotnet_diagnostic.CA1847.severity = none
|
||||||
|
dotnet_diagnostic.CA1018.severity = none
|
||||||
|
dotnet_diagnostic.IDE0100.severity = none
|
||||||
|
dotnet_diagnostic.IDE0022.severity = none
|
||||||
|
dotnet_diagnostic.CA1841.severity = none
|
||||||
|
dotnet_diagnostic.CA2241.severity = none
|
||||||
|
dotnet_diagnostic.CA1436.severity = none
|
||||||
|
dotnet_diagnostic.CA2200.severity = none
|
||||||
|
dotnet_diagnostic.CA1836.severity = none
|
||||||
|
dotnet_diagnostic.IDE0028.severity = none
|
||||||
|
dotnet_diagnostic.IDE0032.severity = none
|
||||||
|
dotnet_diagnostic.IDE0065.severity = none
|
||||||
|
dotnet_diagnostic.IDE0120.severity = none
|
||||||
|
dotnet_diagnostic.IDE0130.severity = none
|
||||||
|
dotnet_diagnostic.IDE0017.severity = none
|
||||||
|
dotnet_diagnostic.IDE0010.severity = none
|
||||||
|
dotnet_diagnostic.IDE0052.severity = none
|
||||||
|
dotnet_diagnostic.IDE1005.severity = none
|
||||||
|
dotnet_diagnostic.IDE0040.severity = none
|
||||||
|
dotnet_diagnostic.IDE0034.severity = none
|
||||||
|
dotnet_diagnostic.IDE0063.severity = none
|
||||||
|
dotnet_diagnostic.IDE0049.severity = none
|
||||||
|
dotnet_diagnostic.IDE0001.severity = none
|
||||||
|
dotnet_diagnostic.IDE0039.severity = none
|
||||||
|
dotnet_diagnostic.IDE0054.severity = none
|
||||||
|
dotnet_diagnostic.IDE0060.severity = none
|
||||||
|
dotnet_diagnostic.IDE0048.severity = none
|
||||||
|
dotnet_diagnostic.IDE0030.severity = none
|
||||||
|
dotnet_diagnostic.IDE0031.severity = none
|
||||||
|
dotnet_diagnostic.IDE0016.severity = none
|
||||||
|
dotnet_diagnostic.IDE0036.severity = none
|
||||||
|
dotnet_diagnostic.IDE0029.severity = none
|
||||||
|
dotnet_diagnostic.IDE0076.severity = none
|
||||||
|
dotnet_diagnostic.IDE0070.severity = none
|
||||||
|
dotnet_diagnostic.IDE0011.severity = none
|
||||||
|
dotnet_diagnostic.IDE0056.severity = none
|
||||||
|
dotnet_diagnostic.IDE0082.severity = none
|
||||||
|
dotnet_diagnostic.IDE0071.severity = none
|
||||||
|
dotnet_diagnostic.IDE0083.severity = none
|
||||||
|
dotnet_diagnostic.IDE0041.severity = none
|
||||||
|
dotnet_diagnostic.IDE0150.severity = none
|
||||||
|
dotnet_diagnostic.IDE0020.severity = none
|
||||||
|
dotnet_diagnostic.IDE0061.severity = none
|
||||||
|
dotnet_diagnostic.IDE0062.severity = none
|
||||||
|
|
||||||
|
#### Core EditorConfig Options ####
|
||||||
|
|
||||||
|
# Indentation and spacing
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
tab_width = 4
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
insert_final_newline = false
|
||||||
|
|
||||||
|
#### .NET Coding Conventions ####
|
||||||
|
|
||||||
|
# Organize usings
|
||||||
|
dotnet_separate_import_directive_groups = false
|
||||||
|
dotnet_sort_system_directives_first = true
|
||||||
|
file_header_template = \nCopyright (c) Microsoft. All rights reserved.\nLicensed under the MIT license. See LICENSE file in the project root for full license information.\n
|
||||||
|
|
||||||
|
# this. and Me. preferences
|
||||||
|
dotnet_style_qualification_for_event = true
|
||||||
|
dotnet_style_qualification_for_field = true
|
||||||
|
dotnet_style_qualification_for_method = true
|
||||||
|
dotnet_style_qualification_for_property = true
|
||||||
|
|
||||||
|
# Language keywords vs BCL types preferences
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true
|
||||||
|
dotnet_style_predefined_type_for_member_access = true
|
||||||
|
|
||||||
|
# Parentheses preferences
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
|
||||||
|
|
||||||
|
# Modifier preferences
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members
|
||||||
|
|
||||||
|
# Expression-level preferences
|
||||||
|
dotnet_style_coalesce_expression = true
|
||||||
|
dotnet_style_collection_initializer = true
|
||||||
|
dotnet_style_explicit_tuple_names = true
|
||||||
|
dotnet_style_namespace_match_folder = true
|
||||||
|
dotnet_style_null_propagation = true
|
||||||
|
dotnet_style_object_initializer = true
|
||||||
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
|
dotnet_style_prefer_auto_properties = true
|
||||||
|
dotnet_style_prefer_compound_assignment = true
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = true
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = false
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
|
||||||
|
dotnet_style_prefer_simplified_boolean_expressions = true
|
||||||
|
dotnet_style_prefer_simplified_interpolation = true
|
||||||
|
|
||||||
|
# Field preferences
|
||||||
|
dotnet_style_readonly_field = true
|
||||||
|
|
||||||
|
# Parameter preferences
|
||||||
|
dotnet_code_quality_unused_parameters = all : error
|
||||||
|
|
||||||
|
# Suppression preferences
|
||||||
|
dotnet_remove_unnecessary_suppression_exclusions = none
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
dotnet_style_allow_multiple_blank_lines_experimental = true
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
||||||
|
|
||||||
|
#### C# Coding Conventions ####
|
||||||
|
|
||||||
|
# var preferences
|
||||||
|
csharp_style_var_elsewhere = false
|
||||||
|
csharp_style_var_for_built_in_types = false
|
||||||
|
csharp_style_var_when_type_is_apparent = true
|
||||||
|
|
||||||
|
# Expression-bodied members
|
||||||
|
csharp_style_expression_bodied_accessors = true
|
||||||
|
csharp_style_expression_bodied_constructors = false
|
||||||
|
csharp_style_expression_bodied_indexers = true
|
||||||
|
csharp_style_expression_bodied_lambdas = true
|
||||||
|
csharp_style_expression_bodied_local_functions = false
|
||||||
|
csharp_style_expression_bodied_methods = false
|
||||||
|
csharp_style_expression_bodied_operators = false
|
||||||
|
csharp_style_expression_bodied_properties = true
|
||||||
|
|
||||||
|
# Pattern matching preferences
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true
|
||||||
|
csharp_style_prefer_not_pattern = true
|
||||||
|
csharp_style_prefer_pattern_matching = true
|
||||||
|
csharp_style_prefer_switch_expression = true
|
||||||
|
|
||||||
|
# Null-checking preferences
|
||||||
|
csharp_style_conditional_delegate_call = true
|
||||||
|
|
||||||
|
# Modifier preferences
|
||||||
|
csharp_prefer_static_local_function = true
|
||||||
|
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
|
||||||
|
|
||||||
|
# Code-block preferences
|
||||||
|
csharp_prefer_braces = true
|
||||||
|
csharp_prefer_simple_using_statement = true
|
||||||
|
|
||||||
|
# Expression-level preferences
|
||||||
|
csharp_prefer_simple_default_expression = true
|
||||||
|
csharp_style_deconstructed_variable_declaration = true
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true
|
||||||
|
csharp_style_inlined_variable_declaration = true
|
||||||
|
csharp_style_pattern_local_over_anonymous_function = true
|
||||||
|
csharp_style_prefer_index_operator = true
|
||||||
|
csharp_style_prefer_range_operator = true
|
||||||
|
csharp_style_throw_expression = true
|
||||||
|
csharp_style_unused_value_assignment_preference = discard_variable
|
||||||
|
# Disable IDE0058 since it causes a lot of noise/suppressions which doesn't seem worth it to have currently
|
||||||
|
dotnet_diagnostic.IDE0058.severity = silent
|
||||||
|
# csharp_style_unused_value_expression_statement_preference = discard_variable
|
||||||
|
|
||||||
|
# 'using' directive preferences
|
||||||
|
csharp_using_directive_placement = outside_namespace
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
|
|
||||||
|
#### C# Formatting Rules ####
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
csharp_new_line_before_catch = true
|
||||||
|
csharp_new_line_before_else = true
|
||||||
|
csharp_new_line_before_finally = true
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_open_brace = all
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
|
||||||
|
# Indentation preferences
|
||||||
|
csharp_indent_block_contents = true
|
||||||
|
csharp_indent_braces = false
|
||||||
|
csharp_indent_case_contents = true
|
||||||
|
csharp_indent_case_contents_when_block = true
|
||||||
|
csharp_indent_labels = one_less_than_current
|
||||||
|
csharp_indent_switch_labels = true
|
||||||
|
|
||||||
|
# Space preferences
|
||||||
|
csharp_space_after_cast = false
|
||||||
|
csharp_space_after_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_after_comma = true
|
||||||
|
csharp_space_after_dot = false
|
||||||
|
csharp_space_after_keywords_in_control_flow_statements = true
|
||||||
|
csharp_space_after_semicolon_in_for_statement = true
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_space_around_declaration_statements = false
|
||||||
|
csharp_space_before_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_before_comma = false
|
||||||
|
csharp_space_before_dot = false
|
||||||
|
csharp_space_before_open_square_brackets = false
|
||||||
|
csharp_space_before_semicolon_in_for_statement = false
|
||||||
|
csharp_space_between_empty_square_brackets = false
|
||||||
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||||
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||||
|
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_parentheses = false
|
||||||
|
csharp_space_between_square_brackets = false
|
||||||
|
|
||||||
|
# Wrapping preferences
|
||||||
|
csharp_preserve_single_line_blocks = true
|
||||||
|
csharp_preserve_single_line_statements = true
|
||||||
|
|
||||||
|
#### Naming styles ####
|
||||||
|
|
||||||
|
# Naming rules
|
||||||
|
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||||
|
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||||
|
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||||
|
|
||||||
|
# Symbol specifications
|
||||||
|
|
||||||
|
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||||
|
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.interface.required_modifiers =
|
||||||
|
|
||||||
|
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||||
|
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.types.required_modifiers =
|
||||||
|
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||||
|
|
||||||
|
# Naming styles
|
||||||
|
|
||||||
|
dotnet_naming_style.pascal_case.required_prefix =
|
||||||
|
dotnet_naming_style.pascal_case.required_suffix =
|
||||||
|
dotnet_naming_style.pascal_case.word_separator =
|
||||||
|
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||||
|
|
||||||
|
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||||
|
dotnet_naming_style.begins_with_i.required_suffix =
|
||||||
|
dotnet_naming_style.begins_with_i.word_separator =
|
||||||
|
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||||
@@ -9,5 +9,6 @@
|
|||||||
<ServiceLayerTargetFramework>net6.0</ServiceLayerTargetFramework>
|
<ServiceLayerTargetFramework>net6.0</ServiceLayerTargetFramework>
|
||||||
<ResourceProviderTargetFramework>net6.0</ResourceProviderTargetFramework>
|
<ResourceProviderTargetFramework>net6.0</ResourceProviderTargetFramework>
|
||||||
<ToolsServiceTargetRuntimes>win-x64;win-x86;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;osx-x64;linux-x64</ToolsServiceTargetRuntimes>
|
<ToolsServiceTargetRuntimes>win-x64;win-x86;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;osx-x64;linux-x64</ToolsServiceTargetRuntimes>
|
||||||
|
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ Task("BuildTest")
|
|||||||
StandardOutputWriter = logWriter,
|
StandardOutputWriter = logWriter,
|
||||||
StandardErrorWriter = logWriter
|
StandardErrorWriter = logWriter
|
||||||
})
|
})
|
||||||
.ExceptionOnError($"Building test {project} failed for {framework}.");
|
.ExceptionOnError($"Building test {project} failed for {framework}. See {logPath} for more details.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace Microsoft.InsightsGenerator
|
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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
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.Collections.Concurrent;
|
||||||
using System.Composition;
|
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
|
namespace Microsoft.Kusto.ServiceLayer.Connection.Contracts
|
||||||
{
|
{
|
||||||
public class RequestSecurityTokenParams
|
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
|
namespace Microsoft.Kusto.ServiceLayer.Connection.Contracts
|
||||||
{
|
{
|
||||||
public class RequestSecurityTokenResponse
|
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;
|
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.Connection.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
|
namespace Microsoft.Kusto.ServiceLayer.Connection
|
||||||
{
|
{
|
||||||
public interface IConnectionManager
|
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 System.Threading.Tasks;
|
||||||
using Microsoft.Kusto.ServiceLayer.Connection.Contracts;
|
using Microsoft.Kusto.ServiceLayer.Connection.Contracts;
|
||||||
using Microsoft.Kusto.ServiceLayer.LanguageServices;
|
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
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Contracts
|
||||||
{
|
{
|
||||||
public class DataSourceConnectionDetails
|
public class DataSourceConnectionDetails
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// <copyright file="KustoQueryUtils.cs" company="Microsoft">
|
//
|
||||||
// Copyright (c) Microsoft. All Rights Reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// </copyright>
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// <copyright file="DataSourceUtils.cs" company="Microsoft">
|
//
|
||||||
// Copyright (c) Microsoft. All Rights Reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// </copyright>
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
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.Collections.Generic;
|
||||||
using System.Composition;
|
using System.Composition;
|
||||||
using Kusto.Data;
|
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>
|
/// <summary>
|
||||||
/// Represents the type of a data source.
|
/// 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
|
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.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Threading;
|
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;
|
using Microsoft.Kusto.ServiceLayer.Connection.Contracts;
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.DataSource
|
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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
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
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense
|
||||||
{
|
{
|
||||||
public class ShowDatabaseSchemaResult
|
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
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense
|
||||||
{
|
{
|
||||||
public class ShowDatabasesResult
|
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
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense
|
||||||
{
|
{
|
||||||
public class ShowFunctionsResult
|
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.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Threading;
|
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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// <copyright file="KustoDataSource.cs" company="Microsoft">
|
//
|
||||||
// Copyright (c) Microsoft. All Rights Reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// </copyright>
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
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;
|
using System.Data;
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Kusto
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Kusto
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// <copyright file="KustoQueryUtils.cs" company="Microsoft">
|
//
|
||||||
// Copyright (c) Microsoft. All Rights Reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// </copyright>
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
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>
|
/// <summary>
|
||||||
/// Column metadata information
|
/// 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>
|
/// <summary>
|
||||||
/// Metadata type enumeration
|
/// 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>
|
/// <summary>
|
||||||
/// Object metadata information
|
/// 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>
|
/// <summary>
|
||||||
/// Database metadata information
|
/// 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>
|
/// <summary>
|
||||||
/// Folder metadata information
|
/// 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
|
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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.Kusto.ServiceLayer.Admin.Contracts;
|
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>
|
/// <summary>
|
||||||
/// Database metadata information
|
/// 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
|
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
|
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
|
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;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
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;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Linq;
|
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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Kusto.Language;
|
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
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models
|
||||||
{
|
{
|
||||||
public class ColumnsModel
|
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
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models
|
||||||
{
|
{
|
||||||
public class TableGroupsModel
|
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
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models
|
||||||
{
|
{
|
||||||
public class TablesModel
|
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
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models
|
||||||
{
|
{
|
||||||
public class WorkspacesModel
|
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;
|
using Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models;
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses
|
namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
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 System.Threading;
|
||||||
using Microsoft.Kusto.ServiceLayer.Connection;
|
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;
|
||||||
using Microsoft.Kusto.ServiceLayer.Connection.Contracts;
|
using Microsoft.Kusto.ServiceLayer.Connection.Contracts;
|
||||||
using Microsoft.Kusto.ServiceLayer.DataSource;
|
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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.SqlTools.ServiceLayer.SqlContext;
|
using Microsoft.SqlTools.ServiceLayer.SqlContext;
|
||||||
using Microsoft.Kusto.ServiceLayer.Utility;
|
using Microsoft.Kusto.ServiceLayer.Utility;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts.ExecuteRequests
|
namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts.ExecuteRequests
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts
|
namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using Microsoft.Kusto.ServiceLayer.Workspace.Contracts;
|
using Microsoft.Kusto.ServiceLayer.Workspace.Contracts;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using Microsoft.SqlTools.Hosting.Protocol;
|
using Microsoft.SqlTools.Hosting.Protocol;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//
|
//
|
||||||
//
|
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// 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.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.QueryExecution
|
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.Kusto.ServiceLayer.Scripting.Contracts;
|
||||||
using Microsoft.SqlServer.Management.Sdk.Sfc;
|
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;
|
using System;
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.Utility
|
namespace Microsoft.Kusto.ServiceLayer.Utility
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Microsoft.SqlTools.Hosting.Utility;
|
using Microsoft.SqlTools.Hosting.Utility;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// <copyright file="SystemExtensions.cs" company="Microsoft">
|
//
|
||||||
// Copyright (c) Microsoft. All Rights Reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// </copyright>
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.Utility
|
namespace Microsoft.Kusto.ServiceLayer.Utility
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// <copyright file="ValidationUtils.cs" company="Microsoft">
|
//
|
||||||
// Copyright (c) Microsoft. All Rights Reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// </copyright>
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.Utility
|
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.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -9,11 +10,11 @@ using Microsoft.SqlTools.ResourceProvider.Core.Extensibility;
|
|||||||
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <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" />
|
/// Implementing classes must add a <see cref="ExportableAttribute" />
|
||||||
/// to the class in order to be found by the extension manager,
|
/// to the class in order to be found by the extension manager,
|
||||||
/// and to define the type and category supported
|
/// and to define the type and category supported
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IAccountManager : IExportable
|
public interface IAccountManager : IExportable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -46,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
bool HasLoginDialog
|
bool HasLoginDialog
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -8,7 +9,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public interface IAzureAuthenticationManager : IAccountManager
|
public interface IAzureAuthenticationManager : IAccountManager
|
||||||
{
|
{
|
||||||
@@ -38,6 +39,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stores the selected subscriptions given the ids
|
/// Stores the selected subscriptions given the ids
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<bool> SetSelectedSubscriptionsAsync(IEnumerable<string> subscriptionIds);
|
Task<bool> SetSelectedSubscriptionsAsync(IEnumerable<string> subscriptionIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
@@ -30,6 +31,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
|||||||
string SubscriptionId
|
string SubscriptionId
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||||
{
|
{
|
||||||
@@ -16,7 +17,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
|||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display ID
|
/// Display ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -24,6 +25,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
|||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
@@ -18,6 +19,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
|||||||
IAzureUserAccount UserAccount
|
IAzureUserAccount UserAccount
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
||||||
{
|
{
|
||||||
@@ -16,7 +17,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
|||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if user needs reauthentication
|
/// Returns true if user needs reauthentication
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -24,6 +25,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
|
|||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
public AuthenticationService()
|
public AuthenticationService()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void InitializeService(IProtocolEndpoint serviceHost)
|
public override void InitializeService(IProtocolEndpoint serviceHost)
|
||||||
{
|
{
|
||||||
Logger.Write(TraceEventType.Verbose, "AuthenticationService initialized");
|
Logger.Write(TraceEventType.Verbose, "AuthenticationService initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IUserAccount> SetCurrentAccountAsync(Account account, Dictionary<string, AccountSecurityToken> securityTokenMappings)
|
public async Task<IUserAccount> SetCurrentAccountAsync(Account account, Dictionary<string, AccountSecurityToken> securityTokenMappings)
|
||||||
{
|
{
|
||||||
var authManager = ServiceProvider.GetService<IAzureAuthenticationManager>();
|
var authManager = ServiceProvider.GetService<IAzureAuthenticationManager>();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@@ -13,7 +14,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class CommonUtil
|
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>
|
/// <summary>
|
||||||
@@ -44,7 +45,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
|
|
||||||
//********************************************************************************************
|
//********************************************************************************************
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Throw an exception if a string is null or empty.
|
/// Throw an exception if a string is null or empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="stringVar">string to check</param>
|
/// <param name="stringVar">string to check</param>
|
||||||
/// <param name="stringVarName">the variable or parameter name to display</param>
|
/// <param name="stringVarName">the variable or parameter name to display</param>
|
||||||
@@ -97,6 +98,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
|
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Data.Common;
|
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
|
/// Returns true if given exception if any of the inner exceptions is UserNeedsAuthenticationException
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static bool IsUserNeedsReauthenticateException(this Exception ex)
|
internal static bool IsUserNeedsReauthenticateException(this Exception ex)
|
||||||
{
|
{
|
||||||
return ex.IsExceptionType(typeof(UserNeedsAuthenticationException));
|
return ex.IsExceptionType(typeof(UserNeedsAuthenticationException));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
@@ -8,7 +9,7 @@ using System.Runtime.Serialization;
|
|||||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public class ExpiredTokenException : ServiceExceptionBase
|
public class ExpiredTokenException : ServiceExceptionBase
|
||||||
{
|
{
|
||||||
@@ -29,11 +30,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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.
|
/// and a reference to the inner exception that is the cause of this exception.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
/// <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>
|
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||||
public ExpiredTokenException(string message, Exception innerException)
|
public ExpiredTokenException(string message, Exception innerException)
|
||||||
: base(message, innerException)
|
: base(message, innerException)
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||||
/// <param name="httpStatusCode">The Http error code. </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>
|
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||||
public ServiceExceptionBase(string message, HttpStatusCode httpStatusCode, Exception innerException = null)
|
public ServiceExceptionBase(string message, HttpStatusCode httpStatusCode, Exception innerException = null)
|
||||||
: this(message, (int)httpStatusCode, innerException)
|
: this(message, (int)httpStatusCode, innerException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -47,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
/// <param name="message">The error message that explains the reason for the exception. </param>
|
||||||
/// <param name="httpStatusCode">The Http error code. </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>
|
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||||
public ServiceExceptionBase(string message, int httpStatusCode, Exception innerException)
|
public ServiceExceptionBase(string message, int httpStatusCode, Exception innerException)
|
||||||
: base(message, innerException)
|
: base(message, innerException)
|
||||||
@@ -57,11 +57,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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.
|
/// and a reference to the inner exception that is the cause of this exception.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
/// <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>
|
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||||
protected ServiceExceptionBase(string message, Exception innerException)
|
protected ServiceExceptionBase(string message, Exception innerException)
|
||||||
: base(message, innerException)
|
: base(message, innerException)
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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.
|
/// and a reference to the inner exception that is the cause of this exception.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
/// <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>
|
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||||
public ServiceFailedException(string message, Exception innerException)
|
public ServiceFailedException(string message, Exception innerException)
|
||||||
: base(message, innerException)
|
: base(message, innerException)
|
||||||
@@ -54,13 +54,13 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
internal static ServiceFailedException CreateException(string message, ServerDefinition serverDefinition, Exception innerException)
|
internal static ServiceFailedException CreateException(string message, ServerDefinition serverDefinition, Exception innerException)
|
||||||
{
|
{
|
||||||
return new ServiceFailedException(
|
return new ServiceFailedException(
|
||||||
string.Format(CultureInfo.CurrentCulture, message,
|
string.Format(CultureInfo.CurrentCulture, message,
|
||||||
serverDefinition != null ? serverDefinition.ServerType : string.Empty,
|
serverDefinition != null ? serverDefinition.ServerType : string.Empty,
|
||||||
serverDefinition != null ? serverDefinition.Category : string.Empty), innerException);
|
serverDefinition != null ? serverDefinition.Category : string.Empty), innerException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
@@ -8,7 +9,7 @@ using System.Runtime.Serialization;
|
|||||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public class UserNeedsAuthenticationException : ServiceExceptionBase
|
public class UserNeedsAuthenticationException : ServiceExceptionBase
|
||||||
{
|
{
|
||||||
@@ -29,11 +30,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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.
|
/// and a reference to the inner exception that is the cause of this exception.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The error message that explains the reason for the exception. </param>
|
/// <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>
|
/// (Nothing in Visual Basic) if no inner exception is specified</param>
|
||||||
public UserNeedsAuthenticationException(string message, Exception innerException)
|
public UserNeedsAuthenticationException(string message, Exception innerException)
|
||||||
: base(message, innerException)
|
: base(message, innerException)
|
||||||
|
|||||||
@@ -68,13 +68,13 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
|
|||||||
public class ProviderSettings
|
public class ProviderSettings
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display name of the provider
|
/// Display name of the provider
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DisplayName;
|
public string DisplayName;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID of the provider
|
/// ID of the provider
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Id;
|
public string Id;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Settings for the provider itself
|
/// Settings for the provider itself
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Account Account { get; set; }
|
public Account Account { get; set; }
|
||||||
/// <summary>
|
/// <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
|
/// now this allows us to get the tokens necessary to find a server and open a firewall rule
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string,AccountSecurityToken> SecurityTokenMappings { get; set; }
|
public Dictionary<string,AccountSecurityToken> SecurityTokenMappings { get; set; }
|
||||||
@@ -47,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
|
|||||||
/// End of the IP address range
|
/// End of the IP address range
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string EndIpAddress { get; set; }
|
public string EndIpAddress { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateFirewallRuleResponse : TokenReliantResponse
|
public class CreateFirewallRuleResponse : TokenReliantResponse
|
||||||
@@ -61,7 +61,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
|
|||||||
public class CanHandleFirewallRuleRequest
|
public class CanHandleFirewallRuleRequest
|
||||||
{
|
{
|
||||||
public static readonly
|
public static readonly
|
||||||
RequestType<HandleFirewallRuleParams, HandleFirewallRuleResponse> Type =
|
RequestType<HandleFirewallRuleParams, HandleFirewallRuleResponse> Type =
|
||||||
RequestType<HandleFirewallRuleParams, HandleFirewallRuleResponse>.Create("resource/handleFirewallRule");
|
RequestType<HandleFirewallRuleParams, HandleFirewallRuleResponse>.Create("resource/handleFirewallRule");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -16,8 +17,8 @@ using Microsoft.SqlTools.Utility;
|
|||||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default implementation for <see cref="IDatabaseDiscoveryProvider"/> for Azure Sql databases.
|
/// 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.
|
/// A discovery provider capable of finding Sql Azure databases for a specific Azure user account.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
[Exportable(
|
[Exportable(
|
||||||
@@ -35,7 +36,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
public AzureDatabaseDiscoveryProvider()
|
public AzureDatabaseDiscoveryProvider()
|
||||||
{
|
{
|
||||||
// Duplicate the exportable attribute as at present we do not support filtering using extensiondescriptor.
|
// 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(
|
Metadata = new ExportableMetadata(
|
||||||
ServerTypes.SqlServer,
|
ServerTypes.SqlServer,
|
||||||
Categories.Azure,
|
Categories.Azure,
|
||||||
@@ -90,9 +91,9 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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
|
/// 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)
|
//public async Task<ServiceResponse<DatabaseInstanceInfo>> GetDatabaseInstancesAsync(UIConnectionInfo uiConnectionInfo, CancellationToken cancellationToken)
|
||||||
//{
|
//{
|
||||||
// ServiceResponse<DatabaseInstanceInfo> result = null;
|
// ServiceResponse<DatabaseInstanceInfo> result = null;
|
||||||
@@ -109,7 +110,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the databases for given server name. Using the account manager to get the databases
|
/// 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)
|
public async Task<ServiceResponse<DatabaseInstanceInfo>> GetDatabaseInstancesAsync(string serverName, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
ServiceResponse<DatabaseInstanceInfo> result = null;
|
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
|
//if connection is passed, we need to search all subscriptions not selected ones
|
||||||
IEnumerable<IAzureUserAccountSubscriptionContext> subscriptions = await GetSubscriptionsAsync(string.IsNullOrEmpty(serverName));
|
IEnumerable<IAzureUserAccountSubscriptionContext> subscriptions = await GetSubscriptionsAsync(string.IsNullOrEmpty(serverName));
|
||||||
if (!cancellationToken.IsCancellationRequested)
|
if (!cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
result = await AzureUtil.ExecuteGetAzureResourceAsParallel((object)null, subscriptions, serverName, cancellationToken,
|
result = await AzureUtil.ExecuteGetAzureResourceAsParallel((object)null, subscriptions, serverName, cancellationToken,
|
||||||
GetDatabaseForSubscriptionAsync);
|
GetDatabaseForSubscriptionAsync);
|
||||||
}
|
}
|
||||||
@@ -159,7 +160,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (_azureAccountManager = _azureAccountManager ?? GetService<IAzureAuthenticationManager>());
|
return (_azureAccountManager = _azureAccountManager ?? GetService<IAzureAuthenticationManager>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -206,11 +207,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
|
|
||||||
/// <summary>
|
/// <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
|
/// 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)
|
private Task<ServiceResponse<DatabaseInstanceInfo>> GetFromCacheAsync(string key)
|
||||||
{
|
{
|
||||||
return Task.Factory.StartNew(() => _cache.Get(key));
|
return Task.Factory.StartNew(() => _cache.Get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a list of Azure sql databases for given subscription
|
/// Returns a list of Azure sql databases for given subscription
|
||||||
@@ -235,7 +236,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
else if (shouldFilter)
|
else if (shouldFilter)
|
||||||
{
|
{
|
||||||
//we should filter the result because the cached data includes databases for all servers
|
//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);
|
result.Errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +244,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
if (!shouldFilter && !cancellationToken.IsCancellationRequested)
|
if (!shouldFilter && !cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
result = _cache.UpdateCache(key, result);
|
result = _cache.UpdateCache(key, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -261,7 +262,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
CancellationToken cancellationToken, CancellationToken internalCancellationToken)
|
CancellationToken cancellationToken, CancellationToken internalCancellationToken)
|
||||||
{
|
{
|
||||||
ServiceResponse<DatabaseInstanceInfo> result = null;
|
ServiceResponse<DatabaseInstanceInfo> result = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!cancellationToken.IsCancellationRequested && !internalCancellationToken.IsCancellationRequested)
|
if (!cancellationToken.IsCancellationRequested && !internalCancellationToken.IsCancellationRequested)
|
||||||
@@ -295,7 +296,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
return result ?? new ServiceResponse<DatabaseInstanceInfo>();
|
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)
|
IList<IAzureSqlServerResource> filteredServersList, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
ServiceResponse<DatabaseInstanceInfo> result = null;
|
ServiceResponse<DatabaseInstanceInfo> result = null;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -43,7 +44,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
result = await AzureUtil.ExecuteGetAzureResourceAsParallel(_session, serverResources, null, cancellationToken, GetDatabasesForServerFromService);
|
result = await AzureUtil.ExecuteGetAzureResourceAsParallel(_session, serverResources, null, cancellationToken, GetDatabasesForServerFromService);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<ServiceResponse<DatabaseInstanceInfo>> GetDatabasesForServerFromService(
|
private async Task<ServiceResponse<DatabaseInstanceInfo>> GetDatabasesForServerFromService(
|
||||||
IAzureResourceManagementSession session,
|
IAzureResourceManagementSession session,
|
||||||
@@ -108,7 +109,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts the resource to DatabaseInstanceInfo
|
/// Converts the resource to DatabaseInstanceInfo
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private DatabaseInstanceInfo ConvertToModel(ServerInstanceInfo serverInstanceInfo, IAzureResource azureResource)
|
private DatabaseInstanceInfo ConvertToModel(ServerInstanceInfo serverInstanceInfo, IAzureResource azureResource)
|
||||||
{
|
{
|
||||||
DatabaseInstanceInfo databaseInstance = new DatabaseInstanceInfo(serverInstanceInfo)
|
DatabaseInstanceInfo databaseInstance = new DatabaseInstanceInfo(serverInstanceInfo)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -12,11 +13,11 @@ using Microsoft.SqlTools.ResourceProvider.Core.Extensibility;
|
|||||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default implementation for <see cref="IServerDiscoveryProvider"/> for Azure Sql servers.
|
/// 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.
|
/// A discovery provider capable of finding Sql Azure servers for a specific Azure user account.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Exportable(
|
[Exportable(
|
||||||
ServerTypes.SqlServer,
|
ServerTypes.SqlServer,
|
||||||
Categories.Azure,
|
Categories.Azure,
|
||||||
typeof(IServerDiscoveryProvider),
|
typeof(IServerDiscoveryProvider),
|
||||||
"Microsoft.SqlServer.ConnectionServices.Azure.AzureServerDiscoveryProvider")]
|
"Microsoft.SqlServer.ConnectionServices.Azure.AzureServerDiscoveryProvider")]
|
||||||
@@ -28,7 +29,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
public AzureSqlServerDiscoveryProvider()
|
public AzureSqlServerDiscoveryProvider()
|
||||||
{
|
{
|
||||||
// Duplicate the exportable attribute as at present we do not support filtering using extensiondescriptor.
|
// 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(
|
Metadata = new ExportableMetadata(
|
||||||
ServerTypes.SqlServer,
|
ServerTypes.SqlServer,
|
||||||
Categories.Azure,
|
Categories.Azure,
|
||||||
@@ -120,6 +121,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
{
|
{
|
||||||
_azureAccountManager = value as IAzureAuthenticationManager;
|
_azureAccountManager = value as IAzureAuthenticationManager;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
public class DatabaseInstanceInfo
|
public class DatabaseInstanceInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default constructor to initialize the instance
|
/// Default constructor to initialize the instance
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serverInstanceInfo"></param>
|
/// <param name="serverInstanceInfo"></param>
|
||||||
public DatabaseInstanceInfo(ServerInstanceInfo serverInstanceInfo)
|
public DatabaseInstanceInfo(ServerInstanceInfo serverInstanceInfo)
|
||||||
@@ -34,7 +35,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ServerInstanceInfo ServerInstanceInfo
|
public ServerInstanceInfo ServerInstanceInfo
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ResourceProvider.Core
|
namespace Microsoft.SqlTools.ResourceProvider.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.SqlTools.ResourceProvider.Core.Authentication;
|
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
|
/// A session used by <see cref="IAzureResourceManager" />. Includes all the clients that the resource management needs to get ther resources
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IAzureResourceManagementSession : IDisposable
|
public interface IAzureResourceManagementSession : IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Closes the session
|
/// Closes the session
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user