@backstage/core-components 0.18.10 → 0.18.11-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/components/Table/Filters.esm.js +8 -1
- package/dist/components/Table/Filters.esm.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/layout/ProxiedSignInPage/ProxiedSignInIdentity.esm.js +6 -1
- package/dist/layout/ProxiedSignInPage/ProxiedSignInIdentity.esm.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @backstage/core-components
|
|
2
2
|
|
|
3
|
+
## 0.18.11-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e0889a3: chore(deps): bump `qs` from 6.15.1 to 6.15.2
|
|
8
|
+
- a07e6a3: Added the correctly-spelled `'header'` literal to the `TableFiltersClassKey` union type and deprecated the previous typoed `'heder'` literal. The generated CSS class with the old key is preserved for backwards compatibility; switch to `'header'` to avoid future removal.
|
|
9
|
+
- 8add9b9: Fixed the proxy-based sign-in page failing to read the session token when the proxy issues a token whose payload is encoded using the URL-safe base64 alphabet. Such tokens are now decoded correctly so sign-in no longer breaks.
|
|
10
|
+
|
|
3
11
|
## 0.18.10
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -27,6 +27,13 @@ const useFilterStyles = makeStyles(
|
|
|
27
27
|
justifyContent: "space-between",
|
|
28
28
|
borderBottom: `1px solid ${theme.palette.grey[500]}`
|
|
29
29
|
},
|
|
30
|
+
// Intentionally empty: the deprecated `heder` class is still applied to
|
|
31
|
+
// the same element as `header` so legacy theme overrides on
|
|
32
|
+
// `BackstageTableFilters.heder` continue to work. Keeping this rule empty
|
|
33
|
+
// (rather than duplicating `header`'s styles) avoids clobbering overrides
|
|
34
|
+
// on the canonical `header` key — JSS injects rules in key order, so an
|
|
35
|
+
// empty `heder` defined after `header` has no properties to override.
|
|
36
|
+
heder: {},
|
|
30
37
|
filters: {
|
|
31
38
|
display: "flex",
|
|
32
39
|
flexDirection: "column",
|
|
@@ -53,7 +60,7 @@ const Filters = (props) => {
|
|
|
53
60
|
onChangeFilters(selectedFilters);
|
|
54
61
|
}, [selectedFilters, onChangeFilters]);
|
|
55
62
|
return /* @__PURE__ */ jsxs(Box, { className: classes.root, children: [
|
|
56
|
-
/* @__PURE__ */ jsxs(Box, { className: classes.header
|
|
63
|
+
/* @__PURE__ */ jsxs(Box, { className: `${classes.header} ${classes.heder}`, children: [
|
|
57
64
|
/* @__PURE__ */ jsx(Box, { className: classes.value, children: t("table.filter.title") }),
|
|
58
65
|
/* @__PURE__ */ jsx(Button, { color: "primary", onClick: handleClick, children: t("table.filter.clearAll") })
|
|
59
66
|
] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filters.esm.js","sources":["../../../src/components/Table/Filters.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage 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 */\n\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useEffect, useState } from 'react';\n\nimport { Select } from '../Select';\nimport { SelectProps } from '../Select/Select';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport type TableFiltersClassKey
|
|
1
|
+
{"version":3,"file":"Filters.esm.js","sources":["../../../src/components/Table/Filters.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage 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 */\n\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useEffect, useState } from 'react';\n\nimport { Select } from '../Select';\nimport { SelectProps } from '../Select/Select';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport type TableFiltersClassKey =\n | 'root'\n | 'value'\n | 'header'\n /**\n * @deprecated Use `'header'` instead. This was a typo in the original class key.\n */\n | 'heder'\n | 'filters';\n\nconst useFilterStyles = makeStyles(\n theme => ({\n root: {\n height: '100%',\n width: '315px',\n display: 'flex',\n flexDirection: 'column',\n marginRight: theme.spacing(3),\n },\n value: {\n fontWeight: 'bold',\n fontSize: 18,\n },\n header: {\n display: 'flex',\n alignItems: 'center',\n height: theme.spacing(7.5),\n justifyContent: 'space-between',\n borderBottom: `1px solid ${theme.palette.grey[500]}`,\n },\n // Intentionally empty: the deprecated `heder` class is still applied to\n // the same element as `header` so legacy theme overrides on\n // `BackstageTableFilters.heder` continue to work. Keeping this rule empty\n // (rather than duplicating `header`'s styles) avoids clobbering overrides\n // on the canonical `header` key — JSS injects rules in key order, so an\n // empty `heder` defined after `header` has no properties to override.\n heder: {},\n filters: {\n display: 'flex',\n flexDirection: 'column',\n '& > *': {\n marginTop: theme.spacing(2),\n },\n },\n }),\n { name: 'BackstageTableFilters' },\n);\n\nexport type Without<T, K> = Pick<T, Exclude<keyof T, K>>;\n\nexport type Filter = {\n type: 'select' | 'multiple-select';\n element: Without<SelectProps, 'onChange'>;\n};\n\nexport type SelectedFilters = {\n [key: string]: string | string[];\n};\n\ntype Props = {\n filters: Filter[];\n selectedFilters?: SelectedFilters;\n onChangeFilters: (arg: any) => any;\n};\n\nexport const Filters = (props: Props) => {\n const classes = useFilterStyles();\n\n const { onChangeFilters } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const [selectedFilters, setSelectedFilters] = useState<SelectedFilters>({\n ...props.selectedFilters,\n });\n const [reset, triggerReset] = useState(false);\n\n // Trigger re-rendering\n const handleClick = () => {\n setSelectedFilters({});\n triggerReset(el => !el);\n };\n\n useEffect(() => {\n onChangeFilters(selectedFilters);\n }, [selectedFilters, onChangeFilters]);\n\n // As material table doesn't provide a way to add a column filter tab we will make our own filter logic\n return (\n <Box className={classes.root}>\n <Box className={`${classes.header} ${classes.heder}`}>\n <Box className={classes.value}>{t('table.filter.title')}</Box>\n <Button color=\"primary\" onClick={handleClick}>\n {t('table.filter.clearAll')}\n </Button>\n </Box>\n <Box className={classes.filters}>\n {props.filters?.length &&\n props.filters.map(filter => (\n <Select\n triggerReset={reset}\n key={filter.element.label}\n {...(filter.element as SelectProps)}\n selected={selectedFilters[filter.element.label]}\n onChange={el =>\n setSelectedFilters({\n ...selectedFilters,\n [filter.element.label]: el as any,\n })\n }\n />\n ))}\n </Box>\n </Box>\n );\n};\n"],"names":["Select"],"mappings":";;;;;;;;;AAoCA,MAAM,eAAA,GAAkB,UAAA;AAAA,EACtB,CAAA,KAAA,MAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,OAAA;AAAA,MACP,OAAA,EAAS,MAAA;AAAA,MACT,aAAA,EAAe,QAAA;AAAA,MACf,WAAA,EAAa,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,KAC9B;AAAA,IACA,KAAA,EAAO;AAAA,MACL,UAAA,EAAY,MAAA;AAAA,MACZ,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,OAAA,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ableFiltersClassKey = 'root' | 'value' | '
|
|
1315
|
+
type TableFiltersClassKey = 'root' | 'value' | 'header'
|
|
1316
|
+
/**
|
|
1317
|
+
* @deprecated Use `'header'` instead. This was a typo in the original class key.
|
|
1318
|
+
*/
|
|
1319
|
+
| 'heder' | 'filters';
|
|
1316
1320
|
type SelectedFilters = {
|
|
1317
1321
|
[key: string]: string | string[];
|
|
1318
1322
|
};
|
|
@@ -9,13 +9,18 @@ const DEFAULTS = {
|
|
|
9
9
|
// shall start trying to get a new one
|
|
10
10
|
tokenExpiryMarginMillis: 5 * 60 * 1e3
|
|
11
11
|
};
|
|
12
|
+
function decodeBase64Url(value) {
|
|
13
|
+
const base64 = value.replace(/-/g, "+").replace(/_/g, "/");
|
|
14
|
+
const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
|
|
15
|
+
return window.atob(padded);
|
|
16
|
+
}
|
|
12
17
|
function tokenToExpiry(jwtToken) {
|
|
13
18
|
const fallback = new Date(Date.now() + DEFAULTS.defaultTokenExpiryMillis);
|
|
14
19
|
if (!jwtToken) {
|
|
15
20
|
return fallback;
|
|
16
21
|
}
|
|
17
22
|
const [_header, rawPayload, _signature] = jwtToken.split(".");
|
|
18
|
-
const payload = JSON.parse(
|
|
23
|
+
const payload = JSON.parse(decodeBase64Url(rawPayload));
|
|
19
24
|
if (typeof payload.exp !== "number") {
|
|
20
25
|
return fallback;
|
|
21
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProxiedSignInIdentity.esm.js","sources":["../../../src/layout/ProxiedSignInPage/ProxiedSignInIdentity.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage 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 */\n\nimport {\n BackstageUserIdentity,\n discoveryApiRef,\n IdentityApi,\n ProfileInfo,\n} from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { ProxiedSession, proxiedSessionSchema } from './types';\n\nexport const DEFAULTS = {\n // The amount of time between token refreshes, if we fail to get an actual\n // value out of the exp claim\n defaultTokenExpiryMillis: 5 * 60 * 1000,\n // The amount of time before the actual expiry of the Backstage token, that we\n // shall start trying to get a new one\n tokenExpiryMarginMillis: 5 * 60 * 1000,\n} as const;\n\n// When the token expires, with some margin\nexport function tokenToExpiry(jwtToken: string | undefined): Date {\n const fallback = new Date(Date.now() + DEFAULTS.defaultTokenExpiryMillis);\n if (!jwtToken) {\n return fallback;\n }\n\n const [_header, rawPayload, _signature] = jwtToken.split('.');\n const payload = JSON.parse(window.atob(rawPayload));\n if (typeof payload.exp !== 'number') {\n return fallback;\n }\n\n return new Date(payload.exp * 1000 - DEFAULTS.tokenExpiryMarginMillis);\n}\n\ntype ProxiedSignInIdentityOptions = {\n provider: string;\n discoveryApi: typeof discoveryApiRef.T;\n headers?: HeadersInit | (() => HeadersInit) | (() => Promise<HeadersInit>);\n};\n\ntype State =\n | {\n type: 'empty';\n }\n | {\n type: 'fetching';\n promise: Promise<ProxiedSession>;\n previous: ProxiedSession | undefined;\n }\n | {\n type: 'active';\n session: ProxiedSession;\n expiresAt: Date;\n }\n | {\n type: 'failed';\n error: Error;\n };\n\n/**\n * An identity API that gets the user auth information solely based on a\n * provider's `/refresh` endpoint.\n */\nexport class ProxiedSignInIdentity implements IdentityApi {\n private readonly options: ProxiedSignInIdentityOptions;\n private readonly abortController: AbortController;\n private state: State;\n\n constructor(options: ProxiedSignInIdentityOptions) {\n this.options = options;\n this.abortController = new AbortController();\n this.state = { type: 'empty' };\n }\n\n async start() {\n // Try to make a first fetch, bubble up any errors to the caller\n await this.getSessionAsync();\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getUserId} */\n getUserId(): string {\n const { backstageIdentity } = this.getSessionSync();\n const ref = backstageIdentity.identity.userEntityRef;\n const match = /^([^:/]+:)?([^:/]+\\/)?([^:/]+)$/.exec(ref);\n if (!match) {\n throw new TypeError(`Invalid user entity reference \"${ref}\"`);\n }\n\n return match[3];\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getIdToken} */\n async getIdToken(): Promise<string | undefined> {\n const session = await this.getSessionAsync();\n return session.backstageIdentity.token;\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getProfile} */\n getProfile(): ProfileInfo {\n const session = this.getSessionSync();\n return session.profile;\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getProfileInfo} */\n async getProfileInfo(): Promise<ProfileInfo> {\n const session = await this.getSessionAsync();\n return session.profile;\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getBackstageIdentity} */\n async getBackstageIdentity(): Promise<BackstageUserIdentity> {\n const session = await this.getSessionAsync();\n return session.backstageIdentity.identity;\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getCredentials} */\n async getCredentials(): Promise<{ token?: string | undefined }> {\n const session = await this.getSessionAsync();\n return {\n token: session.backstageIdentity.token,\n };\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.signOut} */\n async signOut(): Promise<void> {\n this.abortController.abort();\n }\n\n getSessionSync(): ProxiedSession {\n if (this.state.type === 'active') {\n return this.state.session;\n } else if (this.state.type === 'fetching' && this.state.previous) {\n return this.state.previous;\n }\n throw new Error('No session available. Try reloading your browser page.');\n }\n\n async getSessionAsync(): Promise<ProxiedSession> {\n if (this.state.type === 'fetching') {\n return this.state.promise;\n } else if (\n this.state.type === 'active' &&\n new Date() < this.state.expiresAt\n ) {\n return this.state.session;\n }\n\n const previous =\n this.state.type === 'active' ? this.state.session : undefined;\n\n const promise = this.fetchSession().then(\n session => {\n this.state = {\n type: 'active',\n session,\n expiresAt: tokenToExpiry(session.backstageIdentity.token),\n };\n return session;\n },\n error => {\n this.state = {\n type: 'failed',\n error,\n };\n throw error;\n },\n );\n\n this.state = {\n type: 'fetching',\n promise,\n previous,\n };\n\n return promise;\n }\n\n async fetchSession(): Promise<ProxiedSession> {\n const baseUrl = await this.options.discoveryApi.getBaseUrl('auth');\n\n const headers =\n typeof this.options.headers === 'function'\n ? await this.options.headers()\n : this.options.headers;\n const mergedHeaders = new Headers(headers);\n mergedHeaders.set('X-Requested-With', 'XMLHttpRequest');\n\n // Note that we do not use the fetchApi here, since this all happens before\n // sign-in completes so there can be no automatic token injection and\n // similar.\n const response = await fetch(\n `${baseUrl}/${this.options.provider}/refresh`,\n {\n signal: this.abortController.signal,\n headers: mergedHeaders,\n credentials: 'include',\n },\n );\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return proxiedSessionSchema.parse(await response.json());\n }\n}\n"],"names":[],"mappings":";;;AAyBO,MAAM,QAAA,GAAW;AAAA;AAAA;AAAA,EAGtB,wBAAA,EAA0B,IAAI,EAAA,GAAK,GAAA;AAAA;AAAA;AAAA,EAGnC,uBAAA,EAAyB,IAAI,EAAA,GAAK;AACpC;AAGO,SAAS,cAAc,QAAA,EAAoC;AAChE,EAAA,MAAM,WAAW,IAAI,IAAA,CAAK,KAAK,GAAA,EAAI,GAAI,SAAS,wBAAwB,CAAA;AACxE,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,QAAA;AAAA,EACT;AAEA,EAAA,MAAM,CAAC,OAAA,EAAS,UAAA,EAAY,UAAU,CAAA,GAAI,QAAA,CAAS,MAAM,GAAG,CAAA;AAC5D,EAAA,MAAM,UAAU,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,IAAA,CAAK,UAAU,CAAC,CAAA;AAClD,EAAA,IAAI,OAAO,OAAA,CAAQ,GAAA,KAAQ,QAAA,EAAU;AACnC,IAAA,OAAO,QAAA;AAAA,EACT;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EAAQ,KAAK,eAAA,CAAgB,MAAA;AAAA,QAC7B,OAAA,EAAS,aAAA;AAAA,QACT,WAAA,EAAa;AAAA;AACf,KACF;AAEA,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,MAAM,aAAA,CAAc,YAAA,CAAa,QAAQ,CAAA;AAAA,IACjD;AAEA,IAAA,OAAO,oBAAA,CAAqB,KAAA,CAAM,MAAM,QAAA,CAAS,MAAM,CAAA;AAAA,EACzD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"ProxiedSignInIdentity.esm.js","sources":["../../../src/layout/ProxiedSignInPage/ProxiedSignInIdentity.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage 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 */\n\nimport {\n BackstageUserIdentity,\n discoveryApiRef,\n IdentityApi,\n ProfileInfo,\n} from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { ProxiedSession, proxiedSessionSchema } from './types';\n\nexport const DEFAULTS = {\n // The amount of time between token refreshes, if we fail to get an actual\n // value out of the exp claim\n defaultTokenExpiryMillis: 5 * 60 * 1000,\n // The amount of time before the actual expiry of the Backstage token, that we\n // shall start trying to get a new one\n tokenExpiryMarginMillis: 5 * 60 * 1000,\n} as const;\n\n// Decodes a base64url-encoded string. JWTs encode their segments using base64url\n// (RFC 7515), which substitutes '-' and '_' for '+' and '/' and omits padding.\n// `window.atob` only accepts standard base64, so translate back to that alphabet\n// and restore the padding before decoding.\nfunction decodeBase64Url(value: string): string {\n const base64 = value.replace(/-/g, '+').replace(/_/g, '/');\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, '=');\n return window.atob(padded);\n}\n\n// When the token expires, with some margin\nexport function tokenToExpiry(jwtToken: string | undefined): Date {\n const fallback = new Date(Date.now() + DEFAULTS.defaultTokenExpiryMillis);\n if (!jwtToken) {\n return fallback;\n }\n\n const [_header, rawPayload, _signature] = jwtToken.split('.');\n const payload = JSON.parse(decodeBase64Url(rawPayload));\n if (typeof payload.exp !== 'number') {\n return fallback;\n }\n\n return new Date(payload.exp * 1000 - DEFAULTS.tokenExpiryMarginMillis);\n}\n\ntype ProxiedSignInIdentityOptions = {\n provider: string;\n discoveryApi: typeof discoveryApiRef.T;\n headers?: HeadersInit | (() => HeadersInit) | (() => Promise<HeadersInit>);\n};\n\ntype State =\n | {\n type: 'empty';\n }\n | {\n type: 'fetching';\n promise: Promise<ProxiedSession>;\n previous: ProxiedSession | undefined;\n }\n | {\n type: 'active';\n session: ProxiedSession;\n expiresAt: Date;\n }\n | {\n type: 'failed';\n error: Error;\n };\n\n/**\n * An identity API that gets the user auth information solely based on a\n * provider's `/refresh` endpoint.\n */\nexport class ProxiedSignInIdentity implements IdentityApi {\n private readonly options: ProxiedSignInIdentityOptions;\n private readonly abortController: AbortController;\n private state: State;\n\n constructor(options: ProxiedSignInIdentityOptions) {\n this.options = options;\n this.abortController = new AbortController();\n this.state = { type: 'empty' };\n }\n\n async start() {\n // Try to make a first fetch, bubble up any errors to the caller\n await this.getSessionAsync();\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getUserId} */\n getUserId(): string {\n const { backstageIdentity } = this.getSessionSync();\n const ref = backstageIdentity.identity.userEntityRef;\n const match = /^([^:/]+:)?([^:/]+\\/)?([^:/]+)$/.exec(ref);\n if (!match) {\n throw new TypeError(`Invalid user entity reference \"${ref}\"`);\n }\n\n return match[3];\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getIdToken} */\n async getIdToken(): Promise<string | undefined> {\n const session = await this.getSessionAsync();\n return session.backstageIdentity.token;\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getProfile} */\n getProfile(): ProfileInfo {\n const session = this.getSessionSync();\n return session.profile;\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getProfileInfo} */\n async getProfileInfo(): Promise<ProfileInfo> {\n const session = await this.getSessionAsync();\n return session.profile;\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getBackstageIdentity} */\n async getBackstageIdentity(): Promise<BackstageUserIdentity> {\n const session = await this.getSessionAsync();\n return session.backstageIdentity.identity;\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.getCredentials} */\n async getCredentials(): Promise<{ token?: string | undefined }> {\n const session = await this.getSessionAsync();\n return {\n token: session.backstageIdentity.token,\n };\n }\n\n /** {@inheritdoc @backstage/core-plugin-api#IdentityApi.signOut} */\n async signOut(): Promise<void> {\n this.abortController.abort();\n }\n\n getSessionSync(): ProxiedSession {\n if (this.state.type === 'active') {\n return this.state.session;\n } else if (this.state.type === 'fetching' && this.state.previous) {\n return this.state.previous;\n }\n throw new Error('No session available. Try reloading your browser page.');\n }\n\n async getSessionAsync(): Promise<ProxiedSession> {\n if (this.state.type === 'fetching') {\n return this.state.promise;\n } else if (\n this.state.type === 'active' &&\n new Date() < this.state.expiresAt\n ) {\n return this.state.session;\n }\n\n const previous =\n this.state.type === 'active' ? this.state.session : undefined;\n\n const promise = this.fetchSession().then(\n session => {\n this.state = {\n type: 'active',\n session,\n expiresAt: tokenToExpiry(session.backstageIdentity.token),\n };\n return session;\n },\n error => {\n this.state = {\n type: 'failed',\n error,\n };\n throw error;\n },\n );\n\n this.state = {\n type: 'fetching',\n promise,\n previous,\n };\n\n return promise;\n }\n\n async fetchSession(): Promise<ProxiedSession> {\n const baseUrl = await this.options.discoveryApi.getBaseUrl('auth');\n\n const headers =\n typeof this.options.headers === 'function'\n ? await this.options.headers()\n : this.options.headers;\n const mergedHeaders = new Headers(headers);\n mergedHeaders.set('X-Requested-With', 'XMLHttpRequest');\n\n // Note that we do not use the fetchApi here, since this all happens before\n // sign-in completes so there can be no automatic token injection and\n // similar.\n const response = await fetch(\n `${baseUrl}/${this.options.provider}/refresh`,\n {\n signal: this.abortController.signal,\n headers: mergedHeaders,\n credentials: 'include',\n },\n );\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return proxiedSessionSchema.parse(await response.json());\n }\n}\n"],"names":[],"mappings":";;;AAyBO,MAAM,QAAA,GAAW;AAAA;AAAA;AAAA,EAGtB,wBAAA,EAA0B,IAAI,EAAA,GAAK,GAAA;AAAA;AAAA;AAAA,EAGnC,uBAAA,EAAyB,IAAI,EAAA,GAAK;AACpC;AAMA,SAAS,gBAAgB,KAAA,EAAuB;AAC9C,EAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,IAAA,EAAM,GAAG,CAAA,CAAE,OAAA,CAAQ,MAAM,GAAG,CAAA;AACzD,EAAA,MAAM,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,OAAO,MAAA,GAAS,CAAC,CAAA,GAAI,CAAA,EAAG,GAAG,CAAA;AAClE,EAAA,OAAO,MAAA,CAAO,KAAK,MAAM,CAAA;AAC3B;AAGO,SAAS,cAAc,QAAA,EAAoC;AAChE,EAAA,MAAM,WAAW,IAAI,IAAA,CAAK,KAAK,GAAA,EAAI,GAAI,SAAS,wBAAwB,CAAA;AACxE,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,QAAA;AAAA,EACT;AAEA,EAAA,MAAM,CAAC,OAAA,EAAS,UAAA,EAAY,UAAU,CAAA,GAAI,QAAA,CAAS,MAAM,GAAG,CAAA;AAC5D,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,KAAA,CAAM,eAAA,CAAgB,UAAU,CAAC,CAAA;AACtD,EAAA,IAAI,OAAO,OAAA,CAAQ,GAAA,KAAQ,QAAA,EAAU;AACnC,IAAA,OAAO,QAAA;AAA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,MAAA,EAAQ,KAAK,eAAA,CAAgB,MAAA;AAAA,QAC7B,OAAA,EAAS,aAAA;AAAA,QACT,WAAA,EAAa;AAAA;AACf,KACF;AAEA,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,MAAM,aAAA,CAAc,YAAA,CAAa,QAAQ,CAAA;AAAA,IACjD;AAEA,IAAA,OAAO,oBAAA,CAAqB,KAAA,CAAM,MAAM,QAAA,CAAS,MAAM,CAAA;AAAA,EACzD;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/core-components",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.11-next.0",
|
|
4
4
|
"description": "Core components used by Backstage plugins and apps",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library"
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"test": "backstage-cli package test"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@backstage/config": "
|
|
70
|
-
"@backstage/core-plugin-api": "
|
|
71
|
-
"@backstage/errors": "
|
|
72
|
-
"@backstage/theme": "
|
|
73
|
-
"@backstage/version-bridge": "
|
|
69
|
+
"@backstage/config": "1.3.8",
|
|
70
|
+
"@backstage/core-plugin-api": "1.12.6",
|
|
71
|
+
"@backstage/errors": "1.3.1",
|
|
72
|
+
"@backstage/theme": "0.7.3",
|
|
73
|
+
"@backstage/version-bridge": "1.0.12",
|
|
74
74
|
"@dagrejs/dagre": "^1.1.4",
|
|
75
75
|
"@date-io/core": "^1.3.13",
|
|
76
76
|
"@material-table/core": "^3.1.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"linkifyjs": "4.3.2",
|
|
92
92
|
"lodash": "^4.17.21",
|
|
93
93
|
"parse5": "^6.0.0",
|
|
94
|
-
"qs": "^6.
|
|
94
|
+
"qs": "^6.15.2",
|
|
95
95
|
"rc-progress": "3.5.1",
|
|
96
96
|
"react-full-screen": "^1.1.1",
|
|
97
97
|
"react-helmet": "6.1.0",
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
"zod": "^3.25.76 || ^4.0.0"
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
|
-
"@backstage/app-defaults": "
|
|
114
|
-
"@backstage/cli": "
|
|
115
|
-
"@backstage/core-app-api": "
|
|
116
|
-
"@backstage/test-utils": "
|
|
113
|
+
"@backstage/app-defaults": "1.7.9-next.0",
|
|
114
|
+
"@backstage/cli": "0.36.3-next.0",
|
|
115
|
+
"@backstage/core-app-api": "1.20.1",
|
|
116
|
+
"@backstage/test-utils": "1.7.18",
|
|
117
117
|
"@testing-library/dom": "^10.0.0",
|
|
118
118
|
"@testing-library/jest-dom": "^6.0.0",
|
|
119
119
|
"@testing-library/user-event": "^14.0.0",
|