[open-ils-commits] [GIT] Evergreen ILS branch master updated. 19e5d9750d5132cefdd78122fd5b7f8e58d50612

Evergreen Git git at git.evergreen-ils.org
Wed Sep 5 17:56:42 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  19e5d9750d5132cefdd78122fd5b7f8e58d50612 (commit)
       via  9266a76a9f11fcc419e38d99a114216b9266aef6 (commit)
      from  90c716e3bd4be9c449a9e5d71849abd8d4f07e4f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 19e5d9750d5132cefdd78122fd5b7f8e58d50612
Author: Bill Erickson <berickxx at gmail.com>
Date:   Tue Jun 12 12:02:02 2018 -0400

    LP#1755258 Browser client auth proxy login support
    
    Check if the auth_proxy service is enabled during login and use the
    proxy login API when it's available, otherwise fall back to standard
    Evergreen open-ils.auth login.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/web/js/ui/default/staff/services/auth.js b/Open-ILS/web/js/ui/default/staff/services/auth.js
index 9048a34..c46e37e 100644
--- a/Open-ILS/web/js/ui/default/staff/services/auth.js
+++ b/Open-ILS/web/js/ui/default/staff/services/auth.js
@@ -169,7 +169,6 @@ function($q , $timeout , $rootScope , $window , $location , egNet , egHatch) {
         }
 
         service.login_api(args).then(function(evt) {
-
             if (evt.textcode == 'SUCCESS') {
                 service.handle_login_ok(args, evt);
                 ops.deferred.resolve({
@@ -240,7 +239,13 @@ function($q , $timeout , $rootScope , $window , $location , egNet , egHatch) {
         return service.testAuthToken();
     }
 
-    service.login_api = function(args) {
+    service.login_via_auth_proxy = function(args) {
+        return egNet.request(
+            'open-ils.auth_proxy',
+            'open-ils.auth_proxy.login', args);
+    }
+
+    service.login_via_auth = function(args) {
         return egNet.request(
             'open-ils.auth',
             'open-ils.auth.authenticate.init', args.username)
@@ -257,6 +262,27 @@ function($q , $timeout , $rootScope , $window , $location , egNet , egHatch) {
         );
     }
 
+    service.login_api = function(args) {
+
+        return egNet.request(
+            'open-ils.auth_proxy',
+            'open-ils.auth_proxy.enabled')
+        .then(
+            function(enabled) {
+                console.log('proxy check returned ' + enabled);
+                if (Number(enabled) === 1) {
+                    return service.login_via_auth_proxy(args);
+                } else {
+                    return service.login_via_auth(args);
+                }
+            },
+            function() {
+                // request failed, likely a result of auth_proxy not running.
+               return service.login_via_auth(args);
+            }
+        );
+    }
+
     service.handle_login_ok = function(args, evt) {
         service.ws = args.workstation; 
         egHatch.setLoginSessionItem('eg.auth.token', evt.payload.authtoken);

commit 9266a76a9f11fcc419e38d99a114216b9266aef6
Author: Bill Erickson <berickxx at gmail.com>
Date:   Tue Jun 12 12:01:15 2018 -0400

    LP#1755258 Improve network error handling
    
    Improve promise handling and logging in browser client network request
    failure handling.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/web/js/ui/default/staff/services/net.js b/Open-ILS/web/js/ui/default/staff/services/net.js
index 26eb31c..8415dc5 100644
--- a/Open-ILS/web/js/ui/default/staff/services/net.js
+++ b/Open-ILS/web/js/ui/default/staff/services/net.js
@@ -111,13 +111,16 @@ function($q,  $rootScope,  egEvent) {
                 // bother JSON-ifying it, since there is the off
                 // chance that JSON-ification could fail, e.g if 
                 // the object has circular refs.
-                console.error(request.method + 
-                    ' (' + request.params + ')  failed.  See server logs.');
-                deferred.reject(msg);
+                var note = request.method + 
+                    ' (' + request.params + ')  failed.  See server logs.';
+                console.error(note, msg);
+                request.deferred.reject(note);
             },
             onmethoderror : function(req, statCode, statMsg) { 
-                console.error('error calling method ' + 
-                    request.method + ' : ' + statCode + ' : ' + statMsg);
+                var msg = 'error calling method ' + 
+                    request.method + ' : ' + statCode + ' : ' + statMsg;
+                console.error(msg);
+                request.deferred.reject(msg);
             }
 
         }).send();

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/ui/default/staff/services/auth.js |   30 +++++++++++++++++++-
 Open-ILS/web/js/ui/default/staff/services/net.js  |   13 +++++---
 2 files changed, 36 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list