[
  {
    "path": ".eslintrc.yml",
    "content": "env:\n  browser: true\n  es6: true\n  node: true\n\nextends:\n  - eslint:recommended\n  - plugin:node/recommended\n\nplugins:\n  - node\n  - promise\n\nroot: true\n\nrules:\n  comma-dangle: off\n  curly: warn\n  eol-last: error\n  eqeqeq: error\n  handle-callback-err: error\n  indent: [error, 2, {SwitchCase: 1}]\n  no-console: off\n  no-multi-spaces: error\n  no-unused-vars: [error, {vars: all, args: none}]\n  one-var: [error, never]\n  quotes: [error, double]\n  semi: [error, always]\n\n  node/no-unpublished-bin: error\n\n  promise/param-names: error\n  promise/always-return: error\n  promise/catch-or-return: error\n  promise/no-native: off\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\nnpm-shrinkwrap.json\n*.log\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Community Participation Guidelines\n\nThis repository is governed by Mozilla's code of conduct and etiquette guidelines. \nFor more details, please read the\n[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/). \n\n## How to Report\nFor more information on how to report violations of the Community Participation Guidelines, please read our '[How to Report](https://www.mozilla.org/about/governance/policies/participation/reporting/)' page.\n\n<!--\n## Project Specific Etiquette\n\nIn some cases, there will be additional project etiquette i.e.: (https://bugzilla.mozilla.org/page.cgi?id=etiquette.html).\nPlease update for your project.\n-->\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM node:alpine\nMAINTAINER https://github.com/mozilla/observatory-cli\n\nRUN adduser -h /home/observatory -g \"Observatory CLI User\" -s /bin/ash -D observatory\nRUN npm install -g observatory-cli\n\nUSER observatory\nWORKDIR /home/observatory\nENTRYPOINT [\"observatory\"]\nCMD [\"--help\"]\n"
  },
  {
    "path": "LICENSE",
    "content": "Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor\"\n    means each individual or legal entity that creates, contributes to\n    the creation of, or owns Covered Software.\n\n1.2. \"Contributor Version\"\n    means the combination of the Contributions of others (if any) used\n    by a Contributor and that particular Contributor's Contribution.\n\n1.3. \"Contribution\"\n    means Covered Software of a particular Contributor.\n\n1.4. \"Covered Software\"\n    means Source Code Form to which the initial Contributor has attached\n    the notice in Exhibit A, the Executable Form of such Source Code\n    Form, and Modifications of such Source Code Form, in each case\n    including portions thereof.\n\n1.5. \"Incompatible With Secondary Licenses\"\n    means\n\n    (a) that the initial Contributor has attached the notice described\n        in Exhibit B to the Covered Software; or\n\n    (b) that the Covered Software was made available under the terms of\n        version 1.1 or earlier of the License, but not also under the\n        terms of a Secondary License.\n\n1.6. \"Executable Form\"\n    means any form of the work other than Source Code Form.\n\n1.7. \"Larger Work\"\n    means a work that combines Covered Software with other material, in\n    a separate file or files, that is not Covered Software.\n\n1.8. \"License\"\n    means this document.\n\n1.9. \"Licensable\"\n    means having the right to grant, to the maximum extent possible,\n    whether at the time of the initial grant or subsequently, any and\n    all of the rights conveyed by this License.\n\n1.10. \"Modifications\"\n    means any of the following:\n\n    (a) any file in Source Code Form that results from an addition to,\n        deletion from, or modification of the contents of Covered\n        Software; or\n\n    (b) any new file in Source Code Form that contains any Covered\n        Software.\n\n1.11. \"Patent Claims\" of a Contributor\n    means any patent claim(s), including without limitation, method,\n    process, and apparatus claims, in any patent Licensable by such\n    Contributor that would be infringed, but for the grant of the\n    License, by the making, using, selling, offering for sale, having\n    made, import, or transfer of either its Contributions or its\n    Contributor Version.\n\n1.12. \"Secondary License\"\n    means either the GNU General Public License, Version 2.0, the GNU\n    Lesser General Public License, Version 2.1, the GNU Affero General\n    Public License, Version 3.0, or any later versions of those\n    licenses.\n\n1.13. \"Source Code Form\"\n    means the form of the work preferred for making modifications.\n\n1.14. \"You\" (or \"Your\")\n    means an individual or a legal entity exercising rights under this\n    License. For legal entities, \"You\" includes any entity that\n    controls, is controlled by, or is under common control with You. For\n    purposes of this definition, \"control\" means (a) the power, direct\n    or indirect, to cause the direction or management of such entity,\n    whether by contract or otherwise, or (b) ownership of more than\n    fifty percent (50%) of the outstanding shares or beneficial\n    ownership of such entity.\n\n2. License Grants and Conditions\n--------------------------------\n\n2.1. Grants\n\nEach Contributor hereby grants You a world-wide, royalty-free,\nnon-exclusive license:\n\n(a) under intellectual property rights (other than patent or trademark)\n    Licensable by such Contributor to use, reproduce, make available,\n    modify, display, perform, distribute, and otherwise exploit its\n    Contributions, either on an unmodified basis, with Modifications, or\n    as part of a Larger Work; and\n\n(b) under Patent Claims of such Contributor to make, use, sell, offer\n    for sale, have made, import, and otherwise transfer either its\n    Contributions or its Contributor Version.\n\n2.2. Effective Date\n\nThe licenses granted in Section 2.1 with respect to any Contribution\nbecome effective for each Contribution on the date the Contributor first\ndistributes such Contribution.\n\n2.3. Limitations on Grant Scope\n\nThe licenses granted in this Section 2 are the only rights granted under\nthis License. No additional rights or licenses will be implied from the\ndistribution or licensing of Covered Software under this License.\nNotwithstanding Section 2.1(b) above, no patent license is granted by a\nContributor:\n\n(a) for any code that a Contributor has removed from Covered Software;\n    or\n\n(b) for infringements caused by: (i) Your and any other third party's\n    modifications of Covered Software, or (ii) the combination of its\n    Contributions with other software (except as part of its Contributor\n    Version); or\n\n(c) under Patent Claims infringed by Covered Software in the absence of\n    its Contributions.\n\nThis License does not grant any rights in the trademarks, service marks,\nor logos of any Contributor (except as may be necessary to comply with\nthe notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\nNo Contributor makes additional grants as a result of Your choice to\ndistribute the Covered Software under a subsequent version of this\nLicense (see Section 10.2) or under the terms of a Secondary License (if\npermitted under the terms of Section 3.3).\n\n2.5. Representation\n\nEach Contributor represents that the Contributor believes its\nContributions are its original creation(s) or it has sufficient rights\nto grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\nThis License is not intended to limit any rights You have under\napplicable copyright doctrines of fair use, fair dealing, or other\nequivalents.\n\n2.7. Conditions\n\nSections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted\nin Section 2.1.\n\n3. Responsibilities\n-------------------\n\n3.1. Distribution of Source Form\n\nAll distribution of Covered Software in Source Code Form, including any\nModifications that You create or to which You contribute, must be under\nthe terms of this License. You must inform recipients that the Source\nCode Form of the Covered Software is governed by the terms of this\nLicense, and how they can obtain a copy of this License. You may not\nattempt to alter or restrict the recipients' rights in the Source Code\nForm.\n\n3.2. Distribution of Executable Form\n\nIf You distribute Covered Software in Executable Form then:\n\n(a) such Covered Software must also be made available in Source Code\n    Form, as described in Section 3.1, and You must inform recipients of\n    the Executable Form how they can obtain a copy of such Source Code\n    Form by reasonable means in a timely manner, at a charge no more\n    than the cost of distribution to the recipient; and\n\n(b) You may distribute such Executable Form under the terms of this\n    License, or sublicense it under different terms, provided that the\n    license for the Executable Form does not attempt to limit or alter\n    the recipients' rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\nYou may create and distribute a Larger Work under terms of Your choice,\nprovided that You also comply with the requirements of this License for\nthe Covered Software. If the Larger Work is a combination of Covered\nSoftware with a work governed by one or more Secondary Licenses, and the\nCovered Software is not Incompatible With Secondary Licenses, this\nLicense permits You to additionally distribute such Covered Software\nunder the terms of such Secondary License(s), so that the recipient of\nthe Larger Work may, at their option, further distribute the Covered\nSoftware under the terms of either this License or such Secondary\nLicense(s).\n\n3.4. Notices\n\nYou may not remove or alter the substance of any license notices\n(including copyright notices, patent notices, disclaimers of warranty,\nor limitations of liability) contained within the Source Code Form of\nthe Covered Software, except that You may alter any license notices to\nthe extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\nYou may choose to offer, and to charge a fee for, warranty, support,\nindemnity or liability obligations to one or more recipients of Covered\nSoftware. However, You may do so only on Your own behalf, and not on\nbehalf of any Contributor. You must make it absolutely clear that any\nsuch warranty, support, indemnity, or liability obligation is offered by\nYou alone, and You hereby agree to indemnify every Contributor for any\nliability incurred by such Contributor as a result of warranty, support,\nindemnity or liability terms You offer. You may include additional\ndisclaimers of warranty and limitations of liability specific to any\njurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n---------------------------------------------------\n\nIf it is impossible for You to comply with any of the terms of this\nLicense with respect to some or all of the Covered Software due to\nstatute, judicial order, or regulation then You must: (a) comply with\nthe terms of this License to the maximum extent possible; and (b)\ndescribe the limitations and the code they affect. Such description must\nbe placed in a text file included with all distributions of the Covered\nSoftware under this License. Except to the extent prohibited by statute\nor regulation, such description must be sufficiently detailed for a\nrecipient of ordinary skill to be able to understand it.\n\n5. Termination\n--------------\n\n5.1. The rights granted under this License will terminate automatically\nif You fail to comply with any of its terms. However, if You become\ncompliant, then the rights granted under this License from a particular\nContributor are reinstated (a) provisionally, unless and until such\nContributor explicitly and finally terminates Your grants, and (b) on an\nongoing basis, if such Contributor fails to notify You of the\nnon-compliance by some reasonable means prior to 60 days after You have\ncome back into compliance. Moreover, Your grants from a particular\nContributor are reinstated on an ongoing basis if such Contributor\nnotifies You of the non-compliance by some reasonable means, this is the\nfirst time You have received notice of non-compliance with this License\nfrom such Contributor, and You become compliant prior to 30 days after\nYour receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\ninfringement claim (excluding declaratory judgment actions,\ncounter-claims, and cross-claims) alleging that a Contributor Version\ndirectly or indirectly infringes any patent, then the rights granted to\nYou by any and all Contributors for the Covered Software under Section\n2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all\nend user license agreements (excluding distributors and resellers) which\nhave been validly granted by You or Your distributors under this License\nprior to termination shall survive termination.\n\n************************************************************************\n*                                                                      *\n*  6. Disclaimer of Warranty                                           *\n*  -------------------------                                           *\n*                                                                      *\n*  Covered Software is provided under this License on an \"as is\"       *\n*  basis, without warranty of any kind, either expressed, implied, or  *\n*  statutory, including, without limitation, warranties that the       *\n*  Covered Software is free of defects, merchantable, fit for a        *\n*  particular purpose or non-infringing. The entire risk as to the     *\n*  quality and performance of the Covered Software is with You.        *\n*  Should any Covered Software prove defective in any respect, You     *\n*  (not any Contributor) assume the cost of any necessary servicing,   *\n*  repair, or correction. This disclaimer of warranty constitutes an   *\n*  essential part of this License. No use of any Covered Software is   *\n*  authorized under this License except under this disclaimer.         *\n*                                                                      *\n************************************************************************\n\n************************************************************************\n*                                                                      *\n*  7. Limitation of Liability                                          *\n*  --------------------------                                          *\n*                                                                      *\n*  Under no circumstances and under no legal theory, whether tort      *\n*  (including negligence), contract, or otherwise, shall any           *\n*  Contributor, or anyone who distributes Covered Software as          *\n*  permitted above, be liable to You for any direct, indirect,         *\n*  special, incidental, or consequential damages of any character      *\n*  including, without limitation, damages for lost profits, loss of    *\n*  goodwill, work stoppage, computer failure or malfunction, or any    *\n*  and all other commercial damages or losses, even if such party      *\n*  shall have been informed of the possibility of such damages. This   *\n*  limitation of liability shall not apply to liability for death or   *\n*  personal injury resulting from such party's negligence to the       *\n*  extent applicable law prohibits such limitation. Some               *\n*  jurisdictions do not allow the exclusion or limitation of           *\n*  incidental or consequential damages, so this exclusion and          *\n*  limitation may not apply to You.                                    *\n*                                                                      *\n************************************************************************\n\n8. Litigation\n-------------\n\nAny litigation relating to this License may be brought only in the\ncourts of a jurisdiction where the defendant maintains its principal\nplace of business and such litigation shall be governed by laws of that\njurisdiction, without reference to its conflict-of-law provisions.\nNothing in this Section shall prevent a party's ability to bring\ncross-claims or counter-claims.\n\n9. Miscellaneous\n----------------\n\nThis License represents the complete agreement concerning the subject\nmatter hereof. If any provision of this License is held to be\nunenforceable, such provision shall be reformed only to the extent\nnecessary to make it enforceable. Any law or regulation which provides\nthat the language of a contract shall be construed against the drafter\nshall not be used to construe this License against a Contributor.\n\n10. Versions of the License\n---------------------------\n\n10.1. New Versions\n\nMozilla Foundation is the license steward. Except as provided in Section\n10.3, no one other than the license steward has the right to modify or\npublish new versions of this License. Each version will be given a\ndistinguishing version number.\n\n10.2. Effect of New Versions\n\nYou may distribute the Covered Software under the terms of the version\nof the License under which You originally received the Covered Software,\nor under the terms of any subsequent version published by the license\nsteward.\n\n10.3. Modified Versions\n\nIf you create software not governed by this License, and you want to\ncreate a new license for such software, you may create and use a\nmodified version of this License if you rename the license and remove\nany references to the name of the license steward (except to note that\nsuch modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary\nLicenses\n\nIf You choose to distribute Source Code Form that is Incompatible With\nSecondary Licenses under the terms of this version of the License, the\nnotice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\n-------------------------------------------\n\n  This Source Code Form is subject to the terms of the Mozilla Public\n  License, v. 2.0. If a copy of the MPL was not distributed with this\n  file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular\nfile, then You may include the notice in a location (such as a LICENSE\nfile in a relevant directory) where a recipient would be likely to look\nfor such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - \"Incompatible With Secondary Licenses\" Notice\n---------------------------------------------------------\n\n  This Source Code Form is \"Incompatible With Secondary Licenses\", as\n  defined by the Mozilla Public License, v. 2.0.\n"
  },
  {
    "path": "README.md",
    "content": "> [!IMPORTANT]\n>\n> ## ⚠️ Deprecation Announcement for Mozilla HTTP Observatory\n>\n> Dear Mozilla Observatory Users,\n>\n> This code repository is now deprecated. There is a [Node/Javascript based replacement available](https://github.com/mdn/mdn-http-observatory/), that has updated scoring and backs the [HTTP Observatory service on MDN](https://developer.mozilla.org/en-US/observatory).\n>\n> ### 🛠️ What This Means\n>\n> * No Further Updates: We will no longer be providing updates, bug fixes, or new features for this repository.\n> * Limited Support: Official support will be discontinued.\n> * Archival: The repository will be archived soon, making it read-only.\n>\n> 🔍 Alternatives and Recommendations\n>\n> We recommend transitioning to [HTTP Observatory](https://github.com/mdn/mdn-http-observatory/), maintained by [MDN](https://developer.mozilla.org).\n>\n> 📦 Migration Guide\n>\n> To assist you in transitioning, we have prepared a [Migration Guide](https://github.com/mdn/mdn-http-observatory/blob/main/README.md#migrating-from-the-public-v1-api-to-the-v2-api) that covers steps to migrate your existing setup to the alternative.\n\n# Observatory by Mozilla CLI Client\n\nThe Mozilla HTTP Observatory is a set of tools to analyze your website and inform you if you are utilizing the many available methods to secure it.\n\nIt is split into three projects:\n\n* [http-observatory](https://github.com/mozilla/http-observatory) - scanner/grader\n* [observatory-cli](https://github.com/mozilla/observatory-cli) - command line interface\n* [http-observatory-website](https://github.com/mozilla/http-observatory-website) - web interface\n\n## Score your site's HTTPS practices\n\nObservatory by Mozilla is a project designed to help developers, system administrators, and security professionals configure their sites safely and securely.\n\n## Observatory in action!\n\n- <https://observatory.mozilla.org/>\n- [FAQ](https://observatory.mozilla.org/faq.html)\n\n### Example site report, with additional options\n\n![Screenshot of ssllabs.com report, showing colors](report.png)\n\nThe [full report url](https://observatory.mozilla.org/analyze.html?host=ssllabs.com) has suggestions to **repair** each of these issues.\n\n\n## Install\n\n```\n$ npm install -g observatory-cli\n```\n\n(Optional `Docker` instructions below.)\n\n## Usage\n\n1.  **Scan a site** for `https` best practices.\n\n    ```\n    # json!\n    $ observatory some.site.name\n\n    # include 'zero' scores, display as a tabular report\n    $ observatory some.site.name --zero --format=report\n\n    # attempt to force a re-scan\n    $ observatory some.site.name --rescan\n\n    ```\n\n2.  **Test a site** as part of a Continuous Integration pipeline.\n\n    Script will FAIL unless the grade is AT LEAST `B+`\n\n    ```\n    $ observatory some.site.name --min-grade B+\n    ```\n\n    ...and the score is at least 50.\n\n    ```\n    $ observatory some.site.name --min-grade B+ --min-score 50\n    ```\n\n\n3.  **Print the URL** for the expanded online report.\n\n    ```\n    $ observatory some.site.name --format=url\n    ```\n\n4.  **nagios** monitoring plugin mode.\n\n    For `--nagios <failcode>`, `failcode` will be the exit code if the test fails.\n\n    `--min-score`, `--min-grade`, `--zero`, `--skip` affect the test.\n\n    ```\n    $ observatory  --nagios 2 --min-score 85 -z --skip cookies\n    CRITICAL [\"content-security-policy\",...,\"x-xss-protection\"]\n    ```\n\n    Any **negative scores fail the test**, unless `--min-score` or `--min-grade` is specified.\n\n    ```\n    # '2' maps to nagios 'critical.'  Exits '2'\n\n    $ observatory ssllabs.com --nagios 2\n    CRITICAL [\"redirection\"]\n    ```\n\n    We can `--skip` the failing rule, and affect the score.\n\n    ```\n    $ observatory ssllabs.com --nagios 2 --skip redirection\n    observatory [INFO] modfiying score, because of --skip.  was: 100, now: 105\n    OK\n    ```\n\n    Quiet output with `-q`.\n\n    ```\n    $ observatory ssllabs.com --nagios 2 --skip redirection -q\n    OK\n    ```\n\n## Help Ouput\n\n```\n$ observatory --help\n\n  Usage: observatory [options] <site>\n\n  cli for interacting with Mozilla HTTP Observatory\n\n  https://observatory.mozilla.org/\n\n  Options:\n\n    -h, --help               output usage information\n    -V, --version            output the version number\n    --format [format]        format for output.  choice:  (json|report|csv|url).  `json` is default\n    --min-grade <grade>      testing: this grade or better, or exit(1)\n    --min-score <score>      testing: this score or better, or exit(1)\n    --nagios [failcode]      nagios mode, exits with [failcode] on failure\n    --rescan                 initiate a rescan instead of showing recent scan results\n    -z, --zero               show test results that don't affect the final score\n    --attempts <n>           number of attempts to try before failing\n    --api-version [version]  api version:  defaults to 1\n    --skip <rule>            skip rules by name.  works with min-score only\n    --tls                    do tls checks instead\n    -q, --quiet              turns off all logging\n\n\n  Output Formats (--format)\n    - json    json of the report\n    - report  plain-text tabular format\n    - csv     alias for report\n    - url     url for online version\n\n\n  Nagios Mode (--nagios)\n    - if `--min-score` and/or `--min-grade`, use those.\n    - else *any* negative rules fail the check.\n    - exits with integer `failcode`.\n```\n\n## Example Report, Text Version\n\nReport, with options:\n\n* `-z` to show '0' rules (all rules)\n* `--skip` to skip a rule (affects SCORE, but not GRADE)\n\n```\n$ observatory some.site --format=report -z --skip redirection\n\nobservatory [INFO] modfiying score, because of --skip.  was: 60, now: 65\n\nHTTP Observatory Report: some.site\n\nScore Description\n\n  -20 content-security-policy        Content Security Policy (CSP) implemented, but allows 'unsafe-inline' inside script-src\n  -10 x-xss-protection               X-XSS-Protection header not implemented\n   -5 x-content-type-options         X-Content-Type-Options header not implemented\n    0 contribute                     Contribute.json implemented with the required contact information\n    0 cookies                        No cookies detected\n    0 cross-origin-resource-sharing  Content is not visible via cross-origin resource sharing (CORS) files or headers\n    0 public-key-pinning             HTTP Public Key Pinning (HPKP) header not implemented\n    0 strict-transport-security      HTTP Strict Transport Security (HSTS) header set to a minimum of six months (15768000)\n    0 subresource-integrity          Subresource Integrity (SRI) not implemented, but all scripts are loaded from a similar origin\n    0 x-frame-options                X-Frame-Options (XFO) header set to SAMEORIGIN or DENY\n\nScore: 65 (modified due to --skip)\nGrade: C+\n\nFull Report Url: https://observatory.mozilla.org/analyze/some.site\n\n```\n\n## Technical / Development\n\n### Debug observatory api urls\n\n```\nNODE_DEBUG=request observatory --format report --rescan --zero www.mozilla.org\n```\n\n### API Documentation\n\nhttps://github.com/mozilla/http-observatory/blob/master/httpobs/docs/api.md\n\n### Dockerized `observatory-cli`\n\nUse the provided [Dockerfile](./Dockerfile), to build and execute `observatory` in Docker container.  Useful for Continuous Integration/Continuous Deployment (CI/CD) pipelines capable of running containers but that otherwise don't need a lot of extra software.\n\n**To get started,**\n\n1. Build the container.  Tag it as `mozilla/observatory-cli`\n\n    ```\n    docker build -t mozilla/observatory-cli .\n    ```\n\n2. Add a section like this to your `profile` (varies depending on your operating system and shell. `bash` shown).\n\n    ```\n    ## $HOME/.bashrc\n    if [[ -d $HOME/.bash_functions ]]; then\n        for file in $HOME/.bash_functions/*; do\n            . $file\n        done\n    fi\n    ```\n\n3. Create the directory referenced in point 2 and copy the files in `shell_functions` (not `bash_completion`) into that directory:\n\n    ```\n    $ mkdir $HOME/.bash_functions\n    $ find shell_functions -maxdepth 1 -type f -executable | while read file; do cp $file $HOME/.bash_functions; done\n    ```\n\n4. *Optional*: Add Bash completion to your shell.  (varies depending on your host operating system)\n\n    ```\n    ## On Red Hat based distributions:\n    sudo cp shell_functions/bash_completion/observatory.bash /etc/bash_completion.d/\n    ```\n\n5. Start a new shell and execute `observatory`.  Now it's in a Docker container.  Bash completion is available if you've added it.\n\n![Screenshot showing use of containerized observatory-cli](docker_example.png)\n\n\n## Related projects\n\n- [HTTP Observatory](https://github.com/mozilla/http-observatory) by April King\n- [Python observatory-cli](https://github.com/mozilla/http-observatory-cli) by April King\n"
  },
  {
    "path": "index.js",
    "content": "#!/usr/bin/env node\n\n\"use strict\";\n\n// https://github.com/mozilla/http-observatory-cli/blob/master/httpobscli/cli.py\n// we are doing a lot of things in a sillier way\n\nvar chalk = require(\"chalk\");\nvar program = require(\"commander\");\nvar rp = require(\"request-promise\");\nvar delay = require(\"timeout-as-promise\");\nvar sprintf = require(\"sprintf-js\").sprintf;\nvar util = require(\"util\");\nvar url = require(\"url\");\n\nvar SITE_URL = \"https://observatory.mozilla.org/\";\nvar API_URL = process.env.HTTPOBS_API_URL || \"https://http-observatory.security.mozilla.org/api/v1/\";\nif (!API_URL.endsWith(\"/\")) { API_URL += \"/\" ;}\n\n\n/* utilities and ephemera */\nvar clim = require(\"clim\");\n\nvar QUIET = false;\nvar hasSite = false;\n\nfunction padright(s, len) {\n  if (s.length >= len) {\n    return s;\n  }\n  return s + Array(len).fill(\" \").join(\"\").slice(s.length);\n}\n\nclim.logWrite = function(level, prefixes, msg) {\n  if (QUIET) {\n    return;\n  }\n\n  var pfx = \"\";\n  if (prefixes.length > 0) {\n    pfx = prefixes.join(\" \");\n  }\n\n  level = (f[level.toLowerCase()] || function(p) {\n    return p;\n  })(level);\n  var line = util.format(\"%s [%s] %s\", pfx, level, msg);\n\n  switch (level) {\n    case \"ERROR\":\n      process.stderr.write(line + \"\\n\");\n      break;\n    default:\n      process.stdout.write(line + \"\\n\");\n  }\n};\n\nvar logger = clim(chalk.grey(\"observatory\"));\n\nvar f = {\n  error: chalk.red,\n  link: chalk.underline.blue,\n  info: chalk.blue,\n  log: chalk.blue,\n  warn: chalk.red,\n  bold: chalk.bold,\n  code: chalk.bold.grey,\n  header: chalk.bold.blue,\n  plain: chalk.stripColor\n};\n\nfunction collect(val, O) {\n  O[val] = true;\n  return O;\n}\n\nfunction helpAnywhere(rawArgs) {\n  return rawArgs.filter(function(x) {\n    return /^(-h|--help)$/.exec(x);\n  }).length;\n}\n\nvar FORMATS = {\n  \"json\": {\n    \"description\": \"json of the report\",\n    \"action\": function(scores) {\n      console.log(JSON.stringify(scores, null, 2));\n    }\n  },\n  \"report\": {\n    \"description\": \"plain-text tabular format\",\n    \"action\": formatAnswersCsv\n  },\n  \"csv\": {\n    \"description\": util.format(\"alias for %s\", f.code(\"report\")),\n    \"action\": formatAnswersCsv\n  },\n  \"url\": {\n    \"description\": \"url for online version\",\n    // this one we handle early, so it has a different api\n    \"action\": function() {}\n  }\n};\n\nfunction validateFormatChoice(given) {\n  given = given.toLowerCase();\n  if (given in FORMATS) {\n    return given;\n  } else {\n    logger.error(\"not a valid format choice: %s.  Allowed: %s\",\n      f.error(given),\n      f.code(Object.keys(FORMATS).join(\"|\")));\n    process.exit(1);\n  }\n}\n\nfunction longestInList(L) {\n  return Math.max.apply(null, L.map(function(x) {\n    return x.length;\n  }));\n}\n\n/* functions for retrieving reports */\nclass Scanner {\n  constructor (site, options) {\n    this.attempts = 0;\n    this.allowed = options.attempts || 10;\n    this.url = url.resolve(API_URL, \"analyze\");\n  }\n  promiseScan (site, options, method=\"post\") {\n    var that = this;\n    this.attempts += 1;\n    site = site || this.site;\n    options = options || this.options;\n\n    if (this.attempts >= this.allowed) {\n      throw new Error(sprintf(\"too many attempts %s\", this.attempts));\n    }\n    var qargs = {host: site};\n    [\"rescan\", \"zero\"].forEach(function(k) {\n      if (options[k]) {\n        qargs[k] = \"true\";\n      }\n    });\n    // ininitalize with POST\n    return rp({\n      url: this.url,\n      json: true,\n      simple: true,\n      qs: {host: site},\n      formData: qargs,\n      method: method,\n      timeout: 1000\n    }).then(\n      function(scan) {\n        if (options.rescan && (scan.error === \"rescan-attempt-too-soon\")) {\n          logger.warn(\"Rescan attempt is sooner than the allowed cooldown period. Returning cached results instead.\");\n          options.rescan = false;\n          return that.promiseScan(site, options, \"get\");\n        } else {\n          if (scan.error) {\n            throw new Error(util.format(\"Unable to get result. Host:%s Error:%s.\", site, scan.error));\n          }\n        }\n        switch (scan.state) {\n          case \"FINISHED\": {\n            return scan;\n          }\n          case \"ABORTED\":\n          case \"FAILED\": {\n            throw new Error(util.format(\"Unable to get result from the HTTP Observatory. Host: %s Error: %s.\", site, scan.state));\n          }\n        }\n\n        // try again\n        logger.warn(sprintf(\"retrying in 1 second (attempt %s/%s)\", that.attempts, that.allowed));\n        return delay(1000).then(function() {\n          return that.promiseScan(site, options, \"get\");\n        });\n      }\n    );\n  }\n}\n\n/** related to grades */\nvar grades = [\"F\"];\n\"DCBA\".split(\"\").forEach(function(g) {\n  [\"-\", \"\", \"+\"].forEach(function(mark) {\n    grades.push(g + mark);\n  });\n});\n\nfunction gradeCompare(seen, wanted) {\n  return grades.indexOf(wanted) <= grades.indexOf(seen);\n}\n\nfunction validateGrade(val) {\n  val = val.toUpperCase();\n  if (grades.indexOf(val) >= 0) {\n    return val;\n  } else {\n    throw new Error(\"invalid grade: \" + val);\n  }\n}\n\nfunction openSite(url) {\n  logger.log(f.link(url));\n}\n\nfunction filterNegativeScores(scores) {\n  function isNegative(k) {\n    return scores[k].score_modifier < 0;\n  }\n  return Object.keys(scores).filter(isNegative);\n}\n\nfunction promiseReport(scan, options) {\n  var url = API_URL + \"getScanResults?scan=\" + scan.scan_id;\n\n  return rp({\n    url: url,\n    json: true,\n    simple: true\n  }).then(function(reportData) {\n    return formatAnswer(reportData, url, scan, options);\n  });\n}\n\nfunction formatAnswersCsv(scores, url, scan, options) {\n  // print(\"[{modifier:>4}] {reason}\".format(modifier=score[0], reason=score[1].replace(\"\"\",\"\\\\\"\")))\n\n  function sortByScore(a, b) {\n    return a.score_modifier - b.score_modifier;\n  }\n\n  var longest = longestInList(Object.keys(scores));\n\n  var scoresList = [];\n  for (var k in scores) {\n    scoresList.push(scores[k]);\n  }\n\n  // sort and invert to positive\n  scoresList.sort(sortByScore);\n\n  console.log(\"\\n%s: %s\", f.header(\"HTTP Observatory Report\"), options.site);\n\n  console.log(\"\\n%s %s  %s\", f.header(\"Score\"), f.header(padright(\"Rule\",longest)), f.header(\"Description\"));\n\n  scoresList.map(function(score) {\n    var points = score.score_modifier;\n    var fmt = f.plain;\n    if (points > 0) { fmt = f.info; }\n    if (points < 0) { fmt = f.error; }\n\n    var firstSentence = score.score_description.split(\". \")[0];\n    console.log(sprintf(\"%5f %s  %s.\", score.score_modifier, fmt(padright(score.name, longest)), firstSentence));\n  });\n\n  var fullReportUrl = \"https://observatory.mozilla.org/analyze/\" + options.site;\n\n  if (Object.keys(options.skip).length) {\n    console.log(\"\\nScore: %s (modified due to --skip)\", scan.score);\n  } else {\n    console.log(\"\\nScore: %s\", scan.score);\n  }\n  console.log(\"Grade: %s\", scan.grade);\n\n  console.log(sprintf(\"\\n%s: %s\\n\", f.header(\"Full Report Url\"), f.link(fullReportUrl)));\n}\n\nfunction handleNagiosMode(options, scan, scores) {\n  // https://github.com/mozilla/http-observatory-cli/issues/6\n\n  var nagiosExitCodes = {\n    1: \"WARNING\",\n    2: \"CRITICAL\",\n    3: \"UNKNOWN\"\n  };\n\n  if (!(options.nagios in nagiosExitCodes)) {\n    throw new Error(\"nagios exit code must be in %s\", Object.keys(nagiosExitCodes).join(\"|\"));\n  }\n  var codeName = nagiosExitCodes[options.nagios];\n\n  var negatives = filterNegativeScores(scores);\n\n  function OK() {\n    console.log(\"OK\");\n    process.exit(0);\n  }\n\n  function FAIL() {\n    console.log(\"%s %j\", codeName, negatives);\n    process.exit(codeName);\n  }\n\n  if (options.minGrade || (options.minScore !== undefined)) {\n    try {\n      handleExpectedScore(options, scan);\n      OK();\n    } catch (err) {\n      FAIL();\n    }\n    return;\n  } else {\n    if (negatives.length) {\n      FAIL();\n    } else {\n      OK();\n    }\n  }\n}\n\nfunction handleExpectedScore(options, scan) {\n  // side cases\n  var mingrade = options.minGrade;\n  var minscore = options.minScore;\n\n  if (mingrade) {\n    if (!gradeCompare(scan.grade, mingrade)) {\n      throw new Error(sprintf(\"bad grade.  wanted %s, got %s\", mingrade, scan.grade));\n    }\n  }\n  if (minscore !== undefined) {\n    if (scan.score < minscore) {\n      throw new Error(sprintf(\"bad score.  wanted %s, got %s\", minscore, scan.score));\n    }\n  }\n  return;\n}\n\nfunction formatAnswer(reportData, url, scan, options) {\n  /** Reporting: */\n  var scores = {};\n  /* filter out --zeros, and --skip or not */\n  for (var k in reportData) {\n    var v = reportData[k];\n    // --zero\n    if (v.score_modifier !== 0 || options.zero) {\n      // --skip\n      if (k in options.skip) { continue; }\n\n      // actually copy\n      scores[k] = v;\n    }\n  }\n\n  // rescore\n  var newScore = 100;\n  for (k in scores) {\n    newScore += scores[k].score_modifier;\n  }\n\n  if (Object.keys(options.skip).length) {\n    logger.info(\"modfiying score, because of --skip.  was: %s, now: %s\", f.info(scan.score), f.info(newScore));\n    scan.score = newScore;\n  }\n\n  if (options.nagios !== undefined) {\n    // nagios has\n    try {\n      handleNagiosMode(options, scan, scores);\n    } catch (err) {\n      logger.error(err);\n      process.exit(1);\n    }\n  }\n\n  if (options.minGrade || (options.minScore !== undefined)) {\n    try {\n      handleExpectedScore(options, scan);\n    } catch (err) {\n      logger.error(err);\n      process.exit(1);\n    }\n    return;\n  }\n\n  FORMATS[options.format || \"json\"].action(scores, url, scan, options);\n}\n\nvar passedOn = [];\nfunction preprocess(args) {\n  var dashed = false;\n  var out = [];\n  args.forEach(function(a) {\n    if (a === \"--\") {\n      dashed = true;\n      return;\n    }\n    if (dashed) {\n      passedOn.push(a);\n    } else {\n      out.push(a);\n    }\n  });\n  return out;\n}\n\nclass Observatory {\n  handleNoSite (options) {\n    if (options.tls) {\n      logger.info(\"--tls is not yet implemented.\");\n      logger.info(\"website:   \", f.link(\"https://observatory.mozilla.org/\"));\n      logger.info(\"go client: \", f.link(\"https://github.com/mozilla/tls-observatory\"));\n      logger.info(\"comment:    %s\", f.link(\"https://github.com/mozilla/observatory-cli/issues/5\"));\n      return;\n    }\n\n    // require site for everything else\n    logger.error(f.error(\"no <site> given\"));\n    return program.help();\n  }\n}\n\nlet O = new Observatory();\n\nprogram\n  .version(require(\"./package.json\").version)\n  .description(util.format(\"cli for interacting with Mozilla HTTP Observatory \\n\\n  %s\", f.link(SITE_URL)));\n\nprogram\n  //.command(\"check <site>\")\n  .arguments(\"<site>\")\n  .option(\"--format [format]\", util.format(\"format for output.  choice:  (%s).  `json` is default\",\n    f.code(Object.keys(FORMATS).join(\"|\"))),\n    validateFormatChoice)\n  .option(\"--min-grade <grade>\", \"testing: this grade or better, or exit(1)\", validateGrade)\n  .option(\"--min-score <score>\", \"testing: this score or better, or exit(1)\", Number)\n  .option(\"--nagios [failcode]\", \"nagios mode, exits with [failcode] on failure\", Number)\n  .option(\"--rescan\", \"initiate a rescan instead of showing recent scan results\")\n  .option(\"-z, --zero\", \"show test results that don't affect the final score\")\n  .option(\"--attempts <n>\", \"number of attempts to try before failing\", Number)\n  .option(\"--api-version [version]\", \"api version:  defaults to 1\", Number)\n  .option(\"--skip <rule>\", \"skip rules by name.  works with min-score only\", collect, {})\n  .option(\"--tls\", \"do tls checks instead\")\n  .option(\"-q, --quiet\", \"turns off all logging\", function() {QUIET = true;})\n\n  .action(function mainAction(site, options) {\n    // everything here has a site\n    hasSite = true;\n\n    if (helpAnywhere(options.rawArgs)) {\n      program.help();\n    }\n\n    options.site = site; // stuff it in.\n\n    if (options.tls) {\n      return O.handleNoSite(options);\n    }\n    if (options.format === \"url\") {\n      return openSite(util.format(\"https://observatory.mozilla.org/analyze.html?host=%s\", site));\n    }\n\n    var api = options.apiVersion;\n    if (api && api !== 1) {\n      logger.error(sprintf(\"V1 is only API supported, not %s\", api));\n      process.exit(1);\n    }\n\n    var scanner = new Scanner(site, options);\n    scanner.promiseScan(site, options)\n      .then(function(reportId) {\n        return promiseReport(reportId, options);\n      })\n      .catch(function(err) {\n        logger.error(err.message);\n        process.exit(1);\n      });\n  });\n\nfunction newHelp() {\n  var longest = longestInList(Object.keys(FORMATS));\n\n  var out =\n    f.header(\"\\n  Output Formats \") + f.code(\"(--format)\") + \"\\n\" +\n\n    Object.keys(FORMATS).map(\n      function(k) {\n        return util.format(\"    - %s  %s\\n\",\n          f.info(padright(k, longest)),\n          FORMATS[k].description\n        );\n      }).join(\"\") +\n\n    \"\\n\\n\" +\n\n    f.header(\"  Nagios Mode\") + \" \" + f.code(\"(--nagios)\") +\n    \"\\n\" +\n    \"    - if `--min-score` and/or `--min-grade`, use those.\\n\" +\n    \"    - else *any* negative rules fail the check.\\n\" +\n    \"    - exits with integer `failcode`.\\n\";\n\n  return out;\n}\n\nprogram.on(\"--help\", function() {\n  console.log(newHelp());\n});\n\nprogram.parse(preprocess(process.argv));\nif (!hasSite) {\n  O.handleNoSite(program);\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"observatory-cli\",\n  \"description\": \"Command line client for Mozilla HTTP observatory service\",\n  \"version\": \"0.7.1\",\n  \"author\": \"Gregg Lind <glind@mozilla.com>\",\n  \"bin\": {\n    \"observatory\": \"./index.js\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/mozilla/observatory-cli/issues\"\n  },\n  \"dependencies\": {\n    \"chalk\": \"^1.1.3\",\n    \"clim\": \"^1.1.1\",\n    \"commander\": \"^2.9.0\",\n    \"request\": \"^2.74.0\",\n    \"request-promise\": \"^4.1.1\",\n    \"sprintf-js\": \"^1.0.3\",\n    \"timeout-as-promise\": \"^1.0.0\"\n  },\n  \"devDependencies\": {\n    \"depcheck\": \"^0.6.4\",\n    \"eslint\": \"^3.5.0\",\n    \"eslint-plugin-node\": \"^2.1.2\",\n    \"eslint-plugin-promise\": \"^3.0.0\",\n    \"fixpack\": \"^2.3.1\",\n    \"npm-run-all\": \"^3.1.0\",\n    \"nsp\": \"^2.6.1\"\n  },\n  \"engines\": {\n    \"node\": \">=6\"\n  },\n  \"homepage\": \"https://github.com/mozilla/observatory-cli#readme\",\n  \"keywords\": [\n    \"https\",\n    \"mozilla\",\n    \"security\"\n  ],\n  \"license\": \"MPL-2.0\",\n  \"main\": \"index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/mozilla/observatory-cli.git\"\n  },\n  \"scripts\": {\n    \"lint\": \"npm-run-all lint:*\",\n    \"lint:depcheck\": \"depcheck --ignores=nsp,eslint-*\",\n    \"lint:eslint\": \"eslint .\",\n    \"lint:fixpack\": \"fixpack\",\n    \"lint:nsp\": \"nsp check -o summary\",\n    \"prepublish\": \"npm shrinkwrap\",\n    \"pretest\": \"npm run lint\",\n    \"test\": \"echo OK\"\n  }\n}\n"
  },
  {
    "path": "shell_functions/bash_completion/observatory.bash",
    "content": "# bash completion for observatory-cli\n# Author: Jeremy Young\n# Asurion 10/10/2016\n\n_observatory_completion () {\n\tlocal CUR=${COMP_WORDS[COMP_CWORD]}\n\tlocal PREV=${COMP_WORDS[COMP_CWORD-1]}\n\tlocal OPTIONS_ALL=\"-h -V -z -q --help --version --format --min-grade --min-score --nagios \\\n--rescan --zero --attempts --api-version --skip --tls --quiet\"\n\tlocal OPTIONS_BLANK=\"\"\n  local OPTIONS_FORMAT=\"json report csv url\"\n  local OPTIONS_GRADE=\"F D- D D+ C- C C+ B- B B+ A- A A+\"\n\n\tcase $PREV in\n\t\t-h|--help)\n\t\t\tCOMPREPLY=( $( compgen -W \"${OPTIONS_BLANK}\" -- \"${CUR}\" ) )\n\t\t\treturn 0\n\t\t\t;;\n\t\t-V|--version)\n\t\t\tCOMPREPLY=( $( compgen -W \"${OPTIONS_BLANK}\" -- \"${CUR}\" ) )\n\t\t\treturn 0\n\t\t\t;;\n\t\t--format)\n\t\t\tCOMPREPLY=( $( compgen -W \"${OPTIONS_FORMAT}\" -- \"${CUR}\" ) )\n\t\t\treturn 0\n\t\t\t;;\n\t\t--min-grade)\n\t\t\tCOMPREPLY=( $( compgen -W \"${OPTIONS_GRADE}\" -- \"${CUR}\" ) )\n\t\t\t;;\n    --min-score)\n      COMPREPLY=( $( compgen -W \"$( seq 1 100 )\" -- \"${CUR}\" ) )\n      ;;\n    --nagios)\n\t\t\t## https://github.com/mozilla/observatory-cli/blob/master/index.js#L262\n      COMPREPLY=( $( compgen -W \"$( seq 1 3 )\" -- \"${CUR}\" ) )\n      ;;\n    --rescan)\n      COMPREPLY=( $( compgen -W \"${OPTIONS_BLANK}\" -- \"${CUR}\" ) )\n      ;;\n    -z|--zero)\n      COMPREPLY=( $( compgen -W \"${OPTIONS_BLANK}\" -- \"${CUR}\" ) )\n      ;;\n    --attempts)\n      ## 100 seems like a nice place to stop to determine if there was a failure connecting.\n      COMPREPLY=( $( compgen -W \"$( seq 1 100 )\" -- \"${CUR}\" ) )\n      ;;\n    --api-version)\n      ## Picking some ending value arbitrarily.  5 API versions is probably a lot.\n      COMPREPLY=( $( compgen -W \"$( seq 1 5 )\" -- \"${CUR}\" ) )\n      ;;\n    --skip)\n      COMPREPLY=( $( compgen -W \"${OPTIONS_SKIP}\" -- \"${CUR}\" ) )\n      ;;\n    --tls)\n      COMPREPLY=( $( compgen -W \"${OPTIONS_BLANK}\" -- \"${CUR}\" ) )\n      ;;\n    -q|--quiet)\n      COMPREPLY=( $( compgen -W \"${OPTIONS_BLANK}\" -- \"${CUR}\" ) )\n      ;;\n\t\t*)\n\t\t\tif [[ \"${CUR}\" == * ]]; then\n\t\t\t\tCOMPREPLY=( $( compgen -W \"${OPTIONS_ALL}\" -- \"${CUR}\" ) )\n\t\t\tfi\n\t\t\treturn 0\n\t\t\t;;\n\tesac\n}\n\ncomplete -F _observatory_completion observatory\n"
  },
  {
    "path": "shell_functions/docker_perms.sh",
    "content": "_check_docker_sock_perms () {\n  local DOCKER_SOCKET=/var/run/docker.sock\n\n  case \"$( uname )\" in\n    Linux)\n      if [[ ! -w \"${DOCKER_SOCKET}\" ]]; then\n          sudo setfacl -m u:$( whoami ):rw \"${DOCKER_SOCKET}\"\n      fi\n    ;;\n    Darwin)\n      if [[ ! -w \"${DOCKER_SOCKET}\" ]]; then\n          sudo chmod a+w \"${DOCKER_SOCKET}\"\n      fi\n    ;;\n    *)\n    ;;\n  esac\n}\n\n_check_docker_image_installed () {\n  local DOCKER_IMAGE=\"${1}\";\n  local DOCKER_REPO=\"$( echo ${DOCKER_IMAGE} | cut -d : -f 1 )\";\n  local DOCKER_TAG=\"$( echo ${DOCKER_IMAGE} | cut -d : -f 2 )\";\n\n  if [[ -n \"${DOCKER_TAG}\" ]]; then\n      if [[ \"$( docker images | grep -i \"${DOCKER_TAG}\" | grep -i \"${DOCKER_REPO}\" &>/dev/null; echo $? )\" != \"0\" ]]; then\n          printf \"Pulling \"${DOCKER_IMAGE}\" for use...\\n\";\n          docker pull \"${DOCKER_IMAGE}\" &> /dev/null;\n      fi;\n  else\n      if [[ \"$( docker images | grep -i \"${DOCKER_REPO}\" &>/dev/null; echo $? )\" != \"0\" ]]; then\n          printf \"Pulling \"${DOCKER_IMAGE}\" for use...\\n\";\n          docker pull \"${DOCKER_IMAGE}\" &> /dev/null;\n      fi;\n  fi\n}\n"
  },
  {
    "path": "shell_functions/observatory.sh",
    "content": "observatory () {\n  local DOCKER_IMAGE=\"mozilla/observatory-cli\"\n  local OBSERVATORY_NETWORK=\"$( docker network ls | grep observatory | awk '{print $2}' )\"\n  local OBSERVATORY_API=\"$( docker ps | grep website | awk '{print $NF}' )\"\n  local COMMAND=\"docker run --rm -it --name observatory-cli --net=$OBSERVATORY_NETWORK -e HTTPOBS_API_URL=http://$OBSERVATORY_API:57001/api/v1/ --link $OBSERVATORY_API\"\n  local NOBACKEND_COMMAND=\"docker run --rm -it --name observatory-cli\"\n  local ARGS=\"${@}\"\n\n  ## Allow entering the container to test by hand\n  case \"${1}\" in\n    debug)\n      COMMAND=\"${COMMAND} --entrypoint=/bin/ash --user=root\"\n      unset ARGS\n    ;;\n  esac\n\n  _check_docker_sock_perms\n  _check_docker_image_installed \"${DOCKER_IMAGE}\"\n\n  ## Check to see if we're running HTTP Observatory in containers.  If not, use default public instance.\n  if [[ -z \"$( docker ps | grep website | awk '{print $NF}' )\" ]]; then\n    COMMAND=\"${NOBACKEND_COMMAND}\"\n  fi\n\n  ${COMMAND} ${DOCKER_IMAGE} ${ARGS}\n}\n"
  }
]