@backstage/core-components 0.0.0-nightly-202201323044 → 0.0.0-nightly-202201422556
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 +13 -5
- package/dist/index.d.ts +31 -2
- package/dist/index.esm.js +152 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +14 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
# @backstage/core-components
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-202201422556
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- 306d879536: chore(deps): bump `react-syntax-highligher` and `swagger-ui-react`
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/config@0.0.0-nightly-202201422556
|
|
10
|
+
|
|
11
|
+
## 0.8.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 6415189d99: Add a `ProxiedSignInPage` that can be used e.g. for GCP IAP and AWS ALB
|
|
7
16
|
- de2396da24: Create a short delay when `<SidebarSubmenu/>` is opened
|
|
8
17
|
- 5333451def: Cleaned up API exports
|
|
9
18
|
- e2eb92c109: Updated `ResponseErrorPanel` to not use the deprecated `data` property of `ResponseError`.
|
|
10
19
|
- Updated dependencies
|
|
11
|
-
- @backstage/config@0.
|
|
12
|
-
- @backstage/core-plugin-api@0.
|
|
13
|
-
- @backstage/errors@0.
|
|
14
|
-
- @backstage/theme@0.0.0-nightly-202201323044
|
|
20
|
+
- @backstage/config@0.1.12
|
|
21
|
+
- @backstage/core-plugin-api@0.5.0
|
|
22
|
+
- @backstage/errors@0.2.0
|
|
15
23
|
|
|
16
24
|
## 0.8.3
|
|
17
25
|
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { BackstagePalette, BackstageTheme } from '@backstage/theme';
|
|
|
13
13
|
import { TabProps as TabProps$1 } from '@material-ui/core/Tab';
|
|
14
14
|
import { Column, MaterialTableProps } from '@material-table/core';
|
|
15
15
|
import { SparklinesProps, SparklinesLineProps } from 'react-sparklines';
|
|
16
|
-
import { IconComponent, ApiRef, ProfileInfoApi, BackstageIdentityApi, SessionApi,
|
|
16
|
+
import { IconComponent, SignInPageProps, ApiRef, ProfileInfoApi, BackstageIdentityApi, SessionApi, IdentityApi, SignInResult, BackstageUserIdentity, ProfileInfo } from '@backstage/core-plugin-api';
|
|
17
17
|
import * as _material_ui_styles from '@material-ui/styles';
|
|
18
18
|
import * as _material_ui_core_styles from '@material-ui/core/styles';
|
|
19
19
|
import { WithStyles, Theme } from '@material-ui/core/styles';
|
|
@@ -1339,6 +1339,35 @@ declare type PageWithHeaderProps = ComponentProps<typeof Header> & {
|
|
|
1339
1339
|
};
|
|
1340
1340
|
declare function PageWithHeader(props: PropsWithChildren<PageWithHeaderProps>): JSX.Element;
|
|
1341
1341
|
|
|
1342
|
+
/**
|
|
1343
|
+
* Props for {@link ProxiedSignInPage}.
|
|
1344
|
+
*
|
|
1345
|
+
* @public
|
|
1346
|
+
*/
|
|
1347
|
+
declare type ProxiedSignInPageProps = SignInPageProps & {
|
|
1348
|
+
/**
|
|
1349
|
+
* The provider to use, e.g. "gcp-iap" or "aws-alb". This must correspond to
|
|
1350
|
+
* a properly configured auth provider ID in the auth backend.
|
|
1351
|
+
*/
|
|
1352
|
+
provider: string;
|
|
1353
|
+
};
|
|
1354
|
+
/**
|
|
1355
|
+
* A sign-in page that has no user interface of its own. Instead, it relies on
|
|
1356
|
+
* sign-in being performed by a reverse authenticating proxy that Backstage is
|
|
1357
|
+
* deployed behind, and leverages its session handling.
|
|
1358
|
+
*
|
|
1359
|
+
* @remarks
|
|
1360
|
+
*
|
|
1361
|
+
* This sign-in page is useful when you are using products such as Google
|
|
1362
|
+
* Identity-Aware Proxy or AWS Application Load Balancer or similar, to front
|
|
1363
|
+
* your Backstage installation. This sign-in page implementation will silently
|
|
1364
|
+
* and regularly punch through the proxy to the auth backend to refresh your
|
|
1365
|
+
* frontend session information, without requiring user interaction.
|
|
1366
|
+
*
|
|
1367
|
+
* @public
|
|
1368
|
+
*/
|
|
1369
|
+
declare const ProxiedSignInPage: (props: ProxiedSignInPageProps) => JSX.Element | null;
|
|
1370
|
+
|
|
1342
1371
|
declare type SidebarClassKey = 'root' | 'drawer' | 'drawerOpen';
|
|
1343
1372
|
declare type Props$3 = {
|
|
1344
1373
|
openDelayMs?: number;
|
|
@@ -1705,4 +1734,4 @@ declare type BackstageOverrides = Overrides & {
|
|
|
1705
1734
|
[Name in keyof BackstageComponentsNameToClassKey]?: Partial<StyleRules<BackstageComponentsNameToClassKey[Name]>>;
|
|
1706
1735
|
};
|
|
1707
1736
|
|
|
1708
|
-
export { AlertDisplay, Avatar, AvatarClassKey, AvatarProps, BackstageContentClassKey, BackstageOverrides, BoldHeaderClassKey, BottomLink, BottomLinkClassKey, BottomLinkProps, Breadcrumbs, BreadcrumbsClickableTextClassKey, BreadcrumbsStyledBoxClassKey, BrokenImageIcon, ActualButton as Button, ButtonProps, CardActionsTopRightClassKey, CardTab, CardTabClassKey, CatalogIcon, ChatIcon, ClosedDropdownClassKey, CodeSnippet, CodeSnippetProps, Content, ContentHeader, ContentHeaderClassKey, CopyTextButton, CopyTextButtonProps, CreateButton, CreateButtonProps, CustomProviderClassKey, DashboardIcon, DependencyGraph, DependencyGraphDefaultLabelClassKey, DependencyGraphDefaultNodeClassKey, DependencyGraphEdgeClassKey, DependencyGraphNodeClassKey, DependencyGraphProps, types_d as DependencyGraphTypes, DismissableBanner, DismissableBannerClassKey, DismissbleBannerClassKey, DocsIcon, EmailIcon, EmptyState, EmptyStateClassKey, EmptyStateImageClassKey, ErrorBoundary, ErrorBoundaryProps, ErrorPage, ErrorPageClassKey, ErrorPanel, ErrorPanelClassKey, ErrorPanelProps, FeatureCalloutCircleClassKey, FeatureCalloutCircular, FiltersContainerClassKey, Gauge, GaugeCard, GaugeCardClassKey, GaugeClassKey, GaugeProps, GaugePropsGetColor, GaugePropsGetColorOptions, GitHubIcon, GroupIcon, Header, HeaderClassKey, HeaderIconLinkRow, HeaderIconLinkRowClassKey, HeaderLabel, HeaderLabelClassKey, HeaderTabs, HeaderTabsClassKey, HelpIcon, HomepageTimer, HorizontalScrollGrid, HorizontalScrollGridClassKey, IconLinkVerticalClassKey, IconLinkVerticalProps, InfoCard, InfoCardClassKey, InfoCardVariants, IntroCard, ItemCard, ItemCardGrid, ItemCardGridClassKey, ItemCardGridProps, ItemCardHeader, ItemCardHeaderClassKey, ItemCardHeaderProps, Lifecycle, LifecycleClassKey, LinearGauge, ActualLink as Link, LinkProps, LogViewer, LogViewerClassKey, LogViewerProps, LoginRequestListItemClassKey, MarkdownContent, MarkdownContentClassKey, MetadataTableCellClassKey, MetadataTableListClassKey, MetadataTableListItemClassKey, MetadataTableTitleCellClassKey, MicDropClassKey, MissingAnnotationEmptyState, MissingAnnotationEmptyStateClassKey, OAuthRequestDialog, OAuthRequestDialogClassKey, OpenedDropdownClassKey, OverflowTooltip, OverflowTooltipClassKey, Page, PageClassKey, PageWithHeader, Progress, ResponseErrorPanel, ResponseErrorPanelClassKey, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, SelectClassKey, SelectInputBaseClassKey, SelectItem, SelectedItems, Sidebar, SidebarClassKey, SidebarContext, SidebarContextType, SidebarDivider, SidebarDividerClassKey, SidebarExpandButton, SidebarIntro, SidebarIntroClassKey, SidebarItem, SidebarItemClassKey, SidebarPage, SidebarPageClassKey, SidebarPinStateContext, SidebarPinStateContextType, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpaceClassKey, SidebarSpacer, SidebarSpacerClassKey, SidebarSubmenu, SidebarSubmenuItem, SidebarSubmenuItemDropdownItem, SidebarSubmenuItemProps, SidebarSubmenuProps, SignInPage, SignInPageClassKey, SignInProviderConfig, SimpleStepper, SimpleStepperFooterClassKey, SimpleStepperStep, SimpleStepperStepClassKey, StatusAborted, StatusClassKey, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, StructuredMetadataTableListClassKey, StructuredMetadataTableNestedListClassKey, SubvalueCell, SubvalueCellClassKey, SupportButton, SupportButtonClassKey, SupportConfig, SupportItem, SupportItemLink, Tab, TabBarClassKey, TabIconClassKey, TabbedCard, TabbedCardClassKey, TabbedLayout, Table, TableClassKey, TableColumn, TableFilter, TableFiltersClassKey, TableHeaderClassKey, TableProps, TableState, TableToolbarClassKey, Tabs, TabsClassKey, TrendLine, UserIcon, UserIdentity, WarningIcon, WarningPanel, WarningPanelClassKey, sidebarConfig, useQueryParamState, useSupportConfig };
|
|
1737
|
+
export { AlertDisplay, Avatar, AvatarClassKey, AvatarProps, BackstageContentClassKey, BackstageOverrides, BoldHeaderClassKey, BottomLink, BottomLinkClassKey, BottomLinkProps, Breadcrumbs, BreadcrumbsClickableTextClassKey, BreadcrumbsStyledBoxClassKey, BrokenImageIcon, ActualButton as Button, ButtonProps, CardActionsTopRightClassKey, CardTab, CardTabClassKey, CatalogIcon, ChatIcon, ClosedDropdownClassKey, CodeSnippet, CodeSnippetProps, Content, ContentHeader, ContentHeaderClassKey, CopyTextButton, CopyTextButtonProps, CreateButton, CreateButtonProps, CustomProviderClassKey, DashboardIcon, DependencyGraph, DependencyGraphDefaultLabelClassKey, DependencyGraphDefaultNodeClassKey, DependencyGraphEdgeClassKey, DependencyGraphNodeClassKey, DependencyGraphProps, types_d as DependencyGraphTypes, DismissableBanner, DismissableBannerClassKey, DismissbleBannerClassKey, DocsIcon, EmailIcon, EmptyState, EmptyStateClassKey, EmptyStateImageClassKey, ErrorBoundary, ErrorBoundaryProps, ErrorPage, ErrorPageClassKey, ErrorPanel, ErrorPanelClassKey, ErrorPanelProps, FeatureCalloutCircleClassKey, FeatureCalloutCircular, FiltersContainerClassKey, Gauge, GaugeCard, GaugeCardClassKey, GaugeClassKey, GaugeProps, GaugePropsGetColor, GaugePropsGetColorOptions, GitHubIcon, GroupIcon, Header, HeaderClassKey, HeaderIconLinkRow, HeaderIconLinkRowClassKey, HeaderLabel, HeaderLabelClassKey, HeaderTabs, HeaderTabsClassKey, HelpIcon, HomepageTimer, HorizontalScrollGrid, HorizontalScrollGridClassKey, IconLinkVerticalClassKey, IconLinkVerticalProps, InfoCard, InfoCardClassKey, InfoCardVariants, IntroCard, ItemCard, ItemCardGrid, ItemCardGridClassKey, ItemCardGridProps, ItemCardHeader, ItemCardHeaderClassKey, ItemCardHeaderProps, Lifecycle, LifecycleClassKey, LinearGauge, ActualLink as Link, LinkProps, LogViewer, LogViewerClassKey, LogViewerProps, LoginRequestListItemClassKey, MarkdownContent, MarkdownContentClassKey, MetadataTableCellClassKey, MetadataTableListClassKey, MetadataTableListItemClassKey, MetadataTableTitleCellClassKey, MicDropClassKey, MissingAnnotationEmptyState, MissingAnnotationEmptyStateClassKey, OAuthRequestDialog, OAuthRequestDialogClassKey, OpenedDropdownClassKey, OverflowTooltip, OverflowTooltipClassKey, Page, PageClassKey, PageWithHeader, Progress, ProxiedSignInPage, ProxiedSignInPageProps, ResponseErrorPanel, ResponseErrorPanelClassKey, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, SelectClassKey, SelectInputBaseClassKey, SelectItem, SelectedItems, Sidebar, SidebarClassKey, SidebarContext, SidebarContextType, SidebarDivider, SidebarDividerClassKey, SidebarExpandButton, SidebarIntro, SidebarIntroClassKey, SidebarItem, SidebarItemClassKey, SidebarPage, SidebarPageClassKey, SidebarPinStateContext, SidebarPinStateContextType, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpaceClassKey, SidebarSpacer, SidebarSpacerClassKey, SidebarSubmenu, SidebarSubmenuItem, SidebarSubmenuItemDropdownItem, SidebarSubmenuItemProps, SidebarSubmenuProps, SignInPage, SignInPageClassKey, SignInProviderConfig, SimpleStepper, SimpleStepperFooterClassKey, SimpleStepperStep, SimpleStepperStepClassKey, StatusAborted, StatusClassKey, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, StructuredMetadataTableListClassKey, StructuredMetadataTableNestedListClassKey, SubvalueCell, SubvalueCellClassKey, SupportButton, SupportButtonClassKey, SupportConfig, SupportItem, SupportItemLink, Tab, TabBarClassKey, TabIconClassKey, TabbedCard, TabbedCardClassKey, TabbedLayout, Table, TableClassKey, TableColumn, TableFilter, TableFiltersClassKey, TableHeaderClassKey, TableProps, TableState, TableToolbarClassKey, Tabs, TabsClassKey, TrendLine, UserIcon, UserIdentity, WarningIcon, WarningPanel, WarningPanelClassKey, sidebarConfig, useQueryParamState, useSupportConfig };
|
package/dist/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import Snackbar from '@material-ui/core/Snackbar';
|
|
|
3
3
|
import IconButton from '@material-ui/core/IconButton';
|
|
4
4
|
import CloseIcon from '@material-ui/icons/Close';
|
|
5
5
|
import { Alert } from '@material-ui/lab';
|
|
6
|
-
import { useApi, alertApiRef, useAnalytics, errorApiRef, storageApiRef, useApp, oauthRequestApiRef, configApiRef, attachComponentData, useElementFilter, useApiHolder } from '@backstage/core-plugin-api';
|
|
6
|
+
import { useApi, alertApiRef, useAnalytics, errorApiRef, storageApiRef, useApp, oauthRequestApiRef, configApiRef, attachComponentData, discoveryApiRef, useElementFilter, useApiHolder } from '@backstage/core-plugin-api';
|
|
7
7
|
import pluralize from 'pluralize';
|
|
8
8
|
import { makeStyles, createStyles, useTheme, darken, lighten, withStyles, ThemeProvider, styled } from '@material-ui/core/styles';
|
|
9
9
|
import MaterialAvatar from '@material-ui/core/Avatar';
|
|
@@ -56,7 +56,7 @@ import DialogActions from '@material-ui/core/DialogActions';
|
|
|
56
56
|
import DialogContent from '@material-ui/core/DialogContent';
|
|
57
57
|
import DialogTitle from '@material-ui/core/DialogTitle';
|
|
58
58
|
import ListItemAvatar from '@material-ui/core/ListItemAvatar';
|
|
59
|
-
import { isError, ForwardedError } from '@backstage/errors';
|
|
59
|
+
import { isError, ResponseError, ForwardedError } from '@backstage/errors';
|
|
60
60
|
import TextTruncate from 'react-text-truncate';
|
|
61
61
|
import useMountedState from 'react-use/lib/useMountedState';
|
|
62
62
|
import LinearProgress from '@material-ui/core/LinearProgress';
|
|
@@ -114,6 +114,8 @@ import { Sparklines, SparklinesLine } from 'react-sparklines';
|
|
|
114
114
|
import MicDropSvgUrl from './layout/ErrorPage/mic-drop.svg';
|
|
115
115
|
import MaterialBreadcrumbs from '@material-ui/core/Breadcrumbs';
|
|
116
116
|
import CardMedia from '@material-ui/core/CardMedia';
|
|
117
|
+
import useAsync from 'react-use/lib/useAsync';
|
|
118
|
+
import { z } from 'zod';
|
|
117
119
|
import ArrowForwardIosIcon from '@material-ui/icons/ArrowForwardIos';
|
|
118
120
|
import ArrowBackIosIcon from '@material-ui/icons/ArrowBackIos';
|
|
119
121
|
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
|
|
@@ -4269,6 +4271,153 @@ function PageWithHeader(props) {
|
|
|
4269
4271
|
}), children);
|
|
4270
4272
|
}
|
|
4271
4273
|
|
|
4274
|
+
const proxiedSessionSchema = z.object({
|
|
4275
|
+
providerInfo: z.object({}).catchall(z.unknown()).optional(),
|
|
4276
|
+
profile: z.object({
|
|
4277
|
+
email: z.string().optional(),
|
|
4278
|
+
displayName: z.string().optional(),
|
|
4279
|
+
picture: z.string().optional()
|
|
4280
|
+
}),
|
|
4281
|
+
backstageIdentity: z.object({
|
|
4282
|
+
token: z.string(),
|
|
4283
|
+
identity: z.object({
|
|
4284
|
+
type: z.literal("user"),
|
|
4285
|
+
userEntityRef: z.string(),
|
|
4286
|
+
ownershipEntityRefs: z.array(z.string())
|
|
4287
|
+
})
|
|
4288
|
+
})
|
|
4289
|
+
});
|
|
4290
|
+
|
|
4291
|
+
const DEFAULTS = {
|
|
4292
|
+
defaultTokenExpiryMillis: 5 * 60 * 1e3,
|
|
4293
|
+
tokenExpiryMarginMillis: 5 * 60 * 1e3
|
|
4294
|
+
};
|
|
4295
|
+
function tokenToExpiry(jwtToken) {
|
|
4296
|
+
const fallback = new Date(Date.now() + DEFAULTS.defaultTokenExpiryMillis);
|
|
4297
|
+
if (!jwtToken) {
|
|
4298
|
+
return fallback;
|
|
4299
|
+
}
|
|
4300
|
+
const [_header, rawPayload, _signature] = jwtToken.split(".");
|
|
4301
|
+
const payload = JSON.parse(atob(rawPayload));
|
|
4302
|
+
if (typeof payload.exp !== "number") {
|
|
4303
|
+
return fallback;
|
|
4304
|
+
}
|
|
4305
|
+
return new Date(payload.exp * 1e3 - DEFAULTS.tokenExpiryMarginMillis);
|
|
4306
|
+
}
|
|
4307
|
+
class ProxiedSignInIdentity {
|
|
4308
|
+
constructor(options) {
|
|
4309
|
+
this.options = options;
|
|
4310
|
+
this.abortController = new AbortController();
|
|
4311
|
+
this.state = { type: "empty" };
|
|
4312
|
+
}
|
|
4313
|
+
async start() {
|
|
4314
|
+
await this.getSessionAsync();
|
|
4315
|
+
}
|
|
4316
|
+
getUserId() {
|
|
4317
|
+
const { backstageIdentity } = this.getSessionSync();
|
|
4318
|
+
const ref = backstageIdentity.identity.userEntityRef;
|
|
4319
|
+
const match = /^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(ref);
|
|
4320
|
+
if (!match) {
|
|
4321
|
+
throw new TypeError(`Invalid user entity reference "${ref}"`);
|
|
4322
|
+
}
|
|
4323
|
+
return match[3];
|
|
4324
|
+
}
|
|
4325
|
+
async getIdToken() {
|
|
4326
|
+
const session = await this.getSessionAsync();
|
|
4327
|
+
return session.backstageIdentity.token;
|
|
4328
|
+
}
|
|
4329
|
+
getProfile() {
|
|
4330
|
+
const session = this.getSessionSync();
|
|
4331
|
+
return session.profile;
|
|
4332
|
+
}
|
|
4333
|
+
async getProfileInfo() {
|
|
4334
|
+
const session = await this.getSessionAsync();
|
|
4335
|
+
return session.profile;
|
|
4336
|
+
}
|
|
4337
|
+
async getBackstageIdentity() {
|
|
4338
|
+
const session = await this.getSessionAsync();
|
|
4339
|
+
return session.backstageIdentity.identity;
|
|
4340
|
+
}
|
|
4341
|
+
async getCredentials() {
|
|
4342
|
+
const session = await this.getSessionAsync();
|
|
4343
|
+
return {
|
|
4344
|
+
token: session.backstageIdentity.token
|
|
4345
|
+
};
|
|
4346
|
+
}
|
|
4347
|
+
async signOut() {
|
|
4348
|
+
this.abortController.abort();
|
|
4349
|
+
}
|
|
4350
|
+
getSessionSync() {
|
|
4351
|
+
if (this.state.type === "active") {
|
|
4352
|
+
return this.state.session;
|
|
4353
|
+
} else if (this.state.type === "fetching" && this.state.previous) {
|
|
4354
|
+
return this.state.previous;
|
|
4355
|
+
}
|
|
4356
|
+
throw new Error("No session available. Try reloading your browser page.");
|
|
4357
|
+
}
|
|
4358
|
+
async getSessionAsync() {
|
|
4359
|
+
if (this.state.type === "fetching") {
|
|
4360
|
+
return this.state.promise;
|
|
4361
|
+
} else if (this.state.type === "active" && new Date() < this.state.expiresAt) {
|
|
4362
|
+
return this.state.session;
|
|
4363
|
+
}
|
|
4364
|
+
const previous = this.state.type === "active" ? this.state.session : void 0;
|
|
4365
|
+
const promise = this.fetchSession().then((session) => {
|
|
4366
|
+
this.state = {
|
|
4367
|
+
type: "active",
|
|
4368
|
+
session,
|
|
4369
|
+
expiresAt: tokenToExpiry(session.backstageIdentity.token)
|
|
4370
|
+
};
|
|
4371
|
+
return session;
|
|
4372
|
+
}, (error) => {
|
|
4373
|
+
this.state = {
|
|
4374
|
+
type: "failed",
|
|
4375
|
+
error
|
|
4376
|
+
};
|
|
4377
|
+
throw error;
|
|
4378
|
+
});
|
|
4379
|
+
this.state = {
|
|
4380
|
+
type: "fetching",
|
|
4381
|
+
promise,
|
|
4382
|
+
previous
|
|
4383
|
+
};
|
|
4384
|
+
return promise;
|
|
4385
|
+
}
|
|
4386
|
+
async fetchSession() {
|
|
4387
|
+
const baseUrl = await this.options.discoveryApi.getBaseUrl("auth");
|
|
4388
|
+
const response = await fetch(`${baseUrl}/${this.options.provider}/refresh`, {
|
|
4389
|
+
signal: this.abortController.signal,
|
|
4390
|
+
headers: { "x-requested-with": "XMLHttpRequest" },
|
|
4391
|
+
credentials: "include"
|
|
4392
|
+
});
|
|
4393
|
+
if (!response.ok) {
|
|
4394
|
+
throw await ResponseError.fromResponse(response);
|
|
4395
|
+
}
|
|
4396
|
+
return proxiedSessionSchema.parse(await response.json());
|
|
4397
|
+
}
|
|
4398
|
+
}
|
|
4399
|
+
|
|
4400
|
+
const ProxiedSignInPage = (props) => {
|
|
4401
|
+
const discoveryApi = useApi(discoveryApiRef);
|
|
4402
|
+
const { loading, error } = useAsync(async () => {
|
|
4403
|
+
const identity = new ProxiedSignInIdentity({
|
|
4404
|
+
provider: props.provider,
|
|
4405
|
+
discoveryApi
|
|
4406
|
+
});
|
|
4407
|
+
await identity.start();
|
|
4408
|
+
props.onSignInSuccess(identity);
|
|
4409
|
+
}, []);
|
|
4410
|
+
if (loading) {
|
|
4411
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
4412
|
+
} else if (error) {
|
|
4413
|
+
return /* @__PURE__ */ React.createElement(ErrorPanel, {
|
|
4414
|
+
title: "You do not appear to be signed in. Please try reloading the browser page.",
|
|
4415
|
+
error
|
|
4416
|
+
});
|
|
4417
|
+
}
|
|
4418
|
+
return null;
|
|
4419
|
+
};
|
|
4420
|
+
|
|
4272
4421
|
const drawerWidthClosed = 72;
|
|
4273
4422
|
const iconPadding = 24;
|
|
4274
4423
|
const userBadgePadding = 18;
|
|
@@ -5835,5 +5984,5 @@ function CardTab(props) {
|
|
|
5835
5984
|
});
|
|
5836
5985
|
}
|
|
5837
5986
|
|
|
5838
|
-
export { AlertDisplay, Avatar, BottomLink, Breadcrumbs, BrokenImageIcon, ActualButton as Button, CardTab, CatalogIcon, ChatIcon, CodeSnippet, Content, ContentHeader, CopyTextButton, CreateButton, DashboardIcon, DependencyGraph, types as DependencyGraphTypes, DismissableBanner, DocsIcon, EmailIcon, EmptyState, ErrorBoundary, ErrorPage, ErrorPanel, FeatureCalloutCircular, Gauge, GaugeCard, GitHubIcon, GroupIcon, Header, HeaderIconLinkRow, HeaderLabel, HeaderTabs, HelpIcon, HomepageTimer, HorizontalScrollGrid, InfoCard, IntroCard, ItemCard, ItemCardGrid, ItemCardHeader, Lifecycle, LinearGauge, ActualLink as Link, LogViewer, MarkdownContent, MissingAnnotationEmptyState, OAuthRequestDialog, OverflowTooltip, Page, PageWithHeader, Progress, ResponseErrorPanel, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, Sidebar, SidebarContext, SidebarDivider, SidebarExpandButton, SidebarIntro, SidebarItem, SidebarPage, SidebarPinStateContext, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpacer, SidebarSubmenu, SidebarSubmenuItem, SignInPage, SimpleStepper, SimpleStepperStep, StatusAborted, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, SubvalueCell, SupportButton, TabbedCard, TabbedLayout, Table, Tabs, TrendLine, UserIcon, UserIdentity, WarningIcon, WarningPanel, sidebarConfig, useQueryParamState, useSupportConfig };
|
|
5987
|
+
export { AlertDisplay, Avatar, BottomLink, Breadcrumbs, BrokenImageIcon, ActualButton as Button, CardTab, CatalogIcon, ChatIcon, CodeSnippet, Content, ContentHeader, CopyTextButton, CreateButton, DashboardIcon, DependencyGraph, types as DependencyGraphTypes, DismissableBanner, DocsIcon, EmailIcon, EmptyState, ErrorBoundary, ErrorPage, ErrorPanel, FeatureCalloutCircular, Gauge, GaugeCard, GitHubIcon, GroupIcon, Header, HeaderIconLinkRow, HeaderLabel, HeaderTabs, HelpIcon, HomepageTimer, HorizontalScrollGrid, InfoCard, IntroCard, ItemCard, ItemCardGrid, ItemCardHeader, Lifecycle, LinearGauge, ActualLink as Link, LogViewer, MarkdownContent, MissingAnnotationEmptyState, OAuthRequestDialog, OverflowTooltip, Page, PageWithHeader, Progress, ProxiedSignInPage, ResponseErrorPanel, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, Sidebar, SidebarContext, SidebarDivider, SidebarExpandButton, SidebarIntro, SidebarItem, SidebarPage, SidebarPinStateContext, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpacer, SidebarSubmenu, SidebarSubmenuItem, SignInPage, SimpleStepper, SimpleStepperStep, StatusAborted, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, SubvalueCell, SupportButton, TabbedCard, TabbedLayout, Table, Tabs, TrendLine, UserIcon, UserIdentity, WarningIcon, WarningPanel, sidebarConfig, useQueryParamState, useSupportConfig };
|
|
5839
5988
|
//# sourceMappingURL=index.esm.js.map
|