Skip to content
Snippets Groups Projects
Commit 17445d4f authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

cosmetics

parent b8fe9aaa
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ sub parse {
foreach my $child ($EntityDescriptor->childNodes()) {
## Ignoringnodes of type XML::LibXML::Text or XML::LibXML::Comment
## Ignoring nodes of type XML::LibXML::Text or XML::LibXML::Comment
next unless $child->nodeType() == XML_ELEMENT_NODE;
if ($child->localname() eq 'IDPSSODescriptor') {
......@@ -87,8 +87,8 @@ sub parse {
## We also check the index to select the ACS that has the lower index
my ($index_saml1, $index_saml2);
foreach my $sso (
$child->getElementsByLocalName('AssertionConsumerService'))
{
$child->getElementsByLocalName('AssertionConsumerService')
) {
## Extracting endpoints information
push @{ $data->{sp_endpoints} }, {
......@@ -104,42 +104,37 @@ sub parse {
}
foreach my $attribute (
$child->getElementsByLocalName('RequestedAttribute'))
{
$child->getElementsByLocalName('RequestedAttribute')
) {
## Requested attributes information
push @{ $data->{requested_attribute} },
{
'friendly_name' => $attribute->getAttribute('FriendlyName'),
'name' => $attribute->getAttribute('Name'),
'is_required' => _boolean2integer(
push @{ $data->{requested_attribute} }, {
friendly_name => $attribute->getAttribute('FriendlyName'),
name => $attribute->getAttribute('Name'),
is_required => _boolean2integer(
$attribute->getAttribute('isRequired')
)
};
};
}
} elsif ($child->localname() eq 'Extensions') {
foreach my $registrationinfo (
$child->getElementsByLocalName('RegistrationInfo'))
{
$child->getElementsByLocalName('RegistrationInfo')
) {
$data->{registration_info}
{registration_authority} =
$data->{registration_info}->{registration_authority} =
$registrationinfo->getAttribute('registrationAuthority');
$data->{registration_info}
{registration_instant} =
$data->{registration_info}->{registration_instant} =
$registrationinfo->getAttribute('registrationInstant');
foreach my $policy (
$registrationinfo->getElementsByLocalName(
'RegistrationPolicy')
)
{
) {
my $lang = $policy->getAttribute('lang');
if ($lang && $lang eq 'en') {
$data->{registration_info}->{registration_policy} =
$policy->textContent();
}
next unless $lang && $lang eq 'en';
$data->{registration_info}->{registration_policy} =
$policy->textContent();
}
}
} elsif ($child->localname() eq 'ContactPerson') {
......@@ -155,9 +150,9 @@ sub parse {
}
}
foreach
my $displayname ($child->getElementsByLocalName('DisplayName'))
{
foreach my $displayname (
$child->getElementsByLocalName('DisplayName')
) {
$data->{display_name}->{ $displayname->getAttribute('xml:lang') } =
$displayname->textContent();
......@@ -173,17 +168,17 @@ sub parse {
}
foreach
my $description ($child->getElementsByLocalName('Description'))
{
foreach my $description (
$child->getElementsByLocalName('Description')
) {
$data->{description}->{ $description->getAttribute('xml:lang') } =
$description->textContent();
}
foreach
my $contact ($child->getElementsByLocalName('ContactPerson'))
{
foreach my $contact (
$child->getElementsByLocalName('ContactPerson')
) {
my %contact_details;
$contact_details{type} =
......@@ -196,14 +191,15 @@ sub parse {
}
foreach my $sso (
$child->getElementsByLocalName('OrganizationDisplayName'))
{
$child->getElementsByLocalName('OrganizationDisplayName')
) {
$data->{organization} = $sso->textContent();
}
## Getting X.509 certificates
foreach my $cert ($child->getElementsByLocalName('X509Certificate'))
{
foreach my $cert (
$child->getElementsByLocalName('X509Certificate')
) {
$data->{certificate} = $cert->textContent();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment