-
Notifications
You must be signed in to change notification settings - Fork 314
Fix SetProvider to return immediately if user-defined provider found #3620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d0fdcba
Fix SetProvider to return immediately if user-defined provider found
cheenamalhotra 762d785
Include test
cheenamalhotra 08265d2
Fix tests
cheenamalhotra f926b15
Remove unwanted changes
cheenamalhotra 50b14b1
Update config file name
cheenamalhotra ab38d89
Rename file back to app.config
cheenamalhotra 75eb377
Copy always
cheenamalhotra d4db85f
Disable tests for now.
cheenamalhotra 8117bf0
Fix framework inclusion
cheenamalhotra bd37fa3
Fix test failures
cheenamalhotra a6871b0
Touch ups
cheenamalhotra a792b51
Fix test (continued)
cheenamalhotra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...crosoft.Data.SqlClient/tests/FunctionalTests/DataCommon/DummySqlAuthenticationProvider.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.Data.SqlClient.FunctionalTests.DataCommon | ||
{ | ||
/// <summary> | ||
/// Dummy class to override default Sql Authentication provider in functional tests. | ||
/// This type returns a dummy access token and is only used for registration test from app.config file. | ||
/// Since no actual connections are intended to be made in Functional tests, | ||
/// this type is added by default to validate config file registration scenario. | ||
/// </summary> | ||
public class DummySqlAuthenticationProvider : SqlAuthenticationProvider | ||
{ | ||
public static string DUMMY_TOKEN_STR = "dummy_access_token"; | ||
|
||
public override Task<SqlAuthenticationToken> AcquireTokenAsync(SqlAuthenticationParameters parameters) | ||
=> Task.FromResult(new SqlAuthenticationToken(DUMMY_TOKEN_STR, new DateTimeOffset(DateTime.Now.AddHours(2)))); | ||
|
||
// Supported authentication modes don't matter for dummy test, but added to demonstrate config file usage. | ||
public override bool IsSupported(SqlAuthenticationMethod authenticationMethod) | ||
=> authenticationMethod == SqlAuthenticationMethod.ActiveDirectoryInteractive; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Microsoft.Data.SqlClient/tests/FunctionalTests/app.config
cheenamalhotra marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Application configuration file is loaded by the compiler first before loading managed types. --> | ||
<configuration> | ||
<configSections> | ||
<section name="SqlClientAuthenticationProviders" type="Microsoft.Data.SqlClient.SqlClientAuthenticationProviderConfigurationSection,Microsoft.Data.SqlClient" /> | ||
</configSections> | ||
<!-- Custom authentication providers from app.config are loaded by the SqlAuthenticationProviderManager before registering default authentication provider. --> | ||
<SqlClientAuthenticationProviders> | ||
<providers> | ||
<add name="active directory interactive" type="Microsoft.Data.SqlClient.FunctionalTests.DataCommon.DummySqlAuthenticationProvider, FunctionalTests" /> | ||
</providers> | ||
</SqlClientAuthenticationProviders> | ||
</configuration> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.