Skip to content
Snippets Groups Projects

Refactor uw-php-security to use 'Provider' classes

Merged Andy Summers requested to merge andrew-summers/uw-php-security:provider-refactor into master
15 files
+ 256
280
Compare changes
  • Side-by-side
  • Inline
Files
15
  • 06e1cdbb
    After a discussion about the project's design and requirements moving
    forward, it was decided to refactor the project to remove
    `AttributeMapper` classes and have `Provider` classes handle attribute
    mapping as well as user loading. This also adds a third provider,
    `PreauthHTTPUserDetailsProvider`, which can be used in environments
    where Shibboleth attributes are sent as HTTP headers.
<?php
namespace edu\wisc\doit;
/**
* Implementation of {@link UserDetailsAttributeMapper} for use in local development.
*/
class LocalUserDetailsAttributeMapper implements UserDetailsAttributeMapper
{
/**
* {@inheritdoc}
*/
public function mapUser()
{
$jsonString = file_get_contents(__DIR__ . "/../../../resources/localuser.json");
if ($jsonString === false) {
return null;
}
// Return user attributes into a standard PHP array (true specifies array)
return json_decode($jsonString, true);
}
}
\ No newline at end of file
Loading