Shibalike is a PHP library for creating Single Sign On between PHP apps on the same origin by emulating a Shibboleth environment. It has components to query attributes for a user, persist them in a non-native Session implementation, and inject them into the $_SERVER array as would a Shibboleth web server module.
We don't want the SP or StateManager to take on responsibility for sniffing attributes already in $_SERVER (set by shibd), nor to hold business logic for altering attributes from an outside system, so we need dedicated components we can inject into the SP/IdP to handle this:
Interface Shibalike\Attr\ITransformer could specify an object responsible with modifying attributes from some source the following:
alter(array $source): returns array of attributes rewritten according to business logic. E.g. fixing string encoding problems, combining multiple attributes into a single one, filtering out certain attributes, replacing separator tokens.
Interface Shibalike\Attr\IDetector specify the following:
setSourceArray(array $source): used to pass in $_SERVER. This allows cleaner unit testing and should yield user code where it's clear where the data is coming from.
getAttrs(): returns array of attributes we care about from the source (after any needed transformation has been applied).
setTransformer(Shibalike\Attr\IDetector $transformer): an optional transform to apply before returning the attrs.
We don't want the SP or StateManager to take on responsibility for sniffing attributes already in $_SERVER (set by shibd), nor to hold business logic for altering attributes from an outside system, so we need dedicated components we can inject into the SP/IdP to handle this:
Interface Shibalike\Attr\ITransformer could specify an object responsible with modifying attributes from some source the following:
Interface Shibalike\Attr\IDetector specify the following: