You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add regex support for attribute names in AttributeLimit authproc filter (#1971)
* Add regular expression support for attribute names to AttributeLimit. Previously we supported regex for attribute values, but no the names (keys).
* Add nameIsRegex to AttributeLimit documentation
* AttributeLimit - add test case for regexp on name and value similtaneously
* Fix pre-existing scrutinizer bug where $allowedAttributes (and now $allowedAttributeRegex) could be null
* More scruitinizer fixes
* Scrutinizer styling nit-pick
* Simplify __construct() in an attempt to calm scrutinizer down
* More srutinizer nit-picks on styling
* Refactor process() to reduce complexity for improved scrutinizer score
* Further optimizations for scrutinizer score improvements
* Provide test case and fix the unlikely case where nameIsRegex=>false is configured
* More scrutinizer optimizations
* Fix double EOL triggering warning in GitHub Actions lint job for markdown files
* Fixes for phpcs checks
* Use sprintf for exception messages
---------
Co-authored-by: Tim van Dijen <tvdijen@gmail.com>
Copy file name to clipboardExpand all lines: modules/core/docs/authproc_attributelimit.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,15 @@ Only allow specific values for an attribute ignoring case.
53
53
],
54
54
],
55
55
56
+
Only allow attributes that match a regex pattern
57
+
58
+
'authproc' => [
59
+
50 => [
60
+
'class' => 'core:AttributeLimit',
61
+
'/^eduPerson' => [ 'nameIsRegex' => true ]
62
+
],
63
+
],
64
+
56
65
Only allow specific values for an attribute that match a regex pattern
57
66
58
67
'authproc' => [
@@ -82,13 +91,14 @@ like this:
82
91
50 => 'core:AttributeLimit',
83
92
],
84
93
85
-
Then, add the allowed attributes to each service provider metadata, in the `attributes` option:
94
+
Then, add the allowed attributes to each service provider metadata, in the `attributes` option (for exact matches) or `attributesRegex` (for regular expression matches):
0 commit comments