예제 #1
0
        public void DefaultsAreHandled()
        {
            var emptyObj = Krb5ConfigurationSerializer.Serialize(ConfigurationSectionList.FromConfigObject(new Krb5Config()));

            var obj = Krb5ConfigurationSerializer.Deserialize(emptyObj).ToConfigObject();

            Assert.AreEqual(2, obj.Defaults.DefaultTgsEncTypes.Count());
        }
예제 #2
0
        public void ParseBasicConfiguration()
        {
            var conf = ParseConfiguration();

            var roundtrip = Krb5ConfigurationSerializer.Serialize(conf);

            var conf2 = Krb5ConfigurationSerializer.Deserialize(roundtrip);

            Assert.IsNotNull(conf2);

            Assert.AreEqual(conf.Get <bool>("appdefaults.kadmin.forwardable"), conf2.Get <bool>("appdefaults.kadmin.forwardable"));
        }
예제 #3
0
        public void HandleOptionalValues()
        {
            var conf = new ConfigurationSectionList();

            conf.Set("libdefaults.blah", "123", false);
            conf.Set("libdefaults.allow_weak_crypto", "true", false);

            var obj = conf.ToConfigObject();

            Assert.IsTrue(obj.Defaults.AllowWeakCrypto);
            Assert.AreEqual(obj.Defaults.OptionalProperties["blah"], "123");

            var roundtrip = Krb5ConfigurationSerializer.Serialize(obj);

            Assert.IsTrue(roundtrip.Contains("blah = 123"));

            var conf2 = Krb5ConfigurationSerializer.Deserialize(roundtrip);

            var blah = conf2.Get("libdefaults.blah", typeof(string)).ToString();

            Assert.AreEqual("123", blah);
        }