@backstage/plugin-kubernetes 0.9.0-next.1 → 0.9.0-next.2
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 +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +28 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @backstage/plugin-kubernetes
|
|
2
2
|
|
|
3
|
+
## 0.9.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c7bad1005ba: The Kubernetes plugin now requests AKS access tokens from Azure when retrieving
|
|
8
|
+
objects from clusters configured with `authProvider: aks` and sets `auth.aks` in
|
|
9
|
+
its request bodies appropriately.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
- @backstage/theme@0.3.0-next.0
|
|
12
|
+
- @backstage/core-components@0.13.1-next.1
|
|
13
|
+
- @backstage/plugin-kubernetes-common@0.6.3-next.0
|
|
14
|
+
- @backstage/plugin-catalog-react@1.6.0-next.2
|
|
15
|
+
- @backstage/config@1.0.7
|
|
16
|
+
- @backstage/core-plugin-api@1.5.1
|
|
17
|
+
|
|
3
18
|
## 0.9.0-next.1
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ interface KubernetesAuthProvidersApi {
|
|
|
75
75
|
declare class KubernetesAuthProviders implements KubernetesAuthProvidersApi {
|
|
76
76
|
private readonly kubernetesAuthProviderMap;
|
|
77
77
|
constructor(options: {
|
|
78
|
+
microsoftAuthApi: OAuthApi;
|
|
78
79
|
googleAuthApi: OAuthApi;
|
|
79
80
|
oidcProviders?: {
|
|
80
81
|
[key: string]: OpenIdConnectApi;
|
package/dist/index.esm.js
CHANGED
|
@@ -187,6 +187,25 @@ class OidcKubernetesAuthProvider {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
class AksKubernetesAuthProvider {
|
|
191
|
+
constructor(microsoftAuthApi) {
|
|
192
|
+
this.microsoftAuthApi = microsoftAuthApi;
|
|
193
|
+
}
|
|
194
|
+
async decorateRequestBodyForAuth(requestBody) {
|
|
195
|
+
return {
|
|
196
|
+
...requestBody,
|
|
197
|
+
auth: { ...requestBody.auth, aks: (await this.getCredentials()).token }
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
async getCredentials() {
|
|
201
|
+
return {
|
|
202
|
+
token: await this.microsoftAuthApi.getAccessToken(
|
|
203
|
+
"6dae42f8-4368-4678-94ff-3960e28e3630/user.read"
|
|
204
|
+
)
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
190
209
|
class KubernetesAuthProviders {
|
|
191
210
|
constructor(options) {
|
|
192
211
|
this.kubernetesAuthProviderMap = /* @__PURE__ */ new Map();
|
|
@@ -214,6 +233,10 @@ class KubernetesAuthProviders {
|
|
|
214
233
|
"localKubectlProxy",
|
|
215
234
|
new ServerSideKubernetesAuthProvider()
|
|
216
235
|
);
|
|
236
|
+
this.kubernetesAuthProviderMap.set(
|
|
237
|
+
"aks",
|
|
238
|
+
new AksKubernetesAuthProvider(options.microsoftAuthApi)
|
|
239
|
+
);
|
|
217
240
|
if (options.oidcProviders) {
|
|
218
241
|
Object.keys(options.oidcProviders).forEach((provider) => {
|
|
219
242
|
this.kubernetesAuthProviderMap.set(
|
|
@@ -344,7 +367,11 @@ const kubernetesPlugin = createPlugin({
|
|
|
344
367
|
okta: oktaAuthApi,
|
|
345
368
|
onelogin: oneloginAuthApi
|
|
346
369
|
};
|
|
347
|
-
return new KubernetesAuthProviders({
|
|
370
|
+
return new KubernetesAuthProviders({
|
|
371
|
+
microsoftAuthApi,
|
|
372
|
+
googleAuthApi,
|
|
373
|
+
oidcProviders
|
|
374
|
+
});
|
|
348
375
|
}
|
|
349
376
|
})
|
|
350
377
|
],
|