Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Extensions/TestCommon/TestCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Orm\Xtensive.Orm.Tests.Framework\Xtensive.Orm.Tests.Framework.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<None Include="Readme.txt" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>
<Import Project="$(SolutionDir)MSBuild\DataObjects.Net.InternalBuild.targets" />
<ItemGroup>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion Extensions/Xtensive.Orm.Web/Xtensive.Orm.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ protected override string BuildConnectionString(UrlInfo url)
SqlHelper.ValidateConnectionUrl(url);

var builder = new SqlConnectionStringBuilder();
builder.Encrypt = url.Secure;

// host, port, database
if (url.Port==0) {
Expand Down
2 changes: 1 addition & 1 deletion Orm/Xtensive.Orm.Tests/Xtensive.Orm.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="System.CodeDom" Version="4.4.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="System.Runtime.Serialization.Xml" Version="4.3.0" />
<PackageReference Include="System.Spatial" Version="5.8.3" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public override TItem Add(TItem item, bool replaceIfExists)
public override void RemoveKey(TKey key, bool removeCompletely) => realCache.TryRemove(key);

/// <inheritdoc/>
public override void Clear() =>
//TODO: Change to imp.Clear() after updating BitFaster.Caching package to 1.0.4
realCache = new FastConcurrentLru<TKey, TItem>((int) MaxSize);
public override void Clear() => realCache.Clear();

/// <inheritdoc/>
/// <exception cref="NotImplementedException"/>
Expand Down
16 changes: 14 additions & 2 deletions Orm/Xtensive.Orm/Orm/UrlInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2007-2020 Xtensive LLC.
// Copyright (C) 2007-2021 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.
// Created by: Alex Yakunin
Expand Down Expand Up @@ -77,7 +77,7 @@ public class UrlInfo :
ISerializable
{
private static readonly Regex Pattern = new Regex(
@"^(?'proto'[^:]*)://" +
@"^(?'proto'[^:]*[^sS])(?'secure'[sS]?)://" +
@"((?'username'[^:@]*)" +
@"(:(?'password'[^@]*))?@)?" +
@"(?'host'[^:/]*)" +
Expand All @@ -88,6 +88,7 @@ public class UrlInfo :

private string url = string.Empty;
private string protocol = string.Empty;
private bool secure = false;
private string host = string.Empty;
private int port;
private string resource = string.Empty;
Expand Down Expand Up @@ -116,6 +117,16 @@ public string Protocol
get { return protocol; }
}

/// <summary>
/// Gets the security part of the current <see cref="Url"/>
/// Scheme with 's' suffix is secure.
/// </summary>
public bool Secure
{
[DebuggerStepThrough]
get => secure;
}

/// <summary>
/// Gets the host part of the current <see cref="Url"/>
/// (e.g. <b>"localhost"</b> is the host part of the "tcp://admin:password@<b>localhost</b>/resource" URL).
Expand Down Expand Up @@ -237,6 +248,7 @@ private static void Parse(string url, UrlInfo info)
info.resource = UrlDecode(result.Result("${resource}"));
info.host = UrlDecode(result.Result("${host}"));
info.protocol = UrlDecode(result.Result("${proto}"));
info.secure = !string.IsNullOrEmpty(result.Result("${secure}"));
info.port = @port;
info.parameters = new ReadOnlyDictionary<string, string>(@params);
}
Expand Down
4 changes: 2 additions & 2 deletions Orm/Xtensive.Orm/Xtensive.Orm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
</Content>
</ItemGroup>
<ItemGroup Label="Packages">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="BitFaster.Caching" Version="1.0.3" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="BitFaster.Caching" Version="1.0.4" />
</ItemGroup>
<ItemGroup Label="T4GeneratorsUpdaters">
<None Update="Arithmetic\Internal\PrimitiveArithmetics.tt">
Expand Down