-
Notifications
You must be signed in to change notification settings - Fork 395
FOLIO: Use shib_cql if Shib is used for login #2902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 5 commits
262b71e
9cfbbd1
9f10f51
87049e0
ea80cf6
d356c27
65dbc4c
73efee5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,7 @@ public function __invoke( | |
| $manager = $container->get(\Laminas\Session\SessionManager::class); | ||
| return new \Laminas\Session\Container("Folio_$namespace", $manager); | ||
| }; | ||
| return parent::__invoke($container, $requestedName, [$sessionFactory]); | ||
| $authManager = $container->get(\VuFind\Auth\Manager::class); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the only thing we're using the $authManager for in the driver is to get the current auth method, is it worth considering passing only that value, rather than the whole object? That would make the dependency coupling a little looser. |
||
| return parent::__invoke($container, $requestedName, [$sessionFactory, $authManager]); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -170,9 +170,13 @@ protected function createConnector(string $test, ?array $config = null): void | |||||||||
| $manager = new \Laminas\Session\SessionManager(); | ||||||||||
| return new \Laminas\Session\Container("Folio_$namespace", $manager); | ||||||||||
| }; | ||||||||||
| // Create a mock Auth Manager | ||||||||||
| $authManager = $this->getMockBuilder(\VuFind\Auth\Manager::class) | ||||||||||
| ->disableOriginalConstructor() | ||||||||||
| ->getMock(); | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you take my above suggestion, you won't need this at all, but if you decide to keep it you can simplify this to:
Suggested change
|
||||||||||
| // Create a stub for the SomeClass class | ||||||||||
| $this->driver = $this->getMockBuilder(Folio::class) | ||||||||||
| ->setConstructorArgs([new \VuFind\Date\Converter(), $factory]) | ||||||||||
| ->setConstructorArgs([new \VuFind\Date\Converter(), $factory, $authManager]) | ||||||||||
| ->onlyMethods(['makeRequest']) | ||||||||||
| ->getMock(); | ||||||||||
| // Configure the stub | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we made this
cql_by_auth_method[Shibboleth]instead of hard-coding things to Shibboleth? That would make the feature more flexible and avoid hard-coded assumptions about one specific Auth method.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And just to be clear, this would let you refactor the config logic down to something like: