Review Board 1.7.22


CommonContainer token refresh changes for a better UX when tokens expire.

Review Request #3180 - Created Dec. 13, 2011 and submitted

Dan Dumont
SHINDIG-1681
Reviewers
shindig
hsaputra, jcian, lixu, rbaxter, ssievers
shindig
Initial review of 1st change.  Allowing common container to manage container token refreshes.  Also, refresh of gadget security tokens will now wait for valid container security token before trying to refresh.
Tested code in a private container with some examples of setting no refresh (ttl = 0) and setting an initial token (if it was written by jsp page to avoid transaction) etc..

Diff revision 6

This is not the most recent revision of the diff. The latest diff is revision 11. See what's changed.

1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11

  1. http://svn.apache.org/repos/asf/shindig/trunk/content/samplecontainer/examples/commoncontainer/assembler.js: Loading...
  2. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container/container.js: Loading...
  3. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container/service.js: Loading...
  4. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_holder.js: Loading...
  5. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_site.js: Loading...
  6. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.util/util.js: Loading...
  7. http://svn.apache.org/repos/asf/shindig/trunk/features/src/test/javascript/features/container/gadget_holder_test.js: Loading...
  8. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java: Loading...
  9. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerApi.java: Loading...
  10. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerService.java: Loading...
  11. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ModuleIdManager.java: Loading...
  12. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ModuleIdManagerImpl.java: Loading...
  13. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerServiceTest.java: Loading...
  14. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerTest.java: Loading...
http://svn.apache.org/repos/asf/shindig/trunk/content/samplecontainer/examples/commoncontainer/assembler.js
Revision 1222407 New Change
[20] 22 lines
[+20]
23

    
   
23

   
24
var testConfig = testConfig || {};
24
var testConfig = testConfig || {};
25
testConfig[osapi.container.ServiceConfig.API_PATH] = contextRoot + '/rpc';
25
testConfig[osapi.container.ServiceConfig.API_PATH] = contextRoot + '/rpc';
26
testConfig[osapi.container.ContainerConfig.RENDER_DEBUG] = '1';
26
testConfig[osapi.container.ContainerConfig.RENDER_DEBUG] = '1';
27

    
   
27

   
Moved from 34

    
   
28
// Default the security token for the container. Using this example security token requires enabling
Moved from 35

    
   
29
// the DefaultSecurityTokenCodec to let UrlParameterAuthenticationHandler create valid security token.

    
   
30
// 10 seconds is fast, but this is mostly for demonstration purposes.

    
   
31
testConfig[osapi.container.ContainerConfig.GET_CONTAINER_TOKEN] = function(callback) {

    
   
32
  console.log('Updating container security token.');

    
   
33
  callback('john.doe:john.doe:appid:cont:url:0:default', 10);

    
   
34
};

    
   
35

   
28
//  Create the new CommonContainer
36
//  Create the new CommonContainer
29
var CommonContainer = new osapi.container.Container(testConfig);
37
var CommonContainer = new osapi.container.Container(testConfig);
30

    
   
38

   
31
//Gadget site to title id map
39
//Gadget site to title id map
32
var siteToTitleMap = {};
40
var siteToTitleMap = {};
33

    
   
41

   
34
// Default the security token for the container. Using this example security token requires enabling
Moved to 28

   
35
// the DefaultSecurityTokenCodec to let UrlParameterAuthenticationHandler create valid security token.
Moved to 29

   
36
shindig.auth.updateSecurityToken('john.doe:john.doe:appid:cont:url:0:default');

   
37

    
   

   
38
// Need to pull these from values supplied in the dialog
42
// Need to pull these from values supplied in the dialog
39
CommonContainer.init = function() {
43
CommonContainer.init = function() {
40
  //Create my new managed hub
44
  //Create my new managed hub
41
  CommonContainer.managedHub = new OpenAjax.hub.ManagedHub({
45
  CommonContainer.managedHub = new OpenAjax.hub.ManagedHub({
42
    onSubscribe: function(topic, container) {
46
    onSubscribe: function(topic, container) {
[+20] [20] 119 lines
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container/container.js
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container/service.js
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_holder.js
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_site.js
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.util/util.js
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/features/src/test/javascript/features/container/gadget_holder_test.js
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerApi.java
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerService.java
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ModuleIdManager.java
New File
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ModuleIdManagerImpl.java
New File
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerServiceTest.java
Revision 1222407 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerTest.java
Revision 1222407 New Change
 
  1. http://svn.apache.org/repos/asf/shindig/trunk/content/samplecontainer/examples/commoncontainer/assembler.js: Loading...
  2. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container/container.js: Loading...
  3. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container/service.js: Loading...
  4. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_holder.js: Loading...
  5. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_site.js: Loading...
  6. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.util/util.js: Loading...
  7. http://svn.apache.org/repos/asf/shindig/trunk/features/src/test/javascript/features/container/gadget_holder_test.js: Loading...
  8. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java: Loading...
  9. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerApi.java: Loading...
  10. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerService.java: Loading...
  11. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ModuleIdManager.java: Loading...
  12. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ModuleIdManagerImpl.java: Loading...
  13. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerServiceTest.java: Loading...
  14. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerTest.java: Loading...