Skip to content

Commit

Permalink
Make EBSCO URLs configurable; fix defaults for HTTPS compatibility. (v…
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz authored and EreMaijala committed Jun 29, 2021
1 parent ce99714 commit 5f0d553
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions config/vufind/EDS.ini
Expand Up @@ -48,6 +48,12 @@ timeout = 120
; limits that do not affect the POST-based API.
search_http_method = POST

; This is the URL of the EDS API endpoint:
api_url = "https://eds-api.ebscohost.com/edsapi/rest"

; This is the URL of the EBSCO authorization endpoint:
auth_url = "https://eds-api.ebscohost.com/authservice/rest"

; The following two sections can be used to associate specific recommendations
; modules with specific search types defined in the [Basic_Searches] section
; below. For all the details on how these sections work, see the comments above
Expand Down
5 changes: 4 additions & 1 deletion config/vufind/EIT.ini
@@ -1,7 +1,7 @@
; This section contains global settings affecting search behavior.
[General]
; EBSCO offers searching via the EBSCOhost API. See the API
; documentation (http://support.ebsco.com/eit/ws.php) for more information.
; documentation (https://support.ebsco.com/eit/ws.php) for more information.
; "prof" is your profile ID; "pwd" is the password associated with that profile;
; "dbs" is a comma-separated list of three-character codes for EBSCO databases
; to which your institution subscribes and for which access is available via the
Expand All @@ -19,6 +19,9 @@ prof = prof.prof.prof
pwd = password
dbs = aph,reh,ehh,etc

; This is the EIT API base URL:
base_url = "https://eit.ebscohost.com/Services/SearchService.asmx/Search"

; This setting controls the default sort order of search results; the selected
; option should be one of the options present in the [Sorting] section below.
default_sort = relevance
Expand Down
Expand Up @@ -119,7 +119,8 @@ protected function createConnector()
{
$prof = $this->config->General->prof ?? null;
$pwd = $this->config->General->pwd ?? null;
$base = "http://eit.ebscohost.com/Services/SearchService.asmx/Search";
$base = $this->config->General->base_url
?? 'https://eit.ebscohost.com/Services/SearchService.asmx/Search';
$dbs = $this->config->General->dbs ?? null;
$client = $this->serviceLocator->get(\VuFindHttp\HttpService::class)
->createClient();
Expand Down
6 changes: 6 additions & 0 deletions module/VuFind/src/VuFind/Search/Factory/EdsBackendFactory.php
Expand Up @@ -141,6 +141,12 @@ protected function createConnector()
'search_http_method' => $this->edsConfig->General->search_http_method
?? 'POST'
];
if (isset($this->edsConfig->General->api_url)) {
$options['api_url'] = $this->edsConfig->General->api_url;
}
if (isset($this->edsConfig->General->auth_url)) {
$options['auth_url'] = $this->edsConfig->General->auth_url;
}
// Build HTTP client:
$client = $this->serviceLocator->get(\VuFindHttp\HttpService::class)
->createClient();
Expand Down
8 changes: 7 additions & 1 deletion module/VuFindSearch/src/VuFindSearch/Backend/EDS/Base.php
Expand Up @@ -51,7 +51,7 @@ abstract class Base
*
* @var string
*/
protected $edsApiHost = 'http://eds-api.ebscohost.com/edsapi/rest';
protected $edsApiHost = 'https://eds-api.ebscohost.com/edsapi/rest';

/**
* Auth host
Expand Down Expand Up @@ -106,6 +106,12 @@ public function __construct($settings = [])
if (is_array($settings)) {
foreach ($settings as $key => $value) {
switch ($key) {
case 'api_url':
$this->edsApiHost = $value;
break;
case 'auth_url':
$this->authHost = $value;
break;
case 'debug':
$this->debug = $value;
break;
Expand Down

0 comments on commit 5f0d553

Please sign in to comment.