You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2018/03/27 07:52:50 UTC
ignite git commit: IGNITE-8034 .NET: Add
IgniteConfiguration.AuthenticationEnabled
Repository: ignite
Updated Branches:
refs/heads/master 27dc3e56e -> 19a05815b
IGNITE-8034 .NET: Add IgniteConfiguration.AuthenticationEnabled
This closes #3696
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/19a05815
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/19a05815
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/19a05815
Branch: refs/heads/master
Commit: 19a05815bc4858ad49508d0bcb09d22c15168845
Parents: 27dc3e5
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Mar 27 10:51:49 2018 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Mar 27 10:51:49 2018 +0300
----------------------------------------------------------------------
.../utils/PlatformConfigurationUtils.java | 4 ++++
.../Config/full-config.xml | 2 +-
.../IgniteConfigurationSerializerTest.cs | 1 +
.../IgniteConfigurationTest.cs | 4 +++-
.../Apache.Ignite.Core/IgniteConfiguration.cs | 20 ++++++++++++++++++++
.../IgniteConfigurationSection.xsd | 5 +++++
6 files changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/19a05815/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
index 79bafe6..8ebf09e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
@@ -621,6 +621,8 @@ public class PlatformConfigurationUtils {
cfg.setLongQueryWarningTimeout(in.readLong());
if (in.readBoolean())
cfg.setActiveOnStart(in.readBoolean());
+ if (in.readBoolean())
+ cfg.setAuthenticationEnabled(in.readBoolean());
Object consId = in.readObjectDetached();
@@ -1118,6 +1120,8 @@ public class PlatformConfigurationUtils {
w.writeLong(cfg.getLongQueryWarningTimeout());
w.writeBoolean(true);
w.writeBoolean(cfg.isActiveOnStart());
+ w.writeBoolean(true);
+ w.writeBoolean(cfg.isAuthenticationEnabled());
w.writeObject(cfg.getConsistentId());
// Thread pools.
http://git-wip-us.apache.org/repos/asf/ignite/blob/19a05815/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml
index 774e362..341cf7c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml
@@ -23,7 +23,7 @@
workDirectory='c:' JvmMaxMemoryMb='1024' MetricsLogFrequency='0:0:10' isDaemon='true'
isLateAffinityAssignment='false' springConfigUrl='c:\myconfig.xml' autoGenerateIgniteInstanceName='true'
peerAssemblyLoadingMode='CurrentAppDomain' longQueryWarningTimeout='1:2:3' isActiveOnStart='false'
- consistentId='someId012' redirectJavaConsoleOutput='false'>
+ consistentId='someId012' redirectJavaConsoleOutput='false' authenticationEnabled='true'>
<localhost>127.1.1.1</localhost>
<binaryConfiguration compactFooter='false' keepDeserialized='true'>
<nameMapper type='Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+NameMapper' bar='testBar' />
http://git-wip-us.apache.org/repos/asf/ignite/blob/19a05815/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
index c4df141..31d0861 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -97,6 +97,7 @@ namespace Apache.Ignite.Core.Tests
Assert.IsTrue(cfg.AutoGenerateIgniteInstanceName);
Assert.AreEqual(new TimeSpan(1, 2, 3), cfg.LongQueryWarningTimeout);
Assert.IsFalse(cfg.IsActiveOnStart);
+ Assert.IsTrue(cfg.AuthenticationEnabled);
Assert.AreEqual("someId012", cfg.ConsistentId);
Assert.IsFalse(cfg.RedirectJavaConsoleOutput);
http://git-wip-us.apache.org/repos/asf/ignite/blob/19a05815/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
index c707216..ec4a3fd 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
@@ -490,6 +490,7 @@ namespace Apache.Ignite.Core.Tests
Assert.AreEqual(IgniteConfiguration.DefaultClientConnectorConfigurationEnabled,
cfg.ClientConnectorConfigurationEnabled);
Assert.AreEqual(IgniteConfiguration.DefaultRedirectJavaConsoleOutput, cfg.RedirectJavaConsoleOutput);
+ Assert.AreEqual(IgniteConfiguration.DefaultAuthenticationEnabled, cfg.AuthenticationEnabled);
// Thread pools.
Assert.AreEqual(IgniteConfiguration.DefaultManagementThreadPoolSize, cfg.ManagementThreadPoolSize);
@@ -825,7 +826,8 @@ namespace Apache.Ignite.Core.Tests
SwapPath = TestUtils.GetTempDirectoryName()
}
}
- }
+ },
+ AuthenticationEnabled = false
};
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/19a05815/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
index e387634..6c8a429 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
@@ -194,6 +194,9 @@ namespace Apache.Ignite.Core
/** */
private bool? _isActiveOnStart;
+ /** */
+ private bool? _authenticationEnabled;
+
/** Local event listeners. Stored as array to ensure index access. */
private LocalEventListener[] _localEventListenersInternal;
@@ -221,6 +224,11 @@ namespace Apache.Ignite.Core
public const bool DefaultRedirectJavaConsoleOutput = true;
/// <summary>
+ /// Default value for <see cref="AuthenticationEnabled"/> property.
+ /// </summary>
+ public const bool DefaultAuthenticationEnabled = false;
+
+ /// <summary>
/// Initializes a new instance of the <see cref="IgniteConfiguration"/> class.
/// </summary>
public IgniteConfiguration()
@@ -295,6 +303,7 @@ namespace Apache.Ignite.Core
writer.WriteTimeSpanAsLongNullable(_clientFailureDetectionTimeout);
writer.WriteTimeSpanAsLongNullable(_longQueryWarningTimeout);
writer.WriteBooleanNullable(_isActiveOnStart);
+ writer.WriteBooleanNullable(_authenticationEnabled);
writer.WriteObjectDetached(ConsistentId);
// Thread pools
@@ -609,6 +618,7 @@ namespace Apache.Ignite.Core
_clientFailureDetectionTimeout = r.ReadTimeSpanNullable();
_longQueryWarningTimeout = r.ReadTimeSpanNullable();
_isActiveOnStart = r.ReadBooleanNullable();
+ _authenticationEnabled = r.ReadBooleanNullable();
ConsistentId = r.ReadObject<object>();
// Thread pools
@@ -1425,5 +1435,15 @@ namespace Apache.Ignite.Core
/// </summary>
[DefaultValue(DefaultRedirectJavaConsoleOutput)]
public bool RedirectJavaConsoleOutput { get; set; }
+
+ /// <summary>
+ /// Gets or sets whether user authentication is enabled for the cluster. Default is <c>false</c>.
+ /// </summary>
+ [DefaultValue(DefaultAuthenticationEnabled)]
+ public bool AuthenticationEnabled
+ {
+ get { return _authenticationEnabled ?? DefaultAuthenticationEnabled; }
+ set { _authenticationEnabled = value; }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/19a05815/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
index 9d004c3..a97136f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -2209,6 +2209,11 @@
<xs:documentation>Whether grid should be active on start.</xs:documentation>
</xs:annotation>
</xs:attribute>
+ <xs:attribute name="authenticationEnabled" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether user authentication is enabled for the cluster.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
<xs:attribute name="clientConnectorConfigurationEnabled" type="xs:boolean">
<xs:annotation>
<xs:documentation>Whether client connector should be enabled (allow thin clients, ODBC and JDBC drivers to work with Ignite).</xs:documentation>