PFS2: Difference between revisions

6,072 bytes added ,  16 September 2009
no edit summary
No edit summary
Line 1: Line 1:
PFS2 is a simple HTTP service intended to:
# Assist in finding a plugins for MIME types whose handling is unknown to the client
# Offer version and security vulnerability data on installed plugins for upgrade recommendations
__TOC__
= Server =
= Server =
== Codebase ==
http://svn.mozilla.org/projects/pfs2/trunk/


== Schema ==
The server side of PFS2 maintains a database of plugins and plugin releases.
* [http://svn.mozilla.org/addons/trunk/site/app/config/sql/remora.sql Checked in here]
These records are indexed by MIME type, and a set of client application details
* plugins
that help identify the most appropriate versions of plugins for a given
* mimes
platform, OS, locale, & etc.
* plugins_mimes
 
* Public URL: TBD
* Source code (in SVN): http://svn.mozilla.org/projects/pfs2/trunk/
* DB Schema (in SVN): http://svn.mozilla.org/projects/pfs2/trunk/conf/schema.sql
 
== Request Parameters ==
 
Queries against PFS2 are performed using HTTP GET, with the following parameters supported:
 
; mimetype : A space-separated list of mimetypes for a plugin. (Note: space can be encoded as <tt>+</tt> in URLs.)
; clientOS : The client's OS (eg. <tt>navigator.oscpu</tt>, "Windows NT 5.1", "Intel Mac OS X 10.5")
; chromeLocale : The client's locale (eg. <tt>navigator.language</tt>)
; appID : The client's app ID (eg. <tt>navigator.'''???'''</tt> (userAgent?), Firefox is "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}")
; appRelease : Client app release version (eg.  <tt>navigator.'''???'''</tt> (userAgent?), "3.5.3")
; appVersion : Client's application build version (eg. <tt>navigator.buildID</tt>, "20090824085414")
; callback : Function wrapper for JSON output, (see also: [http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/ JSONP technique])
 
=== Example request ===
 
Line breaks added for clarity:
 
    curl -s 'http://dev.pfs2.mozilla.org/?
        mimetype=application/x-shockwave-flash&
        appID=%7Bec8030f7-c20a-464f-9b0e-13a3a9e97384%7D&
        appVersion=2008052906&
        appRelease=3.5&
        clientOS=mac&
        chromeLocale=ja-JP'
 
== Response Format ==


== Environments ==
The response MIME type for PFS2 is either <tt>application/json</tt>, or
Dev - local
<tt>text/javascript</tt> if the <tt>callback</tt> parameter is non-empty.


== Request ==
The top-level JSON payload is an object pairing plugin identifiers (<tt>pfs_id</tt>s)
Current PFS parameters
each with an object describing a plugin's releases and known aliases.  Note
mimetype=application/x-java-appletapp
that the <tt>pfs_id</tt> values are unique only to PFS2, and simply serve as
ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
a way to organize plugins that may change names and other attributes between
appVersion=1.5.0.4
releases.
clientOS=Win
chromeLocale=en-US


Current VersionCheck parameters:
=== Overall structure ===
reqVersion=1
id={49f3fc85-dcfe-4e42-9301-226ebe658509}
version=0.6.1
maxAppVersion=2.0.0.*
status=userEnabled,incompatible
appID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
appVersion=3.0b3pre
appOS=Darwin
appABI=x86-gcc3
locale=en-US


PFS 2 Example call - GET to:
Plugin descriptions have the following overall structure:
  http://pfs2.mozilla.org/?appID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}&mimetype=application/x-shockwave-flash&appVersion=2008052906&appRelease=3.0&clientOS=Windows%20NT%205.1&chromeLocale=en-US&callback=later


* callback - optional, makes the output JSONP instead of JSON
    {
        "adobe-flash-player": {
            "aliases": [ ... ],
            "releases": [ ... ]
        }
    }


== Response ==
=== Plugin name aliases ===
Is the following data a sample of the JSON output of PFS2?


  [ {
The <tt>aliases</tt> property consists of a list of known names by which the
  "name" : "Plugin",
plugin has been called. If a value in the list is contained in <tt>/.../</tt>,
  "version" : "1.0",
that alias is intended to be treated as a regex match.  This list is meant
  "filename" : "plugin.dll",
to assist in identifying installed plugins and matching them with PFS2 results.
  "vendor" : "Mozilla",
 
  "url" : "http://mozilla.com/",
For example:
  "icon_url" : "http://mozilla.com/favicon.ico",
 
  "latest_version" : "1.0",
    {
  "installer_location" : "http://mozilla.com/installer.exe",
        "adobe-flash-player": {
  "installer_hash" : "sha256:592eca7e6f2731c65e344c4514bd7efa0a7ec8a203d97b4f5aadb14c44379178",
            "aliases": [
  "installer_shows_ui" : "false",
                "/.*Flash.*/",
  "license_url" : "http://mozilla.com/license.html",
                "Adobe Flash Player",
  "needs_restart" : "true",
                "Shockwave Flash"
  "description" : "This is a Mozilla plugin that does things.",
            ],
  "platforms" : [
            "releases": [ ... ]
    { "name" : "Mac OSX" },
        }
    { "name" : "Windows NT 6.0" }
    }
  ],  
 
  "xpcomabi" : "x86",
=== Plugin release descriptions ===
  "mime_types" : [ {  
 
    "mime" : "text/plain",
The <tt>releases</tt> property is an object whose properties are named for
    "description" : "HTML",
plugin versions, and whose property values are objects describing plugin
    "suffixes" : ".html, .xhtml, .htm"
releases.  Each of the plugin release description object may some or all of the
  } ]
following properties:
} ]
 
; pfs_id : <tt>pfs_id</tt> of the plugin within PFS2
; name : Name of the plugin
; vendor : Name of the vendor providing the plugin
; version : A dot-separated normalized version for the plugin, may differ from official vendor versioning scheme in order to maintain internal consistency in PFS2
; guid : A GUID for the plugin release, may differ between releases and platforms (unlike <tt>pfs_id</tt>)
; status : Current status of the release, eg. <tt>latest</tt>, <tt>outdated</tt>, <tt>vulnerable</tt>
; vulnerability_description : For status <tt>vulnerable</tt>, a short description of security vulnerabilities for the plugin release
; vulnerability_url : For status <tt>vulnerable</tt>, a URL detailing security vulnerabilities for the plugin release
; filename : Filename of the plugin as installed
; url : URL with details describing the plugin
; license_url : URL where the license for using the plugin may be found
; manual_installation_url : URL for a manually-launched executable installer for the plugin
; xpi_location : URL for an XPI-based installer for the plugin
; installer_location : URL for an executable installer for the plugin (mainly for Windows)
; installer_hash : A hash of the installer's contents for verifying its integrity
; installer_shows_ui : (0/1) whether or not the installer displays a user interface
; needs_restart : (0/1) whether or not the OS needs to restart after plugin installation
; xpcomabi : '''''(Not sure, inherited from PFS1, need a description)'''''
; min : '''''(Not sure, inherited from PFS1, need a description)'''''
; max : '''''(Not sure, inherited from PFS1, need a description)'''''
; app_release : Client app release for which the plugin is intended (* is wildcard)
; app_version : Client app version for which the plugin is intended (* is wildcard)
; locale : Client app locale for which the plugin is intended (* is wildcard)
; os_name : Client app OS for which the plugin is intended (* is wildcard)
; modified : Timestamp when last the release record was modified
 
=== Example response ===
 
    $ curl -s 'http://dev.pfs2.mozilla.org/?mimetype=application/x-shockwave-flash&appID=%7Bec8030f7-c20a-464f-9b0e-13a3a9e97384%7D&appVersion=2008052906&appRelease=3.5&clientOS=mac&chromeLocale=ja-JP'
   
    {
        "adobe-flash-player": {
            "releases": {
                "11.0.0.0": {
                    "status": "latest",  
                    "app_release": "3.5",  
                    "app_version": "*",
                    "vendor": "Adobe",  
                    "pfs_id": "adobe-flash-player",
                    "url": "http://www.adobe.com/go/getflashplayer",
                    "modified": "2009-09-16T00:58:39+00:00",  
                    "app_id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
                    "locale": "ja-JP",
                    "version": "11.0.0.0",
                    "license_url": "http://www.adobe.com/go/eula_flashplayer_jp",  
                    "guid": "{89977581-9028-4be0-b151-7c4f9bcd3211}",  
                    "xpi_location": "http://fpdownload.macromedia.com/get/flashplayer/xpi/current/flashplayer-mac.xpi",
                    "os_name": "mac",
                    "name": "Adobe Flash Player"
                },
                "10.0.32.18": {
                    "status": "vulnerable",
                    "app_release": "3.5",  
                    "app_version": "*",
                    "vendor": "Adobe",  
                    "pfs_id": "adobe-flash-player",  
                    "url": "http://www.adobe.com/go/getflashplayer",  
                    "modified": "2009-09-16T00:58:39+00:00",  
                    "app_id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",  
                    "vulnerability_description": "Makes your computer kick puppies",
                    "vulnerability_url": "http://google.com",  
                    "version": "10.0.32.18",
                    "license_url": "http://www.adobe.com/go/eula_flashplayer_jp",  
                    "locale": "ja-JP",  
                    "guid": "{89977581-9028-4be0-b151-7c4f9bcd3211}",
                    "xpi_location": "http://fpdownload.macromedia.com/get/flashplayer/xpi/current/flashplayer-mac.xpi",  
                    "os_name": "mac",
                    "name": "Adobe Flash Player"
                }
            },  
            "aliases": [
                "/.*Flash.*/",  
                "Adobe Flash Player",  
                "Shockwave Flash"
            ]
        }
    }


= Client =
= Client =
== Codebases ==
== Codebases ==
* [http://svn.mozilla.org/projects/mozilla.com/ mozilla.com]
* [http://svn.mozilla.org/projects/mozilla.com/ mozilla.com]
Confirmed users
920

edits