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

cosmetics

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