Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Application - A Lightning/web app (WPE runtime) or Lightning/Spark app (Spark runtime) loaded from the web.
  • Thunder client - javascript client used by application
  • WPE/Spark - Application Runtime Environments
  • Thunder - Web Platform for Embedded Framework for services
  • Security Agent - A thunder plugin.  Accessible only by COM/RPC only by application runtimes.
  • Plugin1 - Represents any plugin used as a service.  Accessible by JSON/RPC
  • thunder_permissions.conf - configuration for permissions of applications to access Thunder services.

draw.io Diagram
bordertrue
diagramNameThunderSecurityAgentFlow
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth673
revision1
Image Removed

Figure 2.  Sequence Diagram

Notes:  The Spark or WPE runtime loads the application.  The application that wants to use Thunder services creates the ThunderClient.  When the client is created, it requests a security token from the runtime.  The runtime then requests the token directly from the security agent through COM/RPC using the application context (the application's URL).  The security agent then creates and returns the token and returns it to the client.  As noted, the token is not returned back to the application that creates the Thunder client.  Once the application has created the Thunder Client, it then can invoke a service on a plugin... in this case Plugin1.foo().  The Thunder Client creates the request to Thunder by including the security token.  The Thunder Framework (not the actual plugin) checks with the security plugin to determine if the application can access this plugin based on the permissions file, and if so, allows the plugin to perform the request with the result being returned to the application.

draw.io Diagram
bordertrue
diagramNameThunderSecuritySequenceDiagram
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth801
revision1
Image Removed

Sending Security Token in JSON-RPC Requests

...

Code Block
languagecpp
titleSample ACL
{  
      
    "assign": [
        {  
                    {  
            "url": "*://localhost",
                        "role": "local"
                },
        {  
                    {  
            "url": "*://testurl1.com/*",
                        "role": "restricted1"
                },
        {  
                    {  
            "url": "*://testurl2.com/*",
                        "role": "restricted2"
                },
        {                                                 
                    {                                                 
            "url": "*",                  
                              
            "role": "default"    
        }                 
        
        }                 
    ]
"roles": {
                "default": {                  
                              
            "thunder": {    
                    
                "block": [
                                        "*"
                ]                       
            }               
        },
                        ]                       
            }               
        },
        "local": {           
                       
            "thunder": {  
                  
                "allow": [
                                        "*"
                ]                     
            }            
        },            
                        ]                     
            }            
        },            
        "restricted1": {           
                       
            "thunder": {  
                  
                "allow": [
                                        "org.rdk.DisplaySettings",
                                        "org.rdk.Timer"
                ]                     
            }            
        },            
                         ]                     
            }            
        },            
         "restricted2": {           
                       
            "thunder": { 
             
            "allow": [
                                        "*"
                ],                     
                                ],                     
                "block": [
                                        "org.rdk.SystemServices",
                                        "org.rdk.StorageManager"
                ]                     
            }            
        }            
                    ]                     
            }            
        }            
    }
}