Пример #1
0
        /// <summary>
        ///     Zahteva od PIP komponente dodatne atribute.
        /// </summary>
        /// <param name="attributeDesignator"></param>
        /// <returns></returns>
        public List <AttributeType> RequestForEnvironmentAttribute(AttributeDesignatorType attributeDesignator)
        {
            List <AttributeType> RequestedAttributes = new List <AttributeType>(3);

            /// zahteva od PIP komponente atribute okruzenja
            NetTcpBinding binding = new NetTcpBinding();

            binding.CloseTimeout   = new TimeSpan(0, 10, 0);
            binding.OpenTimeout    = new TimeSpan(0, 10, 0);
            binding.ReceiveTimeout = new TimeSpan(0, 10, 0);
            binding.SendTimeout    = new TimeSpan(0, 10, 0);
            string address = "net.tcp://localhost:7000/PipService";

            DomainAttribute EnvironmentAttribute = new DomainAttribute();

            using (PipProxy proxy = new PipProxy(binding, new EndpointAddress(address)))
            {
                EnvironmentAttribute = proxy.RequestEnvironmentAttribute(attributeDesignator.AttributeId);
            }

            AttributeType XacmlAttribute = CreateXacmlAttribute(EnvironmentAttribute);

            RequestedAttributes.Add(XacmlAttribute);
            return(RequestedAttributes);
        }
Пример #2
0
        public List <AttributeType> RequestForSubjectAttribute(AttributeDesignatorType attributeDesignator, string subjectId)
        {
            List <AttributeType> RequestedAttributes = new List <AttributeType>(3);

            /// zahteva od PIP komponente atribute okruzenja
            NetTcpBinding binding = new NetTcpBinding();

            binding.CloseTimeout   = new TimeSpan(0, 10, 0);
            binding.OpenTimeout    = new TimeSpan(0, 10, 0);
            binding.ReceiveTimeout = new TimeSpan(0, 10, 0);
            binding.SendTimeout    = new TimeSpan(0, 10, 0);
            string address = "net.tcp://localhost:7000/PipService";

            List <DomainAttribute> SubjecttAttributes = new List <DomainAttribute>();

            using (PipProxy proxy = new PipProxy(binding, new EndpointAddress(address)))
            {
                SubjecttAttributes = proxy.RequestSubjectAttributes(attributeDesignator.AttributeId, subjectId);
            }

            foreach (DomainAttribute attribute in SubjecttAttributes)
            {
                AttributeType XacmlAttribute = CreateXacmlAttribute(attribute);
                RequestedAttributes.Add(XacmlAttribute);
            }

            return(RequestedAttributes);
        }