@backstage/plugin-proxy-backend 0.4.0-next.3 → 0.4.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,5 +1,36 @@
1
1
  # @backstage/plugin-proxy-backend
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 71114ac50e02: **BREAKING**: The export for the new backend system has been moved to be the `default` export.
8
+
9
+ For example, if you are currently importing the plugin using the following pattern:
10
+
11
+ ```ts
12
+ import { examplePlugin } from '@backstage/plugin-example-backend';
13
+
14
+ backend.add(examplePlugin);
15
+ ```
16
+
17
+ It should be migrated to this:
18
+
19
+ ```ts
20
+ backend.add(import('@backstage/plugin-example-backend'));
21
+ ```
22
+
23
+ ### Patch Changes
24
+
25
+ - 02ba0a2efd2a: Add the route name to an error message that appears when the backend
26
+ proxy wasn't well configured. This will help users to understand the
27
+ issue and fix the right configuration.
28
+ - 03691f0f3270: Add back the legacy proxy config, to get secret redaction
29
+ - Updated dependencies
30
+ - @backstage/backend-common@0.19.5
31
+ - @backstage/config@1.1.0
32
+ - @backstage/backend-plugin-api@0.6.3
33
+
3
34
  ## 0.4.0-next.3
4
35
 
5
36
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-proxy-backend",
3
- "version": "0.4.0-next.3",
3
+ "version": "0.4.0",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
package/config.d.ts CHANGED
@@ -73,5 +73,54 @@ export interface Config {
73
73
  allowedHeaders?: string[];
74
74
  };
75
75
  };
76
+ } & {
77
+ /**
78
+ * This was the legacy way of expressing proxies, and is now deprecated. We
79
+ * keep it around in the config schema, to ensure that legacy setups still
80
+ * have properly secret-marked values so that they get redacted.
81
+ *
82
+ * TODO(freben): Remove this in the future (suggestion: after 2024-03-01)
83
+ * when people likely have moved off of this format.
84
+ */
85
+ [key: string]:
86
+ | string
87
+ | {
88
+ /**
89
+ * Target of the proxy. Url string to be parsed with the url module.
90
+ */
91
+ target: string;
92
+ /**
93
+ * Object with extra headers to be added to target requests.
94
+ */
95
+ headers?: {
96
+ /** @visibility secret */
97
+ Authorization?: string;
98
+ /** @visibility secret */
99
+ authorization?: string;
100
+ /** @visibility secret */
101
+ 'X-Api-Key'?: string;
102
+ /** @visibility secret */
103
+ 'x-api-key'?: string;
104
+ [key: string]: string | undefined;
105
+ };
106
+ /**
107
+ * Changes the origin of the host header to the target URL. Default: true.
108
+ */
109
+ changeOrigin?: boolean;
110
+ /**
111
+ * Rewrite target's url path. Object-keys will be used as RegExp to match paths.
112
+ * If pathRewrite is not specified, it is set to a single rewrite that removes the entire prefix and route.
113
+ */
114
+ pathRewrite?: { [regexp: string]: string };
115
+ /**
116
+ * Limit the forwarded HTTP methods, for example allowedMethods: ['GET'] to enforce read-only access.
117
+ */
118
+ allowedMethods?: string[];
119
+ /**
120
+ * Limit the forwarded HTTP methods. By default, only the headers that are considered safe for CORS
121
+ * and headers that are set by the proxy will be forwarded.
122
+ */
123
+ allowedHeaders?: string[];
124
+ };
76
125
  };
77
126
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-proxy-backend",
3
3
  "description": "A Backstage backend plugin that helps you set up proxy endpoints in the backend",
4
- "version": "0.4.0-next.3",
4
+ "version": "0.4.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -33,9 +33,9 @@
33
33
  "clean": "backstage-cli package clean"
34
34
  },
35
35
  "dependencies": {
36
- "@backstage/backend-common": "^0.19.5-next.3",
37
- "@backstage/backend-plugin-api": "^0.6.3-next.3",
38
- "@backstage/config": "^1.1.0-next.2",
36
+ "@backstage/backend-common": "^0.19.5",
37
+ "@backstage/backend-plugin-api": "^0.6.3",
38
+ "@backstage/config": "^1.1.0",
39
39
  "@types/express": "^4.17.6",
40
40
  "express": "^4.17.1",
41
41
  "express-promise-router": "^4.1.0",
@@ -48,9 +48,9 @@
48
48
  "yup": "^0.32.9"
49
49
  },
50
50
  "devDependencies": {
51
- "@backstage/backend-test-utils": "^0.2.3-next.3",
52
- "@backstage/cli": "^0.22.13-next.3",
53
- "@backstage/config-loader": "^1.5.0-next.3",
51
+ "@backstage/backend-test-utils": "^0.2.3",
52
+ "@backstage/cli": "^0.22.13",
53
+ "@backstage/config-loader": "^1.5.0",
54
54
  "@types/http-proxy-middleware": "^0.19.3",
55
55
  "@types/supertest": "^2.0.8",
56
56
  "@types/uuid": "^8.0.0",