Improve debugging of authproc configuration - AttributeDump authproc#2601
Open
nathanjrobertson wants to merge 3 commits intosimplesamlphp:simplesamlphp-2.5from
Open
Improve debugging of authproc configuration - AttributeDump authproc#2601nathanjrobertson wants to merge 3 commits intosimplesamlphp:simplesamlphp-2.5from
nathanjrobertson wants to merge 3 commits intosimplesamlphp:simplesamlphp-2.5from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements an authproc which dumps attributes to the SimpleSAMLphp logs. By default, it will output all attributes, but this can be refined by either specifying attribute names or regular expressions to match attribute names.
This is intended to help server administrators debug whilst developing configuration of their authprocs. Being able to insert an AttributeDump into the list of filters is invaluable to finding "where did that value come from?".
The base case implemented dumps out all attributes present at the current position in the authproc filter list:
You can optionally specify a list of attributes to output (
attributes), or a list of regular expressions of the attributes you want to output (attributesRegex). If either or both of those are specified, the list of attributes outputted to the log files is trimmed to only those which match the given criteria.Included is documentation and phpunit tests.
Please note, in the PHPunit test class in order to test the value of the outputted log message it uses the deprecated
SimpleSAML\TestUtils\ArrayLogger, copying the waySimpleSAML\Test\Module\core\Controller\ExceptionTestworks. I can only see one use case of the replacement / newerSimpleTestLoggerin thesaml2project, and both cases take the$loggeras a parameter to the function. I don't think it's a drop in replacement, which is probably whyExceptionTeststays with the deprecatedArrayLogger. Anyway, happy to take feedback on what the preferred way to go with this one is.