@backstage/plugin-kubernetes-react 0.2.0 → 0.2.1-next.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 CHANGED
@@ -1,5 +1,33 @@
1
1
  # @backstage/plugin-kubernetes-react
2
2
 
3
+ ## 0.2.1-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d5d2c67: Add `authuser` search parameter to GKE cluster link formatter in k8s plugin
8
+
9
+ Thanks to this, people with multiple simultaneously logged-in accounts in their GCP console will automatically view objects with the same email as the one signed in to the Google auth provider in Backstage.
10
+
11
+ - Updated dependencies
12
+ - @backstage/core-plugin-api@1.8.2-next.0
13
+ - @backstage/core-components@0.13.10-next.1
14
+ - @backstage/catalog-model@1.4.3
15
+ - @backstage/errors@1.2.3
16
+ - @backstage/types@1.1.1
17
+ - @backstage/plugin-kubernetes-common@0.7.3-next.0
18
+
19
+ ## 0.2.1-next.0
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+ - @backstage/core-components@0.13.10-next.0
25
+ - @backstage/plugin-kubernetes-common@0.7.3-next.0
26
+ - @backstage/catalog-model@1.4.3
27
+ - @backstage/core-plugin-api@1.8.1
28
+ - @backstage/errors@1.2.3
29
+ - @backstage/types@1.1.1
30
+
3
31
  ## 0.2.0
4
32
 
5
33
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import React__default from 'react';
5
5
  import { IObjectMeta, IIoK8sApimachineryPkgApisMetaV1ObjectMeta } from '@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta';
6
6
  import { TypeMeta } from '@kubernetes-models/base';
7
7
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
8
- import { OAuthApi, OpenIdConnectApi, DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
8
+ import { OAuthApi, OpenIdConnectApi, DiscoveryApi, IdentityApi, ProfileInfoApi } from '@backstage/core-plugin-api';
9
9
  import * as kubernetes_models_v1 from 'kubernetes-models/v1';
10
10
  import { Event, Pod, IContainer, IContainerStatus } from 'kubernetes-models/v1';
11
11
  import { JsonObject } from '@backstage/types';
@@ -331,6 +331,8 @@ declare class EksClusterLinksFormatter implements ClusterLinksFormatter {
331
331
 
332
332
  /** @public */
333
333
  declare class GkeClusterLinksFormatter implements ClusterLinksFormatter {
334
+ private readonly googleAuthApi;
335
+ constructor(googleAuthApi: ProfileInfoApi | undefined);
334
336
  formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL>;
335
337
  }
336
338
 
@@ -352,7 +354,9 @@ declare class RancherClusterLinksFormatter implements ClusterLinksFormatter {
352
354
  /** @public */
353
355
  declare const DEFAULT_FORMATTER_NAME = "standard";
354
356
  /** @public */
355
- declare function getDefaultFormatters(_deps: {}): Record<string, ClusterLinksFormatter>;
357
+ declare function getDefaultFormatters(deps: {
358
+ googleAuthApi: ProfileInfoApi;
359
+ }): Record<string, ClusterLinksFormatter>;
356
360
 
357
361
  /**
358
362
  * Props for Cluster
package/dist/index.esm.js CHANGED
@@ -656,6 +656,9 @@ const kindMappings$3 = {
656
656
  horizontalpodautoscaler: "deployment"
657
657
  };
658
658
  class GkeClusterLinksFormatter {
659
+ constructor(googleAuthApi) {
660
+ this.googleAuthApi = googleAuthApi;
661
+ }
659
662
  async formatClusterLink(options) {
660
663
  var _a, _b, _c, _d;
661
664
  if (!options.dashboardParameters) {
@@ -695,6 +698,12 @@ class GkeClusterLinksFormatter {
695
698
  }
696
699
  const result = new URL(path, basePath);
697
700
  result.searchParams.set("project", args.projectId);
701
+ if (this.googleAuthApi) {
702
+ const profile = await this.googleAuthApi.getProfile({ optional: true });
703
+ if (profile == null ? void 0 : profile.email) {
704
+ result.searchParams.set("authuser", profile.email);
705
+ }
706
+ }
698
707
  return result;
699
708
  }
700
709
  }
@@ -805,12 +814,12 @@ class RancherClusterLinksFormatter {
805
814
  }
806
815
 
807
816
  const DEFAULT_FORMATTER_NAME = "standard";
808
- function getDefaultFormatters(_deps) {
817
+ function getDefaultFormatters(deps) {
809
818
  return {
810
819
  standard: new StandardClusterLinksFormatter(),
811
820
  aks: new AksClusterLinksFormatter(),
812
821
  eks: new EksClusterLinksFormatter(),
813
- gke: new GkeClusterLinksFormatter(),
822
+ gke: new GkeClusterLinksFormatter(deps.googleAuthApi),
814
823
  openshift: new OpenshiftClusterLinksFormatter(),
815
824
  rancher: new RancherClusterLinksFormatter()
816
825
  };