Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SWITCHwayf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
AAI
SWITCHwayf
Commits
8ed17cd7
Commit
8ed17cd7
authored
Sep 24, 2019
by
Lukas Haemmerle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented #3919 where Shib Scopes and MDUI DomainHint would be added as keywords per IdP as well.
parent
00927b23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
lib/readMetadata.php
lib/readMetadata.php
+35
-1
No files found.
lib/readMetadata.php
View file @
8ed17cd7
...
...
@@ -292,6 +292,23 @@ function processIDPRoleDescriptor($IDPRoleDescriptorNode){
$IDP
[
$lang
][
'Keywords'
]
=
$keywords
;
}
// Ensure there is a keyword entry for default language
if
(
!
isset
(
$IDP
[
$defaultLanguage
][
'Keywords'
])){
$IDP
[
$defaultLanguage
][
'Keywords'
]
=
''
;
}
// Also add entityID as keyword
$IDP
[
$defaultLanguage
][
'Keywords'
]
.
=
$IDPRoleDescriptorNode
->
parentNode
->
getAttribute
(
'entityID'
);
// Get scopes
$ShibScopes
=
getShibScopes
(
$IDPRoleDescriptorNode
);
// Get domain hints
$MDUIDomainHints
=
getMDUIDomainHints
(
$IDPRoleDescriptorNode
);
// Add unique domains as keywords as well
$IDP
[
$defaultLanguage
][
'Keywords'
]
.
=
' '
.
implode
(
' '
,
array_unique
(
array_merge
(
$ShibScopes
,
$MDUIDomainHints
)));
// Get Logos
$MDUILogos
=
getMDUILogos
(
$IDPRoleDescriptorNode
);
foreach
(
$MDUILogos
as
$Logo
){
...
...
@@ -327,7 +344,6 @@ function processIDPRoleDescriptor($IDPRoleDescriptorNode){
}
// Get DomainHints
$MDUIDomainHints
=
getMDUIDomainHints
(
$IDPRoleDescriptorNode
);
if
(
$MDUIDomainHints
){
$IDP
[
'DomainHint'
]
=
$MDUIDomainHints
;
}
...
...
@@ -507,6 +523,24 @@ function getMDUIKeywords($RoleDescriptorNode){
return
$Entity
;
}
// Get Shib Scopes from RoleDescriptor
function
getShibScopes
(
$RoleDescriptorNode
){
$Scopes
=
Array
();
$ShibScopes
=
$RoleDescriptorNode
->
getElementsByTagNameNS
(
'urn:mace:shibboleth:metadata:1.0'
,
'Scope'
);
foreach
(
$ShibScopes
as
$ShibScopeEntry
){
// Ignore regular expression scopes
if
(
$ShibScopeEntry
->
getAttribute
(
'regexp'
)
&&
$ShibScopeEntry
->
getAttribute
(
'regexp'
)
==
'true'
){
continue
;
}
$Scopes
[]
=
trim
(
$ShibScopeEntry
->
nodeValue
);
}
return
$Scopes
;
}
// Get MD Logos from RoleDescriptor. Prefer the favicon logos
function
getMDUILogos
(
$RoleDescriptorNode
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment