Beispiel #1
0
        public void Test21Headers()
        {
            var transformer           = new HeaderTransformerTestObject(true, "2.1");
            WebHeaderCollection coll1 = new WebHeaderCollection()
            {
                { "a", "b" }
            };
            var rightsideHeaders = transformer.TestPvpHeaderTransformation(coll1);

            Assert.AreEqual(0, rightsideHeaders.Count);

            coll1 = new WebHeaderCollection()
            {
                { "dummy", "nonsense" },
                { "X-PVP-Version", "2.1" },
                { "X-PVP-participantId", "AT:L6:1234789" },
                { "X-PVP-UserId", "*****@*****.**" },
                { "X-PVP-PRINCIPAL-NAME", "Mustermann" },
                { "X-PVP-gvGid", "AT:B:0:LxXnvpcYZesiqVXsZG0bB==" },
                { "X-PVP-gvOuId", "AT:GGA-60420:0815" },
                { "X-PVP-Ou", "Meldeamt" },
                { "X-PVP-gvOuOKZ", "AT:GGA-60420-Abt13" },
                { "X-PVP-mail", "*****@*****.**" },
                { "X-PVP-tel", "+43 3155 5153" },
                { "X-PVP-gvSecClass", "2" },
                { "X-PVP-roles", "Beispielrolle(GKZ=60420)" },
            };
            rightsideHeaders = transformer.TestPvpHeaderTransformation(coll1);
            Assert.AreEqual(11, rightsideHeaders.Count);
            Assert.IsTrue(rightsideHeaders["X-PVP-participantId_01"] == "AT:L6:1234789");
            Assert.IsTrue(rightsideHeaders["X-PVP-UserId_01"] == "*****@*****.**");
            Assert.IsTrue(rightsideHeaders["X-PVP-PRINCIPAL-NAME_01"] == "Mustermann");
            Assert.IsTrue(rightsideHeaders["X-PVP-gvGid_01"] == "AT:B:0:LxXnvpcYZesiqVXsZG0bB==");
            Assert.IsTrue(rightsideHeaders["X-PVP-gvOuId_01"] == "AT:GGA-60420:0815");
            Assert.IsTrue(rightsideHeaders["X-PVP-Ou_01"] == "Meldeamt");
            Assert.IsTrue(rightsideHeaders["X-PVP-gvOuOKZ_01"] == "AT:GGA-60420-Abt13");
            Assert.IsTrue(rightsideHeaders["X-PVP-mail_01"] == "*****@*****.**");
            Assert.IsTrue(rightsideHeaders["X-PVP-tel_01"] == "+43 3155 5153");
            Assert.IsTrue(rightsideHeaders["X-PVP-gvSecClass_01"] == "2");
            Assert.IsTrue(rightsideHeaders["X-PVP-roles_01"] == "Beispielrolle(GKZ=60420)");
        }
Beispiel #2
0
        public void Test19Headers()
        {
            var transformer           = new HeaderTransformerTestObject(true, "1.9");
            WebHeaderCollection coll1 = new WebHeaderCollection()
            {
                { "a", "b" }
            };
            var rightsideHeaders = transformer.TestPvpHeaderTransformation(coll1);

            Assert.AreEqual(0, rightsideHeaders.Count);

            coll1 = new WebHeaderCollection()
            {
                { "dummy", "nonsense" },
                { "X-Version", "1.9" },
                { "X-AUTHENTICATE-participantId", "AT:L6:1234789" },
                { "X-AUTHENTICATE-UserId", "*****@*****.**" },
                { "X-AUTHENTICATE-cn", "Max Mustermann" },
                { "X-AUTHENTICATE-gvGid", "AT:B:0:LxXnvpcYZesiqVXsZG0bB==" },
                { "X-AUTHENTICATE-gvOuId", "AT:GGA-60420:0815" },
                { "X-AUTHENTICATE-Ou", "Meldeamt" },
                { "X-AUTHENTICATE-gvOuOKZ", "AT:GGA-60420-Abt13" },
                { "X-AUTHENTICATE-mail", "*****@*****.**" },
                { "X-AUTHENTICATE-tel", "+43 3155 5153" },
                { "X-AUTHENTICATE-gvSecClass", "2" },
                { "X-AUTHORIZE-roles", "Beispielrolle(GKZ=60420)" },
            };
            rightsideHeaders = transformer.TestPvpHeaderTransformation(coll1);
            Assert.AreEqual(12, rightsideHeaders.Count);
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-participantId"] == "AT:L6:1234789");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-UserId"] == "*****@*****.**");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-cn"] == "Max Mustermann");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-gvGid"] == "AT:B:0:LxXnvpcYZesiqVXsZG0bB==");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-gvOuId"] == "AT:GGA-60420:0815");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-Ou"] == "Meldeamt");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-gvOuOKZ"] == "AT:GGA-60420-Abt13");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-mail"] == "*****@*****.**");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-tel"] == "+43 3155 5153");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHENTICATE-gvSecClass"] == "2");
            Assert.IsTrue(rightsideHeaders["X-01-AUTHORIZE-roles"] == "Beispielrolle(GKZ=60420)");
        }