Merge branch 'master' into templateallthemarkup
authorJason Skomorowski <jason@indexdata.com>
Thu, 7 Aug 2014 18:23:34 +0000 (14:23 -0400)
committerJason Skomorowski <jason@indexdata.com>
Thu, 7 Aug 2014 18:23:34 +0000 (14:23 -0400)
doc/mkws-manual.markdown
examples/htdocs/Makefile
examples/htdocs/README
examples/htdocs/jasmine-local-popup.html
examples/htdocs/jasmine-popup.html
examples/htdocs/jquery.html [deleted file]
examples/htdocs/language.html
examples/htdocs/mike.html
test/js/mkws-jasmine-run.js
tools/htdocs/index.html
tools/service-proxy/service-proxy.properties

index c4ddeb7..2247868 100644 (file)
@@ -368,7 +368,7 @@ Some MKWS applications will be content to use the default library with
 its selection of targets. Most, though, will want to define their own
 library providing a different range of available targets. An important
 case is that of applications that authenticate onto subscription
-resources by means of backe-end site credentials stored in MKAdmin:
+resources by means of back-end site credentials stored in MKAdmin:
 precautions must be taken so that such library accounts do not allow
 unauthorised access.
 
@@ -376,16 +376,15 @@ Setting up such a library is a process of several stages.
 
 ### Create the User Access account
 
-
-Log in to MKAdmin administrate your library:
+Log in to MKAdmin to add a User Access account for your library:
 
 * Go to <http://mkx-admin.indexdata.com/console/>
 * Enter the adminstrative username/password
 * Go to the User Access tab
 * Create an end-user account
 * Depending on what authentication method it be used, set the
-  User Access account's username and password, or IP-address range, or
-  referring URL, or hostname.
+  User Access account's username and password, or referring URL, or
+  Service Proxy hostname, or IP-address range.
 
 If your MWKS application runs at a well-known, permanent address --
 <http://yourname.com/app.html>, say -- you can set the User Access
@@ -399,9 +398,13 @@ of this hostname to your library by setting the User Access record's
 that this is not secure, as other applications can use this virtual
 hostname to gain access to your library.**
 
-> TODO Authentication by IP address does not yet work correctly -- see
-> bug MKWS-234 ("Improve SP configuration/proxying for better
-> authentication").
+Or if your application's users are coming from a well-known range of
+IP-address space, you can enter the range in the "IP Ranges"
+field. The format of this field is as follows: it can contain any
+number of ranges, separated by commas; each range is either a single
+IP address or two addresses separated by a hyphen; each IP address is
+four small integers separated by periods. For example,
+`80.229.143.255-80.229.143.255, 5.57.0.0-5.57.255.255, 127.0.0.1`.
 
 Alternatively, your application can authenticate by username and
 password credentials. This is a useful approach in several situations,
@@ -410,22 +413,25 @@ usual one. To arrange for this, set the username and password as a
 single string separated by a slash -- e.g. "mike/swordfish" -- into
 the User Access record's Authentication field.
 
-You can create multiple User Access records: for example, one that
-uses Referring URL, and another that uses a username/password pair to
-be used when running an application from a different URL.
+You can set multiple fields into a single User Access record; or
+create multiple User Access records. For example, a single User Access
+record can specify both a Referring URL a username/password pair that
+can be used when running an application from a different URL. But if
+multiple Referring URLs are needed, then each must be specified in its
+own User Access record.
 
 ### Tell the application to use the library
 
 In the HTML of the application, tell MKWS to authenticate on to the
-Service Proxy. When IP-based, referer-based or hostname-based
-authentication is used, this is very simple:
+Service Proxy. When referer-based or IP-based authentication is used,
+this is very simple:
 
        <script type="text/javascript">
          var mkws_config = { service_proxy_auth:
          "//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig" };
        </script>
 
-> TODO This should be the default setting
+> TODO This should be the default setting: see **MKWS-251**.
 
 And ensure that access to the MWKS application is from the correct
 Referrer URL or IP-range.
@@ -436,13 +442,14 @@ When hostname-based authentication is in use, it's necessary to access
 the Service Proxy as the correctly named virtual host. This can be
 done by setting the `service_proxy_auth` configuration item to a
 URL containing that hostname, such as
-<//yourname.sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig>
+`//yourname.sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig`
 
 > TODO It should be possible to change just the hostname without
-> needing to repeat the rest of the URL (protocol, path, query)
+> needing to repeat the rest of the URL (protocol, path, query): see
+> **MKWS-252**.
 
 > TODO When changing the SP authentication URL, the Pazpar2 URL should
-> in general change along with it.
+> in general change along with it: see **MKWS-253**.
 
 ### (Optional): embed credentials for access to the library
 
@@ -450,10 +457,11 @@ When credential-based authentication is in use (username and
 password), it's necessary to pass these credentials into the Service
 Proxy when establishing the session. This can most simply be done just
 by setting the `service_proxy_auth` configuration item to a URL such as
-<//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig&username=mike&password=swordfish>
+`//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig&username=mike&password=swordfish`
 
 > TODO It should be possible to add the username and password to the
-> configuration without needing to repeat the rest of the URL.
+> configuration without needing to repeat the rest of the URL: see
+> **MKWS-254**.
 
 ### (Optional): conceal credentials from HTML source
 
@@ -471,15 +479,16 @@ to that local authentication URL. Here is one way to do it when
 Apache2 is the application's web-server, which we will call
 yourname.com:
 
-- Add a rewriting authentication alias to the configuration:
+Step 1: add a rewriting authentication alias to the configuration:
 
        RewriteEngine on
        RewriteRule /spauth/ http://mkws.indexdata.com/service-proxy/?command=auth&action=check,login&username=U&password=PW [P]
 
-- Set the MKWS configuration item `service_proxy_auth` to
-  <http://yourname.com/spauth/>
-- Protect access to the local path <http://yourname.com/spauth/>
-  (e.g. using a .htaccess file).
+Step 2: set the MKWS configuration item `service_proxy_auth` to
+<http://yourname.com/spauth/>
+
+Step 3: protect access to the local path <http://yourname.com/spauth/>
+(e.g. using a `.htaccess` file).
 
 
 Choosing targets from the library
index 683cb0e..418b161 100644 (file)
@@ -1,16 +1,14 @@
 # Copyright (c) 2013-2014 IndexData ApS. http://indexdata.com
 
-all: apache-config.txt jasmine-links
+all: apache-config.txt
 
 apache-config.txt: ../apache2/mkws-examples-mike
        rm -f $@
        cp -p $< $@
        chmod ugo-w $@
 
-jasmine-links:
-
 help:
-       @echo "make [ all | clean | jasmine-links ]"
+       @echo "make [ all | clean ]"
 
 clean distclean:
        rm -f apache-config.txt
index d1e1c2b..83e20ff 100644 (file)
@@ -3,7 +3,6 @@ Public demo pages
 auto.html
 dict.html
 index.html
-jquery.html 
 language.html
 localauth.html
 lowlevel.html
index cde7ac2..12af4ac 100644 (file)
@@ -57,7 +57,7 @@
     var jasmine_config = {
       search_query: "netbsd",
       expected_hits: 10,
-      active_clients: 13,
+      active_clients: 12,
       check_motd: false,
       check_sortby: true,
       show_record_url: true
index b2c7450..2f14059 100644 (file)
@@ -59,7 +59,7 @@
     var jasmine_config = {
       search_query: "netbsd",
       expected_hits: 10,
-      active_clients: 13,
+      active_clients: 12,
       check_motd: false,
       show_record_url: true
     };
diff --git a/examples/htdocs/jquery.html b/examples/htdocs/jquery.html
deleted file mode 100644 (file)
index 6ebb30f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: jQuery plugin</title>
-    <link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
-    <link rel="stylesheet" type="text/css" href="//mkws.indexdata.com/mkws.css" />
-
-    <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
-    <script src="//code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
-  </head>
-  <body>
-    <script type="text/javascript">
-    jQuery.pazpar2({
-        "layout": "popup",               /* "table" [default], "div", "popup" */
-        "id_button": "input.mkwsButton", /* submit button id in search field */
-        "id_popup": ".mkwsPopup",        /* internal id of popup window */
-        "width": 880,                    /* popup width, should be at least 800 */ 
-        "height": 760                    /* popup height, should be at least 600 */
-    });
-    </script>
-  </body>
-</html>
index 3ac6968..265f7ec 100644 (file)
@@ -3,7 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <meta name="copyright" content="(c) 1999-2013 IndexData ApS, http://indexdata.com" />
+    <meta name="copyright" content="(c) 1999-2014 IndexData ApS, http://indexdata.com" />
     <title>MKWS demo: full configuration</title>
     <link rel="stylesheet" type="text/css" href="//mkws.indexdata.com/mkws.css" />
     <script type="text/javascript">
@@ -80,7 +80,7 @@
     </div>
     <div id="footer">
       <div class="mkwsStat"></div>
-      <span>Powered by MKWS &copy; 2013 <a target="_new" href="http://www.indexdata.com">Index Data</a></span>
+      <span>Powered by MKWS &copy; 2013-2014 <a target="_new" href="http://www.indexdata.com">Index Data</a></span>
     </div>
   </body>
 </html>
index 86b5852..90caf92 100644 (file)
@@ -1,12 +1,14 @@
 <html>
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: Orex</title>
+    <title>MKWS demo</title>
     <link rel="stylesheet" type="text/css" href="tools/htdocs/mkws.css" />
     <script type="text/javascript">
       var mkws_config = {
        pazpar2_url:        "//sp-mkws.indexdata.com/service-proxy/",
-       service_proxy_auth: "//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig&username=Xorex&password=orexmkc"
+        // For now, we have to provide known-bad credentials to skip user/pw login: see bug MKSP-125
+       service_proxy_auth: "//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig&username=XXX&password=XXX"
+        // For explicit credential-based authentication, add: &username=orex&password=orexmkc
       };
     </script>
     <script type="text/javascript" src="//code.jquery.com/jquery-1.10.0.min.js"></script>
@@ -29,6 +31,7 @@
     <script type="text/javascript" src="mkws-widget-credo.js"></script>
   </head>
   <body>
+    <div class="mkwsAuthname"></div>
     <div class="mkwsSwitch"></div>
     <div class="mkwsLang"></div>
     <div class="mkwsProgress"></div>
index 1037775..572eb11 100644 (file)
@@ -36,7 +36,7 @@ function mkws_jasmine_init(delay) {
 };
 
 mkws.$(document).ready(function() { 
-    mkws_jasmine_init(100);
+    mkws_jasmine_init(0);
 });
 
 /* EOF */
index f98e095..9835c66 100644 (file)
             >Apache2 configuration stanza</a>.
        </li>
        <li>
-          The
-          <a href="//example.indexdata.com/jquery.html"
-             >jQuery plugin</a>
-          version, consisting of a single JavaScript statement.
-       </li>
-       <li>
           <a href="//example.indexdata.com/popup.html"
              >A version that uses a jQuery popup</a>.
        </li>
index 8f4c8d8..1c67a04 100644 (file)
@@ -24,7 +24,7 @@ relay.CF_ENGINE_ADDRESS = localhost:9003
 # authn plugin, for torus based authentication 
 authn.TORUS_URL        = http://mkc-admin.indexdata.com/torus2/identity.USERS/records/
 authn.MASTER_TORUS_URL = http://mkc-admin.indexdata.com/torus2/admin.admin/records/
-authn.ACTION_SEQUENCE = check,login,referrer,constraint
+authn.ACTION_SEQUENCE = check,login,referrer,constraint,ipauth
 authn.SPECIFIC_CONSTRAINT = hostName=${thisHost} 
 
 # categories plugin, for Torus-based target categories