@grafana/plugin-validator 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +39 -16
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -22,7 +22,7 @@ Ensure that your version of Go matches the one specified in the `go.mod` file to
22
22
  It is easiest to run the tool using the Docker image as it contains all the [security scanning tools](#security-tools) needed for the full set of analyzers - so you don't need to have these additional tools installed on your system.
23
23
 
24
24
  ```SHELL
25
- docker run --pull=always grafana/plugin-validator-cli [options] [path/to/plugin_archive.zip]
25
+ docker run --pull=always grafana/plugin-validator-cli [options] [http://yourdomain/plugin_archive.zip]
26
26
  ```
27
27
 
28
28
  #### Example 1 (basic)
@@ -37,6 +37,26 @@ docker run --pull=always grafana/plugin-validator-cli https://github.com/grafana
37
37
  docker run --pull=always grafana/plugin-validator-cli -sourceCodeUri https://github.com/grafana/clock-panel/tree/v2.1.2 https://github.com/grafana/clock-panel/releases/download/v2.1.2/grafana-clock-panel-2.1.2.zip
38
38
  ```
39
39
 
40
+ #### Using a local archive file with Docker
41
+
42
+ To run the tool with a local archive you will need to mount it as a docker volume. Here's an example:
43
+
44
+ ```SHELL
45
+ docker run --pull=always -v /path/to/plugin_archive.zip:/archive.zip grafana/plugin-validator-cli /archive.zip
46
+ ```
47
+
48
+ > [!NOTE]
49
+ > If using relative paths your path must start with `./`
50
+
51
+ #### Using a local archive file and local source code
52
+
53
+ ```SHELL
54
+ docker run --pull=always -v /path/to/plugin_archive.zip:/archive.zip -v /path/to/source_code:/source_code grafana/plugin-validator-cli -sourceCodeUri /source_code /archive.zip
55
+ ```
56
+
57
+ > [!NOTE]
58
+ > If using relative paths your path must start with `./`
59
+
40
60
  ### NPX
41
61
 
42
62
  ```SHELL
@@ -89,6 +109,8 @@ Usage plugincheck2:
89
109
  URI to the source code of the plugin. If set, the source code will be downloaded and analyzed. This can be a ZIP file URL, a URL to git repository or a local file (starting with `file://`)
90
110
  -strict (optional)
91
111
  If set, plugincheck returns non-zero exit code for warnings
112
+ -checksum string (optional)
113
+ If set, the checksum of the plugin archive will be checked against this value. MD5 and SHA256 are supported.
92
114
 
93
115
  ```
94
116
 
@@ -193,39 +215,40 @@ The tool runs a series of analyzers to ensure submitted plugins are following be
193
215
  | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
194
216
  | Archive Structure / `archive` | Ensures the contents of the zip file have the expected layout. | None |
195
217
  | Archive Name / `archivename` | The name of the archive should be correctly formatted. | None |
196
- | Backend Binary / `backendbinary` | Validates the consistency between the existence of a binary file and plugin.json declarations for backend or alerting. | None |
218
+ | Backend Binary / `backendbinary` | Validates the consistency between the existence of a binary file and plugin.json declarations for backend or alerting. | None |
197
219
  | Backend Debug / `backenddebug` | Checks that the standalone debug files for backend plugins are not present. | None |
198
220
  | Binary Permissions / `binarypermissions` | For datasources and apps with binaries, this ensures the plugin can run when extracted on a system. | None |
199
- | Broken Links / `brokenlinks` | Detects if any URL doesn't resolve to a valid location. | None |
200
- | Checksum / `checksum` | Validates that the passed checksum (as a validator arg) is the one calculated from the archive file. | `checksum` |
221
+ | Broken Links / `brokenlinks` | Detects if any URL doesn't resolve to a valid location. | None |
222
+ | Checksum / `checksum` | Validates that the passed checksum (as a validator arg) is the one calculated from the archive file. | `checksum` |
201
223
  | Code Rules / `coderules` | Checks for forbidden access to environment variables, file system or use of `syscall` module. | [semgrep](https://github.com/returntocorp/semgrep), `sourceCodeUri` |
202
- | Discoverability / `discoverability` | Warns about missing keywords and description that are used for plugin indexing in the catalog. | None |
224
+ | Discoverability / `discoverability` | Warns about missing keywords and description that are used for plugin indexing in the catalog. | None |
203
225
  | Go Manifest / `gomanifest` | Validates the build manifest. | `sourceCodeUri` |
204
226
  | Go Security Checker / `gosec` | Inspects source code for security problems by scanning the Go AST. | [gosec](https://github.com/securego/gosec), `sourceCodeUri` |
205
- | Developer Jargon / `jargon` | Generally discourages use of code jargon in the documentation. | None |
206
- | JS Source Map / `jssourcemap` | Checks for required `module.js.map` file(s) in archive. | `sourceCodeUri` |
207
- | Legacy Grafana Toolkit usage / `legacybuilder` | Detects the usage of the not longer supported Grafana Toolkit. | None |
227
+ | Nested includes metadata / `includesnested` | Validates that nested plugins have the correct metadata. | |
228
+ | Developer Jargon / `jargon` | Generally discourages use of code jargon in the documentation. | None |
229
+ | JS Source Map / `jssourcemap` | Checks for required `module.js.map` file(s) in archive. | `sourceCodeUri` |
230
+ | Legacy Grafana Toolkit usage / `legacybuilder` | Detects the usage of the not longer supported Grafana Toolkit. | None |
208
231
  | Legacy Platform / `legacyplatform` | Detects use of Angular which is deprecated. | None |
209
232
  | License Type / `license` | Checks the declared license is one of: BSD, MIT, Apache 2.0, LGPL3, GPL3, AGPL3. | None |
210
- | Logos / `logos` | Detects whether the plugin includes small and large logos to display in the plugin catalog. | none |
211
- | Manifest (Signing) / `manifest` | When a plugin is signed, the zip file will contain a signed `MANIFEST.txt` file. | None |
233
+ | Logos / `logos` | Detects whether the plugin includes small and large logos to display in the plugin catalog. | none |
234
+ | Manifest (Signing) / `manifest` | When a plugin is signed, the zip file will contain a signed `MANIFEST.txt` file. | None |
212
235
  | Metadata Paths / `metadatapaths` | Ensures all paths are valid and images referenced exist. | None |
213
236
  | Metadata Validity / `metadatavalid` | Ensures metadata is valid and matches plugin schema. | None |
214
- | module.js (exists) / `modulejs` | All plugins require a `module.js` to be loaded. | None |
237
+ | module.js (exists) / `modulejs` | All plugins require a `module.js` to be loaded. | None |
215
238
  | Organization (exists) / `org` | Verifies the org specified in the plugin ID exists. | None |
216
239
  | Vulnerability Scanner / `osv-scanner` | Detects critical vulnerabilities in Go modules and yarn lock files. | [osv-scanner](https://github.com/google/osv-scanner), `sourceCodeUri` |
217
240
  | Plugin Name formatting / `pluginname` | Validates the plugin ID used conforms to our naming convention. | None |
218
- | Published / `published` | Detects whether any version of this plugin exists in the Grafana plugin catalog currently. | None |
219
- | Readme (exists) / `readme` | Ensures a `README.md` file exists within the zip file. | None |
241
+ | Published / `published` | Detects whether any version of this plugin exists in the Grafana plugin catalog currently. | None |
242
+ | Readme (exists) / `readme` | Ensures a `README.md` file exists within the zip file. | None |
220
243
  | Restrictive Dependency / `restrictivedep` | Specifies a valid range of Grafana versions that work with this version of the plugin. | None |
221
- | Screenshots / `screenshots` | Screenshots are specified in `plugin.json` that will be used in the Grafana plugin catalog. | None |
244
+ | Screenshots / `screenshots` | Screenshots are specified in `plugin.json` that will be used in the Grafana plugin catalog. | None |
222
245
  | Signature / `signature` | Ensures the plugin has a valid signature. | None |
223
246
  | !Source Code / `sourcecode` | A comparison is made between the zip file and the source code to ensure what is released matches the repo associated with it. | `sourceCodeUri` |
224
- | Unique README.md / `templatereadme` | Ensures the plugin doesn't re-use the template from the `create-plugin` tool. | None |
247
+ | Unique README.md / `templatereadme` | Ensures the plugin doesn't re-use the template from the `create-plugin` tool. | None |
225
248
  | No Tracking Scripts / `trackingscripts` | Detects if there are any known tracking scripts, which are not allowed. | None |
226
249
  | Type Suffix (panel/app/datasource) / `typesuffix` | Ensures the plugin has a valid type specified. | None |
227
250
  | Version / `version` | Ensures the version submitted is newer than the currently published plugin. If this is a new/unpublished plugin, this is skipped. | None |
228
- | Unsafe SVG / `unsafesvg` | Checks if any svg files are safe based on a whitelist of elements and attributes. | none |
251
+ | Unsafe SVG / `unsafesvg` | Checks if any svg files are safe based on a whitelist of elements and attributes. | none |
229
252
 
230
253
  ## Output
231
254
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/plugin-validator",
3
- "version": "0.16.1",
3
+ "version": "0.17.0",
4
4
  "description": "Grafana Plugin Validator",
5
5
  "main": "index.js",
6
6
  "scripts": {