fn service_attrib_parser(
        &mut self,
        servicetype: SamlBindingType,
        attributes: Vec<OwnedAttribute>,
    ) -> Result<ServiceBinding, String> {
        let mut tmp_sb = ServiceBinding {
            servicetype,
            binding: SamlBinding::HttpPost,
            location: "".to_string(),
            index: 0,
        };
        for attribute in attributes {
            match attribute.name.local_name.to_lowercase().as_str() {
                "binding" => {
                    log::debug!("Found Binding");
                    let binding = match SamlBinding::from_str(&attribute.value) {
                        Ok(value) => value,
                        Err(error) => {
                            return Err(format!(
                                "UNMATCHED BINDING: {}: {}",
                                &attribute.value, error
                            ))
                        }
                    };
                    tmp_sb.binding = binding;
                }
                "location" => {
                    log::debug!("Found Location");
                    tmp_sb.location = attribute.value;
                }
                "index" => {
                    log::debug!("Found index");
                    tmp_sb.index = attribute.value.parse::<u8>().unwrap();
                }
                _ => {
                    eprintln!(
                        "Found unhandled attribute in AssertionConsumerService: {:?}",
                        attribute
                    );
                }
            }
        }
        log::debug!("Returning {:?}", tmp_sb);
        Ok(tmp_sb)
    }
/// Used for handling the attributes of services in the tags of an SP Metadata XML file
///
/// Types tested (poorly):
/// - AssertionConsumerService
/// - SingleLogoutService
Used for handling the attributes of services in the tags of an SP Metadata XML file
Types tested (poorly):
AssertionConsumerService
SingleLogoutService
Used for handling the attributes of services in the tags of an SP Metadata XML file Types tested ( poorly ) : AssertionConsumerService SingleLogoutService
fn service_attrib_parser(
        &mut self,
        servicetype: SamlBindingType,
        attributes: Vec<OwnedAttribute>,
    ) -> Result<ServiceBinding, String> {
        let mut tmp_sb = ServiceBinding {
            servicetype,
            binding: SamlBinding::HttpPost,
            location: "".to_string(),
            index: 0,
        };
        for attribute in attributes {
            match attribute.name.local_name.to_lowercase().as_str() {
                "binding" => {
                    log::debug!("Found Binding");
                    let binding = match SamlBinding::from_str(&attribute.value) {
                        Ok(value) => value,
                        Err(error) => {
                            return Err(format!(
                                "UNMATCHED BINDING: {}: {}",
                                &attribute.value, error
                            ))
                        }
                    };
                    tmp_sb.binding = binding;
                }
                "location" => {
                    log::debug!("Found Location");
                    tmp_sb.location = attribute.value;
                }
                "index" => {
                    log::debug!("Found index");
                    tmp_sb.index = attribute.value.parse::<u8>().unwrap();
                }
                _ => {
                    eprintln!(
                        "Found unhandled attribute in AssertionConsumerService: {:?}",
                        attribute
                    );
                }
            }
        }
        log::debug!("Returning {:?}", tmp_sb);
        Ok(tmp_sb)
    }
fn service_attrib_parser ( & mut self , servicetype : SamlBindingType , attributes : Vec < OwnedAttribute > , ) -> Result < ServiceBinding , String > { let mut tmp_sb = ServiceBinding { servicetype , binding : SamlBinding :: HttpPost , location : " " . to_string ( ) , index : 0 , } ; for attribute in attributes { match attribute . name . local_name . to_lowercase ( ) . as_str ( ) { " " => { log :: debug ! ( " " ) ; let binding = match SamlBinding :: from_str ( & attribute . value ) { Ok ( value ) => value , Err ( error ) => { return Err ( format ! ( " " attribute value error ) ) } } ; tmp_sb . binding = binding ; } " " => { log :: debug ! ( " " ) ; tmp_sb . location = attribute . value ; } " " => { log :: debug ! ( " " ) ; tmp_sb . index = attribute . value . parse :: < u8 > ( ) . unwrap ( ) ; } _ => { eprintln ! ( " " attribute ) ; } } } log :: debug ! ( " " tmp_sb ) ; Ok ( tmp_sb ) }
Used for handling the attributes of services in the tags of an SP Metadata XML file
Types tested (poorly):
 AssertionConsumerService
 SingleLogoutService
Used for handling the attributes of services in the tags of an SP Metadata XML file Types tested ( poorly ) : AssertionConsumerService SingleLogoutService
&mut self
servicetype
SamlBindingType
attributes
Vec<OwnedAttribute>
&mut self
servicetype
SamlBindingType
attributes
Vec<OwnedAttribute>