Home | History | Annotate | Download | only in api
      1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 [
      6   {
      7     "namespace":"networkingPrivate",
      8     "description": "none",
      9     "compiler_options": {
     10       "implemented_in": "chrome/browser/extensions/api/networking_private/networking_private_api.h"
     11     },
     12     "types" : [
     13       {
     14         "id": "NetworkProperties",
     15         "type": "object",
     16         "additionalProperties": { "type": "any" }
     17       },
     18       {
     19         "id": "ManagedNetworkProperties",
     20         "type": "object",
     21         "additionalProperties": { "type": "any" }
     22       },
     23       {
     24         "id": "VerificationProperties",
     25         "type": "object",
     26         "properties": {
     27           "certificate": {
     28             "type": "string",
     29             "description": "A string containing a PEM-encoded X.509 certificate for use in verifying the signed data."
     30           },
     31           "publicKey": {
     32             "type": "string",
     33             "description": "A string containing a PEM-encoded RSA public key to be used to compare with the one in signedData"
     34           },
     35           "nonce": {
     36             "type": "string",
     37             "description": "A string containing a base64-encoded random binary data for use in verifying the signed data."
     38           },
     39           "signedData": {
     40             "type": "string",
     41             "description": "A string containing the identifying data string signed by the device."
     42           },
     43           "deviceSerial": {
     44             "type": "string",
     45             "description": "A string containing the serial number of the device."
     46           },
     47           "deviceSsid": {
     48             "type": "string",
     49             "description": "A string containing the SSID of the device.  Only set if the device has already been setup once."
     50           },
     51           "deviceBssid": {
     52             "type": "string",
     53             "description": "A string containing the BSSID of the device.  Only set if the device has already been setup."
     54           }
     55         }
     56       }
     57     ],
     58     "functions": [
     59       {
     60         "name": "getProperties",
     61         "description": "Gets all the properties of the network with id networkGuid.  Includes all properties of the network (read-only and read/write values).",
     62         "parameters": [
     63           {
     64             "name": "networkGuid",
     65             "type": "string",
     66             "description": "The unique identifier of the network to get properties from."
     67           },
     68           {
     69             "name": "callback",
     70             "type": "function",
     71             "parameters": [
     72               {
     73                 "name": "properties",
     74                 "$ref": "NetworkProperties",
     75                 "description": "Results of the query for network properties."
     76               }
     77             ]
     78           }
     79         ]
     80       },
     81       {
     82         "name": "getManagedProperties",
     83         "description": "Gets the merged properties of the network with id networkGuid from the sources: User settings, shared settings, user policy, device policy and the currently active settings.",
     84         "parameters": [
     85           {
     86             "name": "networkGuid",
     87             "type": "string",
     88             "description": "The unique identifier of the network to get properties from."
     89           },
     90           {
     91             "name": "callback",
     92             "type": "function",
     93             "parameters": [
     94               {
     95                 "name": "properties",
     96                 "$ref": "ManagedNetworkProperties",
     97                 "description": "Results of the query for managed network properties."
     98               }
     99             ]
    100           }
    101         ]
    102       },
    103       {
    104         "name": "getState",
    105         "description": "Gets the cached read-only properties of the network with id networkGuid.  This is meant to be a higher performance function than getProperties, which requires a round trip to query the networking subsystem.  It only returns a subset of the properties returned by getProperties.",
    106         "parameters": [
    107           {
    108             "name": "networkGuid",
    109             "type": "string",
    110             "description": "The unique identifier of the network to set properties on."
    111           },
    112           {
    113             "name": "callback",
    114             "type": "function",
    115             "parameters": [
    116               {
    117                 "name": "properties",
    118                 "$ref": "NetworkProperties",
    119                 "description": "Results of the query for network properties."
    120               }
    121             ]
    122           }
    123         ]
    124       },
    125       {
    126         "name": "setProperties",
    127         "description": "Sets the properties of the network with id networkGuid.",
    128         "parameters": [
    129           {
    130             "name": "networkGuid",
    131             "type": "string",
    132             "description": "The unique identifier of the network to set properties on."
    133           },
    134           {
    135             "name": "properties",
    136             "$ref": "NetworkProperties",
    137             "description": "The properties to set on the network."
    138           },
    139           {
    140             "name": "callback",
    141             "type": "function",
    142             "parameters": []
    143           }
    144         ]
    145       },
    146       {
    147         "name": "getVisibleNetworks",
    148         "description": "Gets the list of visible networks, and returns a list of cached, read-only network properties for each.",
    149         "parameters": [
    150           {
    151             "name": "type",
    152             "type": "string",
    153             "enum": ["Ethernet", "WiFi", "Bluetooth", "Cellular", "VPN", "All"],
    154             "description": "The type of networks to return."
    155           },
    156           {
    157             "name": "callback",
    158             "type": "function",
    159             "optional": true,
    160             "parameters": [
    161               {
    162                 "name": "networkList",
    163                 "type": "array",
    164                 "items": { "$ref": "NetworkProperties" }
    165               }
    166             ]
    167           }
    168         ]
    169       },
    170       {
    171         "name": "requestNetworkScan",
    172         "description": "Requests that the networking subsystem scan for new networks and update the list returned by getVisibleNetworks.  This is only a request: the network subsystem can choose to ignore it.  If the list is updated, then the onNetworkListChanged event will be fired.",
    173         "parameters": []
    174       },
    175       {
    176         "name": "startConnect",
    177         "description": "Starts a connection to the network with networkGuid.",
    178         "parameters": [
    179           {
    180             "name": "networkGuid",
    181             "type": "string",
    182             "description": "The unique identifier of the network to connect to."
    183           },
    184           {
    185             "name": "callback",
    186             "type": "function",
    187             "optional": true,
    188             "parameters": [],
    189             "description": "A callback function that indicates that a connection has been initiated."
    190           }
    191         ]
    192       },
    193       {
    194         "name": "startDisconnect",
    195         "description": "Starts a disconnect from the network with networkGuid.",
    196         "parameters": [
    197           {
    198             "name": "networkGuid",
    199             "type": "string",
    200             "description": "The unique identifier of the network to disconnect from."
    201           },
    202           {
    203             "name": "callback",
    204             "type": "function",
    205             "optional": true,
    206             "parameters": [],
    207             "description": "A callback function that indicates that a disconnect has been initiated."
    208           }
    209         ]
    210       },
    211       {
    212         "name": "verifyDestination",
    213         "description": "Verifies that the device is a trusted device.",
    214         "parameters": [
    215           {
    216             "name": "properties",
    217             "$ref": "VerificationProperties",
    218             "description": "Properties of the destination to use in verifying that it is a trusted device."
    219           },
    220           {
    221             "name": "callback",
    222             "type": "function",
    223             "parameters": [
    224               {
    225                 "name": "verified",
    226                 "type": "boolean"
    227               }
    228             ],
    229             "description": "A callback function that indicates whether or not the device is a trusted device."
    230           }
    231         ]
    232       },
    233       {
    234         "name": "verifyAndEncryptCredentials",
    235         "description": "Verifies that the device is a trusted device and retrieves encrypted network credentials.",
    236         "parameters": [
    237           {
    238             "name": "properties",
    239             "$ref": "VerificationProperties",
    240             "description": "Properties of the destination to use in verifying that it is a trusted device."
    241           },
    242           {
    243             "name": "guid",
    244             "type": "string",
    245             "description": "A string containing the unique identifier of the network to get credentials for."
    246           },
    247           {
    248             "name": "callback",
    249             "type": "function",
    250             "parameters": [
    251               {
    252                 "name": "credentials",
    253                 "type": "string"
    254               }
    255             ],
    256             "description": "A callback function that receives base64-encoded encrypted credential data to send to a trusted device."
    257           }
    258         ]
    259       },
    260       {
    261         "name": "verifyAndEncryptData",
    262         "description": "Verifies that the device is a trusted device and encrypts supplied data with device public key.",
    263         "parameters": [
    264           {
    265             "name": "properties",
    266             "$ref": "VerificationProperties",
    267             "description": "Properties of the destination to use in verifying that it is a trusted device."
    268           },
    269           {
    270             "name": "data",
    271             "type": "string",
    272             "description": "A string containing the base64-encoded data to encrypt."
    273           },
    274           {
    275             "name": "callback",
    276             "type": "function",
    277             "parameters": [
    278               {
    279                 "name": "encryptedData",
    280                 "type": "string"
    281               }
    282             ],
    283             "description": "A callback function that receives base64-encoded encrypted data to send to a trusted device."
    284           }
    285         ]
    286       }
    287     ],
    288     "events": [
    289       {
    290         "name": "onNetworksChanged",
    291         "type": "function",
    292         "description": "Fired when the properties change on any of the networks.  Sends a list of identifiers for networks whose properties have changed.",
    293         "parameters": [
    294           {
    295             "name": "changes",
    296             "type": "array",
    297             "items": { "type": "string" }
    298           }
    299         ]
    300       },
    301       {
    302         "name": "onNetworkListChanged",
    303         "type": "function",
    304         "description": "Fired when the list of networks has changed.  Sends a complete list of identifiers for all the current networks.",
    305         "parameters": [
    306           {
    307             "name": "changes",
    308             "type": "array",
    309             "items": { "type": "string" }
    310           }
    311         ]
    312       }
    313     ]
    314   }
    315 ]
    316