@grafana/sign-plugin 1.1.0-canary.331.cc6e77d.0 → 1.1.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # v1.1.0 (Mon Aug 07 2023)
2
+
3
+ :tada: This release contains work from a new contributor! :tada:
4
+
5
+ Thank you, Yulia Shanyrova ([@Ukochka](https://github.com/Ukochka)), for all your work!
6
+
7
+ #### 🚀 Enhancement
8
+
9
+ - sign-plugin: GRAFANA_ACESS_POLICY_TOKEN has been added instead of GRAFANA_API_KEY [#331](https://github.com/grafana/plugin-tools/pull/331) ([@Ukochka](https://github.com/Ukochka))
10
+
11
+ #### Authors: 1
12
+
13
+ - Yulia Shanyrova ([@Ukochka](https://github.com/Ukochka))
14
+
15
+ ---
16
+
1
17
  # v1.0.3 (Mon Jul 10 2023)
2
18
 
3
19
  #### 🐛 Bug Fix
package/README.md CHANGED
@@ -26,17 +26,17 @@ Please refer to [Signing plugins documentation](https://grafana.com/docs/grafana
26
26
 
27
27
  ### Sign a public plugin
28
28
 
29
- In your plugin directory, sign the plugin with your Grafana API key. Grafana sign-plugin creates a MANIFEST.txt file in the dist directory of your plugin.
29
+ In your plugin directory, sign the plugin with your Grafana access policy token. Grafana sign-plugin creates a MANIFEST.txt file in the dist directory of your plugin.
30
30
 
31
31
  ```bash
32
- export GRAFANA_API_KEY=<YOUR_API_KEY>
32
+ export GRAFANA_ACCESS_POLICY_TOKEN=<YOUR_GRAFANA_ACCESS_POLICY_TOKEN>
33
33
  npx @grafana/sign-plugin@latest
34
34
  ```
35
35
 
36
36
  If the plugin distribution directory differs from the default `dist`, specify the path to use with the `--distDir` flag.
37
37
 
38
38
  ```bash
39
- export GRAFANA_API_KEY=<YOUR_API_KEY>
39
+ export GRAFANA_ACCESS_POLICY_TOKEN=<YOUR_GRAFANA_ACCESS_POLICY_TOKEN>
40
40
  npx @grafana/sign-plugin@latest --distDir path/to/directory
41
41
  ```
42
42
 
@@ -218,13 +218,11 @@ function signManifest(manifest) {
218
218
  case 0:
219
219
  GRAFANA_API_KEY = process.env.GRAFANA_API_KEY;
220
220
  GRAFANA_ACCESS_POLICY_TOKEN = process.env.GRAFANA_ACCESS_POLICY_TOKEN;
221
- if (!GRAFANA_ACCESS_POLICY_TOKEN) {
222
- if (!GRAFANA_API_KEY) {
223
- throw new Error('You must create a GRAFANA_ACCESS_POLICY_TOKEN env variable to sign plugins. Please see: https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/#generate-an-api-key for instructions.');
224
- }
225
- else {
226
- console.warn("\u001B[33m%s\u001B[0m", 'The usage of GRAFANA_API_KEY is deprecated, please consider using GRAFANA_ACCESS_POLICY_TOKEN instead. For more info visit https://grafana.com/docs/grafana/latest/developers/plugins/publish-a-plugin/sign-a-plugin');
227
- }
221
+ if (!GRAFANA_ACCESS_POLICY_TOKEN && !GRAFANA_API_KEY) {
222
+ throw new Error('You must create a GRAFANA_ACCESS_POLICY_TOKEN env variable to sign plugins. Please see: https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/#generate-a-token for instructions.');
223
+ }
224
+ if (GRAFANA_API_KEY) {
225
+ console.warn("\u001B[33m%s\u001B[0m", 'The usage of GRAFANA_API_KEY is deprecated, please consider using GRAFANA_ACCESS_POLICY_TOKEN instead. For more info visit https://grafana.com/docs/grafana/latest/developers/plugins/publish-a-plugin/sign-a-plugin');
228
226
  }
229
227
  GRAFANA_COM_URL = process.env.GRAFANA_COM_URL || 'https://grafana.com/api';
230
228
  url = GRAFANA_COM_URL + '/plugins/ci/sign';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/sign-plugin",
3
- "version": "1.1.0-canary.331.cc6e77d.0",
3
+ "version": "1.1.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "directory": "packages/sign-plugin",
@@ -40,5 +40,5 @@
40
40
  "engines": {
41
41
  "node": ">=16"
42
42
  },
43
- "gitHead": "cc6e77d2b730dfe44c297e567dbf536c6643e4c7"
43
+ "gitHead": "85bae17e8637567be338933541d02d811d314251"
44
44
  }
@@ -78,15 +78,13 @@ export async function signManifest(manifest: ManifestInfo): Promise<string> {
78
78
  const GRAFANA_API_KEY = process.env.GRAFANA_API_KEY;
79
79
  const GRAFANA_ACCESS_POLICY_TOKEN = process.env.GRAFANA_ACCESS_POLICY_TOKEN;
80
80
 
81
- if(!GRAFANA_ACCESS_POLICY_TOKEN) {
82
- if (!GRAFANA_API_KEY) {
83
- throw new Error(
84
- 'You must create a GRAFANA_ACCESS_POLICY_TOKEN env variable to sign plugins. Please see: https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/#generate-an-api-key for instructions.'
85
- );
86
- }
87
- else {
88
- console.warn(`\x1b[33m%s\x1b[0m`,'The usage of GRAFANA_API_KEY is deprecated, please consider using GRAFANA_ACCESS_POLICY_TOKEN instead. For more info visit https://grafana.com/docs/grafana/latest/developers/plugins/publish-a-plugin/sign-a-plugin')
89
- }
81
+ if(!GRAFANA_ACCESS_POLICY_TOKEN && !GRAFANA_API_KEY) {
82
+ throw new Error(
83
+ 'You must create a GRAFANA_ACCESS_POLICY_TOKEN env variable to sign plugins. Please see: https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/#generate-a-token for instructions.'
84
+ );
85
+ }
86
+ if (GRAFANA_API_KEY) {
87
+ console.warn(`\x1b[33m%s\x1b[0m`,'The usage of GRAFANA_API_KEY is deprecated, please consider using GRAFANA_ACCESS_POLICY_TOKEN instead. For more info visit https://grafana.com/docs/grafana/latest/developers/plugins/publish-a-plugin/sign-a-plugin')
90
88
  }
91
89
 
92
90
  const GRAFANA_COM_URL = process.env.GRAFANA_COM_URL || 'https://grafana.com/api';