-
Notifications
You must be signed in to change notification settings - Fork 330
Remove connection options inheritance #4237
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
base: main
Are you sure you want to change the base?
Changes from all commits
5d26307
cadd40a
9ef831b
4ff134c
6209356
341f181
439c6ef
bf5931d
1133675
6d0afa0
c55f6fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,9 @@ | |
|
|
||
| namespace Microsoft.Data.Common | ||
| { | ||
| // @TODO: Theoretically this class could be replaced with SqlConnectionString. | ||
| // Note: This class exists exclusively for use in SqlClientPermission. It provides a stable serialization format when the permission set is serialized | ||
| // by Code Access Security (CAS). CAS itself is deprecated in all versions of .NET and .NET Framework, but it won't be dropped from .NET Framework. | ||
| // We should maintain this class and SqlClientPermission to ensure that existing CAS-based security checks continue to work correctly on .NET Framework. | ||
|
|
||
| [Serializable] // MDAC 83147 | ||
| internal sealed class DbConnectionString | ||
|
|
@@ -53,20 +55,20 @@ internal DbConnectionString( | |
| string restrictions, | ||
| KeyRestrictionBehavior behavior, | ||
| IReadOnlyDictionary<string, string> synonyms) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to have a constructor that accepts synonyms. The only value that is ever passed is SqlConnectionOptions.KeywordMap. I opted to leave this constructor as-is to reduce the disturbance to anyone who uses this via reflection. Modifying these CAS helper-classes isn't the focus of this PR. They support a deprecated feature and I just need them to compile
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we officially support customers reflecting into our internals?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, but it still happens :) I basically just want to forget that these classes even exist and never touch them. |
||
| : this(new DbConnectionOptions(value, synonyms), restrictions, behavior, synonyms, false) | ||
| : this(new SqlConnectionOptions(value), restrictions, behavior, synonyms, false) | ||
| { | ||
| // The IReadOnlyDictionary doesn't need to be cloned since it isn't shared with anything else | ||
|
mdaigle marked this conversation as resolved.
|
||
| } | ||
|
|
||
| internal DbConnectionString(DbConnectionOptions connectionOptions) | ||
| internal DbConnectionString(SqlConnectionOptions connectionOptions) | ||
| : this(connectionOptions, (string)null, KeyRestrictionBehavior.AllowOnly, null, true) | ||
| { | ||
| // used by DBDataPermission to convert from DbConnectionOptions to DbConnectionString | ||
| // used by DBDataPermission to convert from SqlConnectionOptions to DbConnectionString | ||
| // since backward compatibility requires Everett level classes | ||
| } | ||
|
|
||
|
mdaigle marked this conversation as resolved.
|
||
| private DbConnectionString( | ||
| DbConnectionOptions connectionOptions, | ||
| SqlConnectionOptions connectionOptions, | ||
| string restrictions, | ||
| KeyRestrictionBehavior behavior, | ||
| IReadOnlyDictionary<string, string> synonyms, | ||
|
|
@@ -505,7 +507,7 @@ private static string[] ParseRestrictions(string restrictions, IReadOnlyDictiona | |
| int startPosition = nextStartPosition; | ||
|
|
||
| string keyname; // since parsing restrictions ignores values, it doesn't matter if we use ODBC rules or OLEDB rules | ||
| nextStartPosition = DbConnectionOptions.GetKeyValuePair(restrictions, startPosition, buffer, false, out keyname, out _); | ||
| nextStartPosition = SqlConnectionOptions.GetKeyValuePair(restrictions, startPosition, buffer, false, out keyname, out _); | ||
| if (!string.IsNullOrEmpty(keyname)) | ||
| { | ||
| #if DEBUG | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.