Commit Graph

32 Commits

Author SHA1 Message Date
Cheena Malhotra
463fc60330 Move back 'Shared' content to 'Hosting' assembly (#1967) 2023-03-24 15:07:02 -07:00
Cheena Malhotra
187b6ecc14 Introduce AAD interactive auth mode (#1860) 2023-03-02 09:39:54 -08:00
Cheena Malhotra
c83f380b8e Improve secure enclaves error handling (#1880) 2023-02-28 13:31:40 -08:00
Alan Ren
15250a9178 make list databases return in their original order (#1859)
* return databases in their original order

* remove using statement

* fix unit tests

* fix error
2023-02-09 14:27:25 -08:00
Karl Burtram
f288bee294 Make nullable warnings a per file opt-in (#1842)
* Make nullable warnings a per file opt-in

* Remove unneeded compiler directives

* Remove compiler directive for User Data
2023-02-03 18:10:07 -08:00
Cheena Malhotra
a8f9219f09 Introduce support for "Command Timeout" connection property (#1765) 2023-01-03 21:42:32 -08:00
Alex Ma
7eee5180a2 Add change password function and handling (#1771)
* added ChangePassword to connectionService

* added changepasswordparams

* added more code

* added more changes to connectionservice

* added more changes

* added small test

* added changepasswordrequest

* added different ServerConnection constructor

* consolidated changepassword

* added exception catch

* added passwordChangeFail params

* added changePassword to it's own function

* simplified changePassword

* made fixes to test

* added new test

* added one additional connection test

* added response callback

* removed unnecessary SendError

* added localized empty password error

* added updated error messages

* added small fix to check

* added changes based on feedback

* added minor change

* fix tests

* renamed messages to errorDetails

* simplified error message

* small change to connectionservice message

* error message change

* added environment newline

* added error retry messages to STS

* added regex

* added newline handling
2022-12-07 14:24:26 -08:00
Cheena Malhotra
faaec187a7 Support Boolean type for Encrypt option value (#1737) 2022-10-27 14:32:22 -07:00
Cheena Malhotra
c0f8482e26 Update Microsoft.Data.SqlClient to v5.0.1 (#1708) 2022-10-24 20:10:04 -07:00
Alex Ma
54c1d0418a Added error message to validate connect params. (#1660)
* Added error message to validate connect params.

* removed connectionParam == null as ConnnectionCompleteParams cannot be nulled.

* Added ValidateConnectParams to other connection services

* removed message from error

* reverted change to connectionServiceCore

* added updated message

* restore null and added errormessage to GetConnectionCompleteParams

* fix for sr.xlf

* fix for tab

* another fix to tabs

* added message to connection complete error

* small fix
2022-08-30 14:24:44 -07:00
Aasim Khan
9877af54b9 Updating to dotnet 5.0 (#1218)
* adding network file validator contract

* updating to dotnet 5

* reverting change in pipeline

* updating target framework to 5.0

* updating srgen and using target framework var

* reverting srgen back to 3.1

* Adding dotnet 3.1 to build

* Fixing task def

* removing global json

* updating other 3.1 refs to 5.0

* removing netcore folder from build.cake

* Moving and renaming dotnet 3.1 task
2021-06-25 13:53:01 -07:00
Karl Burtram
6fe715d2d8 Do not update the DB name when connecting to DB pool (#1186)
* Do not update the DB name when connecting to DB pool

* Fix typo in the connection service
2021-04-15 14:48:02 -07:00
David Shiflet
839acf67cd Convert most tools service tests to nunit (#1037)
* Remove xunit dependency from testdriver

* swap expected/actual as needed

* Convert Test.Common to nunit

* port hosting unit tests to nunit

* port batchparser integration tests to nunit

* port testdriver.tests to nunit

* fix target to copy dependency

* port servicelayer unittests to nunit

* more unit test fixes

* port integration tests to nunit

* fix test method type

* try using latest windows build for PRs

* reduce test memory use
2020-08-05 13:43:14 -04:00
Udeesha Gautam
4c819e0fc1 Fixes for tests affected by MDS update (#987)
* Fixing tests in parallel that were affected by MDS update
2020-06-23 11:27:19 -07:00
Alan Ren
8f6662b019 extend the list databases request (#951)
* extend the list databases request

* reuse databaseInfo and refactor

* fix typo
2020-04-28 16:12:56 -07:00
Jeff Trimmer
927b0d73ca Enable Always Encrypted enclave connection parameters (#919)
* Enable the enclave connection parameters.

* Update the switch statement to use the enum constants for EnclaveAttestationProtocol

* Update verbiage for Always Encrypted connection options

* Update the argument exception to chose one specific to this connection option

* Add resource logic to resource files.

* Add error checking for when enclave parameters are added and Always Encrypted is set to disabled.

* Add/Update unit tests
2020-02-18 15:33:12 -08:00
Jeff Trimmer
7b102df5a7 Enable column encryption setting (#908)
* Enable the Column Encryption advanced security connection setting and add supporting tests.
2020-01-22 16:02:05 -08:00
Karl Burtram
427f0c11e8 Bump SMO and SqlClient to pickup Microsoft.Data.SqlClient fixes (#894)
* Revert "Revert to SMO with older SQLClient driver (#889)"

This reverts commit b763abae47.

* Bump SMO and SqlClient
2019-11-22 17:17:21 -08:00
Karl Burtram
b763abae47 Revert to SMO with older SQLClient driver (#889)
* Revert "Update SMO (#875)"

This reverts commit 96593d66e3.

* Revert "Switch Tools Service to new SMO and Microsoft.Data.SqlClient driver (#865)"

This reverts commit 9d140b53f3.

* Bump SMO to 160.1910315.0-preview
2019-11-04 13:00:45 -08:00
David Shiflet
9d140b53f3 Switch Tools Service to new SMO and Microsoft.Data.SqlClient driver (#865)
* switch to ambient props and targets files

* build against Microsoft.Data.SqlClient

* build tests

* fix test bug

* temporarily add SMO nuget to the repo

* update to released Microsoft.Data package
2019-09-17 17:51:19 -04:00
Charles Gagnon
85f34b65f1 Fix a number of cred scan hits (#800)
Bunch of secrets in files, usually fixed by generating random password. The deleted script files didn't seem to be used anywhere.
2019-04-24 13:31:34 -07:00
Matt Irvine
7f28f249de Add support for Azure Active Directory connections (#727) 2018-11-13 11:50:30 -08:00
Anthony Dresser
3c0a282333 Serialize Connection String (#680)
* add string serialization

* add unadded file

* changed code to be testable, added test

* moved test to correct location

* change to send undefined rather than error if the serialization fails

* update request name
2018-08-16 13:10:14 -07:00
Kevin Cunnane
42ee96f99f Fix Ops Studio issue 97 where query connection is dropped (#549)
- Fixes https://github.com/Microsoft/sqlopsstudio/issues/97.
- This should fix the bulk of the issues reported by users since it's the 1st use of this connection in the query code path.
- Implemented the fix in the connection service. This will always open a connection when calling `GetOrOpenConnection`. I cannot see a reason why the connection returned from this should ever be closed.
- resolve issues in both this code path and the edit data code path since both use this method.
2017-11-21 14:46:20 -08:00
Anthony Dresser
399b03cbd1 Add force change database logic (#519)
* add logic to close connections if changing fails

* added logic to close connections and reopen that fail to change (azure)

* expose connection map in connection info, change while to foreach

* removed unneeded code

* reworked logic to not depend on thrown errors

* added tests
2017-10-25 10:54:17 -07:00
Benjamin Russell
e9bc97e290 Edit Data: Better errors for possible truncation (#514)
* Fix to make sql exceptions surface properly to user (with important notes!)

* Adding support for detecting column size issues when updating a cell

* Adding unit tests for the exception on read scenario
2017-10-21 11:08:40 -07:00
Kevin Cunnane
01d7cde0e3 Add support for Dedicated Administrator Connection (#466)
* Prototype support for admin connection

* Added test and used correct default for ADMIN connection casing
2017-09-20 16:04:12 -07:00
Matt Irvine
b20529cced Enable changing database when connected with a connection string (#413)
This commit builds connection options using the connection string as a base, but allow other options to be overridden, which is how we change database. This commit also makes sure to copy the connection string when copying a connection, since that didn't happen before
2017-07-14 13:24:00 -07:00
Matt Irvine
fb239ac956 Support connecting with a connection string (#334)
- Add support for connecting with a connection string by passing it as one of the connection parameters
- If a connection string is present, it will override any other parameters that are present
2017-05-01 21:01:26 -07:00
Kevin Cunnane
f3bf330da6 Connect with different properties should actually change context (#307)
* Connect with different properties should actually change context
- Up to now, calling Connect for a previously-connected URI would disconnect, then reconnect ot the original (not new) target. WIth these changes we handle changes to database name or other key properties by updating the ConnectionInfo and connecting to the new target
- Some interesting scenarios are raised by our API, notably that an empty database name maps to the default DB (which we know nothing about). This limits the new feature such that only if the DB Name is specified, we'll change the connection. Hence 2 calls to an empty DB will not result in a DB change.

Additional changes:
- After discussion with Ben, we're simplifying the cancellation logic. He had made changes to support this, so the main update is that we dispose the token in the final block after its last use (hence avoiding a disposed exception) and clean up the number of Waits required since we already have async cancellation support
- Factored some logic such that the OnConnection callback isn't invoked until after we've updated the database name in the GetConnectionCompleteParams method. Again, this supports reporting the actual DB name instead of leaving it blank for default DB requests.

* PR comment fixes
2017-04-06 11:25:59 -07:00
Karl Burtram
f00136cffb Fix namespaces for code moved to separate class libraries (#263)
* Create ServiceHost a service-specific class

* Renaming hosting namespace

* Rename credentials namespace

* Fix namespaces
2017-03-02 14:41:06 -08:00
Benjamin Russell
1166778249 Isolate Shared Test Code (#252)
The goal of this make sure that test code is correctly organized to ensure that test suites aren't dependent on each other.
* UnitTests get their own project now (renaming Microsoft.SqlTools.ServiceLayer.Test to Microsoft.SqlTools.ServiceLayer.UnitTests) which is about 90% of the changes to the files.
* IntegrationTests no longer depends on UnitTests, only Test.Common
* Any shared components from TestObjects that spins up a "live" connection has been moved to IntegrationTests Utility/LiveConnectionHelper.cs
* The dictionary-based mock file stream factory has been moved to Test.Common since it is used by UnitTests and IntegrationTests
    * Added a overload that doesn't take a dictionary for when we don't care about monitoring the storage (about 90% of the time)
* The RunIf* wrapper methods have been moved to Test.Common
* OwnerUri and StandardQuery constants have been moved to Test.Common Constants file

* Updating to latest SDK version available at https://www.microsoft.com/net/core#windowscmd

* Moving unit tests to unit test folder

* Changing namespaces to UnitTests

* Moving some constants and shared functionality into common project, making the UnitTests reference it

* Unit tests are working!

* Integration tests are working

* Updating automated test runs

* Fixing one last broken unit test

* Exposing internals for other projects

* Moving edit data tests to UnitTest project

* Applying refactor fixes to unit tests

* Fixing flaky test that wasn't awaiting completion
2017-03-02 13:00:31 -08:00