@backstage-community/plugin-3scale-backend 1.8.1
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 +374 -0
- package/README.md +136 -0
- package/alpha/package.json +6 -0
- package/app-config.yaml +11 -0
- package/config.d.ts +22 -0
- package/dist/alpha.cjs.js +39 -0
- package/dist/alpha.cjs.js.map +1 -0
- package/dist/alpha.d.ts +5 -0
- package/dist/cjs/ThreeScaleApiEntityProvider-B3TyzFXk.cjs.js +246 -0
- package/dist/cjs/ThreeScaleApiEntityProvider-B3TyzFXk.cjs.js.map +1 -0
- package/dist/index.cjs.js +28 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +132 -0
- package/package.json +81 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.8.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.7.1...@janus-idp/backstage-plugin-3scale-backend@1.8.0) (2024-07-25)
|
|
2
|
+
|
|
3
|
+
## 1.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3f259e2: The 3scale-backend plugin from the [janus-idp/backstage-plugins](https://github.com/janus-idp/backstage-plugins/tree/main/plugins/3scale-backend) repository was migrated to the community plugins. The migration was performed by following the manual migration steps outlined in the [Community Plugins CONTRIBUTING guide](https://github.com/backstage/community-plugins/blob/main/CONTRIBUTING.md#migrating-a-plugin)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **deps:** update to backstage 1.29 ([#1900](https://github.com/janus-idp/backstage-plugins/issues/1900)) ([f53677f](https://github.com/janus-idp/backstage-plugins/commit/f53677fb02d6df43a9de98c43a9f101a6db76802))
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
- **@janus-idp/cli:** upgraded to 1.13.0
|
|
16
|
+
|
|
17
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.7.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.7.0...@janus-idp/backstage-plugin-3scale-backend@1.7.1) (2024-07-23)
|
|
18
|
+
|
|
19
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.7.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.6.1...@janus-idp/backstage-plugin-3scale-backend@1.7.0) (2024-07-17)
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
- **deps:** update to backstage 1.28 ([#1891](https://github.com/janus-idp/backstage-plugins/issues/1891)) ([1ba1108](https://github.com/janus-idp/backstage-plugins/commit/1ba11088e0de60e90d138944267b83600dc446e5))
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
- **@janus-idp/cli:** upgraded to 1.12.0
|
|
28
|
+
|
|
29
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.6.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.6.0...@janus-idp/backstage-plugin-3scale-backend@1.6.1) (2024-06-19)
|
|
30
|
+
|
|
31
|
+
### Dependencies
|
|
32
|
+
|
|
33
|
+
- **@janus-idp/cli:** upgraded to 1.11.1
|
|
34
|
+
|
|
35
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.6.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.16...@janus-idp/backstage-plugin-3scale-backend@1.6.0) (2024-06-13)
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
- **deps:** update to backstage 1.27 ([#1683](https://github.com/janus-idp/backstage-plugins/issues/1683)) ([a14869c](https://github.com/janus-idp/backstage-plugins/commit/a14869c3f4177049cb8d6552b36c3ffd17e7997d))
|
|
40
|
+
|
|
41
|
+
### Dependencies
|
|
42
|
+
|
|
43
|
+
- **@janus-idp/cli:** upgraded to 1.11.0
|
|
44
|
+
|
|
45
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.16](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.15...@janus-idp/backstage-plugin-3scale-backend@1.5.16) (2024-06-13)
|
|
46
|
+
|
|
47
|
+
### Dependencies
|
|
48
|
+
|
|
49
|
+
- **@janus-idp/cli:** upgraded to 1.10.1
|
|
50
|
+
|
|
51
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.15](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.14...@janus-idp/backstage-plugin-3scale-backend@1.5.15) (2024-06-05)
|
|
52
|
+
|
|
53
|
+
### Dependencies
|
|
54
|
+
|
|
55
|
+
- **@janus-idp/cli:** upgraded to 1.10.0
|
|
56
|
+
|
|
57
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.14](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.13...@janus-idp/backstage-plugin-3scale-backend@1.5.14) (2024-06-04)
|
|
58
|
+
|
|
59
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.13](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.12...@janus-idp/backstage-plugin-3scale-backend@1.5.13) (2024-06-03)
|
|
60
|
+
|
|
61
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.12](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.11...@janus-idp/backstage-plugin-3scale-backend@1.5.12) (2024-06-03)
|
|
62
|
+
|
|
63
|
+
### Dependencies
|
|
64
|
+
|
|
65
|
+
- **@janus-idp/cli:** upgraded to 1.9.0
|
|
66
|
+
|
|
67
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.11](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.10...@janus-idp/backstage-plugin-3scale-backend@1.5.11) (2024-05-29)
|
|
68
|
+
|
|
69
|
+
### Dependencies
|
|
70
|
+
|
|
71
|
+
- **@janus-idp/cli:** upgraded to 1.8.10
|
|
72
|
+
|
|
73
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.10](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.9...@janus-idp/backstage-plugin-3scale-backend@1.5.10) (2024-05-29)
|
|
74
|
+
|
|
75
|
+
### Dependencies
|
|
76
|
+
|
|
77
|
+
- **@janus-idp/cli:** upgraded to 1.8.9
|
|
78
|
+
|
|
79
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.9](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.8...@janus-idp/backstage-plugin-3scale-backend@1.5.9) (2024-05-28)
|
|
80
|
+
|
|
81
|
+
### Dependencies
|
|
82
|
+
|
|
83
|
+
- **@janus-idp/cli:** upgraded to 1.8.8
|
|
84
|
+
|
|
85
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.8](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.7...@janus-idp/backstage-plugin-3scale-backend@1.5.8) (2024-05-17)
|
|
86
|
+
|
|
87
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.7](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.6...@janus-idp/backstage-plugin-3scale-backend@1.5.7) (2024-05-16)
|
|
88
|
+
|
|
89
|
+
### Dependencies
|
|
90
|
+
|
|
91
|
+
- **@janus-idp/cli:** upgraded to 1.8.7
|
|
92
|
+
|
|
93
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.6](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.5...@janus-idp/backstage-plugin-3scale-backend@1.5.6) (2024-05-09)
|
|
94
|
+
|
|
95
|
+
### Dependencies
|
|
96
|
+
|
|
97
|
+
- **@janus-idp/cli:** upgraded to 1.8.6
|
|
98
|
+
|
|
99
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.5](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.4...@janus-idp/backstage-plugin-3scale-backend@1.5.5) (2024-05-02)
|
|
100
|
+
|
|
101
|
+
### Dependencies
|
|
102
|
+
|
|
103
|
+
- **@janus-idp/cli:** upgraded to 1.8.5
|
|
104
|
+
|
|
105
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.4](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.3...@janus-idp/backstage-plugin-3scale-backend@1.5.4) (2024-05-02)
|
|
106
|
+
|
|
107
|
+
### Dependencies
|
|
108
|
+
|
|
109
|
+
- **@janus-idp/cli:** upgraded to 1.8.4
|
|
110
|
+
|
|
111
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.3](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.2...@janus-idp/backstage-plugin-3scale-backend@1.5.3) (2024-04-30)
|
|
112
|
+
|
|
113
|
+
### Dependencies
|
|
114
|
+
|
|
115
|
+
- **@janus-idp/cli:** upgraded to 1.8.3
|
|
116
|
+
|
|
117
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.1...@janus-idp/backstage-plugin-3scale-backend@1.5.2) (2024-04-30)
|
|
118
|
+
|
|
119
|
+
### Dependencies
|
|
120
|
+
|
|
121
|
+
- **@janus-idp/cli:** upgraded to 1.8.2
|
|
122
|
+
|
|
123
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.5.0...@janus-idp/backstage-plugin-3scale-backend@1.5.1) (2024-04-25)
|
|
124
|
+
|
|
125
|
+
### Dependencies
|
|
126
|
+
|
|
127
|
+
- **@janus-idp/cli:** upgraded to 1.8.1
|
|
128
|
+
|
|
129
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.5.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.12...@janus-idp/backstage-plugin-3scale-backend@1.5.0) (2024-04-15)
|
|
130
|
+
|
|
131
|
+
### Features
|
|
132
|
+
|
|
133
|
+
- checkPluginVersion.sh bump plugins for 1.2.0 release ([#1511](https://github.com/janus-idp/backstage-plugins/issues/1511)) ([73c6588](https://github.com/janus-idp/backstage-plugins/commit/73c6588adb7e8c20907b06f2a8ef248cfd4332e4))
|
|
134
|
+
|
|
135
|
+
### Dependencies
|
|
136
|
+
|
|
137
|
+
- **@janus-idp/cli:** upgraded to 1.8.0
|
|
138
|
+
|
|
139
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.12](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.11...@janus-idp/backstage-plugin-3scale-backend@1.4.12) (2024-04-09)
|
|
140
|
+
|
|
141
|
+
### Dependencies
|
|
142
|
+
|
|
143
|
+
- **@janus-idp/cli:** upgraded to 1.7.10
|
|
144
|
+
|
|
145
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.11](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.10...@janus-idp/backstage-plugin-3scale-backend@1.4.11) (2024-04-09)
|
|
146
|
+
|
|
147
|
+
### Dependencies
|
|
148
|
+
|
|
149
|
+
- **@janus-idp/cli:** upgraded to 1.7.9
|
|
150
|
+
|
|
151
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.10](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.9...@janus-idp/backstage-plugin-3scale-backend@1.4.10) (2024-04-05)
|
|
152
|
+
|
|
153
|
+
### Dependencies
|
|
154
|
+
|
|
155
|
+
- **@janus-idp/cli:** upgraded to 1.7.8
|
|
156
|
+
|
|
157
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.9](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.8...@janus-idp/backstage-plugin-3scale-backend@1.4.9) (2024-04-02)
|
|
158
|
+
|
|
159
|
+
### Dependencies
|
|
160
|
+
|
|
161
|
+
- **@janus-idp/cli:** upgraded to 1.7.7
|
|
162
|
+
|
|
163
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.8](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.7...@janus-idp/backstage-plugin-3scale-backend@1.4.8) (2024-03-29)
|
|
164
|
+
|
|
165
|
+
### Bug Fixes
|
|
166
|
+
|
|
167
|
+
- **3scale:** pull in newer dynamic plugin... ([#1408](https://github.com/janus-idp/backstage-plugins/issues/1408)) ([95cad79](https://github.com/janus-idp/backstage-plugins/commit/95cad79f84d0771e63921ece1749c6827c2b9872))
|
|
168
|
+
- **3scale:** revert readme change to pull plugin deps ([#1409](https://github.com/janus-idp/backstage-plugins/issues/1409)) ([b34acd2](https://github.com/janus-idp/backstage-plugins/commit/b34acd2874d7e5df44c937b2b197820fcb3a4c50))
|
|
169
|
+
|
|
170
|
+
### Dependencies
|
|
171
|
+
|
|
172
|
+
- **@janus-idp/cli:** upgraded to 1.7.6
|
|
173
|
+
|
|
174
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.7](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.6...@janus-idp/backstage-plugin-3scale-backend@1.4.7) (2024-03-04)
|
|
175
|
+
|
|
176
|
+
### Dependencies
|
|
177
|
+
|
|
178
|
+
- **@janus-idp/cli:** upgraded to 1.7.5
|
|
179
|
+
|
|
180
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.6](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.5...@janus-idp/backstage-plugin-3scale-backend@1.4.6) (2024-02-27)
|
|
181
|
+
|
|
182
|
+
### Dependencies
|
|
183
|
+
|
|
184
|
+
- **@janus-idp/cli:** upgraded to 1.7.4
|
|
185
|
+
|
|
186
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.5](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.4...@janus-idp/backstage-plugin-3scale-backend@1.4.5) (2024-02-26)
|
|
187
|
+
|
|
188
|
+
### Dependencies
|
|
189
|
+
|
|
190
|
+
- **@janus-idp/cli:** upgraded to 1.7.3
|
|
191
|
+
|
|
192
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.4](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.3...@janus-idp/backstage-plugin-3scale-backend@1.4.4) (2024-02-21)
|
|
193
|
+
|
|
194
|
+
### Dependencies
|
|
195
|
+
|
|
196
|
+
- **@janus-idp/cli:** upgraded to 1.7.2
|
|
197
|
+
|
|
198
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.3](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.2...@janus-idp/backstage-plugin-3scale-backend@1.4.3) (2024-02-07)
|
|
199
|
+
|
|
200
|
+
### Bug Fixes
|
|
201
|
+
|
|
202
|
+
- **3scale:** modify 3scale environment variables - using THREESCALE ([#1173](https://github.com/janus-idp/backstage-plugins/issues/1173)) ([247ebe0](https://github.com/janus-idp/backstage-plugins/commit/247ebe0d7ea6971d460f962455d0c36a73ca7606))
|
|
203
|
+
|
|
204
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.1...@janus-idp/backstage-plugin-3scale-backend@1.4.2) (2024-02-05)
|
|
205
|
+
|
|
206
|
+
### Dependencies
|
|
207
|
+
|
|
208
|
+
- **@janus-idp/cli:** upgraded to 1.7.1
|
|
209
|
+
|
|
210
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.4.0...@janus-idp/backstage-plugin-3scale-backend@1.4.1) (2024-02-05)
|
|
211
|
+
|
|
212
|
+
### Bug Fixes
|
|
213
|
+
|
|
214
|
+
- **3scale:** modify 3scale environment variables ([#1166](https://github.com/janus-idp/backstage-plugins/issues/1166)) ([24dfba0](https://github.com/janus-idp/backstage-plugins/commit/24dfba03f0c8151cd5ae59047b53bcabbcd73454))
|
|
215
|
+
|
|
216
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.4.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.12...@janus-idp/backstage-plugin-3scale-backend@1.4.0) (2024-01-30)
|
|
217
|
+
|
|
218
|
+
### Features
|
|
219
|
+
|
|
220
|
+
- add new backend system support for existing backend plugins that have not been migrated over yet ([#1132](https://github.com/janus-idp/backstage-plugins/issues/1132)) ([06e16fd](https://github.com/janus-idp/backstage-plugins/commit/06e16fdcf64257dd08297cb727445d9a8a23c522))
|
|
221
|
+
|
|
222
|
+
### Dependencies
|
|
223
|
+
|
|
224
|
+
- **@janus-idp/cli:** upgraded to 1.7.0
|
|
225
|
+
|
|
226
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.12](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.11...@janus-idp/backstage-plugin-3scale-backend@1.3.12) (2024-01-25)
|
|
227
|
+
|
|
228
|
+
### Dependencies
|
|
229
|
+
|
|
230
|
+
- **@janus-idp/cli:** upgraded to 1.6.0
|
|
231
|
+
|
|
232
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.11](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.10...@janus-idp/backstage-plugin-3scale-backend@1.3.11) (2024-01-16)
|
|
233
|
+
|
|
234
|
+
### Dependencies
|
|
235
|
+
|
|
236
|
+
- **@janus-idp/cli:** upgraded to 1.5.0
|
|
237
|
+
|
|
238
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.10](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.9...@janus-idp/backstage-plugin-3scale-backend@1.3.10) (2023-12-07)
|
|
239
|
+
|
|
240
|
+
### Bug Fixes
|
|
241
|
+
|
|
242
|
+
- attempt to force a bump of backend plugins ([#1007](https://github.com/janus-idp/backstage-plugins/issues/1007)) ([7a37225](https://github.com/janus-idp/backstage-plugins/commit/7a372254fb7e8107aa794f7900a6511eee096677))
|
|
243
|
+
|
|
244
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.9](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.8...@janus-idp/backstage-plugin-3scale-backend@1.3.9) (2023-12-07)
|
|
245
|
+
|
|
246
|
+
### Dependencies
|
|
247
|
+
|
|
248
|
+
- **@janus-idp/cli:** upgraded to 1.4.7
|
|
249
|
+
|
|
250
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.8](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.7...@janus-idp/backstage-plugin-3scale-backend@1.3.8) (2023-11-30)
|
|
251
|
+
|
|
252
|
+
### Dependencies
|
|
253
|
+
|
|
254
|
+
- **@janus-idp/cli:** upgraded to 1.4.6
|
|
255
|
+
|
|
256
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.7](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.6...@janus-idp/backstage-plugin-3scale-backend@1.3.7) (2023-11-22)
|
|
257
|
+
|
|
258
|
+
### Dependencies
|
|
259
|
+
|
|
260
|
+
- **@janus-idp/cli:** upgraded to 1.4.5
|
|
261
|
+
|
|
262
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.6](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.5...@janus-idp/backstage-plugin-3scale-backend@1.3.6) (2023-11-22)
|
|
263
|
+
|
|
264
|
+
### Bug Fixes
|
|
265
|
+
|
|
266
|
+
- add default 3scale schedule ([#969](https://github.com/janus-idp/backstage-plugins/issues/969)) ([11c10b0](https://github.com/janus-idp/backstage-plugins/commit/11c10b0472a191e467573f2eecad06487172014f))
|
|
267
|
+
|
|
268
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.5](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.4...@janus-idp/backstage-plugin-3scale-backend@1.3.5) (2023-11-21)
|
|
269
|
+
|
|
270
|
+
### Bug Fixes
|
|
271
|
+
|
|
272
|
+
- sync versions in dynamic assets and publish derived packages as additional packages ([#963](https://github.com/janus-idp/backstage-plugins/issues/963)) ([7d0a386](https://github.com/janus-idp/backstage-plugins/commit/7d0a38609b4a18b54c75378a150e8b5c3ba8ff43))
|
|
273
|
+
|
|
274
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.4](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.3...@janus-idp/backstage-plugin-3scale-backend@1.3.4) (2023-11-20)
|
|
275
|
+
|
|
276
|
+
### Bug Fixes
|
|
277
|
+
|
|
278
|
+
- **aap+3scale+ocm:** don't log sensitive data from errors ([#945](https://github.com/janus-idp/backstage-plugins/issues/945)) ([7a5e7b8](https://github.com/janus-idp/backstage-plugins/commit/7a5e7b8a57c9841003d9b16e1a65fb62e101fbf1))
|
|
279
|
+
|
|
280
|
+
### Dependencies
|
|
281
|
+
|
|
282
|
+
- **@janus-idp/cli:** upgraded to 1.4.4
|
|
283
|
+
|
|
284
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.3](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.2...@janus-idp/backstage-plugin-3scale-backend@1.3.3) (2023-11-16)
|
|
285
|
+
|
|
286
|
+
### Dependencies
|
|
287
|
+
|
|
288
|
+
- **@janus-idp/cli:** upgraded to 1.4.3
|
|
289
|
+
|
|
290
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.1...@janus-idp/backstage-plugin-3scale-backend@1.3.2) (2023-11-13)
|
|
291
|
+
|
|
292
|
+
### Dependencies
|
|
293
|
+
|
|
294
|
+
- **@janus-idp/cli:** upgraded to 1.4.2
|
|
295
|
+
|
|
296
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.3.0...@janus-idp/backstage-plugin-3scale-backend@1.3.1) (2023-11-13)
|
|
297
|
+
|
|
298
|
+
### Dependencies
|
|
299
|
+
|
|
300
|
+
- **@janus-idp/cli:** upgraded to 1.4.1
|
|
301
|
+
|
|
302
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.3.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.2.0...@janus-idp/backstage-plugin-3scale-backend@1.3.0) (2023-11-08)
|
|
303
|
+
|
|
304
|
+
### Features
|
|
305
|
+
|
|
306
|
+
- update entity provider schedulers ([#827](https://github.com/janus-idp/backstage-plugins/issues/827)) ([19731d1](https://github.com/janus-idp/backstage-plugins/commit/19731d1449a9d8ffa67aec069d2214e45bfe54ff))
|
|
307
|
+
|
|
308
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.2.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.1.2...@janus-idp/backstage-plugin-3scale-backend@1.2.0) (2023-11-07)
|
|
309
|
+
|
|
310
|
+
### Features
|
|
311
|
+
|
|
312
|
+
- make backend plugins dynamic (first round) ([#910](https://github.com/janus-idp/backstage-plugins/issues/910)) ([60523e5](https://github.com/janus-idp/backstage-plugins/commit/60523e588ba374cdcfd453afa2c17fc1a7a1ca2d))
|
|
313
|
+
|
|
314
|
+
### Dependencies
|
|
315
|
+
|
|
316
|
+
- **@janus-idp/cli:** upgraded to 1.4.0
|
|
317
|
+
|
|
318
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.1.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.1.1...@janus-idp/backstage-plugin-3scale-backend@1.1.2) (2023-10-19)
|
|
319
|
+
|
|
320
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.1.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.1.0...@janus-idp/backstage-plugin-3scale-backend@1.1.1) (2023-08-23)
|
|
321
|
+
|
|
322
|
+
### Bug Fixes
|
|
323
|
+
|
|
324
|
+
- **config types:** inline types in config.d.ts ([#664](https://github.com/janus-idp/backstage-plugins/issues/664)) ([ae1aea1](https://github.com/janus-idp/backstage-plugins/commit/ae1aea1f4890c0034d1c2602223d59463c61206b))
|
|
325
|
+
|
|
326
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.1.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.0.7...@janus-idp/backstage-plugin-3scale-backend@1.1.0) (2023-08-14)
|
|
327
|
+
|
|
328
|
+
### Features
|
|
329
|
+
|
|
330
|
+
- **ts:** transpile each plugin separately ([#634](https://github.com/janus-idp/backstage-plugins/issues/634)) ([b94c4dc](https://github.com/janus-idp/backstage-plugins/commit/b94c4dc50ada328e5ce1bed5fb7c76f64607e1ee))
|
|
331
|
+
|
|
332
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.0.7](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.0.6...@janus-idp/backstage-plugin-3scale-backend@1.0.7) (2023-07-25)
|
|
333
|
+
|
|
334
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.0.6](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.0.5...@janus-idp/backstage-plugin-3scale-backend@1.0.6) (2023-06-21)
|
|
335
|
+
|
|
336
|
+
### Documentation
|
|
337
|
+
|
|
338
|
+
- **3scale:** adding admin section in readme ([#473](https://github.com/janus-idp/backstage-plugins/issues/473)) ([423d7a9](https://github.com/janus-idp/backstage-plugins/commit/423d7a9c0a08ff97e4189e443d276790de3d84d3))
|
|
339
|
+
|
|
340
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.0.5](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.0.4...@janus-idp/backstage-plugin-3scale-backend@1.0.5) (2023-06-14)
|
|
341
|
+
|
|
342
|
+
### Other changes
|
|
343
|
+
|
|
344
|
+
- reorder imports via prettier ([#419](https://github.com/janus-idp/backstage-plugins/issues/419)) ([17f1e6a](https://github.com/janus-idp/backstage-plugins/commit/17f1e6a689bd793a619ec5e42e5cdda0998f78a5))
|
|
345
|
+
|
|
346
|
+
### Documentation
|
|
347
|
+
|
|
348
|
+
- update plugin README formatting ([#396](https://github.com/janus-idp/backstage-plugins/issues/396)) ([9b39056](https://github.com/janus-idp/backstage-plugins/commit/9b39056f6c66e9a6a0a5d0c4059420dff66db263)), closes [#295](https://github.com/janus-idp/backstage-plugins/issues/295) [#369](https://github.com/janus-idp/backstage-plugins/issues/369) [#295](https://github.com/janus-idp/backstage-plugins/issues/295) [#369](https://github.com/janus-idp/backstage-plugins/issues/369)
|
|
349
|
+
|
|
350
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.0.4](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.0.3...@janus-idp/backstage-plugin-3scale-backend@1.0.4) (2023-05-31)
|
|
351
|
+
|
|
352
|
+
### Bug Fixes
|
|
353
|
+
|
|
354
|
+
- **3scale:** don't expose token and use correct config ([#388](https://github.com/janus-idp/backstage-plugins/issues/388)) ([d0700da](https://github.com/janus-idp/backstage-plugins/commit/d0700da7a3ba8ce79ba0de230326df7ce735edb2))
|
|
355
|
+
|
|
356
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.0.3](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.0.2...@janus-idp/backstage-plugin-3scale-backend@1.0.3) (2023-05-30)
|
|
357
|
+
|
|
358
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.0.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.0.1...@janus-idp/backstage-plugin-3scale-backend@1.0.2) (2023-05-18)
|
|
359
|
+
|
|
360
|
+
### Documentation
|
|
361
|
+
|
|
362
|
+
- update plugin READMEs ([#373](https://github.com/janus-idp/backstage-plugins/issues/373)) ([478560e](https://github.com/janus-idp/backstage-plugins/commit/478560e38cceaa40d976bccf4785956ed58b5221))
|
|
363
|
+
|
|
364
|
+
## @janus-idp/backstage-plugin-3scale-backend [1.0.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.0.0...@janus-idp/backstage-plugin-3scale-backend@1.0.1) (2023-05-04)
|
|
365
|
+
|
|
366
|
+
### Other changes
|
|
367
|
+
|
|
368
|
+
- **deps:** update all non-major dependencies ([#127](https://github.com/janus-idp/backstage-plugins/issues/127)) ([a9d359f](https://github.com/janus-idp/backstage-plugins/commit/a9d359f01448d1b9b4b4d3d9b087052fb6ff16b3))
|
|
369
|
+
|
|
370
|
+
# @janus-idp/backstage-plugin-3scale-backend 1.0.0 (2023-03-06)
|
|
371
|
+
|
|
372
|
+
### Bug Fixes
|
|
373
|
+
|
|
374
|
+
- **metadata:** adding default metadata to current plugins ([06776da](https://github.com/janus-idp/backstage-plugins/commit/06776dafdbab6d4fa85b92d5b676f65d97bbdb44)), closes [#155](https://github.com/janus-idp/backstage-plugins/issues/155) [#155](https://github.com/janus-idp/backstage-plugins/issues/155)
|
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# 3scale Backstage provider
|
|
2
|
+
|
|
3
|
+
The 3scale Backstage provider plugin synchronizes the 3scale content into the [Backstage](https://backstage.io/) catalog.
|
|
4
|
+
|
|
5
|
+
## For administrators
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
Run the following command to install the 3scale Backstage provider plugin:
|
|
10
|
+
|
|
11
|
+
```console
|
|
12
|
+
yarn workspace backend add @janus-idp/backstage-plugin-3scale-backend
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Configuration
|
|
16
|
+
|
|
17
|
+
3scale Backstage provider allows configuration of one or multiple providers using the `app-config.yaml` configuration file of Backstage.
|
|
18
|
+
|
|
19
|
+
#### Legacy Backend Procedure
|
|
20
|
+
|
|
21
|
+
1. Use a `threeScaleApiEntity` marker to start configuring the `app-config.yaml` file of Backstage:
|
|
22
|
+
|
|
23
|
+
```yaml title="app-config.yaml"
|
|
24
|
+
catalog:
|
|
25
|
+
providers:
|
|
26
|
+
threeScaleApiEntity:
|
|
27
|
+
dev:
|
|
28
|
+
baseUrl: https://<TENANT>-admin.3scale.net
|
|
29
|
+
accessToken: <ACCESS_TOKEN>
|
|
30
|
+
schedule: # optional; same options as in TaskScheduleDefinition
|
|
31
|
+
# supports cron, ISO duration, "human duration" as used in code
|
|
32
|
+
frequency: { minutes: 30 }
|
|
33
|
+
# supports ISO duration, "human duration" as used in code
|
|
34
|
+
timeout: { minutes: 3 }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. If installing into the _legacy_ backend, configure the scheduler for the entity provider using one of the following methods:
|
|
38
|
+
|
|
39
|
+
- **Method 1**: If the scheduler is configured inside the `app-config.yaml` using the schedule config key mentioned previously, add the following code to `packages/backend/src/plugins/catalog.ts` file:
|
|
40
|
+
|
|
41
|
+
```ts title="packages/backend/src/plugins/catalog.ts"
|
|
42
|
+
/* highlight-add-next-line */
|
|
43
|
+
import { ThreeScaleApiEntityProvider } from '@janus-idp/backstage-plugin-3scale-backend';
|
|
44
|
+
|
|
45
|
+
export default async function createPlugin(
|
|
46
|
+
env: PluginEnvironment,
|
|
47
|
+
): Promise<Router> {
|
|
48
|
+
const builder = await CatalogBuilder.create(env);
|
|
49
|
+
|
|
50
|
+
/* ... other processors and/or providers ... */
|
|
51
|
+
/* highlight-add-start */
|
|
52
|
+
builder.addEntityProvider(
|
|
53
|
+
ThreeScaleApiEntityProvider.fromConfig(env.config, {
|
|
54
|
+
logger: env.logger,
|
|
55
|
+
scheduler: env.scheduler,
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
/* highlight-add-end */
|
|
59
|
+
|
|
60
|
+
const { processingEngine, router } = await builder.build();
|
|
61
|
+
await processingEngine.start();
|
|
62
|
+
return router;
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
68
|
+
**NOTE**
|
|
69
|
+
|
|
70
|
+
If you have made any changes to the schedule in the `app-config.yaml` file, then restart to apply the changes.
|
|
71
|
+
|
|
72
|
+
***
|
|
73
|
+
|
|
74
|
+
- **Method 2**: Add a schedule directly inside the `packages/backend/src/plugins/catalog.ts` file as follows:
|
|
75
|
+
|
|
76
|
+
```ts title="packages/backend/src/plugins/catalog.ts"
|
|
77
|
+
/* highlight-add-next-line */
|
|
78
|
+
import { ThreeScaleApiEntityProvider } from '@janus-idp/backstage-plugin-3scale-backend';
|
|
79
|
+
|
|
80
|
+
export default async function createPlugin(
|
|
81
|
+
env: PluginEnvironment,
|
|
82
|
+
): Promise<Router> {
|
|
83
|
+
const builder = await CatalogBuilder.create(env);
|
|
84
|
+
|
|
85
|
+
/* ... other processors and/or providers ... */
|
|
86
|
+
/* highlight-add-start */
|
|
87
|
+
builder.addEntityProvider(
|
|
88
|
+
ThreeScaleApiEntityProvider.fromConfig(env.config, {
|
|
89
|
+
logger: env.logger,
|
|
90
|
+
schedule: env.scheduler.createScheduledTaskRunner({
|
|
91
|
+
frequency: { minutes: 30 },
|
|
92
|
+
timeout: { minutes: 3 },
|
|
93
|
+
}),
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
/* highlight-add-end */
|
|
97
|
+
|
|
98
|
+
const { processingEngine, router } = await builder.build();
|
|
99
|
+
await processingEngine.start();
|
|
100
|
+
return router;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
***
|
|
105
|
+
|
|
106
|
+
**NOTE**
|
|
107
|
+
|
|
108
|
+
If both the `schedule` (hard-coded schedule) and `scheduler` (`app-config.yaml` schedule) option are provided in the `packages/backend/src/plugins/catalog.ts`, the `scheduler` option takes precedence. However, if the schedule inside the `app-config.yaml` file is not configured, then the `schedule` option is used.
|
|
109
|
+
|
|
110
|
+
***
|
|
111
|
+
|
|
112
|
+
#### New Backend Procedure
|
|
113
|
+
|
|
114
|
+
1. If installing into the new backend system, make the same configurations to the `app=config.yaml` as in the [Legacy Backend Installation Procedure](#legacy-backend-installation-procedure). Make sure to configure the schedule inside the `app-config.yaml` file. The default schedule is a frequency of 30 minutes and a timeout of 3 minutes.
|
|
115
|
+
2. Add the following code to the `packages/backend/src/index.ts` file:
|
|
116
|
+
|
|
117
|
+
```ts title="packages/backend/src/index.ts"
|
|
118
|
+
const backend = createBackend();
|
|
119
|
+
|
|
120
|
+
/* highlight-add-next-line */
|
|
121
|
+
backend.add(import('@janus-idp/backstage-plugin-3scale-backend/alpha'));
|
|
122
|
+
|
|
123
|
+
backend.start();
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Troubleshooting
|
|
127
|
+
|
|
128
|
+
When you start your Backstage application, you can see some log lines as follows:
|
|
129
|
+
|
|
130
|
+
```log
|
|
131
|
+
[1] 2023-02-13T15:26:09.356Z catalog info Discovered ApiEntity API type=plugin target=ThreeScaleApiEntityProvider:dev
|
|
132
|
+
[1] 2023-02-13T15:26:09.423Z catalog info Discovered ApiEntity Red Hat Event (DEV, v1.2.0) type=plugin target=ThreeScaleApiEntityProvider:dev
|
|
133
|
+
[1] 2023-02-13T15:26:09.620Z catalog info Discovered ApiEntity Red Hat Event (TEST, v1.1.0) type=plugin target=ThreeScaleApiEntityProvider:dev
|
|
134
|
+
[1] 2023-02-13T15:26:09.819Z catalog info Discovered ApiEntity Red Hat Event (PROD, v1.1.0) type=plugin target=ThreeScaleApiEntityProvider:dev
|
|
135
|
+
[1] 2023-02-13T15:26:09.819Z catalog info Applying the mutation with 3 entities type=plugin target=ThreeScaleApiEntityProvider:dev
|
|
136
|
+
```
|
package/app-config.yaml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
catalog:
|
|
2
|
+
providers:
|
|
3
|
+
threeScaleApiEntity:
|
|
4
|
+
dev:
|
|
5
|
+
baseUrl: '${THREESCALE_BASE_URL}' # https://<TENANT>-admin.3scale.net
|
|
6
|
+
accessToken: '${THREESCALE_ACCESS_TOKEN}'
|
|
7
|
+
schedule: # optional; same options as in TaskScheduleDefinition
|
|
8
|
+
# supports cron, ISO duration, "human duration" as used in code
|
|
9
|
+
frequency: { minutes: 1 }
|
|
10
|
+
# supports ISO duration, "human duration" as used in code
|
|
11
|
+
timeout: { minutes: 1 }
|
package/config.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TaskScheduleDefinitionConfig } from '@backstage/backend-tasks';
|
|
2
|
+
|
|
3
|
+
export interface Config {
|
|
4
|
+
catalog?: {
|
|
5
|
+
providers?: {
|
|
6
|
+
threeScaleApiEntity?: {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
/**
|
|
9
|
+
* ThreeScaleConfig
|
|
10
|
+
*/
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
/** @visibility secret */
|
|
13
|
+
accessToken: string;
|
|
14
|
+
systemLabel?: string;
|
|
15
|
+
ownerLabel?: string;
|
|
16
|
+
addLabels?: boolean;
|
|
17
|
+
schedule?: TaskScheduleDefinitionConfig;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
6
|
+
var alpha = require('@backstage/plugin-catalog-node/alpha');
|
|
7
|
+
var ThreeScaleApiEntityProvider = require('./cjs/ThreeScaleApiEntityProvider-B3TyzFXk.cjs.js');
|
|
8
|
+
require('@backstage/catalog-model');
|
|
9
|
+
require('@backstage/backend-tasks');
|
|
10
|
+
|
|
11
|
+
const catalogModule3ScaleEntityProvider = backendPluginApi.createBackendModule({
|
|
12
|
+
moduleId: "catalog-backend-module-3scale",
|
|
13
|
+
pluginId: "catalog",
|
|
14
|
+
register(env) {
|
|
15
|
+
env.registerInit({
|
|
16
|
+
deps: {
|
|
17
|
+
catalog: alpha.catalogProcessingExtensionPoint,
|
|
18
|
+
config: backendPluginApi.coreServices.rootConfig,
|
|
19
|
+
logger: backendPluginApi.coreServices.logger,
|
|
20
|
+
scheduler: backendPluginApi.coreServices.scheduler
|
|
21
|
+
},
|
|
22
|
+
async init({ catalog, config, logger, scheduler }) {
|
|
23
|
+
catalog.addEntityProvider(
|
|
24
|
+
ThreeScaleApiEntityProvider.ThreeScaleApiEntityProvider.fromConfig(config, {
|
|
25
|
+
logger,
|
|
26
|
+
scheduler,
|
|
27
|
+
schedule: scheduler.createScheduledTaskRunner({
|
|
28
|
+
frequency: { minutes: 30 },
|
|
29
|
+
timeout: { minutes: 3 }
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
exports.default = catalogModule3ScaleEntityProvider;
|
|
39
|
+
//# sourceMappingURL=alpha.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 The Janus IDP Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\n\nimport { ThreeScaleApiEntityProvider } from './providers';\n\nexport const catalogModule3ScaleEntityProvider = createBackendModule({\n moduleId: 'catalog-backend-module-3scale',\n pluginId: 'catalog',\n register(env) {\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n config: coreServices.rootConfig,\n logger: coreServices.logger,\n scheduler: coreServices.scheduler,\n },\n async init({ catalog, config, logger, scheduler }) {\n catalog.addEntityProvider(\n ThreeScaleApiEntityProvider.fromConfig(config, {\n logger,\n scheduler: scheduler,\n schedule: scheduler.createScheduledTaskRunner({\n frequency: { minutes: 30 },\n timeout: { minutes: 3 },\n }),\n }),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","catalogProcessingExtensionPoint","coreServices","ThreeScaleApiEntityProvider"],"mappings":";;;;;;;;;;AAuBO,MAAM,oCAAoCA,oCAAoB,CAAA;AAAA,EACnE,QAAU,EAAA,+BAAA;AAAA,EACV,QAAU,EAAA,SAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,OAAS,EAAAC,qCAAA;AAAA,QACT,QAAQC,6BAAa,CAAA,UAAA;AAAA,QACrB,QAAQA,6BAAa,CAAA,MAAA;AAAA,QACrB,WAAWA,6BAAa,CAAA,SAAA;AAAA,OAC1B;AAAA,MACA,MAAM,IAAK,CAAA,EAAE,SAAS,MAAQ,EAAA,MAAA,EAAQ,WAAa,EAAA;AACjD,QAAQ,OAAA,CAAA,iBAAA;AAAA,UACNC,uDAAA,CAA4B,WAAW,MAAQ,EAAA;AAAA,YAC7C,MAAA;AAAA,YACA,SAAA;AAAA,YACA,QAAA,EAAU,UAAU,yBAA0B,CAAA;AAAA,cAC5C,SAAA,EAAW,EAAE,OAAA,EAAS,EAAG,EAAA;AAAA,cACzB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAE,EAAA;AAAA,aACvB,CAAA;AAAA,WACF,CAAA;AAAA,SACH,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var catalogModel = require('@backstage/catalog-model');
|
|
4
|
+
var backendTasks = require('@backstage/backend-tasks');
|
|
5
|
+
|
|
6
|
+
function listServices(baseUrl, access_token, page, size) {
|
|
7
|
+
return fetch(
|
|
8
|
+
`${baseUrl}/admin/api/services.json?access_token=${access_token}&page=${page}&size=${size}`
|
|
9
|
+
).then((response) => {
|
|
10
|
+
if (!response.ok) {
|
|
11
|
+
throw new Error(response.statusText);
|
|
12
|
+
}
|
|
13
|
+
return response.json();
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function listApiDocs(baseUrl, access_token) {
|
|
17
|
+
return fetch(
|
|
18
|
+
`${baseUrl}/admin/api/active_docs.json?access_token=${access_token}`
|
|
19
|
+
).then((response) => {
|
|
20
|
+
if (!response.ok) {
|
|
21
|
+
throw new Error(response.statusText);
|
|
22
|
+
}
|
|
23
|
+
return response.json();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function getProxyConfig(baseUrl, access_token, service_id) {
|
|
27
|
+
return fetch(
|
|
28
|
+
`${baseUrl}/admin/api/services/${service_id}/proxy.json?access_token=${access_token}`
|
|
29
|
+
).then((response) => {
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
throw new Error(response.statusText);
|
|
32
|
+
}
|
|
33
|
+
return response.json();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function readThreeScaleApiEntityConfigs(config) {
|
|
38
|
+
const providerConfigs = config.getOptionalConfig(
|
|
39
|
+
"catalog.providers.threeScaleApiEntity"
|
|
40
|
+
);
|
|
41
|
+
if (!providerConfigs) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
return providerConfigs.keys().map(
|
|
45
|
+
(id) => readThreeScaleApiEntityConfig(id, providerConfigs.getConfig(id))
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
function readThreeScaleApiEntityConfig(id, config) {
|
|
49
|
+
const baseUrl = config.getString("baseUrl");
|
|
50
|
+
const accessToken = config.getString("accessToken");
|
|
51
|
+
const systemLabel = config.getOptionalString("systemLabel");
|
|
52
|
+
const ownerLabel = config.getOptionalString("ownerLabel");
|
|
53
|
+
const addLabels = config.getOptionalBoolean("addLabels") || true;
|
|
54
|
+
const schedule = config.has("schedule") ? backendTasks.readTaskScheduleDefinitionFromConfig(config.getConfig("schedule")) : void 0;
|
|
55
|
+
return {
|
|
56
|
+
id,
|
|
57
|
+
baseUrl,
|
|
58
|
+
accessToken,
|
|
59
|
+
systemLabel,
|
|
60
|
+
ownerLabel,
|
|
61
|
+
addLabels,
|
|
62
|
+
schedule
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
class ThreeScaleApiEntityProvider {
|
|
67
|
+
static SERVICES_FETCH_SIZE = 500;
|
|
68
|
+
env;
|
|
69
|
+
baseUrl;
|
|
70
|
+
accessToken;
|
|
71
|
+
logger;
|
|
72
|
+
scheduleFn;
|
|
73
|
+
connection;
|
|
74
|
+
static fromConfig(configRoot, options) {
|
|
75
|
+
const providerConfigs = readThreeScaleApiEntityConfigs(configRoot);
|
|
76
|
+
if (!options.schedule && !options.scheduler) {
|
|
77
|
+
throw new Error("Either schedule or scheduler must be provided.");
|
|
78
|
+
}
|
|
79
|
+
return providerConfigs.map((providerConfig) => {
|
|
80
|
+
if (!options.schedule && !providerConfig.schedule) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
`No schedule provided neither via code nor config for ThreeScaleApiEntityProvider:${providerConfig.id}.`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
let taskRunner;
|
|
86
|
+
if (options.scheduler && providerConfig.schedule) {
|
|
87
|
+
taskRunner = options.scheduler.createScheduledTaskRunner(
|
|
88
|
+
providerConfig.schedule
|
|
89
|
+
);
|
|
90
|
+
} else if (options.schedule) {
|
|
91
|
+
taskRunner = options.schedule;
|
|
92
|
+
} else {
|
|
93
|
+
throw new Error("Neither schedule nor scheduler is provided.");
|
|
94
|
+
}
|
|
95
|
+
return new ThreeScaleApiEntityProvider(
|
|
96
|
+
providerConfig,
|
|
97
|
+
options.logger,
|
|
98
|
+
taskRunner
|
|
99
|
+
);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
constructor(config, logger, taskRunner) {
|
|
103
|
+
this.env = config.id;
|
|
104
|
+
this.baseUrl = config.baseUrl;
|
|
105
|
+
this.accessToken = config.accessToken;
|
|
106
|
+
this.logger = logger.child({
|
|
107
|
+
target: this.getProviderName()
|
|
108
|
+
});
|
|
109
|
+
this.scheduleFn = this.createScheduleFn(taskRunner);
|
|
110
|
+
}
|
|
111
|
+
createScheduleFn(taskRunner) {
|
|
112
|
+
return async () => {
|
|
113
|
+
const taskId = `${this.getProviderName()}:run`;
|
|
114
|
+
return taskRunner.run({
|
|
115
|
+
id: taskId,
|
|
116
|
+
fn: async () => {
|
|
117
|
+
try {
|
|
118
|
+
await this.run();
|
|
119
|
+
} catch (error) {
|
|
120
|
+
this.logger.error(
|
|
121
|
+
`Error while syncing 3scale API from ${this.baseUrl}`,
|
|
122
|
+
{
|
|
123
|
+
// Default Error properties:
|
|
124
|
+
name: error.name,
|
|
125
|
+
message: error.message,
|
|
126
|
+
stack: error.stack,
|
|
127
|
+
// Additional status code if available:
|
|
128
|
+
status: error.response?.status
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
getProviderName() {
|
|
137
|
+
return `ThreeScaleApiEntityProvider:${this.env}`;
|
|
138
|
+
}
|
|
139
|
+
async connect(connection) {
|
|
140
|
+
this.connection = connection;
|
|
141
|
+
await this.scheduleFn();
|
|
142
|
+
}
|
|
143
|
+
async run() {
|
|
144
|
+
if (!this.connection) {
|
|
145
|
+
throw new Error("Not initialized");
|
|
146
|
+
}
|
|
147
|
+
this.logger.info(`Discovering ApiEntities from 3scale ${this.baseUrl}`);
|
|
148
|
+
const entities = [];
|
|
149
|
+
let page = 0;
|
|
150
|
+
let services;
|
|
151
|
+
let apiDocs;
|
|
152
|
+
let fetchServices = true;
|
|
153
|
+
while (fetchServices) {
|
|
154
|
+
services = await listServices(
|
|
155
|
+
this.baseUrl,
|
|
156
|
+
this.accessToken,
|
|
157
|
+
page,
|
|
158
|
+
ThreeScaleApiEntityProvider.SERVICES_FETCH_SIZE
|
|
159
|
+
);
|
|
160
|
+
apiDocs = await listApiDocs(this.baseUrl, this.accessToken);
|
|
161
|
+
for (const element of services.services) {
|
|
162
|
+
const service = element;
|
|
163
|
+
this.logger.debug(`Find service ${service.service.name}`);
|
|
164
|
+
const apiDoc = apiDocs.api_docs.find((obj) => {
|
|
165
|
+
if (obj.api_doc.service_id !== void 0) {
|
|
166
|
+
return obj.api_doc.service_id === service.service.id;
|
|
167
|
+
}
|
|
168
|
+
return false;
|
|
169
|
+
});
|
|
170
|
+
const proxy = await getProxyConfig(
|
|
171
|
+
this.baseUrl,
|
|
172
|
+
this.accessToken,
|
|
173
|
+
service.service.id
|
|
174
|
+
);
|
|
175
|
+
if (apiDoc !== void 0) {
|
|
176
|
+
this.logger.info(JSON.stringify(apiDoc));
|
|
177
|
+
const apiEntity = this.buildApiEntityFromService(
|
|
178
|
+
service,
|
|
179
|
+
apiDoc,
|
|
180
|
+
proxy
|
|
181
|
+
);
|
|
182
|
+
entities.push(apiEntity);
|
|
183
|
+
this.logger.debug(`Discovered ApiEntity ${service.service.name}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (services.services.length < ThreeScaleApiEntityProvider.SERVICES_FETCH_SIZE) {
|
|
187
|
+
fetchServices = false;
|
|
188
|
+
}
|
|
189
|
+
page++;
|
|
190
|
+
}
|
|
191
|
+
this.logger.info(`Applying the mutation with ${entities.length} entities`);
|
|
192
|
+
await this.connection.applyMutation({
|
|
193
|
+
type: "full",
|
|
194
|
+
entities: entities.map((entity) => ({
|
|
195
|
+
entity,
|
|
196
|
+
locationKey: this.getProviderName()
|
|
197
|
+
}))
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
buildApiEntityFromService(service, apiDoc, proxy) {
|
|
201
|
+
const location = `url:${this.baseUrl}/apiconfig/services/${service.service.id}`;
|
|
202
|
+
const spec = JSON.parse(apiDoc.api_doc.body);
|
|
203
|
+
return {
|
|
204
|
+
kind: "API",
|
|
205
|
+
apiVersion: "backstage.io/v1alpha1",
|
|
206
|
+
metadata: {
|
|
207
|
+
annotations: {
|
|
208
|
+
[catalogModel.ANNOTATION_LOCATION]: location,
|
|
209
|
+
[catalogModel.ANNOTATION_ORIGIN_LOCATION]: location
|
|
210
|
+
},
|
|
211
|
+
// TODO: add tenant name
|
|
212
|
+
name: `${service.service.system_name}`,
|
|
213
|
+
description: spec.info.description || `Version: ${service.service.description}`,
|
|
214
|
+
// TODO: add labels
|
|
215
|
+
// labels: this.getApiEntityLabels(service),
|
|
216
|
+
links: [
|
|
217
|
+
{
|
|
218
|
+
url: `${this.baseUrl}/apiconfig/services/${service.service.id}`,
|
|
219
|
+
title: "3scale Overview"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
url: `${proxy.proxy.sandbox_endpoint}`,
|
|
223
|
+
title: "Staging Apicast Endpoint"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
url: `${proxy.proxy.endpoint}`,
|
|
227
|
+
title: "Production Apicast Endpoint"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
spec: {
|
|
232
|
+
type: "openapi",
|
|
233
|
+
lifecycle: this.env,
|
|
234
|
+
system: "3scale",
|
|
235
|
+
owner: "3scale",
|
|
236
|
+
definition: apiDoc.api_doc.body
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
exports.ThreeScaleApiEntityProvider = ThreeScaleApiEntityProvider;
|
|
243
|
+
exports.getProxyConfig = getProxyConfig;
|
|
244
|
+
exports.listApiDocs = listApiDocs;
|
|
245
|
+
exports.listServices = listServices;
|
|
246
|
+
//# sourceMappingURL=ThreeScaleApiEntityProvider-B3TyzFXk.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeScaleApiEntityProvider-B3TyzFXk.cjs.js","sources":["../../src/clients/ThreeScaleAPIConnector.ts","../../src/providers/config.ts","../../src/providers/ThreeScaleApiEntityProvider.ts"],"sourcesContent":["import { APIDocs, Proxy, Services } from './types';\n\nexport function listServices(\n baseUrl: string,\n access_token: string,\n page: number,\n size: number,\n): Promise<Services> {\n return fetch(\n `${baseUrl}/admin/api/services.json?access_token=${access_token}&page=${page}&size=${size}`,\n ).then(response => {\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return response.json() as Promise<Services>;\n });\n}\n\nexport function listApiDocs(\n baseUrl: string,\n access_token: string,\n): Promise<APIDocs> {\n return fetch(\n `${baseUrl}/admin/api/active_docs.json?access_token=${access_token}`,\n ).then(response => {\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return response.json() as Promise<APIDocs>;\n });\n}\n\nexport function getProxyConfig(\n baseUrl: string,\n access_token: string,\n service_id: number,\n): Promise<Proxy> {\n return fetch(\n `${baseUrl}/admin/api/services/${service_id}/proxy.json?access_token=${access_token}`,\n ).then(response => {\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return response.json() as Promise<Proxy>;\n });\n}\n","import { readTaskScheduleDefinitionFromConfig } from '@backstage/backend-tasks';\nimport { Config } from '@backstage/config';\n\nimport { ThreeScaleConfig } from './types';\n\nexport function readThreeScaleApiEntityConfigs(\n config: Config,\n): ThreeScaleConfig[] {\n const providerConfigs = config.getOptionalConfig(\n 'catalog.providers.threeScaleApiEntity',\n );\n if (!providerConfigs) {\n return [];\n }\n return providerConfigs\n .keys()\n .map(id =>\n readThreeScaleApiEntityConfig(id, providerConfigs.getConfig(id)),\n );\n}\n\nfunction readThreeScaleApiEntityConfig(\n id: string,\n config: Config,\n): ThreeScaleConfig {\n const baseUrl = config.getString('baseUrl');\n const accessToken = config.getString('accessToken');\n const systemLabel = config.getOptionalString('systemLabel');\n const ownerLabel = config.getOptionalString('ownerLabel');\n const addLabels = config.getOptionalBoolean('addLabels') || true;\n\n const schedule = config.has('schedule')\n ? readTaskScheduleDefinitionFromConfig(config.getConfig('schedule'))\n : undefined;\n\n return {\n id,\n baseUrl,\n accessToken,\n systemLabel,\n ownerLabel,\n addLabels,\n schedule,\n };\n}\n","import { LoggerService } from '@backstage/backend-plugin-api';\nimport { PluginTaskScheduler, TaskRunner } from '@backstage/backend-tasks';\nimport {\n ANNOTATION_LOCATION,\n ANNOTATION_ORIGIN_LOCATION,\n ApiEntity,\n Entity,\n} from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport {\n EntityProvider,\n EntityProviderConnection,\n} from '@backstage/plugin-catalog-node';\n\nimport {\n getProxyConfig,\n listApiDocs,\n listServices,\n} from '../clients/ThreeScaleAPIConnector';\nimport {\n APIDocElement,\n APIDocs,\n Proxy,\n ServiceElement,\n Services,\n} from '../clients/types';\nimport { readThreeScaleApiEntityConfigs } from './config';\nimport { ThreeScaleConfig } from './types';\n\nexport class ThreeScaleApiEntityProvider implements EntityProvider {\n private static SERVICES_FETCH_SIZE: number = 500;\n private readonly env: string;\n private readonly baseUrl: string;\n private readonly accessToken: string;\n private readonly logger: LoggerService;\n private readonly scheduleFn: () => Promise<void>;\n private connection?: EntityProviderConnection;\n\n static fromConfig(\n configRoot: Config,\n options: {\n logger: LoggerService;\n schedule?: TaskRunner;\n scheduler?: PluginTaskScheduler;\n },\n ): ThreeScaleApiEntityProvider[] {\n const providerConfigs = readThreeScaleApiEntityConfigs(configRoot);\n\n if (!options.schedule && !options.scheduler) {\n throw new Error('Either schedule or scheduler must be provided.');\n }\n\n return providerConfigs.map(providerConfig => {\n if (!options.schedule && !providerConfig.schedule) {\n throw new Error(\n `No schedule provided neither via code nor config for ThreeScaleApiEntityProvider:${providerConfig.id}.`,\n );\n }\n\n let taskRunner;\n\n if (options.scheduler && providerConfig.schedule) {\n // Create a scheduled task runner using the provided scheduler and schedule configuration\n taskRunner = options.scheduler.createScheduledTaskRunner(\n providerConfig.schedule,\n );\n } else if (options.schedule) {\n // Use the provided schedule directly\n taskRunner = options.schedule;\n } else {\n // Handle the case where both options.schedule and options.scheduler are missing\n throw new Error('Neither schedule nor scheduler is provided.');\n }\n\n return new ThreeScaleApiEntityProvider(\n providerConfig,\n options.logger,\n taskRunner,\n );\n });\n }\n\n private constructor(\n config: ThreeScaleConfig,\n logger: LoggerService,\n taskRunner: TaskRunner,\n ) {\n this.env = config.id;\n this.baseUrl = config.baseUrl;\n this.accessToken = config.accessToken;\n this.logger = logger.child({\n target: this.getProviderName(),\n });\n\n this.scheduleFn = this.createScheduleFn(taskRunner);\n }\n\n private createScheduleFn(taskRunner: TaskRunner): () => Promise<void> {\n return async () => {\n const taskId = `${this.getProviderName()}:run`;\n return taskRunner.run({\n id: taskId,\n fn: async () => {\n try {\n await this.run();\n } catch (error: any) {\n // Ensure that we don't log any sensitive internal data:\n this.logger.error(\n `Error while syncing 3scale API from ${this.baseUrl}`,\n {\n // Default Error properties:\n name: error.name,\n message: error.message,\n stack: error.stack,\n // Additional status code if available:\n status: error.response?.status,\n },\n );\n }\n },\n });\n };\n }\n\n getProviderName(): string {\n return `ThreeScaleApiEntityProvider:${this.env}`;\n }\n\n async connect(connection: EntityProviderConnection): Promise<void> {\n this.connection = connection;\n await this.scheduleFn();\n }\n\n async run(): Promise<void> {\n if (!this.connection) {\n throw new Error('Not initialized');\n }\n\n this.logger.info(`Discovering ApiEntities from 3scale ${this.baseUrl}`);\n\n const entities: Entity[] = [];\n\n let page: number = 0;\n let services: Services;\n let apiDocs: APIDocs;\n let fetchServices: boolean = true;\n while (fetchServices) {\n services = await listServices(\n this.baseUrl,\n this.accessToken,\n page,\n ThreeScaleApiEntityProvider.SERVICES_FETCH_SIZE,\n );\n apiDocs = await listApiDocs(this.baseUrl, this.accessToken);\n for (const element of services.services) {\n const service = element;\n this.logger.debug(`Find service ${service.service.name}`);\n\n // Trying to find the API Doc for the service and validate if api doc was assigned to an API.\n const apiDoc = apiDocs.api_docs.find(obj => {\n if (obj.api_doc.service_id !== undefined) {\n return obj.api_doc.service_id === service.service.id;\n }\n return false;\n });\n\n const proxy = await getProxyConfig(\n this.baseUrl,\n this.accessToken,\n service.service.id,\n );\n if (apiDoc !== undefined) {\n this.logger.info(JSON.stringify(apiDoc));\n const apiEntity: ApiEntity = this.buildApiEntityFromService(\n service,\n apiDoc,\n proxy,\n );\n entities.push(apiEntity);\n this.logger.debug(`Discovered ApiEntity ${service.service.name}`);\n }\n }\n\n if (\n services.services.length <\n ThreeScaleApiEntityProvider.SERVICES_FETCH_SIZE\n ) {\n fetchServices = false;\n }\n page++;\n }\n\n this.logger.info(`Applying the mutation with ${entities.length} entities`);\n\n await this.connection.applyMutation({\n type: 'full',\n entities: entities.map(entity => ({\n entity,\n locationKey: this.getProviderName(),\n })),\n });\n }\n\n private buildApiEntityFromService(\n service: ServiceElement,\n apiDoc: APIDocElement,\n proxy: Proxy,\n ): ApiEntity {\n const location = `url:${this.baseUrl}/apiconfig/services/${service.service.id}`;\n\n const spec = JSON.parse(apiDoc.api_doc.body);\n\n return {\n kind: 'API',\n apiVersion: 'backstage.io/v1alpha1',\n metadata: {\n annotations: {\n [ANNOTATION_LOCATION]: location,\n [ANNOTATION_ORIGIN_LOCATION]: location,\n },\n // TODO: add tenant name\n name: `${service.service.system_name}`,\n description:\n spec.info.description || `Version: ${service.service.description}`,\n // TODO: add labels\n // labels: this.getApiEntityLabels(service),\n links: [\n {\n url: `${this.baseUrl}/apiconfig/services/${service.service.id}`,\n title: '3scale Overview',\n },\n {\n url: `${proxy.proxy.sandbox_endpoint}`,\n title: 'Staging Apicast Endpoint',\n },\n {\n url: `${proxy.proxy.endpoint}`,\n title: 'Production Apicast Endpoint',\n },\n ],\n },\n spec: {\n type: 'openapi',\n lifecycle: this.env,\n system: '3scale',\n owner: '3scale',\n definition: apiDoc.api_doc.body,\n },\n };\n }\n}\n"],"names":["readTaskScheduleDefinitionFromConfig","ANNOTATION_LOCATION","ANNOTATION_ORIGIN_LOCATION"],"mappings":";;;;;AAEO,SAAS,YACd,CAAA,OAAA,EACA,YACA,EAAA,IAAA,EACA,IACmB,EAAA;AACnB,EAAO,OAAA,KAAA;AAAA,IACL,GAAG,OAAO,CAAA,sCAAA,EAAyC,YAAY,CAAS,MAAA,EAAA,IAAI,SAAS,IAAI,CAAA,CAAA;AAAA,GAC3F,CAAE,KAAK,CAAY,QAAA,KAAA;AACjB,IAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,MAAM,MAAA,IAAI,KAAM,CAAA,QAAA,CAAS,UAAU,CAAA,CAAA;AAAA,KACrC;AACA,IAAA,OAAO,SAAS,IAAK,EAAA,CAAA;AAAA,GACtB,CAAA,CAAA;AACH,CAAA;AAEgB,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CAAA,OAAA,CAAQ,WAAW,CAAA,CAAA;AAAA,QACpC,aACE,IAAK,CAAA,IAAA,CAAK,eAAe,CAAY,SAAA,EAAA,OAAA,CAAQ,QAAQ,WAAW,CAAA,CAAA;AAAA;AAAA;AAAA,QAGlE,KAAO,EAAA;AAAA,UACL;AAAA,YACE,KAAK,CAAG,EAAA,IAAA,CAAK,OAAO,CAAuB,oBAAA,EAAA,OAAA,CAAQ,QAAQ,EAAE,CAAA,CAAA;AAAA,YAC7D,KAAO,EAAA,iBAAA;AAAA,WACT;AAAA,UACA;AAAA,YACE,GAAK,EAAA,CAAA,EAAG,KAAM,CAAA,KAAA,CAAM,gBAAgB,CAAA,CAAA;AAAA,YACpC,KAAO,EAAA,0BAAA;AAAA,WACT;AAAA,UACA;AAAA,YACE,GAAK,EAAA,CAAA,EAAG,KAAM,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AAAA,YAC5B,KAAO,EAAA,6BAAA;AAAA,WACT;AAAA,SACF;AAAA,OACF;AAAA,MACA,IAAM,EAAA;AAAA,QACJ,IAAM,EAAA,SAAA;AAAA,QACN,WAAW,IAAK,CAAA,GAAA;AAAA,QAChB,MAAQ,EAAA,QAAA;AAAA,QACR,KAAO,EAAA,QAAA;AAAA,QACP,UAAA,EAAY,OAAO,OAAQ,CAAA,IAAA;AAAA,OAC7B;AAAA,KACF,CAAA;AAAA,GACF;AACF;;;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ThreeScaleApiEntityProvider = require('./cjs/ThreeScaleApiEntityProvider-B3TyzFXk.cjs.js');
|
|
4
|
+
require('@backstage/catalog-model');
|
|
5
|
+
require('@backstage/backend-tasks');
|
|
6
|
+
|
|
7
|
+
const dynamicPluginInstaller = {
|
|
8
|
+
kind: "legacy",
|
|
9
|
+
async catalog(builder, env) {
|
|
10
|
+
builder.addEntityProvider(
|
|
11
|
+
ThreeScaleApiEntityProvider.ThreeScaleApiEntityProvider.fromConfig(env.config, {
|
|
12
|
+
logger: env.logger,
|
|
13
|
+
scheduler: env.scheduler,
|
|
14
|
+
schedule: env.scheduler.createScheduledTaskRunner({
|
|
15
|
+
frequency: { minutes: 1 },
|
|
16
|
+
timeout: { minutes: 1 }
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.ThreeScaleApiEntityProvider = ThreeScaleApiEntityProvider.ThreeScaleApiEntityProvider;
|
|
24
|
+
exports.getProxyConfig = ThreeScaleApiEntityProvider.getProxyConfig;
|
|
25
|
+
exports.listApiDocs = ThreeScaleApiEntityProvider.listApiDocs;
|
|
26
|
+
exports.listServices = ThreeScaleApiEntityProvider.listServices;
|
|
27
|
+
exports.dynamicPluginInstaller = dynamicPluginInstaller;
|
|
28
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/dynamic/index.ts"],"sourcesContent":["/*\n * Copyright 2023 The Janus IDP Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BackendDynamicPluginInstaller } from '@backstage/backend-dynamic-feature-service';\n\nimport { ThreeScaleApiEntityProvider } from '../providers';\n\nexport const dynamicPluginInstaller: BackendDynamicPluginInstaller = {\n kind: 'legacy',\n async catalog(builder, env) {\n builder.addEntityProvider(\n ThreeScaleApiEntityProvider.fromConfig(env.config, {\n logger: env.logger,\n scheduler: env.scheduler,\n schedule: env.scheduler.createScheduledTaskRunner({\n frequency: { minutes: 1 },\n timeout: { minutes: 1 },\n }),\n }),\n );\n },\n};\n"],"names":["ThreeScaleApiEntityProvider"],"mappings":";;;;;;AAmBO,MAAM,sBAAwD,GAAA;AAAA,EACnE,IAAM,EAAA,QAAA;AAAA,EACN,MAAM,OAAQ,CAAA,OAAA,EAAS,GAAK,EAAA;AAC1B,IAAQ,OAAA,CAAA,iBAAA;AAAA,MACNA,uDAAA,CAA4B,UAAW,CAAA,GAAA,CAAI,MAAQ,EAAA;AAAA,QACjD,QAAQ,GAAI,CAAA,MAAA;AAAA,QACZ,WAAW,GAAI,CAAA,SAAA;AAAA,QACf,QAAA,EAAU,GAAI,CAAA,SAAA,CAAU,yBAA0B,CAAA;AAAA,UAChD,SAAA,EAAW,EAAE,OAAA,EAAS,CAAE,EAAA;AAAA,UACxB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAE,EAAA;AAAA,SACvB,CAAA;AAAA,OACF,CAAA;AAAA,KACH,CAAA;AAAA,GACF;AACF;;;;;;;;"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { LoggerService } from '@backstage/backend-plugin-api';
|
|
2
|
+
import { TaskRunner, PluginTaskScheduler } from '@backstage/backend-tasks';
|
|
3
|
+
import { Config } from '@backstage/config';
|
|
4
|
+
import { EntityProvider, EntityProviderConnection } from '@backstage/plugin-catalog-node';
|
|
5
|
+
import { BackendDynamicPluginInstaller } from '@backstage/backend-dynamic-feature-service';
|
|
6
|
+
|
|
7
|
+
interface Services {
|
|
8
|
+
services: ServiceElement[];
|
|
9
|
+
}
|
|
10
|
+
interface ServiceElement {
|
|
11
|
+
service: ServiceService;
|
|
12
|
+
}
|
|
13
|
+
interface ServiceService {
|
|
14
|
+
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
state: string;
|
|
17
|
+
system_name: string;
|
|
18
|
+
backend_version: string;
|
|
19
|
+
deployment_option: string;
|
|
20
|
+
support_email: string;
|
|
21
|
+
description: string;
|
|
22
|
+
intentions_required: boolean;
|
|
23
|
+
buyers_manage_apps: boolean;
|
|
24
|
+
buyers_manage_keys: boolean;
|
|
25
|
+
referrer_filters_required: boolean;
|
|
26
|
+
custom_keys_enabled: boolean;
|
|
27
|
+
buyer_key_regenerate_enabled: boolean;
|
|
28
|
+
mandatory_app_key: boolean;
|
|
29
|
+
buyer_can_select_plan: boolean;
|
|
30
|
+
buyer_plan_change_permission: string;
|
|
31
|
+
created_at: Date;
|
|
32
|
+
updated_at: Date;
|
|
33
|
+
links: Link[];
|
|
34
|
+
}
|
|
35
|
+
interface Link {
|
|
36
|
+
rel: string;
|
|
37
|
+
href: string;
|
|
38
|
+
}
|
|
39
|
+
interface APIDocs {
|
|
40
|
+
api_docs: APIDocElement[];
|
|
41
|
+
}
|
|
42
|
+
interface APIDocElement {
|
|
43
|
+
api_doc: APIDoc;
|
|
44
|
+
}
|
|
45
|
+
interface APIDoc {
|
|
46
|
+
id: number;
|
|
47
|
+
system_name: string;
|
|
48
|
+
name: string;
|
|
49
|
+
published: boolean;
|
|
50
|
+
skip_swagger_validations: boolean;
|
|
51
|
+
body: string;
|
|
52
|
+
created_at: Date;
|
|
53
|
+
updated_at: Date;
|
|
54
|
+
description?: string;
|
|
55
|
+
service_id?: number;
|
|
56
|
+
}
|
|
57
|
+
interface Proxy {
|
|
58
|
+
proxy: ProxyElement;
|
|
59
|
+
}
|
|
60
|
+
interface ProxyElement {
|
|
61
|
+
service_id: number;
|
|
62
|
+
endpoint: string;
|
|
63
|
+
api_backend: string;
|
|
64
|
+
credentials_location: string;
|
|
65
|
+
auth_app_key: string;
|
|
66
|
+
auth_app_id: string;
|
|
67
|
+
auth_user_key: string;
|
|
68
|
+
error_auth_failed: string;
|
|
69
|
+
error_auth_missing: string;
|
|
70
|
+
error_status_auth_failed: number;
|
|
71
|
+
error_headers_auth_failed: string;
|
|
72
|
+
error_status_auth_missing: number;
|
|
73
|
+
error_headers_auth_missing: string;
|
|
74
|
+
error_no_match: string;
|
|
75
|
+
error_status_no_match: number;
|
|
76
|
+
error_headers_no_match: string;
|
|
77
|
+
error_limits_exceeded: string;
|
|
78
|
+
error_status_limits_exceeded: number;
|
|
79
|
+
error_headers_limits_exceeded: string;
|
|
80
|
+
secret_token: string;
|
|
81
|
+
sandbox_endpoint: string;
|
|
82
|
+
api_test_path: string;
|
|
83
|
+
policies_config: PoliciesConfig[];
|
|
84
|
+
created_at: Date;
|
|
85
|
+
updated_at: Date;
|
|
86
|
+
deployment_option: string;
|
|
87
|
+
lock_version: number;
|
|
88
|
+
links: Link[];
|
|
89
|
+
}
|
|
90
|
+
interface PoliciesConfig {
|
|
91
|
+
name: string;
|
|
92
|
+
version: string;
|
|
93
|
+
configuration: Configuration;
|
|
94
|
+
enabled: boolean;
|
|
95
|
+
}
|
|
96
|
+
interface Configuration {
|
|
97
|
+
commands?: Command[];
|
|
98
|
+
}
|
|
99
|
+
interface Command {
|
|
100
|
+
op: string;
|
|
101
|
+
regex: string;
|
|
102
|
+
replace: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare function listServices(baseUrl: string, access_token: string, page: number, size: number): Promise<Services>;
|
|
106
|
+
declare function listApiDocs(baseUrl: string, access_token: string): Promise<APIDocs>;
|
|
107
|
+
declare function getProxyConfig(baseUrl: string, access_token: string, service_id: number): Promise<Proxy>;
|
|
108
|
+
|
|
109
|
+
declare class ThreeScaleApiEntityProvider implements EntityProvider {
|
|
110
|
+
private static SERVICES_FETCH_SIZE;
|
|
111
|
+
private readonly env;
|
|
112
|
+
private readonly baseUrl;
|
|
113
|
+
private readonly accessToken;
|
|
114
|
+
private readonly logger;
|
|
115
|
+
private readonly scheduleFn;
|
|
116
|
+
private connection?;
|
|
117
|
+
static fromConfig(configRoot: Config, options: {
|
|
118
|
+
logger: LoggerService;
|
|
119
|
+
schedule?: TaskRunner;
|
|
120
|
+
scheduler?: PluginTaskScheduler;
|
|
121
|
+
}): ThreeScaleApiEntityProvider[];
|
|
122
|
+
private constructor();
|
|
123
|
+
private createScheduleFn;
|
|
124
|
+
getProviderName(): string;
|
|
125
|
+
connect(connection: EntityProviderConnection): Promise<void>;
|
|
126
|
+
run(): Promise<void>;
|
|
127
|
+
private buildApiEntityFromService;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare const dynamicPluginInstaller: BackendDynamicPluginInstaller;
|
|
131
|
+
|
|
132
|
+
export { ThreeScaleApiEntityProvider, dynamicPluginInstaller, getProxyConfig, listApiDocs, listServices };
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@backstage-community/plugin-3scale-backend",
|
|
3
|
+
"version": "1.8.1",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"main": "./dist/index.cjs.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"backstage": {
|
|
11
|
+
"role": "backend-plugin-module",
|
|
12
|
+
"supported-versions": "1.28.4",
|
|
13
|
+
"pluginId": "3scale",
|
|
14
|
+
"pluginPackage": "@backstage-community/plugin-3scale-backend"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"require": "./dist/index.cjs.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.cjs.js"
|
|
21
|
+
},
|
|
22
|
+
"./alpha": {
|
|
23
|
+
"require": "./dist/alpha.cjs.js",
|
|
24
|
+
"types": "./dist/alpha.d.ts",
|
|
25
|
+
"default": "./dist/alpha.cjs.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "backstage-cli package build",
|
|
31
|
+
"clean": "backstage-cli package clean",
|
|
32
|
+
"export-dynamic": "janus-cli package export-dynamic-plugin --no-embed-as-dependencies",
|
|
33
|
+
"lint": "backstage-cli package lint",
|
|
34
|
+
"postpack": "backstage-cli package postpack",
|
|
35
|
+
"postversion": "yarn run export-dynamic",
|
|
36
|
+
"prepack": "backstage-cli package prepack",
|
|
37
|
+
"start": "backstage-cli package start",
|
|
38
|
+
"test": "backstage-cli package test --passWithNoTests --coverage",
|
|
39
|
+
"tsc": "tsc"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@backstage/backend-common": "^0.23.3",
|
|
43
|
+
"@backstage/backend-dynamic-feature-service": "^0.2.15",
|
|
44
|
+
"@backstage/backend-plugin-api": "^0.7.0",
|
|
45
|
+
"@backstage/backend-tasks": "^0.5.27",
|
|
46
|
+
"@backstage/catalog-model": "^1.5.0",
|
|
47
|
+
"@backstage/config": "^1.2.0",
|
|
48
|
+
"@backstage/plugin-catalog-node": "^1.12.4"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@backstage/cli": "0.26.11",
|
|
52
|
+
"@janus-idp/cli": "1.13.0",
|
|
53
|
+
"@types/supertest": "2.0.16",
|
|
54
|
+
"msw": "1.3.3",
|
|
55
|
+
"supertest": "6.3.4"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"dist",
|
|
59
|
+
"config.d.ts",
|
|
60
|
+
"dist-dynamic/*.*",
|
|
61
|
+
"dist-dynamic/dist/**",
|
|
62
|
+
"dist-dynamic/alpha/*",
|
|
63
|
+
"app-config.yaml",
|
|
64
|
+
"alpha"
|
|
65
|
+
],
|
|
66
|
+
"configSchema": "config.d.ts",
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "https://github.com/backstage/community-plugins",
|
|
70
|
+
"directory": "workspaces/3scale/plugins/3scale-backend"
|
|
71
|
+
},
|
|
72
|
+
"keywords": [
|
|
73
|
+
"support:tech-preview",
|
|
74
|
+
"lifecycle:active",
|
|
75
|
+
"backstage",
|
|
76
|
+
"plugin"
|
|
77
|
+
],
|
|
78
|
+
"homepage": "https://red.ht/rhdh",
|
|
79
|
+
"bugs": "https://github.com/backstage/community-plugins/issues",
|
|
80
|
+
"author": "Red Hat"
|
|
81
|
+
}
|