From 074aa670fef04c92253b0a8d0a62f9131ff0f49d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 06:15:24 +0000 Subject: [PATCH 01/21] build(deps): bump @rollup/plugin-commonjs from 12.0.0 to 13.0.0 Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins) from 12.0.0 to 13.0.0. - [Release notes](https://github.com/rollup/plugins/releases) - [Commits](https://github.com/rollup/plugins/compare/commonjs-v12.0.0...commonjs-v13.0.0) Signed-off-by: dependabot-preview[bot] --- packages/cli/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 97e3aaa972..1a155ef085 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -32,7 +32,7 @@ "@hot-loader/react-dom": "^16.13.0", "@lerna/package-graph": "^3.18.5", "@lerna/project": "^3.18.0", - "@rollup/plugin-commonjs": "^12.0.0", + "@rollup/plugin-commonjs": "^13.0.0", "@rollup/plugin-json": "^4.0.2", "@rollup/plugin-node-resolve": "^7.1.1", "@spotify/eslint-config": "^7.0.1", diff --git a/yarn.lock b/yarn.lock index 20ed4ae91c..54207ed2f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2409,10 +2409,10 @@ prop-types "^15.6.1" react-lifecycles-compat "^3.0.4" -"@rollup/plugin-commonjs@^12.0.0": - version "12.0.0" - resolved "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-12.0.0.tgz#e2f308ae6057499e0f413f878fff7c3a0fdc02a1" - integrity sha512-8+mDQt1QUmN+4Y9D3yCG8AJNewuTSLYPJVzKKUZ+lGeQrI+bV12Tc5HCyt2WdlnG6ihIL/DPbKRJlB40DX40mw== +"@rollup/plugin-commonjs@^13.0.0": + version "13.0.0" + resolved "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-13.0.0.tgz#8a1d684ba6848afe8b9e3d85649d4b2f6f7217ec" + integrity sha512-Anxc3qgkAi7peAyesTqGYidG5GRim9jtg8xhmykNaZkImtvjA7Wsqep08D2mYsqw1IF7rA3lYfciLgzUSgRoqw== dependencies: "@rollup/pluginutils" "^3.0.8" commondir "^1.0.1" From 78baf7f932583fb73c0fe9a9f151e495fa29bad5 Mon Sep 17 00:00:00 2001 From: Raghunandan Date: Mon, 22 Jun 2020 18:02:19 +0200 Subject: [PATCH 02/21] backend - fix types + refactoring --- .../src/lib/OAuthProvider.test.ts | 64 +++++++++----- plugins/auth-backend/src/lib/OAuthProvider.ts | 69 ++++++++------- .../src/lib/PassportStrategyHelper.test.ts | 4 +- .../src/lib/PassportStrategyHelper.ts | 86 +++++++++++-------- .../src/providers/github/provider.ts | 40 ++++++--- .../src/providers/google/provider.ts | 68 +++++++++------ .../src/providers/saml/provider.ts | 76 ++++++++++------ plugins/auth-backend/src/providers/types.ts | 79 ++++++++++++----- 8 files changed, 314 insertions(+), 172 deletions(-) diff --git a/plugins/auth-backend/src/lib/OAuthProvider.test.ts b/plugins/auth-backend/src/lib/OAuthProvider.test.ts index 48952e6dad..d84226214d 100644 --- a/plugins/auth-backend/src/lib/OAuthProvider.test.ts +++ b/plugins/auth-backend/src/lib/OAuthProvider.test.ts @@ -23,7 +23,23 @@ import { verifyNonce, OAuthProvider, } from './OAuthProvider'; -import { AuthResponse, OAuthProviderHandlers } from '../providers/types'; +import { + WebMessageResponse, + OAuthProviderHandlers, + OAuthResponse, +} from '../providers/types'; + +const mockResponseData: OAuthResponse = { + providerInfo: { + accessToken: 'ACCESS_TOKEN', + idToken: 'ID_TOKEN', + expiresInSeconds: 10, + scope: 'email', + }, + profile: { + email: 'foo@bar.com', + }, +}; describe('OAuthProvider Utils', () => { describe('verifyNonce', () => { @@ -38,6 +54,7 @@ describe('OAuthProvider Utils', () => { verifyNonce(mockRequest, 'providera'); }).toThrowError('Missing nonce'); }); + it('should throw error if state nonce missing', () => { const mockRequest = ({ cookies: { @@ -49,6 +66,7 @@ describe('OAuthProvider Utils', () => { verifyNonce(mockRequest, 'providera'); }).toThrowError('Missing nonce'); }); + it('should throw error if nonce mismatch', () => { const mockRequest = ({ cookies: { @@ -62,6 +80,7 @@ describe('OAuthProvider Utils', () => { verifyNonce(mockRequest, 'providera'); }).toThrowError('Invalid nonce'); }); + it('should not throw any error if nonce matches', () => { const mockRequest = ({ cookies: { @@ -85,13 +104,19 @@ describe('OAuthProvider Utils', () => { setHeader: jest.fn().mockReturnThis(), } as unknown) as express.Response; - const data: AuthResponse = { - type: 'auth-result', - payload: { - accessToken: 'ACCESS_TOKEN', - idToken: 'ID_TOKEN', - expiresInSeconds: 10, - scope: 'email', + const data: WebMessageResponse = { + type: 'authorization_response', + response: { + providerInfo: { + accessToken: 'ACCESS_TOKEN', + idToken: 'ID_TOKEN', + expiresInSeconds: 10, + scope: 'email', + }, + profile: { + email: 'foo@bar.com', + }, + userIdToken: 'a.b.c', }, }; const jsonData = JSON.stringify(data); @@ -111,8 +136,8 @@ describe('OAuthProvider Utils', () => { setHeader: jest.fn().mockReturnThis(), } as unknown) as express.Response; - const data: AuthResponse = { - type: 'auth-result', + const data: WebMessageResponse = { + type: 'authorization_response', error: new Error('Unknown error occured'), }; const jsonData = JSON.stringify(data); @@ -161,16 +186,12 @@ describe('OAuthProvider', () => { } async handler() { return { - user: {}, - info: { - refreshToken: 'token', - }, + response: mockResponseData, + refreshToken: 'token', }; } async refresh() { - return { - accessToken: 'token', - }; + return mockResponseData; } } const providerInstance = new MyAuthProvider(); @@ -323,11 +344,10 @@ describe('OAuthProvider', () => { await oauthProvider.refresh(mockRequest, mockResponse); expect(mockResponse.send).toHaveBeenCalledTimes(1); - expect(mockResponse.send).toHaveBeenCalledWith( - expect.objectContaining({ - accessToken: 'token', - }), - ); + expect(mockResponse.send).toHaveBeenCalledWith({ + ...mockResponseData, + userIdToken: 'my-id-token', + }); }); it('handles refresh without capabilities', async () => { diff --git a/plugins/auth-backend/src/lib/OAuthProvider.ts b/plugins/auth-backend/src/lib/OAuthProvider.ts index 38065c3380..1c88dae693 100644 --- a/plugins/auth-backend/src/lib/OAuthProvider.ts +++ b/plugins/auth-backend/src/lib/OAuthProvider.ts @@ -21,6 +21,7 @@ import { AuthResponse, AuthProviderRouteHandlers, OAuthProviderHandlers, + WebMessageResponse, } from '../providers/types'; import { InputError } from '@backstage/backend-common'; import { TokenIssuer } from '../identity'; @@ -53,9 +54,9 @@ export const verifyNonce = (req: express.Request, providerId: string) => { export const postMessageResponse = ( res: express.Response, appOrigin: string, - data: AuthResponse, + response: WebMessageResponse, ) => { - const jsonData = JSON.stringify(data); + const jsonData = JSON.stringify(response); const base64Data = Buffer.from(jsonData, 'utf8').toString('base64'); res.setHeader('Content-Type', 'text/html'); @@ -96,7 +97,7 @@ export class OAuthProvider implements AuthProviderRouteHandlers { this.basePath = url.pathname; } - async start(req: express.Request, res: express.Response): Promise { + async start(req: express.Request, res: express.Response): Promise { // retrieve scopes from request const scope = req.query.scope?.toString() ?? ''; @@ -108,14 +109,15 @@ export class OAuthProvider implements AuthProviderRouteHandlers { // set a nonce cookie before redirecting to oauth provider this.setNonceCookie(res, nonce); - const options = { + const queryParameters = { scope, - accessType: 'offline', - prompt: 'consent', state: nonce, }; - const { url, status } = await this.providerHandlers.start(req, options); + const { url, status } = await this.providerHandlers.start( + req, + queryParameters, + ); res.statusCode = status || 302; res.setHeader('Location', url); @@ -126,16 +128,17 @@ export class OAuthProvider implements AuthProviderRouteHandlers { async frameHandler( req: express.Request, res: express.Response, - ): Promise { + ): Promise { try { // verify nonce cookie and state cookie on callback verifyNonce(req, this.options.providerId); - const { user, info } = await this.providerHandlers.handler(req); + const { response, refreshToken } = await this.providerHandlers.handler( + req, + ); if (!this.options.disableRefresh) { // throw error if missing refresh token - const { refreshToken } = info; if (!refreshToken) { throw new Error('Missing refresh token'); } @@ -144,19 +147,23 @@ export class OAuthProvider implements AuthProviderRouteHandlers { this.setRefreshTokenCookie(res, refreshToken); } - user.userIdToken = await this.options.tokenIssuer.issueToken({ - claims: { sub: user.profile.email }, + const userIdToken = await this.options.tokenIssuer.issueToken({ + claims: { sub: response.profile.email }, }); + const fullResponse: AuthResponse = { + ...response, + userIdToken, + }; // post message back to popup if successful return postMessageResponse(res, this.options.appOrigin, { - type: 'auth-result', - payload: user, + type: 'authorization_response', + response: fullResponse, }); } catch (error) { // post error message back to popup if failure return postMessageResponse(res, this.options.appOrigin, { - type: 'auth-result', + type: 'authorization_response', error: { name: error.name, message: error.message, @@ -165,27 +172,30 @@ export class OAuthProvider implements AuthProviderRouteHandlers { } } - async logout(req: express.Request, res: express.Response): Promise { + async logout(req: express.Request, res: express.Response): Promise { if (!ensuresXRequestedWith(req)) { - return res.status(401).send('Invalid X-Requested-With header'); + res.status(401).send('Invalid X-Requested-With header'); + return; } if (!this.options.disableRefresh) { // remove refresh token cookie before logout this.removeRefreshTokenCookie(res); } - return res.send('logout!'); + res.send('logout!'); } - async refresh(req: express.Request, res: express.Response): Promise { + async refresh(req: express.Request, res: express.Response): Promise { if (!ensuresXRequestedWith(req)) { - return res.status(401).send('Invalid X-Requested-With header'); + res.status(401).send('Invalid X-Requested-With header'); + return; } if (!this.providerHandlers.refresh || this.options.disableRefresh) { - return res.send( + res.send( `Refresh token not supported for provider: ${this.options.providerId}`, ); + return; } try { @@ -200,18 +210,19 @@ export class OAuthProvider implements AuthProviderRouteHandlers { const scope = req.query.scope?.toString() ?? ''; // get new access_token - const refreshInfo = await this.providerHandlers.refresh( - refreshToken, - scope, - ); + const response = await this.providerHandlers.refresh(refreshToken, scope); - refreshInfo.userIdToken = await this.options.tokenIssuer.issueToken({ - claims: { sub: refreshInfo.profile?.email }, + const userIdToken = await this.options.tokenIssuer.issueToken({ + claims: { sub: response.profile.email }, }); + const fullResponse: AuthResponse = { + ...response, + userIdToken, + }; - return res.send(refreshInfo); + res.send(fullResponse); } catch (error) { - return res.status(401).send(`${error.message}`); + res.status(401).send(`${error.message}`); } } diff --git a/plugins/auth-backend/src/lib/PassportStrategyHelper.test.ts b/plugins/auth-backend/src/lib/PassportStrategyHelper.test.ts index 071c949a21..d8f6d25d0f 100644 --- a/plugins/auth-backend/src/lib/PassportStrategyHelper.test.ts +++ b/plugins/auth-backend/src/lib/PassportStrategyHelper.test.ts @@ -82,8 +82,8 @@ describe('PassportStrategyHelper', () => { expect(spyAuthenticate).toBeCalledTimes(1); await expect(frameHandlerStrategyPromise).resolves.toStrictEqual( expect.objectContaining({ - user: { accessToken: 'ACCESS_TOKEN' }, - info: { refreshToken: 'REFRESH_TOKEN' }, + response: { accessToken: 'ACCESS_TOKEN' }, + privateInfo: { refreshToken: 'REFRESH_TOKEN' }, }), ); }); diff --git a/plugins/auth-backend/src/lib/PassportStrategyHelper.ts b/plugins/auth-backend/src/lib/PassportStrategyHelper.ts index 1e8dfca5ed..bb6d1b5d42 100644 --- a/plugins/auth-backend/src/lib/PassportStrategyHelper.ts +++ b/plugins/auth-backend/src/lib/PassportStrategyHelper.ts @@ -26,42 +26,52 @@ import { export const makeProfileInfo = ( profile: passport.Profile, - params: any, + idToken?: string, ): ProfileInfo => { - const { displayName: name } = profile; + const { displayName } = profile; - let email = ''; + let email: string | undefined = undefined; if (profile.emails) { const [firstEmail] = profile.emails; email = firstEmail.value; } - if (!email && params.id_token) { - try { - const decoded: { email: string } = jwtDecoder(params.id_token); - email = decoded.email; - } catch (e) { - console.error('Failed to parse id token and get profile info'); - } - } - - let picture = ''; + let picture: string | undefined = undefined; if (profile.photos) { const [firstPhoto] = profile.photos; picture = firstPhoto.value; } + if ((!email || !picture) && idToken) { + try { + const decoded: Record = jwtDecoder(idToken); + + if (!email && decoded.email) { + email = decoded.email; + } + if (!picture && decoded.picture) { + picture = decoded.picture; + } + } catch (e) { + throw new Error(`Failed to parse id token and get profile info, ${e}`); + } + } + + if (!email) { + throw new Error('No email received in profile info'); + } + return { - name, email, picture, + displayName, }; }; export const executeRedirectStrategy = async ( req: express.Request, providerStrategy: passport.Strategy, - options: any, + options: Record, ): Promise => { return new Promise(resolve => { const strategy = Object.create(providerStrategy); @@ -73,30 +83,32 @@ export const executeRedirectStrategy = async ( }); }; -export const executeFrameHandlerStrategy = async ( +export const executeFrameHandlerStrategy = async ( req: express.Request, providerStrategy: passport.Strategy, ) => { - return new Promise<{ user: any; info: any }>((resolve, reject) => { - const strategy = Object.create(providerStrategy); - strategy.success = (user: any, info: any) => { - resolve({ user, info }); - }; - strategy.fail = ( - info: { type: 'success' | 'error'; message?: string }, - // _status: number, - ) => { - reject(new Error(`Authentication rejected, ${info.message ?? ''}`)); - }; - strategy.error = (error: Error) => { - reject(new Error(`Authentication failed, ${error}`)); - }; - strategy.redirect = () => { - reject(new Error('Unexpected redirect')); - }; + return new Promise<{ response: T; privateInfo: PrivateInfo }>( + (resolve, reject) => { + const strategy = Object.create(providerStrategy); + strategy.success = (response: any, privateInfo: any) => { + resolve({ response, privateInfo }); + }; + strategy.fail = ( + info: { type: 'success' | 'error'; message?: string }, + // _status: number, + ) => { + reject(new Error(`Authentication rejected, ${info.message ?? ''}`)); + }; + strategy.error = (error: Error) => { + reject(new Error(`Authentication failed, ${error}`)); + }; + strategy.redirect = () => { + reject(new Error('Unexpected redirect')); + }; - strategy.authenticate(req, {}); - }); + strategy.authenticate(req, {}); + }, + ); }; export const executeRefreshTokenStrategy = async ( @@ -151,7 +163,7 @@ export const executeRefreshTokenStrategy = async ( export const executeFetchUserProfileStrategy = async ( providerStrategy: passport.Strategy, accessToken: string, - params: any, + idToken?: string, ): Promise => { return new Promise((resolve, reject) => { const anyStrategy = (providerStrategy as unknown) as ProviderStrategy; @@ -162,7 +174,7 @@ export const executeFetchUserProfileStrategy = async ( reject(error); } - const profile = makeProfileInfo(passportProfile, params); + const profile = makeProfileInfo(passportProfile, idToken); resolve(profile); }, ); diff --git a/plugins/auth-backend/src/providers/github/provider.ts b/plugins/auth-backend/src/providers/github/provider.ts index b5f9d7e46b..3ae9858bb1 100644 --- a/plugins/auth-backend/src/providers/github/provider.ts +++ b/plugins/auth-backend/src/providers/github/provider.ts @@ -19,16 +19,17 @@ import { Strategy as GithubStrategy } from 'passport-github2'; import { executeFrameHandlerStrategy, executeRedirectStrategy, + makeProfileInfo, } from '../../lib/PassportStrategyHelper'; import { OAuthProviderHandlers, AuthProviderConfig, RedirectInfo, - AuthInfoBase, - AuthInfoPrivate, EnvironmentProviderConfig, OAuthProviderOptions, OAuthProviderConfig, + OAuthResponse, + PassportDoneCallback, } from '../types'; import { OAuthProvider } from '../../lib/OAuthProvider'; import { @@ -44,25 +45,42 @@ export class GithubAuthProvider implements OAuthProviderHandlers { constructor(options: OAuthProviderOptions) { this._strategy = new GithubStrategy( { ...options }, - (accessToken: any, _: any, params: any, profile: any, done: any) => { + ( + accessToken: any, + _: any, + params: any, + rawProfile: any, + done: PassportDoneCallback, + ) => { + const profile = makeProfileInfo(rawProfile); done(undefined, { + providerInfo: { + accessToken, + scope: params.scope, + expiresInSeconds: params.expires_in, + }, profile, - accessToken, - scope: params.scope, - expiresInSeconds: params.expires_in, }); }, ); } - async start(req: express.Request, options: any): Promise { + async start( + req: express.Request, + options: Record, + ): Promise { return await executeRedirectStrategy(req, this._strategy, options); } - async handler( - req: express.Request, - ): Promise<{ user: AuthInfoBase; info: AuthInfoPrivate }> { - return await executeFrameHandlerStrategy(req, this._strategy); + async handler(req: express.Request): Promise<{ response: OAuthResponse }> { + const result = await executeFrameHandlerStrategy( + req, + this._strategy, + ); + + return { + response: result.response, + }; } } diff --git a/plugins/auth-backend/src/providers/google/provider.ts b/plugins/auth-backend/src/providers/google/provider.ts index f41fbfe787..f12b248021 100644 --- a/plugins/auth-backend/src/providers/google/provider.ts +++ b/plugins/auth-backend/src/providers/google/provider.ts @@ -25,14 +25,13 @@ import { } from '../../lib/PassportStrategyHelper'; import { OAuthProviderHandlers, - AuthInfoBase, - AuthInfoPrivate, RedirectInfo, AuthProviderConfig, - AuthInfoWithProfile, EnvironmentProviderConfig, OAuthProviderOptions, OAuthProviderConfig, + OAuthResponse, + PassportDoneCallback, } from '../types'; import { OAuthProvider } from '../../lib/OAuthProvider'; import passport from 'passport'; @@ -43,6 +42,10 @@ import { import { Logger } from 'winston'; import { TokenIssuer } from '../../identity'; +type PrivateInfo = { + refreshToken: string; +}; + export class GoogleAuthProvider implements OAuthProviderHandlers { private readonly _strategy: GoogleStrategy; @@ -56,18 +59,20 @@ export class GoogleAuthProvider implements OAuthProviderHandlers { accessToken: any, refreshToken: any, params: any, - profile: passport.Profile, - done: any, + rawProfile: passport.Profile, + done: PassportDoneCallback, ) => { - const profileInfo = makeProfileInfo(profile, params); + const profile = makeProfileInfo(rawProfile, params.id_token); done( undefined, { - profile: profileInfo, - idToken: params.id_token, - accessToken, - scope: params.scope, - expiresInSeconds: params.expires_in, + providerInfo: { + idToken: params.id_token, + accessToken, + scope: params.scope, + expiresInSeconds: params.expires_in, + }, + profile, }, { refreshToken, @@ -77,20 +82,33 @@ export class GoogleAuthProvider implements OAuthProviderHandlers { ); } - async start(req: express.Request, options: any): Promise { - return await executeRedirectStrategy(req, this._strategy, options); + async start( + req: express.Request, + options: Record, + ): Promise { + const providerOptions = { + ...options, + accessType: 'offline', + prompt: 'consent', + }; + return await executeRedirectStrategy(req, this._strategy, providerOptions); } async handler( req: express.Request, - ): Promise<{ user: AuthInfoBase; info: AuthInfoPrivate }> { - return await executeFrameHandlerStrategy(req, this._strategy); + ): Promise<{ response: OAuthResponse; refreshToken: string }> { + const result = await executeFrameHandlerStrategy< + OAuthResponse, + PrivateInfo + >(req, this._strategy); + + return { + response: result.response, + refreshToken: result.privateInfo.refreshToken, + }; } - async refresh( - refreshToken: string, - scope: string, - ): Promise { + async refresh(refreshToken: string, scope: string): Promise { const { accessToken, params } = await executeRefreshTokenStrategy( this._strategy, refreshToken, @@ -100,14 +118,16 @@ export class GoogleAuthProvider implements OAuthProviderHandlers { const profile = await executeFetchUserProfileStrategy( this._strategy, accessToken, - params, + params.id_token, ); return { - accessToken, - idToken: params.id_token, - expiresInSeconds: params.expires_in, - scope: params.scope, + providerInfo: { + accessToken, + idToken: params.id_token, + expiresInSeconds: params.expires_in, + scope: params.scope, + }, profile, }; } diff --git a/plugins/auth-backend/src/providers/saml/provider.ts b/plugins/auth-backend/src/providers/saml/provider.ts index 621b75078c..867bd280a2 100644 --- a/plugins/auth-backend/src/providers/saml/provider.ts +++ b/plugins/auth-backend/src/providers/saml/provider.ts @@ -15,7 +15,11 @@ */ import express from 'express'; -import { Strategy as SamlStrategy } from 'passport-saml'; +import { + Strategy as SamlStrategy, + Profile as SamlProfile, + VerifyWithoutRequest, +} from 'passport-saml'; import { executeFrameHandlerStrategy, executeRedirectStrategy, @@ -25,6 +29,8 @@ import { AuthProviderRouteHandlers, EnvironmentProviderConfig, SAMLProviderConfig, + PassportDoneCallback, + ProfileInfo, } from '../types'; import { postMessageResponse } from '../../lib/OAuthProvider'; import { @@ -32,30 +38,39 @@ import { EnvironmentHandler, } from '../../lib/EnvironmentHandler'; import { Logger } from 'winston'; +import { TokenIssuer } from '../../identity'; + +type SamlInfo = { + userId: string; + profile: ProfileInfo; +}; export class SamlAuthProvider implements AuthProviderRouteHandlers { private readonly strategy: SamlStrategy; + private readonly tokenIssuer: TokenIssuer; constructor(options: SAMLProviderOptions) { - this.strategy = new SamlStrategy( - { ...options }, - (profile: any, done: any) => { - // TODO: There's plenty more validation and profile handling to do here, - // this provider is currently only intended to validate the provider pattern - // for non-oauth auth flows. - // TODO: This flow doesn't issue an identity token that can be used to validate - // the identity of the user in other backends, which we need in some form. - done(undefined, { - email: profile.email, - firstName: profile.firstName, - lastName: profile.lastName, - displayName: profile.displayName, - }); - }, - ); + this.tokenIssuer = options.tokenIssuer; + this.strategy = new SamlStrategy({ ...options }, (( + profile: SamlProfile, + done: PassportDoneCallback, + ) => { + // TODO: There's plenty more validation and profile handling to do here, + // this provider is currently only intended to validate the provider pattern + // for non-oauth auth flows. + // TODO: This flow doesn't issue an identity token that can be used to validate + // the identity of the user in other backends, which we need in some form. + done(undefined, { + userId: profile.ID!, + profile: { + email: profile.email!, + displayName: profile.displayName as string, + }, + }); + }) as VerifyWithoutRequest); } - async start(req: express.Request, res: express.Response): Promise { + async start(req: express.Request, res: express.Response): Promise { const { url } = await executeRedirectStrategy(req, this.strategy, {}); res.redirect(url); } @@ -63,17 +78,27 @@ export class SamlAuthProvider implements AuthProviderRouteHandlers { async frameHandler( req: express.Request, res: express.Response, - ): Promise { + ): Promise { try { - const { user } = await executeFrameHandlerStrategy(req, this.strategy); + const { + response: { userId, profile }, + } = await executeFrameHandlerStrategy(req, this.strategy); + + const userIdToken = await this.tokenIssuer.issueToken({ + claims: { sub: userId }, + }); return postMessageResponse(res, 'http://localhost:3000', { - type: 'auth-result', - payload: user, + type: 'authorization_response', + response: { + providerInfo: {}, + profile, + userIdToken, + }, }); } catch (error) { return postMessageResponse(res, 'http://localhost:3000', { - type: 'auth-result', + type: 'authorization_response', error: { name: error.name, message: error.message, @@ -82,7 +107,7 @@ export class SamlAuthProvider implements AuthProviderRouteHandlers { } } - async logout(_req: express.Request, res: express.Response): Promise { + async logout(_req: express.Request, res: express.Response): Promise { res.send('noop'); } } @@ -91,12 +116,14 @@ type SAMLProviderOptions = { entryPoint: string; issuer: string; path: string; + tokenIssuer: TokenIssuer; }; export function createSamlProvider( _authProviderConfig: AuthProviderConfig, providerConfig: EnvironmentProviderConfig, logger: Logger, + tokenIssuer: TokenIssuer, ) { const envProviders: EnvironmentHandlers = {}; @@ -106,6 +133,7 @@ export function createSamlProvider( entryPoint: config.entryPoint, issuer: config.issuer, path: '/auth/saml/handler/frame', + tokenIssuer, }; if (!opts.entryPoint || !opts.issuer) { diff --git a/plugins/auth-backend/src/providers/types.ts b/plugins/auth-backend/src/providers/types.ts index 3660751c1c..2101fc19bb 100644 --- a/plugins/auth-backend/src/providers/types.ts +++ b/plugins/auth-backend/src/providers/types.ts @@ -89,25 +89,30 @@ export interface OAuthProviderHandlers { * @param {express.Request} req * @param options */ - start(req: express.Request, options: any): Promise; + start( + req: express.Request, + options: Record, + ): Promise; /** * Handles the redirect from the auth provider when the user has signed in. * @param {express.Request} req */ - handler(req: express.Request): Promise; + handler( + req: express.Request, + ): Promise<{ response: OAuthResponse; refreshToken?: string }>; /** * (Optional) Given a refresh token and scope fetches a new access token from the auth provider. * @param {string} refreshToken * @param {string} scope */ - refresh?(refreshToken: string, scope: string): Promise; + refresh?(refreshToken: string, scope: string): Promise; /** * (Optional) Sign out of the auth provider. */ - logout?(): Promise; + logout?(): Promise; } /** @@ -134,7 +139,7 @@ export interface AuthProviderRouteHandlers { * @param {express.Request} req * @param {express.Response} res */ - start(req: express.Request, res: express.Response): Promise; + start(req: express.Request, res: express.Response): Promise; /** * Once the user signs in or consents in the OAuth screen, the auth provider redirects to the @@ -149,7 +154,7 @@ export interface AuthProviderRouteHandlers { * @param {express.Request} req * @param {express.Response} res */ - frameHandler(req: express.Request, res: express.Response): Promise; + frameHandler(req: express.Request, res: express.Response): Promise; /** * (Optional) If the auth provider supports refresh tokens then this method handles @@ -163,7 +168,7 @@ export interface AuthProviderRouteHandlers { * @param {express.Request} req * @param {express.Response} res */ - refresh?(req: express.Request, res: express.Response): Promise; + refresh?(req: express.Request, res: express.Response): Promise; /** * (Optional) Handles sign out requests @@ -174,7 +179,7 @@ export interface AuthProviderRouteHandlers { * @param {express.Request} req * @param {express.Response} res */ - logout?(req: express.Request, res: express.Response): Promise; + logout?(req: express.Request, res: express.Response): Promise; } export type AuthProviderFactory = ( @@ -184,7 +189,18 @@ export type AuthProviderFactory = ( issuer: TokenIssuer, ) => AuthProviderRouteHandlers; -export type AuthInfoBase = { +export type AuthResponse = { + providerInfo: ProviderInfo; + profile: ProfileInfo; + userIdToken: string; +}; + +export type OAuthResponse = Omit< + AuthResponse, + 'userIdToken' +>; + +export type OAuthProviderInfo = { /** * An access token issued for the signed in user. */ @@ -203,34 +219,35 @@ export type AuthInfoBase = { scope: string; }; -export type AuthInfoWithProfile = AuthInfoBase & { - /** - * Profile information of the signed in user. - */ - profile: ProfileInfo | undefined; -}; - -export type AuthInfoPrivate = { +export type OAuthPrivateInfo = { /** * A refresh token issued for the signed in user. */ refreshToken: string; }; +// {type: 'authorization_response', response: {...}} + /** * Payload sent as a post message after the auth request is complete. * If successful then has a valid payload with Auth information else contains an error. */ -export type AuthResponse = +export type WebMessageResponse = | { - type: 'auth-result'; - payload: AuthInfoBase | AuthInfoWithProfile; + type: 'authorization_response'; + response: AuthResponse; } | { - type: 'auth-result'; + type: 'authorization_response'; error: Error; }; +export type PassportDoneCallback = ( + err?: Error, + response?: Res, + privateInfo?: Private, +) => void; + export type RedirectInfo = { /** * URL to redirect to @@ -242,6 +259,22 @@ export type RedirectInfo = { status?: number; }; +/* +metadata: + name: john +spec: + profile: + email: john.doe@example.com + displayName: John Doe + picture: https://example.com/avatars/john.doe + + identities: + - type: google + email: john.doe@gmail.com + */ + +// 1. Link to identity in catalog / within backstage +// 2. Display login information to user, i.e. sidebar popup export type ProfileInfo = { /** * Email ID of the signed in user. @@ -250,12 +283,12 @@ export type ProfileInfo = { /** * Display name that can be presented to the signed in user. */ - name: string; + displayName?: string; /** * URL to an image that can be used as the display image or avatar of the * signed in user. */ - picture: string; + picture?: string; }; export type RefreshTokenResponse = { From 7bee3392226c9b412e47fed08a925bae718fc9b9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2020 12:08:45 +0000 Subject: [PATCH 03/21] build(deps): bump @rollup/plugin-node-resolve from 7.1.3 to 8.1.0 Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins) from 7.1.3 to 8.1.0. - [Release notes](https://github.com/rollup/plugins/releases) - [Commits](https://github.com/rollup/plugins/compare/node-resolve-v7.1.3...node-resolve-v8.1.0) Signed-off-by: dependabot-preview[bot] --- packages/cli/package.json | 2 +- yarn.lock | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 66828e9dec..13d68b6994 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -36,7 +36,7 @@ "@lerna/project": "^3.18.0", "@rollup/plugin-commonjs": "^12.0.0", "@rollup/plugin-json": "^4.0.2", - "@rollup/plugin-node-resolve": "^7.1.1", + "@rollup/plugin-node-resolve": "^8.1.0", "@spotify/eslint-config": "^7.0.1", "@sucrase/webpack-loader": "^2.0.0", "@svgr/plugin-jsx": "4.3.x", diff --git a/yarn.lock b/yarn.lock index da47a9bd86..180d4e3ad2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2446,14 +2446,16 @@ dependencies: "@rollup/pluginutils" "^3.0.8" -"@rollup/plugin-node-resolve@^7.1.1": - version "7.1.3" - resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz#80de384edfbd7bfc9101164910f86078151a3eca" - integrity sha512-RxtSL3XmdTAE2byxekYLnx+98kEUOrPHF/KRVjLH+DEIHy6kjIw7YINQzn+NXiH/NTrQLAwYs0GWB+csWygA9Q== +"@rollup/plugin-node-resolve@^8.1.0": + version "8.1.0" + resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-8.1.0.tgz#1da5f3d0ccabc8f66f5e3c74462aad76cfd96c47" + integrity sha512-ovq7ZM3JJYUUmEjjO+H8tnUdmQmdQudJB7xruX8LFZ1W2q8jXdPUS6SsIYip8ByOApu4RR7729Am9WhCeCMiHA== dependencies: "@rollup/pluginutils" "^3.0.8" "@types/resolve" "0.0.8" builtin-modules "^3.1.0" + deep-freeze "^0.0.1" + deepmerge "^4.2.2" is-module "^1.0.0" resolve "^1.14.2" @@ -7427,6 +7429,11 @@ deep-extend@^0.6.0: resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== +deep-freeze@^0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz#3a0b0005de18672819dfd38cd31f91179c893e84" + integrity sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ= + deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.3" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" From a5785b80faf4946f47f2875e15783f7abd034040 Mon Sep 17 00:00:00 2001 From: Marcus Eide Date: Tue, 23 Jun 2020 15:45:48 +0200 Subject: [PATCH 04/21] Identity and profile work, wip --- .../src/apis/definitions/IdentityApi.ts | 6 + .../core-api/src/apis/definitions/auth.ts | 104 ++++++++++-------- .../auth/github/GithubAuth.test.ts | 2 +- .../implementations/auth/github/GithubAuth.ts | 46 ++++++-- .../apis/implementations/auth/github/types.ts | 13 ++- .../auth/google/GoogleAuth.test.ts | 44 ++++---- .../implementations/auth/google/GoogleAuth.ts | 68 +++++++----- .../apis/implementations/auth/google/types.ts | 13 ++- packages/core-api/src/app/App.tsx | 4 + packages/core-api/src/app/AppIdentity.ts | 17 ++- packages/core-api/src/app/types.ts | 5 +- .../layout/Sidebar/Settings/UserProfile.tsx | 72 ++---------- .../src/layout/SignInPage/customProvider.tsx | 3 + .../src/layout/SignInPage/googleProvider.tsx | 38 ++++--- .../src/layout/SignInPage/guestProvider.tsx | 12 +- .../src/lib/OAuthProvider.test.ts | 10 +- plugins/auth-backend/src/lib/OAuthProvider.ts | 14 ++- .../src/providers/saml/provider.ts | 7 +- plugins/auth-backend/src/providers/types.ts | 16 ++- plugins/auth-backend/src/service/router.ts | 6 - 20 files changed, 288 insertions(+), 212 deletions(-) diff --git a/packages/core-api/src/apis/definitions/IdentityApi.ts b/packages/core-api/src/apis/definitions/IdentityApi.ts index dbc36ad967..13f4cd24bc 100644 --- a/packages/core-api/src/apis/definitions/IdentityApi.ts +++ b/packages/core-api/src/apis/definitions/IdentityApi.ts @@ -14,6 +14,7 @@ * limitations under the License. */ import { createApiRef } from '../ApiRef'; +import { ProfileInfo } from './auth'; /** * The Identity API used to identify and get information about the signed in user. @@ -29,6 +30,11 @@ export type IdentityApi = { */ getUserId(): string; + /** + * The profile of the signed in user. + */ + getProfile(): ProfileInfo; + /** * An OpenID Connect ID Token which proves the identity of the signed in user. * diff --git a/packages/core-api/src/apis/definitions/auth.ts b/packages/core-api/src/apis/definitions/auth.ts index c884bf975b..ccd40e66ce 100644 --- a/packages/core-api/src/apis/definitions/auth.ts +++ b/packages/core-api/src/apis/definitions/auth.ts @@ -37,13 +37,13 @@ import { Observable } from '../..'; */ export type OAuthScope = string | string[]; -export type AccessTokenOptions = { +export type AuthRequestOptions = { /** * If this is set to true, the user will not be prompted to log in, - * and an empty access token will be returned if there is no existing session. + * and an empty response will be returned if there is no existing session. * - * This can be used to perform a check whether the user is logged in with a set of scopes, - * or if you don't want to force a user to be logged in, but provide functionality if they already are. + * This can be used to perform a check whether the user is logged in, or if you don't + * want to force a user to be logged in, but provide functionality if they already are. * * @default false */ @@ -88,7 +88,7 @@ export type OAuthApi = { */ getAccessToken( scope?: OAuthScope, - options?: AccessTokenOptions, + options?: AuthRequestOptions, ): Promise; /** @@ -97,29 +97,6 @@ export type OAuthApi = { logout(): Promise; }; -export type IdTokenOptions = { - /** - * If this is set to true, the user will not be prompted to log in, - * and an empty id token will be returned if there is no existing session. - * - * This can be used to perform a check whether the user is logged in, or if you don't - * want to force a user to be logged in, but provide functionality if they already are. - * - * @default false - */ - optional?: boolean; - - /** - * If this is set to true, the request will bypass the regular oauth login modal - * and open the login popup directly. - * - * The method must be called synchronously from a user action for this to work in all browsers. - * - * @default false - */ - instantPopup?: boolean; -}; - /** * This API provides access to OpenID Connect credentials. It lets you request ID tokens, * which can be passed to backend services to prove the user's identity. @@ -136,7 +113,7 @@ export type OpenIdConnectApi = { * to log in. The returned promise will not resolve until the user has successfully logged in. * The returned promise can be rejected, but only if the user rejects the login request. */ - getIdToken(options?: IdTokenOptions): Promise; + getIdToken(options?: AuthRequestOptions): Promise; /** * Log out the user's session. This will reload the page. @@ -144,38 +121,65 @@ export type OpenIdConnectApi = { logout(): Promise; }; -export type ProfileInfoOptions = { - /** - * If this is set to true, the user will not be prompted to log in, - * and an empty profile will be returned if there is no existing session. - * - * This can be used to perform a check whether the user is logged in, or if you don't - * want to force a user to be logged in, but provide functionality if they already are. - * - * @default false - */ - optional?: boolean; -}; - /** * This API provides access to profile information of the user from an auth provider. */ export type ProfileInfoApi = { - getProfile(options?: ProfileInfoOptions): Promise; + /** + * Get profile information for the user as supplied by this auth provider. + * + * If the optional flag is not set, a session is guaranteed to be returned, while if + * the optional flag is set, the session may be undefined. See @AuthRequestOptions for more details. + */ + getProfile(options?: AuthRequestOptions): Promise; }; /** - * Profile information of the user from an auth provider. + * This API provides access to the user's identity within Backstage. + * + * An auth provider that implements this interface can be used to sign-in to backstage. It is + * not intended to be used directly from a plugin, but instead serves as a connection between + * this authentication method and the app's @IdentityApi + */ +export type BackstageIdentityApi = { + /** + * Get the user's identity within Backstage. This should normally not be called directly, + * use the @IdentityApi instead. + * + * If the optional flag is not set, a session is guaranteed to be returned, while if + * the optional flag is set, the session may be undefined. See @AuthRequestOptions for more details. + */ + getBackstageIdentity( + options?: AuthRequestOptions, + ): Promise; +}; + +export type BackstageIdentity = { + /** + * The backstage user ID. + */ + id: string; + + /** + * An ID token that can be used to authenticate the user within Backstage. + */ + idToken: string; +}; + +/** + * Profile information of the user. */ export type ProfileInfo = { /** * Email ID. */ email: string; + /** * Display name that can be presented to the user. */ - name?: string; + displayName?: string; + /** * URL to an avatar image of the user. */ @@ -207,7 +211,11 @@ export type SessionStateApi = { * email and expiration information. Do not rely on any other fields, as they might not be present. */ export const googleAuthApiRef = createApiRef< - OAuthApi & OpenIdConnectApi & ProfileInfoApi & SessionStateApi + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionStateApi >({ id: 'core.auth.google', description: 'Provides authentication towards Google APIs and identities', @@ -219,7 +227,9 @@ export const googleAuthApiRef = createApiRef< * See https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/ * for a full list of supported scopes. */ -export const githubAuthApiRef = createApiRef({ +export const githubAuthApiRef = createApiRef< + OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionStateApi +>({ id: 'core.auth.github', description: 'Provides authentication towards Github APIs', }); diff --git a/packages/core-api/src/apis/implementations/auth/github/GithubAuth.test.ts b/packages/core-api/src/apis/implementations/auth/github/GithubAuth.test.ts index 7c8e6ce9f0..3ff29cc6ef 100644 --- a/packages/core-api/src/apis/implementations/auth/github/GithubAuth.test.ts +++ b/packages/core-api/src/apis/implementations/auth/github/GithubAuth.test.ts @@ -20,7 +20,7 @@ describe('GithubAuth', () => { it('should get access token', async () => { const getSession = jest .fn() - .mockResolvedValue({ accessToken: 'access-token' }); + .mockResolvedValue({ providerInfo: { accessToken: 'access-token' } }); const githubAuth = new GithubAuth({ getSession } as any); expect(await githubAuth.getAccessToken()).toBe('access-token'); diff --git a/packages/core-api/src/apis/implementations/auth/github/GithubAuth.ts b/packages/core-api/src/apis/implementations/auth/github/GithubAuth.ts index f4a7092f79..4641dd7b50 100644 --- a/packages/core-api/src/apis/implementations/auth/github/GithubAuth.ts +++ b/packages/core-api/src/apis/implementations/auth/github/GithubAuth.ts @@ -19,9 +19,11 @@ import { DefaultAuthConnector } from '../../../../lib/AuthConnector'; import { GithubSession } from './types'; import { OAuthApi, - AccessTokenOptions, SessionStateApi, SessionState, + ProfileInfo, + BackstageIdentity, + AuthRequestOptions, } from '../../../definitions/auth'; import { OAuthRequestApi, AuthProvider } from '../../../definitions'; import { SessionManager } from '../../../../lib/AuthSessionManager/types'; @@ -41,10 +43,13 @@ type CreateOptions = { }; export type GithubAuthResponse = { - accessToken: string; - idToken: string; - scope: string; - expiresInSeconds: number; + providerInfo: { + accessToken: string; + scope: string; + expiresInSeconds: number; + }; + profile: ProfileInfo; + backstageIdentity: BackstageIdentity; }; const DEFAULT_PROVIDER = { @@ -69,9 +74,14 @@ class GithubAuth implements OAuthApi, SessionStateApi { oauthRequestApi: oauthRequestApi, sessionTransform(res: GithubAuthResponse): GithubSession { return { - accessToken: res.accessToken, - scopes: GithubAuth.normalizeScope(res.scope), - expiresAt: new Date(Date.now() + res.expiresInSeconds * 1000), + ...res, + providerInfo: { + accessToken: res.providerInfo.accessToken, + scopes: GithubAuth.normalizeScope(res.providerInfo.scope), + expiresAt: new Date( + Date.now() + res.providerInfo.expiresInSeconds * 1000, + ), + }, }; }, }); @@ -79,7 +89,7 @@ class GithubAuth implements OAuthApi, SessionStateApi { const sessionManager = new StaticAuthSessionManager({ connector, defaultScopes: new Set(['user']), - sessionScopes: session => session.scopes, + sessionScopes: (session: GithubSession) => session.providerInfo.scopes, }); return new GithubAuth(sessionManager); @@ -93,7 +103,7 @@ class GithubAuth implements OAuthApi, SessionStateApi { constructor(private readonly sessionManager: SessionManager) {} - async getAccessToken(scope?: string, options?: AccessTokenOptions) { + async getAccessToken(scope?: string, options?: AuthRequestOptions) { const normalizedScopes = GithubAuth.normalizeScope(scope); const session = await this.sessionManager.getSession({ ...options, @@ -101,11 +111,25 @@ class GithubAuth implements OAuthApi, SessionStateApi { }); this.sessionStateTracker.setIsSignedId(!!session); if (session) { - return session.accessToken; + return session.providerInfo.accessToken; } return ''; } + async getBackstageIdentity( + options: AuthRequestOptions = {}, + ): Promise { + const session = await this.sessionManager.getSession(options); + this.sessionStateTracker.setIsSignedId(!!session); + return session?.backstageIdentity; + } + + async getProfile(options: AuthRequestOptions = {}) { + const session = await this.sessionManager.getSession(options); + this.sessionStateTracker.setIsSignedId(!!session); + return session?.profile; + } + async logout() { await this.sessionManager.removeSession(); this.sessionStateTracker.setIsSignedId(false); diff --git a/packages/core-api/src/apis/implementations/auth/github/types.ts b/packages/core-api/src/apis/implementations/auth/github/types.ts index 282017b80d..54c427423c 100644 --- a/packages/core-api/src/apis/implementations/auth/github/types.ts +++ b/packages/core-api/src/apis/implementations/auth/github/types.ts @@ -14,8 +14,15 @@ * limitations under the License. */ +import { ProfileInfo } from '../../..'; +import { BackstageIdentity } from '../../../definitions'; + export type GithubSession = { - accessToken: string; - scopes: Set; - expiresAt: Date; + providerInfo: { + accessToken: string; + scopes: Set; + expiresAt: Date; + }; + profile: ProfileInfo; + backstageIdentity: BackstageIdentity; }; diff --git a/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.test.ts b/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.test.ts index 1ee3575b89..5290ee798b 100644 --- a/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.test.ts +++ b/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.test.ts @@ -23,9 +23,9 @@ const PREFIX = 'https://www.googleapis.com/auth/'; describe('GoogleAuth', () => { it('should get refreshed access token', async () => { - const getSession = jest - .fn() - .mockResolvedValue({ accessToken: 'access-token', expiresAt: theFuture }); + const getSession = jest.fn().mockResolvedValue({ + providerInfo: { accessToken: 'access-token', expiresAt: theFuture }, + }); const googleAuth = new GoogleAuth({ getSession } as any); expect(await googleAuth.getAccessToken()).toBe('access-token'); @@ -33,9 +33,9 @@ describe('GoogleAuth', () => { }); it('should get refreshed id token', async () => { - const getSession = jest - .fn() - .mockResolvedValue({ idToken: 'id-token', expiresAt: theFuture }); + const getSession = jest.fn().mockResolvedValue({ + providerInfo: { idToken: 'id-token', expiresAt: theFuture }, + }); const googleAuth = new GoogleAuth({ getSession } as any); expect(await googleAuth.getIdToken()).toBe('id-token'); @@ -43,9 +43,9 @@ describe('GoogleAuth', () => { }); it('should get optional id token', async () => { - const getSession = jest - .fn() - .mockResolvedValue({ idToken: 'id-token', expiresAt: theFuture }); + const getSession = jest.fn().mockResolvedValue({ + providerInfo: { idToken: 'id-token', expiresAt: theFuture }, + }); const googleAuth = new GoogleAuth({ getSession } as any); expect(await googleAuth.getIdToken({ optional: true })).toBe('id-token'); @@ -58,9 +58,11 @@ describe('GoogleAuth', () => { const getSession = jest .fn() .mockResolvedValueOnce({ - accessToken: 'access-token', - expiresAt: theFuture, - scopes: new Set([`${PREFIX}not-enough`]), + providerInfo: { + accessToken: 'access-token', + expiresAt: theFuture, + scopes: new Set([`${PREFIX}not-enough`]), + }, }) .mockRejectedValue(error); const googleAuth = new GoogleAuth({ getSession } as any); @@ -77,17 +79,21 @@ describe('GoogleAuth', () => { it('should wait for all session refreshes', async () => { const initialSession = { - idToken: 'token1', - expiresAt: theFuture, - scopes: new Set(), + providerInfo: { + idToken: 'token1', + expiresAt: theFuture, + scopes: new Set(), + }, }; const getSession = jest .fn() .mockResolvedValueOnce(initialSession) .mockResolvedValue({ - idToken: 'token2', - expiresAt: theFuture, - scopes: new Set(), + providerInfo: { + idToken: 'token2', + expiresAt: theFuture, + scopes: new Set(), + }, }); const googleAuth = new GoogleAuth({ getSession } as any); @@ -95,7 +101,7 @@ describe('GoogleAuth', () => { await expect(googleAuth.getIdToken()).resolves.toBe('token1'); expect(getSession).toBeCalledTimes(1); - initialSession.expiresAt = thePast; + initialSession.providerInfo.expiresAt = thePast; const promise1 = googleAuth.getIdToken(); const promise2 = googleAuth.getIdToken(); diff --git a/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.ts b/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.ts index 183ea592b4..db26d2d9a4 100644 --- a/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.ts +++ b/packages/core-api/src/apis/implementations/auth/google/GoogleAuth.ts @@ -20,13 +20,13 @@ import { GoogleSession } from './types'; import { OAuthApi, OpenIdConnectApi, - IdTokenOptions, - AccessTokenOptions, ProfileInfoApi, - ProfileInfoOptions, ProfileInfo, SessionStateApi, SessionState, + BackstageIdentityApi, + AuthRequestOptions, + BackstageIdentity, } from '../../../definitions/auth'; import { OAuthRequestApi, AuthProvider } from '../../../definitions'; import { SessionManager } from '../../../../lib/AuthSessionManager/types'; @@ -46,11 +46,14 @@ type CreateOptions = { }; export type GoogleAuthResponse = { + providerInfo: { + accessToken: string; + idToken: string; + scope: string; + expiresInSeconds: number; + }; profile: ProfileInfo; - accessToken: string; - idToken: string; - scope: string; - expiresInSeconds: number; + backstageIdentity: BackstageIdentity; }; const DEFAULT_PROVIDER = { @@ -62,7 +65,12 @@ const DEFAULT_PROVIDER = { const SCOPE_PREFIX = 'https://www.googleapis.com/auth/'; class GoogleAuth - implements OAuthApi, OpenIdConnectApi, ProfileInfoApi, SessionStateApi { + implements + OAuthApi, + OpenIdConnectApi, + ProfileInfoApi, + BackstageIdentityApi, + SessionStateApi { static create({ apiOrigin, basePath, @@ -78,11 +86,15 @@ class GoogleAuth oauthRequestApi: oauthRequestApi, sessionTransform(res: GoogleAuthResponse): GoogleSession { return { - profile: res.profile, - idToken: res.idToken, - accessToken: res.accessToken, - scopes: GoogleAuth.normalizeScopes(res.scope), - expiresAt: new Date(Date.now() + res.expiresInSeconds * 1000), + ...res, + providerInfo: { + idToken: res.providerInfo.idToken, + accessToken: res.providerInfo.accessToken, + scopes: GoogleAuth.normalizeScopes(res.providerInfo.scope), + expiresAt: new Date( + Date.now() + res.providerInfo.expiresInSeconds * 1000, + ), + }, }; }, }); @@ -94,9 +106,10 @@ class GoogleAuth `${SCOPE_PREFIX}userinfo.email`, `${SCOPE_PREFIX}userinfo.profile`, ]), - sessionScopes: session => session.scopes, - sessionShouldRefresh: session => { - const expiresInSec = (session.expiresAt.getTime() - Date.now()) / 1000; + sessionScopes: (session: GoogleSession) => session.providerInfo.scopes, + sessionShouldRefresh: (session: GoogleSession) => { + const expiresInSec = + (session.providerInfo.expiresAt.getTime() - Date.now()) / 1000; return expiresInSec < 60 * 5; }, }); @@ -114,7 +127,7 @@ class GoogleAuth async getAccessToken( scope?: string | string[], - options?: AccessTokenOptions, + options?: AuthRequestOptions, ) { const normalizedScopes = GoogleAuth.normalizeScopes(scope); const session = await this.sessionManager.getSession({ @@ -123,16 +136,16 @@ class GoogleAuth }); this.sessionStateTracker.setIsSignedId(!!session); if (session) { - return session.accessToken; + return session.providerInfo.accessToken; } return ''; } - async getIdToken(options: IdTokenOptions = {}) { + async getIdToken(options: AuthRequestOptions = {}) { const session = await this.sessionManager.getSession(options); this.sessionStateTracker.setIsSignedId(!!session); if (session) { - return session.idToken; + return session.providerInfo.idToken; } return ''; } @@ -142,13 +155,18 @@ class GoogleAuth this.sessionStateTracker.setIsSignedId(false); } - async getProfile(options: ProfileInfoOptions = {}) { + async getBackstageIdentity( + options: AuthRequestOptions = {}, + ): Promise { const session = await this.sessionManager.getSession(options); this.sessionStateTracker.setIsSignedId(!!session); - if (!session) { - return undefined; - } - return session.profile; + return session?.backstageIdentity; + } + + async getProfile(options: AuthRequestOptions = {}) { + const session = await this.sessionManager.getSession(options); + this.sessionStateTracker.setIsSignedId(!!session); + return session?.profile; } static normalizeScopes(scopes?: string | string[]): Set { diff --git a/packages/core-api/src/apis/implementations/auth/google/types.ts b/packages/core-api/src/apis/implementations/auth/google/types.ts index ea251c7006..3b40932980 100644 --- a/packages/core-api/src/apis/implementations/auth/google/types.ts +++ b/packages/core-api/src/apis/implementations/auth/google/types.ts @@ -14,12 +14,15 @@ * limitations under the License. */ -import { ProfileInfo } from '../../../definitions'; +import { ProfileInfo, BackstageIdentity } from '../../../definitions'; export type GoogleSession = { + providerInfo: { + idToken: string; + accessToken: string; + scopes: Set; + expiresAt: Date; + }; profile: ProfileInfo; - idToken: string; - accessToken: string; - scopes: Set; - expiresAt: Date; + backstageIdentity: BackstageIdentity; }; diff --git a/packages/core-api/src/app/App.tsx b/packages/core-api/src/app/App.tsx index a20a9b27f8..dc2136a806 100644 --- a/packages/core-api/src/app/App.tsx +++ b/packages/core-api/src/app/App.tsx @@ -293,6 +293,10 @@ export class PrivateAppImpl implements BackstageApp { if (!SignInPageComponent) { this.identityApi.setSignInResult({ userId: 'guest', + profile: { + email: 'guest@example.com', + displayName: 'Guest', + }, }); return ( diff --git a/packages/core-api/src/app/AppIdentity.ts b/packages/core-api/src/app/AppIdentity.ts index c38ece53df..69ee5d28ac 100644 --- a/packages/core-api/src/app/AppIdentity.ts +++ b/packages/core-api/src/app/AppIdentity.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { IdentityApi } from '../apis'; +import { IdentityApi, ProfileInfo } from '../apis'; import { SignInResult } from './types'; /** @@ -24,6 +24,7 @@ import { SignInResult } from './types'; export class AppIdentity implements IdentityApi { private hasIdentity = false; private userId?: string; + private profile?: ProfileInfo; private idTokenFunc?: () => Promise; private logoutFunc?: () => Promise; @@ -36,6 +37,15 @@ export class AppIdentity implements IdentityApi { return this.userId!; } + getProfile(): ProfileInfo { + if (!this.hasIdentity) { + throw new Error( + 'Tried to access IdentityApi profile before app was loaded', + ); + } + return this.profile!; + } + async getIdToken(): Promise { if (!this.hasIdentity) { throw new Error( @@ -55,6 +65,7 @@ export class AppIdentity implements IdentityApi { location.reload(); } + // This is indirectly called by the sign-in page to continue into the app. setSignInResult(result: SignInResult) { if (this.hasIdentity) { return; @@ -62,8 +73,12 @@ export class AppIdentity implements IdentityApi { if (!result.userId) { throw new Error('Invalid sign-in result, userId not set'); } + if (!result.profile) { + throw new Error('Invalid sign-in result, profile not set'); + } this.hasIdentity = true; this.userId = result.userId; + this.profile = result.profile; this.idTokenFunc = result.getIdToken; this.logoutFunc = result.logout; } diff --git a/packages/core-api/src/app/types.ts b/packages/core-api/src/app/types.ts index 33b884fd58..6b022c2736 100644 --- a/packages/core-api/src/app/types.ts +++ b/packages/core-api/src/app/types.ts @@ -18,7 +18,7 @@ import { ComponentType } from 'react'; import { IconComponent, SystemIconKey, SystemIcons } from '../icons'; import { BackstagePlugin } from '../plugin'; import { ApiHolder } from '../apis'; -import { AppTheme, ConfigApi } from '../apis/definitions'; +import { AppTheme, ConfigApi, ProfileInfo } from '../apis/definitions'; import { AppConfig } from '@backstage/config'; export type BootErrorPageProps = { @@ -31,6 +31,9 @@ export type SignInResult = { * User ID that will be returned by the IdentityApi */ userId: string; + + profile: ProfileInfo; + /** * Function used to retrieve an ID token for the signed in user. */ diff --git a/packages/core/src/layout/Sidebar/Settings/UserProfile.tsx b/packages/core/src/layout/Sidebar/Settings/UserProfile.tsx index 06c36bf9ce..101ae7010b 100644 --- a/packages/core/src/layout/Sidebar/Settings/UserProfile.tsx +++ b/packages/core/src/layout/Sidebar/Settings/UserProfile.tsx @@ -14,19 +14,12 @@ * limitations under the License. */ -import React, { FC, useState, useRef, useEffect } from 'react'; +import React, { FC, useRef } from 'react'; import { makeStyles, Avatar, Divider } from '@material-ui/core'; -import { - ProfileInfo, - useApi, - googleAuthApiRef, - Subscription, - SessionState, -} from '@backstage/core-api'; +import { useApi, identityApiRef } from '@backstage/core-api'; import { SidebarItem } from '../Items'; import ExpandLess from '@material-ui/icons/ExpandLess'; import ExpandMore from '@material-ui/icons/ExpandMore'; -import AccountCircleIcon from '@material-ui/icons/AccountCircle'; const useStyles = makeStyles({ avatar: { @@ -39,71 +32,26 @@ export const UserProfile: FC<{ open: boolean; setOpen: Function }> = ({ open, setOpen, }) => { - const [profile, setProfile] = useState(); const ref = useRef(); // for scrolling down when collapse item opens - const googleAuth = useApi(googleAuthApiRef); const classes = useStyles(); + const profile = useApi(identityApiRef).getProfile(); const handleClick = () => { setOpen(!open); setTimeout(() => ref.current?.scrollIntoView({ behavior: 'smooth' }), 300); }; - useEffect(() => { - const fetchProfile = async () => { - await googleAuth - .getProfile({ optional: true }) - .then((userProfile?: ProfileInfo) => { - setProfile(userProfile); - }); - }; - - let subscription: Subscription; - const observeSession = () => { - subscription = googleAuth - .sessionState$() - .subscribe(async (sessionState: SessionState) => { - if (sessionState === SessionState.SignedIn) { - await fetchProfile(); - } else { - setProfile(undefined); - } - }); - }; - - fetchProfile(); - observeSession(); - return () => { - subscription.unsubscribe(); - }; - }, [googleAuth]); - - // Handle main auth info that is shown on the collapsible SidebarItem - let avatar; - let displayName = 'Guest'; - if (profile) { - const email = profile.email; - const name = profile.name; - const imageUrl = profile.picture; - const emailTrimmed = email.split('@')[0]; - const displayEmail = - emailTrimmed.charAt(0).toUpperCase() + emailTrimmed.slice(1); - displayName = name ?? displayEmail; - avatar = imageUrl - ? () => ( - - ) - : () => ; - } + const displayName = profile.displayName ?? profile.email; + const SignInAvatar = () => ( + + {displayName[0]} + + ); return ( <> - + {open ? : } diff --git a/packages/core/src/layout/SignInPage/customProvider.tsx b/packages/core/src/layout/SignInPage/customProvider.tsx index d24b054b16..c6cb9b789d 100644 --- a/packages/core/src/layout/SignInPage/customProvider.tsx +++ b/packages/core/src/layout/SignInPage/customProvider.tsx @@ -56,6 +56,9 @@ const Component: ProviderComponent = ({ onResult }) => { const handleResult = ({ userId, idToken }: Data) => { onResult({ userId, + profile: { + email: `${userId}@example.com`, + }, getIdToken: idToken ? async () => idToken : undefined, }); }; diff --git a/packages/core/src/layout/SignInPage/googleProvider.tsx b/packages/core/src/layout/SignInPage/googleProvider.tsx index 9613437af8..632b81ad17 100644 --- a/packages/core/src/layout/SignInPage/googleProvider.tsx +++ b/packages/core/src/layout/SignInPage/googleProvider.tsx @@ -18,16 +18,7 @@ import React from 'react'; import { Grid, Typography, Button } from '@material-ui/core'; import { InfoCard } from '../InfoCard/InfoCard'; import { ProviderComponent, ProviderLoader, SignInProvider } from './types'; -import { - useApi, - googleAuthApiRef, - errorApiRef, - ProfileInfo, -} from '@backstage/core-api'; - -function parseUserId(profile: ProfileInfo) { - return profile!.email.replace(/@.*/, ''); -} +import { useApi, googleAuthApiRef, errorApiRef } from '@backstage/core-api'; const Component: ProviderComponent = ({ onResult }) => { const googleAuthApi = useApi(googleAuthApiRef); @@ -35,12 +26,17 @@ const Component: ProviderComponent = ({ onResult }) => { const handleLogin = async () => { try { - await googleAuthApi.getIdToken({ instantPopup: true }); + const identity = await googleAuthApi.getBackstageIdentity({ + instantPopup: true, + }); + const profile = await googleAuthApi.getProfile(); onResult({ - userId: parseUserId(profile!), - getIdToken: () => googleAuthApi.getIdToken(), + userId: identity!.id, + profile: profile!, + getIdToken: () => + googleAuthApi.getBackstageIdentity().then(i => i!.idToken), logout: async () => { await googleAuthApi.logout(); }, @@ -69,11 +65,21 @@ const Component: ProviderComponent = ({ onResult }) => { const loader: ProviderLoader = async apis => { const googleAuthApi = apis.get(googleAuthApiRef)!; - const profile = await googleAuthApi.getProfile({ optional: true }); + const identity = await googleAuthApi.getBackstageIdentity({ + optional: true, + }); + + if (!identity) { + return undefined; + } + + const profile = await googleAuthApi.getProfile(); return { - userId: parseUserId(profile!), - getIdToken: () => googleAuthApi.getIdToken(), + userId: identity.id, + profile: profile!, + getIdToken: () => + googleAuthApi.getBackstageIdentity().then(i => i!.idToken), logout: async () => { await googleAuthApi.logout(); }, diff --git a/packages/core/src/layout/SignInPage/guestProvider.tsx b/packages/core/src/layout/SignInPage/guestProvider.tsx index 78d0191ba9..85784eb205 100644 --- a/packages/core/src/layout/SignInPage/guestProvider.tsx +++ b/packages/core/src/layout/SignInPage/guestProvider.tsx @@ -19,6 +19,14 @@ import { Grid, Typography, Button } from '@material-ui/core'; import { InfoCard } from '../InfoCard/InfoCard'; import { ProviderComponent, ProviderLoader, SignInProvider } from './types'; +const result = { + userId: 'guest', + profile: { + email: 'guest@example.com', + displayName: 'Guest', + }, +}; + const Component: ProviderComponent = ({ onResult }) => ( ( @@ -45,7 +53,7 @@ const Component: ProviderComponent = ({ onResult }) => ( ); const loader: ProviderLoader = async () => { - return { userId: 'guest' }; + return result; }; export const guestProvider: SignInProvider = { Component, loader }; diff --git a/plugins/auth-backend/src/lib/OAuthProvider.test.ts b/plugins/auth-backend/src/lib/OAuthProvider.test.ts index d84226214d..f92875fd48 100644 --- a/plugins/auth-backend/src/lib/OAuthProvider.test.ts +++ b/plugins/auth-backend/src/lib/OAuthProvider.test.ts @@ -116,7 +116,10 @@ describe('OAuthProvider Utils', () => { profile: { email: 'foo@bar.com', }, - userIdToken: 'a.b.c', + backstageIdentity: { + id: 'a', + idToken: 'a.b.c', + }, }, }; const jsonData = JSON.stringify(data); @@ -346,7 +349,10 @@ describe('OAuthProvider', () => { expect(mockResponse.send).toHaveBeenCalledTimes(1); expect(mockResponse.send).toHaveBeenCalledWith({ ...mockResponseData, - userIdToken: 'my-id-token', + backstageIdentity: { + id: mockResponseData.profile.email, + idToken: 'my-id-token', + }, }); }); diff --git a/plugins/auth-backend/src/lib/OAuthProvider.ts b/plugins/auth-backend/src/lib/OAuthProvider.ts index 1c88dae693..dac31af451 100644 --- a/plugins/auth-backend/src/lib/OAuthProvider.ts +++ b/plugins/auth-backend/src/lib/OAuthProvider.ts @@ -147,12 +147,13 @@ export class OAuthProvider implements AuthProviderRouteHandlers { this.setRefreshTokenCookie(res, refreshToken); } - const userIdToken = await this.options.tokenIssuer.issueToken({ - claims: { sub: response.profile.email }, + const id = response.profile.email; + const idToken = await this.options.tokenIssuer.issueToken({ + claims: { sub: id }, }); const fullResponse: AuthResponse = { ...response, - userIdToken, + backstageIdentity: { id, idToken }, }; // post message back to popup if successful @@ -212,12 +213,13 @@ export class OAuthProvider implements AuthProviderRouteHandlers { // get new access_token const response = await this.providerHandlers.refresh(refreshToken, scope); - const userIdToken = await this.options.tokenIssuer.issueToken({ - claims: { sub: response.profile.email }, + const id = response.profile.email; + const idToken = await this.options.tokenIssuer.issueToken({ + claims: { sub: id }, }); const fullResponse: AuthResponse = { ...response, - userIdToken, + backstageIdentity: { id, idToken }, }; res.send(fullResponse); diff --git a/plugins/auth-backend/src/providers/saml/provider.ts b/plugins/auth-backend/src/providers/saml/provider.ts index 867bd280a2..68b84c7e33 100644 --- a/plugins/auth-backend/src/providers/saml/provider.ts +++ b/plugins/auth-backend/src/providers/saml/provider.ts @@ -84,8 +84,9 @@ export class SamlAuthProvider implements AuthProviderRouteHandlers { response: { userId, profile }, } = await executeFrameHandlerStrategy(req, this.strategy); - const userIdToken = await this.tokenIssuer.issueToken({ - claims: { sub: userId }, + const id = userId; + const idToken = await this.tokenIssuer.issueToken({ + claims: { sub: id }, }); return postMessageResponse(res, 'http://localhost:3000', { @@ -93,7 +94,7 @@ export class SamlAuthProvider implements AuthProviderRouteHandlers { response: { providerInfo: {}, profile, - userIdToken, + backstageIdentity: { id, idToken }, }, }); } catch (error) { diff --git a/plugins/auth-backend/src/providers/types.ts b/plugins/auth-backend/src/providers/types.ts index 2101fc19bb..87ea88230c 100644 --- a/plugins/auth-backend/src/providers/types.ts +++ b/plugins/auth-backend/src/providers/types.ts @@ -192,14 +192,26 @@ export type AuthProviderFactory = ( export type AuthResponse = { providerInfo: ProviderInfo; profile: ProfileInfo; - userIdToken: string; + backstageIdentity: BackstageIdentity; }; export type OAuthResponse = Omit< AuthResponse, - 'userIdToken' + 'backstageIdentity' >; +export type BackstageIdentity = { + /** + * The backstage user ID. + */ + id: string; + + /** + * An ID token that can be used to authenticate the user within Backstage. + */ + idToken: string; +}; + export type OAuthProviderInfo = { /** * An access token issued for the signed in user. diff --git a/plugins/auth-backend/src/service/router.ts b/plugins/auth-backend/src/service/router.ts index 68b2d31032..28718e85a1 100644 --- a/plugins/auth-backend/src/service/router.ts +++ b/plugins/auth-backend/src/service/router.ts @@ -67,12 +67,6 @@ export async function createRouter( clientId: process.env.AUTH_GOOGLE_CLIENT_ID!, clientSecret: process.env.AUTH_GOOGLE_CLIENT_SECRET!, }, - production: { - appOrigin: 'http://localhost:3000', - secure: false, - clientId: '', - clientSecret: '', - }, }, github: { development: { From 593cc2c6e6ef0f06c22abcfd8dc6d2d5bee12033 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 16:06:26 +0200 Subject: [PATCH 05/21] core-api: update web message response handling in loginPopup to expect RFC format --- packages/core-api/src/lib/loginPopup.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/core-api/src/lib/loginPopup.ts b/packages/core-api/src/lib/loginPopup.ts index b4af94be49..10d6efd7a4 100644 --- a/packages/core-api/src/lib/loginPopup.ts +++ b/packages/core-api/src/lib/loginPopup.ts @@ -46,11 +46,11 @@ export type LoginPopupOptions = { type AuthResult = | { - type: 'auth-result'; - payload: any; + type: 'authorization_response'; + response: unknown; } | { - type: 'auth-result'; + type: 'authorization_response'; error: { name: string; message: string; @@ -58,12 +58,13 @@ type AuthResult = }; /** - * Show a popup pointing to a URL that starts an auth flow. + * Show a popup pointing to a URL that starts an auth flow. Implementing the receiving + * end of the postMessage mechanism outlined in https://tools.ietf.org/html/draft-sakimura-oauth-wmrm-00 * * The redirect handler of the flow should use postMessage to communicate back * to the app window. The message posted to the app must match the AuthResult type. * - * The returned promise resolves to the contents of the message that was posted from the auth popup. + * The returned promise resolves to the response of the message that was posted from the auth popup. */ export function showLoginPopup(options: LoginPopupOptions): Promise { return new Promise((resolve, reject) => { @@ -91,7 +92,7 @@ export function showLoginPopup(options: LoginPopupOptions): Promise { return; } const { data } = event; - if (data.type !== 'auth-result') { + if (data.type !== 'authorization_response') { return; } const authResult = data as AuthResult; @@ -103,7 +104,7 @@ export function showLoginPopup(options: LoginPopupOptions): Promise { // error.extra = authResult.error.extra; reject(error); } else { - resolve(authResult.payload); + resolve(authResult.response); } done(); }; From cc3664faf16df70e3c3b33ed856d3594d0dfd7b7 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 18:34:33 +0200 Subject: [PATCH 06/21] core: fix sign-in hot reloading issues and unmounted component access --- packages/core-api/src/app/App.tsx | 19 ++++--------------- .../Settings/OAuthProviderSettings.tsx | 11 +++++++++-- .../Sidebar/Settings/OIDCProviderSettings.tsx | 11 +++++++++-- .../core/src/layout/SignInPage/providers.tsx | 3 ++- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/packages/core-api/src/app/App.tsx b/packages/core-api/src/app/App.tsx index dc2136a806..27a63ea04a 100644 --- a/packages/core-api/src/app/App.tsx +++ b/packages/core-api/src/app/App.tsx @@ -17,7 +17,6 @@ import React, { ComponentType, FC, useMemo, - useCallback, useState, ReactElement, } from 'react'; @@ -258,24 +257,14 @@ export class PrivateAppImpl implements BackstageApp { component: ComponentType; children: ReactElement; }> = ({ component: Component, children }) => { - const [done, setDone] = useState(false); + const [result, setResult] = useState(); - const onResult = useCallback( - (result: SignInResult) => { - if (done) { - throw new Error('Identity result callback was called twice'); - } - this.identityApi.setSignInResult(result); - setDone(true); - }, - [done], - ); - - if (done) { + if (result) { + this.identityApi.setSignInResult(result); return children; } - return ; + return ; }; const AppRouter: FC<{}> = ({ children }) => { diff --git a/packages/core/src/layout/Sidebar/Settings/OAuthProviderSettings.tsx b/packages/core/src/layout/Sidebar/Settings/OAuthProviderSettings.tsx index b81ba2aaf7..73659eb63d 100644 --- a/packages/core/src/layout/Sidebar/Settings/OAuthProviderSettings.tsx +++ b/packages/core/src/layout/Sidebar/Settings/OAuthProviderSettings.tsx @@ -41,22 +41,29 @@ export const OAuthProviderSettings: FC = ({ const [signedIn, setSignedIn] = useState(false); useEffect(() => { + let didCancel = false; + const checkSession = async () => { const session = await api.getAccessToken('', { optional: true }); - setSignedIn(!!session); + if (!didCancel) { + setSignedIn(!!session); + } }; let subscription: Subscription; const observeSession = () => { subscription = api .sessionState$() .subscribe((sessionState: SessionState) => { - setSignedIn(sessionState === SessionState.SignedIn); + if (!didCancel) { + setSignedIn(sessionState === SessionState.SignedIn); + } }); }; checkSession(); observeSession(); return () => { + didCancel = true; subscription.unsubscribe(); }; }, [api]); diff --git a/packages/core/src/layout/Sidebar/Settings/OIDCProviderSettings.tsx b/packages/core/src/layout/Sidebar/Settings/OIDCProviderSettings.tsx index 139d79213f..19ee00eee1 100644 --- a/packages/core/src/layout/Sidebar/Settings/OIDCProviderSettings.tsx +++ b/packages/core/src/layout/Sidebar/Settings/OIDCProviderSettings.tsx @@ -41,9 +41,13 @@ export const OIDCProviderSettings: FC = ({ const [signedIn, setSignedIn] = useState(false); useEffect(() => { + let didCancel = false; + const checkSession = async () => { const session = await api.getIdToken({ optional: true }); - setSignedIn(!!session); + if (!didCancel) { + setSignedIn(!!session); + } }; let subscription: Subscription; @@ -51,13 +55,16 @@ export const OIDCProviderSettings: FC = ({ subscription = api .sessionState$() .subscribe((sessionState: SessionState) => { - setSignedIn(sessionState === SessionState.SignedIn); + if (!didCancel) { + setSignedIn(sessionState === SessionState.SignedIn); + } }); }; checkSession(); observeSession(); return () => { + didCancel = true; subscription.unsubscribe(); }; }, [api]); diff --git a/packages/core/src/layout/SignInPage/providers.tsx b/packages/core/src/layout/SignInPage/providers.tsx index d60c8ff281..96dbc30a89 100644 --- a/packages/core/src/layout/SignInPage/providers.tsx +++ b/packages/core/src/layout/SignInPage/providers.tsx @@ -93,8 +93,9 @@ export const useSignInProviders = ( } if (result) { handleWrappedResult(result); + } else { + setLoading(false); } - setLoading(false); }) .catch(error => { if (didCancel) { From a6815e3543c23773f871858e7d315ea54bfec193 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 19:21:15 +0200 Subject: [PATCH 07/21] core-api: update loginPopup tests --- packages/core-api/src/lib/loginPopup.test.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core-api/src/lib/loginPopup.test.ts b/packages/core-api/src/lib/loginPopup.test.ts index 755438fead..55f1408e8d 100644 --- a/packages/core-api/src/lib/loginPopup.test.ts +++ b/packages/core-api/src/lib/loginPopup.test.ts @@ -59,7 +59,7 @@ describe('showLoginPopup', () => { // None of these should be accepted listener({ source: popupMock } as MessageEvent); listener({ origin: 'my-origin' } as MessageEvent); - listener({ data: { type: 'auth-result' } } as MessageEvent); + listener({ data: { type: 'authorization_response' } } as MessageEvent); listener({ source: popupMock, origin: 'my-origin', @@ -68,26 +68,26 @@ describe('showLoginPopup', () => { listener({ source: popupMock, origin: 'my-origin', - data: { type: 'not-auth-result', payload: {} }, + data: { type: 'not-auth-result', response: {} }, } as MessageEvent); await expect(Promise.race([payloadPromise, 'waiting'])).resolves.toBe( 'waiting', ); - const myPayload = {}; + const myResponse = {}; // This should be accepted as a valid sessions response listener({ source: popupMock, origin: 'my-origin', data: { - type: 'auth-result', - payload: myPayload, + type: 'authorization_response', + response: myResponse, }, } as MessageEvent); - await expect(payloadPromise).resolves.toBe(myPayload); + await expect(payloadPromise).resolves.toBe(myResponse); expect(openSpy).toBeCalledTimes(1); expect(addEventListenerSpy).toBeCalledTimes(1); @@ -118,7 +118,7 @@ describe('showLoginPopup', () => { source: popupMock, origin: 'my-origin', data: { - type: 'auth-result', + type: 'authorization_response', error: { message: 'NOPE', name: 'NopeError', From 005ca191a829876c2e4f7577b7ce377e247fc83e Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 19:29:04 +0200 Subject: [PATCH 08/21] storybook: update identity api mock --- packages/storybook/.storybook/apis.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/storybook/.storybook/apis.js b/packages/storybook/.storybook/apis.js index 65b2ec5aaa..3b61ae7af8 100644 --- a/packages/storybook/.storybook/apis.js +++ b/packages/storybook/.storybook/apis.js @@ -22,6 +22,7 @@ builder.add(errorApiRef, new ErrorAlerter(alertApi, new ErrorApiForwarder())); builder.add(identityApiRef, { getUserId: () => 'guest', + getProfile: () => ({ email: 'guest@example.com' }), getIdToken: () => undefined, logout: async () => {}, }); From 60db4adb189359b56d6b48aa72bd174ef2f9578f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 21:27:17 +0200 Subject: [PATCH 09/21] cli: include assets-types in published package --- packages/cli/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/package.json b/packages/cli/package.json index e80016e2e1..5269afb79e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -116,6 +116,7 @@ "zombie": "^6.1.4" }, "files": [ + "asset-types", "templates", "config", "bin", From 910057bc8a41788039cd13d9eba4ba8a748063c4 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 21:27:58 +0200 Subject: [PATCH 10/21] v0.1.1-alpha.11 --- lerna.json | 2 +- packages/app/package.json | 32 ++++++++++++------------- packages/backend-common/package.json | 6 ++--- packages/backend/package.json | 22 ++++++++--------- packages/catalog-model/package.json | 6 ++--- packages/cli/package.json | 6 ++--- packages/config-loader/package.json | 4 ++-- packages/config/package.json | 2 +- packages/core-api/package.json | 10 ++++---- packages/core/package.json | 12 +++++----- packages/dev-utils/package.json | 10 ++++---- packages/storybook/package.json | 4 ++-- packages/techdocs-cli/package.json | 4 ++-- packages/test-utils-core/package.json | 2 +- packages/test-utils/package.json | 10 ++++---- packages/theme/package.json | 4 ++-- plugins/auth-backend/package.json | 10 ++++---- plugins/catalog-backend/package.json | 8 +++---- plugins/catalog/package.json | 18 +++++++------- plugins/circleci/package.json | 10 ++++---- plugins/explore/package.json | 12 +++++----- plugins/gitops-profiles/package.json | 10 ++++---- plugins/graphiql/package.json | 12 +++++----- plugins/identity-backend/package.json | 6 ++--- plugins/lighthouse/package.json | 12 +++++----- plugins/register-component/package.json | 14 +++++------ plugins/scaffolder-backend/package.json | 8 +++---- plugins/scaffolder/package.json | 10 ++++---- plugins/sentry-backend/package.json | 6 ++--- plugins/sentry/package.json | 10 ++++---- plugins/tech-radar/package.json | 12 +++++----- plugins/techdocs/package.json | 10 ++++---- plugins/welcome/package.json | 10 ++++---- 33 files changed, 157 insertions(+), 157 deletions(-) diff --git a/lerna.json b/lerna.json index 71775b7af0..540b51e483 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": ["packages/*", "plugins/*"], "npmClient": "yarn", "useWorkspaces": true, - "version": "0.1.1-alpha.10" + "version": "0.1.1-alpha.11" } diff --git a/packages/app/package.json b/packages/app/package.json index 740ba4a4c3..7a2f81e42f 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,23 +1,23 @@ { "name": "example-app", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": true, "dependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/plugin-catalog": "^0.1.1-alpha.10", - "@backstage/plugin-circleci": "^0.1.1-alpha.10", - "@backstage/plugin-explore": "^0.1.1-alpha.10", - "@backstage/plugin-gitops-profiles": "^0.1.1-alpha.10", - "@backstage/plugin-lighthouse": "^0.1.1-alpha.10", - "@backstage/plugin-register-component": "^0.1.1-alpha.10", - "@backstage/plugin-scaffolder": "^0.1.1-alpha.10", - "@backstage/plugin-sentry": "^0.1.1-alpha.10", - "@backstage/plugin-tech-radar": "^0.1.1-alpha.10", - "@backstage/plugin-techdocs": "^0.1.1-alpha.10", - "@backstage/plugin-welcome": "^0.1.1-alpha.10", - "@backstage/test-utils": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/plugin-catalog": "^0.1.1-alpha.11", + "@backstage/plugin-circleci": "^0.1.1-alpha.11", + "@backstage/plugin-explore": "^0.1.1-alpha.11", + "@backstage/plugin-gitops-profiles": "^0.1.1-alpha.11", + "@backstage/plugin-lighthouse": "^0.1.1-alpha.11", + "@backstage/plugin-register-component": "^0.1.1-alpha.11", + "@backstage/plugin-scaffolder": "^0.1.1-alpha.11", + "@backstage/plugin-sentry": "^0.1.1-alpha.11", + "@backstage/plugin-tech-radar": "^0.1.1-alpha.11", + "@backstage/plugin-techdocs": "^0.1.1-alpha.11", + "@backstage/plugin-welcome": "^0.1.1-alpha.11", + "@backstage/test-utils": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "prop-types": "^15.7.2", diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index 49265cae33..b81fc18ab6 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-common", "description": "Common functionality library for Backstage backends", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -29,7 +29,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.10", + "@backstage/config": "^0.1.1-alpha.11", "@types/cors": "^2.8.6", "@types/express": "^4.17.6", "compression": "^1.7.4", @@ -41,7 +41,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", "@types/compression": "^1.7.0", "@types/http-errors": "^1.6.3", "@types/morgan": "^1.9.0", diff --git a/packages/backend/package.json b/packages/backend/package.json index a4d5f059f9..db8e7f8013 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "example-backend", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "dist/index.cjs.js", "types": "src/index.ts", "private": true, @@ -17,22 +17,22 @@ "migrate:create": "knex migrate:make -x ts" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.10", - "@backstage/catalog-model": "^0.1.1-alpha.10", - "@backstage/config": "^0.1.1-alpha.10", - "@backstage/config-loader": "^0.1.1-alpha.10", - "@backstage/plugin-auth-backend": "^0.1.1-alpha.10", - "@backstage/plugin-catalog-backend": "^0.1.1-alpha.10", - "@backstage/plugin-identity-backend": "^0.1.1-alpha.10", - "@backstage/plugin-scaffolder-backend": "^0.1.1-alpha.10", - "@backstage/plugin-sentry-backend": "^0.1.1-alpha.10", + "@backstage/backend-common": "^0.1.1-alpha.11", + "@backstage/catalog-model": "^0.1.1-alpha.11", + "@backstage/config": "^0.1.1-alpha.11", + "@backstage/config-loader": "^0.1.1-alpha.11", + "@backstage/plugin-auth-backend": "^0.1.1-alpha.11", + "@backstage/plugin-catalog-backend": "^0.1.1-alpha.11", + "@backstage/plugin-identity-backend": "^0.1.1-alpha.11", + "@backstage/plugin-scaffolder-backend": "^0.1.1-alpha.11", + "@backstage/plugin-sentry-backend": "^0.1.1-alpha.11", "express": "^4.17.1", "knex": "^0.21.1", "sqlite3": "^4.2.0", "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", "@types/express": "^4.17.6", "@types/express-serve-static-core": "^4.17.5", "@types/helmet": "^0.0.47" diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json index eb59012829..63458d8c0e 100644 --- a/packages/catalog-model/package.json +++ b/packages/catalog-model/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/catalog-model", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,14 +20,14 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.10", + "@backstage/config": "^0.1.1-alpha.11", "@types/yup": "^0.28.2", "lodash": "^4.17.15", "uuid": "^8.0.0", "yup": "^0.28.5" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", "@types/express": "^4.17.6", "@types/jest": "^25.2.2", "@types/lodash": "^4.14.151", diff --git a/packages/cli/package.json b/packages/cli/package.json index 5269afb79e..d8aec12323 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/cli", "description": "CLI for developing Backstage plugins and apps", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public" @@ -29,8 +29,8 @@ "backstage-cli": "bin/backstage-cli" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.10", - "@backstage/config-loader": "^0.1.1-alpha.10", + "@backstage/config": "^0.1.1-alpha.11", + "@backstage/config-loader": "^0.1.1-alpha.11", "@hot-loader/react-dom": "^16.13.0", "@lerna/package-graph": "^3.18.5", "@lerna/project": "^3.18.0", diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index 3fc7667466..fed39815f6 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/config-loader", "description": "Config loading functionality used by Backstage backend, and CLI", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public", @@ -30,7 +30,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.10", + "@backstage/config": "^0.1.1-alpha.11", "fs-extra": "^9.0.0", "yaml": "^1.9.2", "yup": "^0.28.5" diff --git a/packages/config/package.json b/packages/config/package.json index 5b67e9b974..8d9fc6771a 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/config", "description": "Config API used by Backstage core, backend, and CLI", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public", diff --git a/packages/core-api/package.json b/packages/core-api/package.json index 0f538d31d0..956dab3a4c 100644 --- a/packages/core-api/package.json +++ b/packages/core-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-api", "description": "Internal Core API used by Backstage plugins and apps", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public", @@ -29,8 +29,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/config": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@types/react": "^16.9", @@ -41,8 +41,8 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/test-utils-core": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/test-utils-core": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/packages/core/package.json b/packages/core/package.json index 212fe7ab35..56a9376860 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core", "description": "Core API used by Backstage plugins and apps", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public", @@ -29,9 +29,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.10", - "@backstage/core-api": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/config": "^0.1.1-alpha.11", + "@backstage/core-api": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -54,8 +54,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/test-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/test-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 922b661170..f2ecde4f28 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/dev-utils", "description": "Utilities for developing Backstage plugins.", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public", @@ -29,10 +29,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/test-utils": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/test-utils": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@testing-library/jest-dom": "^5.7.0", diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 5a59426538..8601d9b5b5 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "description": "Storybook build for core package", "private": true, "scripts": { @@ -14,7 +14,7 @@ ] }, "dependencies": { - "@backstage/theme": "^0.1.1-alpha.10" + "@backstage/theme": "^0.1.1-alpha.11" }, "devDependencies": { "@storybook/addon-actions": "^5.3.17", diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index 52448d7a1f..fa756ac8c0 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/techdocs-cli", "description": "CLI for running TechDocs locally.", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": true, "publishConfig": { "access": "public" @@ -28,7 +28,7 @@ "techdocs": "bin/techdocs-cli" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10" + "@backstage/cli": "^0.1.1-alpha.11" }, "files": [ "bin", diff --git a/packages/test-utils-core/package.json b/packages/test-utils-core/package.json index 9fc4951df9..7b6177a66c 100644 --- a/packages/test-utils-core/package.json +++ b/packages/test-utils-core/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/test-utils-core", "description": "Utilities to test Backstage core", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public", diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index ff6f7b85fa..477c501143 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/test-utils", "description": "Utilities to test Backstage plugins and apps.", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public", @@ -29,10 +29,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/core-api": "^0.1.1-alpha.10", - "@backstage/test-utils-core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/core-api": "^0.1.1-alpha.11", + "@backstage/test-utils-core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", diff --git a/packages/theme/package.json b/packages/theme/package.json index 04bb5f4467..6ac537458d 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/theme", "description": "material-ui theme for use with Backstage.", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public", @@ -31,7 +31,7 @@ "@material-ui/core": "^4.9.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10" + "@backstage/cli": "^0.1.1-alpha.11" }, "files": [ "dist/**/*.{js,d.ts}" diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index a00fdcb249..e6e4205156 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,9 +20,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.10", - "@backstage/config": "^0.1.1-alpha.10", - "@backstage/config-loader": "^0.1.1-alpha.10", + "@backstage/backend-common": "^0.1.1-alpha.11", + "@backstage/config": "^0.1.1-alpha.11", + "@backstage/config-loader": "^0.1.1-alpha.11", "@types/express": "^4.17.6", "body-parser": "^1.19.0", "compression": "^1.7.4", @@ -46,7 +46,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", "@types/body-parser": "^1.19.0", "@types/cookie-parser": "^1.4.2", "@types/jwt-decode": "2.2.1", diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index b3d18b220b..b98175f782 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "mock-data": "./scripts/mock-data" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.10", - "@backstage/catalog-model": "^0.1.1-alpha.10", + "@backstage/backend-common": "^0.1.1-alpha.11", + "@backstage/catalog-model": "^0.1.1-alpha.11", "@types/express": "^4.17.6", "express": "^4.17.1", "express-promise-router": "^3.0.3", @@ -39,7 +39,7 @@ "yup": "^0.28.5" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", "@types/lodash": "^4.14.151", "@types/node-fetch": "^2.5.7", "@types/supertest": "^2.0.8", diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 352f4a613e..9764b2107c 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,11 +21,11 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.10", - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/plugin-scaffolder": "^0.1.1-alpha.10", - "@backstage/plugin-sentry": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/catalog-model": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/plugin-scaffolder": "^0.1.1-alpha.11", + "@backstage/plugin-sentry": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -38,9 +38,9 @@ "swr": "^0.2.2" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", - "@backstage/test-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/test-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/react-hooks": "^3.3.0", diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index 4ae6eca890..ea9470e9fe 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-circleci", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,8 +30,8 @@ "postpack": "backstage-cli postpack" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -45,8 +45,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 17a6b8cebc..29ea27d175 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-explore", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,9 +32,9 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", - "@backstage/test-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/test-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index 663a6505a5..59b8ee3b53 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-gitops-profiles", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,8 +32,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index 16e47552a3..570cb4d12a 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-graphiql", "description": "Backstage plugin for browsing GraphQL APIs", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "private": false, "publishConfig": { "access": "public", @@ -31,8 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -43,9 +43,9 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", - "@backstage/test-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/test-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/identity-backend/package.json b/plugins/identity-backend/package.json index cb1f8dffd5..c7cf21a01d 100644 --- a/plugins/identity-backend/package.json +++ b/plugins/identity-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-identity-backend", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,7 +20,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.10", + "@backstage/backend-common": "^0.1.1-alpha.11", "@types/express": "^4.17.6", "compression": "^1.7.4", "cors": "^2.8.5", @@ -33,7 +33,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index cf9722dde5..693b36c3a9 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-lighthouse", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -33,9 +33,9 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", - "@backstage/test-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/test-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index c40e4e8367..256764d4be 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-register-component", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.10", - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/plugin-catalog": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/catalog-model": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/plugin-catalog": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -36,8 +36,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 994e898b88..531ebcc9d6 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "mock-data": "./scripts/mock-data" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.10", - "@backstage/catalog-model": "^0.1.1-alpha.10", + "@backstage/backend-common": "^0.1.1-alpha.11", + "@backstage/catalog-model": "^0.1.1-alpha.11", "@types/express": "^4.17.6", "compression": "^1.7.4", "cors": "^2.8.5", @@ -38,7 +38,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", "@types/fs-extra": "^9.0.1", "@types/git-url-parse": "^9.0.0", "@types/nodegit": "0.26.5", diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index 04260819ed..9720494cd2 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,8 +32,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/sentry-backend/package.json b/plugins/sentry-backend/package.json index c8fa9a8403..48d3208a01 100644 --- a/plugins/sentry-backend/package.json +++ b/plugins/sentry-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-sentry-backend", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,7 +20,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.10", + "@backstage/backend-common": "^0.1.1-alpha.11", "@types/express": "^4.17.6", "axios": "^0.19.2", "compression": "^1.7.4", @@ -34,7 +34,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json index f72fdcd229..31f3a221cc 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-sentry", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -34,8 +34,8 @@ "timeago.js": "^4.0.2" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index 9f077233ac..90bd1e84a4 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-tech-radar", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,9 +21,9 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/test-utils-core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/test-utils-core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -36,8 +36,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index 40d94f6ced..d4498568f6 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -31,8 +31,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index 8484afdb6b..d0ddc85efd 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-welcome", - "version": "0.1.1-alpha.10", + "version": "0.1.1-alpha.11", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -21,8 +21,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.10", - "@backstage/theme": "^0.1.1-alpha.10", + "@backstage/core": "^0.1.1-alpha.11", + "@backstage/theme": "^0.1.1-alpha.11", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,8 +32,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.10", - "@backstage/dev-utils": "^0.1.1-alpha.10", + "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/dev-utils": "^0.1.1-alpha.11", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", From 086417829d0e731e92013c631980818315bf13f4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2020 22:19:32 +0200 Subject: [PATCH 11/21] build(deps-dev): bump @storybook/addon-links from 5.3.18 to 5.3.19 (#1414) Bumps [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/addons/links) from 5.3.18 to 5.3.19. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v5.3.19/addons/links) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- yarn.lock | 107 ++++-------------------------------------------------- 1 file changed, 7 insertions(+), 100 deletions(-) diff --git a/yarn.lock b/yarn.lock index da47a9bd86..7e990f4310 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2570,15 +2570,15 @@ uuid "^3.3.2" "@storybook/addon-links@^5.3.17": - version "5.3.18" - resolved "https://registry.npmjs.org/@storybook/addon-links/-/addon-links-5.3.18.tgz#6b4aec83e158c000221bfe1f43e4a473f0727193" - integrity sha512-rDpsAQUr60BEM83TBh7mwKjaZvqTR+CAAMLAxXN+J8DMoOjymjd2sjq4UVJsOQVTnw3wjIc4+xpAL/eYqkJAIQ== + version "5.3.19" + resolved "https://registry.npmjs.org/@storybook/addon-links/-/addon-links-5.3.19.tgz#3c23e886d44b56978ae254fed3bf8be54c877178" + integrity sha512-gn9u8lebREfRsyzxoDPG0O+kOf5aJ0BhzcCJGZZdqha0F6OWHhh8vJYZZvjJ/Qwze+Qt2zjrgWm+Q6+JLD8ugQ== dependencies: - "@storybook/addons" "5.3.18" - "@storybook/client-logger" "5.3.18" - "@storybook/core-events" "5.3.18" + "@storybook/addons" "5.3.19" + "@storybook/client-logger" "5.3.19" + "@storybook/core-events" "5.3.19" "@storybook/csf" "0.0.1" - "@storybook/router" "5.3.18" + "@storybook/router" "5.3.19" core-js "^3.0.1" global "^4.3.2" prop-types "^15.7.2" @@ -2604,19 +2604,6 @@ regenerator-runtime "^0.13.3" util-deprecate "^1.0.2" -"@storybook/addons@5.3.18": - version "5.3.18" - resolved "https://registry.npmjs.org/@storybook/addons/-/addons-5.3.18.tgz#5cbba6407ef7a802041c5ee831473bc3bed61f64" - integrity sha512-ZQjDgTUDFRLvAiBg2d8FgPgghfQ+9uFyXQbtiGlTBLinrPCeQd7J86qiUES0fcGoohCCw0wWKtvB0WF2z1XNDg== - dependencies: - "@storybook/api" "5.3.18" - "@storybook/channels" "5.3.18" - "@storybook/client-logger" "5.3.18" - "@storybook/core-events" "5.3.18" - core-js "^3.0.1" - global "^4.3.2" - util-deprecate "^1.0.2" - "@storybook/addons@5.3.19", "@storybook/addons@^5.3.17": version "5.3.19" resolved "https://registry.npmjs.org/@storybook/addons/-/addons-5.3.19.tgz#3a7010697afd6df9a41b8c8a7351d9a06ff490a4" @@ -2630,32 +2617,6 @@ global "^4.3.2" util-deprecate "^1.0.2" -"@storybook/api@5.3.18": - version "5.3.18" - resolved "https://registry.npmjs.org/@storybook/api/-/api-5.3.18.tgz#95582ab90d947065e0e34ed603650a3630dcbd16" - integrity sha512-QXaccNCARHzPWOuxYndiebGWBZmwiUvRgB9ji0XTJBS3y8K0ZPb5QyuqiKPaEWUj8dBA8rzdDtkW3Yt95Namaw== - dependencies: - "@reach/router" "^1.2.1" - "@storybook/channels" "5.3.18" - "@storybook/client-logger" "5.3.18" - "@storybook/core-events" "5.3.18" - "@storybook/csf" "0.0.1" - "@storybook/router" "5.3.18" - "@storybook/theming" "5.3.18" - "@types/reach__router" "^1.2.3" - core-js "^3.0.1" - fast-deep-equal "^2.0.1" - global "^4.3.2" - lodash "^4.17.15" - memoizerific "^1.11.3" - prop-types "^15.6.2" - react "^16.8.3" - semver "^6.0.0" - shallow-equal "^1.1.0" - store2 "^2.7.1" - telejson "^3.2.0" - util-deprecate "^1.0.2" - "@storybook/api@5.3.19": version "5.3.19" resolved "https://registry.npmjs.org/@storybook/api/-/api-5.3.19.tgz#77f15e9e2eee59fe1ddeaba1ef39bc34713a6297" @@ -2693,13 +2654,6 @@ global "^4.3.2" telejson "^3.2.0" -"@storybook/channels@5.3.18": - version "5.3.18" - resolved "https://registry.npmjs.org/@storybook/channels/-/channels-5.3.18.tgz#490c9eaa8292b0571c0f665052b12addf7c35f21" - integrity sha512-scP/6td/BJSEOgfN+qaYGDf3E793xye7tIw6W+sYqwg+xdMFO39wVXgVZNpQL6sLEwpJZTaPywCjC6p6ksErqQ== - dependencies: - core-js "^3.0.1" - "@storybook/channels@5.3.19": version "5.3.19" resolved "https://registry.npmjs.org/@storybook/channels/-/channels-5.3.19.tgz#65ad7cd19d70aa5eabbb2e5e39ceef5e510bcb7f" @@ -2730,13 +2684,6 @@ ts-dedent "^1.1.0" util-deprecate "^1.0.2" -"@storybook/client-logger@5.3.18": - version "5.3.18" - resolved "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-5.3.18.tgz#27c9d09d788965db0164be6e168bc3f03adbf88f" - integrity sha512-RZjxw4uqZX3Yk27IirbB/pQG+wRsQSSRlKqYa8KQ5bSanm4IrcV9VA1OQbuySW9njE+CexAnakQJ/fENdmurNg== - dependencies: - core-js "^3.0.1" - "@storybook/client-logger@5.3.19": version "5.3.19" resolved "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-5.3.19.tgz#fbbd186e82102eaca1d6a5cca640271cae862921" @@ -2771,13 +2718,6 @@ simplebar-react "^1.0.0-alpha.6" ts-dedent "^1.1.0" -"@storybook/core-events@5.3.18": - version "5.3.18" - resolved "https://registry.npmjs.org/@storybook/core-events/-/core-events-5.3.18.tgz#e5d335f8a2c7dd46502b8f505006f1e111b46d49" - integrity sha512-uQ6NYJ5WODXK8DJ7m8y3yUAtWB3n+6XtYztjY+tdkCsLYvTYDXNS+epV+f5Hu9+gB+/Dm+b5Su4jDD+LZB2QWA== - dependencies: - core-js "^3.0.1" - "@storybook/core-events@5.3.19": version "5.3.19" resolved "https://registry.npmjs.org/@storybook/core-events/-/core-events-5.3.19.tgz#18020cd52e0d8ef0973a8e9622a10d5f99796f79" @@ -2910,21 +2850,6 @@ ts-dedent "^1.1.0" webpack "^4.33.0" -"@storybook/router@5.3.18": - version "5.3.18" - resolved "https://registry.npmjs.org/@storybook/router/-/router-5.3.18.tgz#8ab22f1f2f7f957e78baf992030707a62289076e" - integrity sha512-6B2U2C75KTSVaCuYYgcubeJGcCSnwsXuEf50hEd5mGqWgHZfojCtGvB7Ko4X+0h8rEC+eNA4p7YBOhlUv9WNrQ== - dependencies: - "@reach/router" "^1.2.1" - "@storybook/csf" "0.0.1" - "@types/reach__router" "^1.2.3" - core-js "^3.0.1" - global "^4.3.2" - lodash "^4.17.15" - memoizerific "^1.11.3" - qs "^6.6.0" - util-deprecate "^1.0.2" - "@storybook/router@5.3.19": version "5.3.19" resolved "https://registry.npmjs.org/@storybook/router/-/router-5.3.19.tgz#0f783b85658f99e4007f74347ad7ef17dbf7fc3a" @@ -2956,24 +2881,6 @@ prop-types "^15.7.2" regenerator-runtime "^0.13.3" -"@storybook/theming@5.3.18": - version "5.3.18" - resolved "https://registry.npmjs.org/@storybook/theming/-/theming-5.3.18.tgz#35e78de79d9cf8f1248af0dd1c7fa60555761312" - integrity sha512-lfFTeLoYwLMKg96N3gn0umghMdAHgJBGuk2OM8Ll84yWtdl9RGnzfiI1Fl7Cr5k95dCF7drLJlJCao1VxUkFSA== - dependencies: - "@emotion/core" "^10.0.20" - "@emotion/styled" "^10.0.17" - "@storybook/client-logger" "5.3.18" - core-js "^3.0.1" - deep-object-diff "^1.1.0" - emotion-theming "^10.0.19" - global "^4.3.2" - memoizerific "^1.11.3" - polished "^3.3.1" - prop-types "^15.7.2" - resolve-from "^5.0.0" - ts-dedent "^1.1.0" - "@storybook/theming@5.3.19": version "5.3.19" resolved "https://registry.npmjs.org/@storybook/theming/-/theming-5.3.19.tgz#177d9819bd64f7a1a6ea2f1920ffa5baf9a5f467" From 4d94f4cbb421a3110592efca6ddb4f238efdca7c Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 22:24:13 +0200 Subject: [PATCH 12/21] packages: publish entire dist folder --- packages/catalog-model/package.json | 2 +- .../cli/templates/default-app/plugins/welcome/package.json.hbs | 2 +- packages/cli/templates/default-plugin/package.json.hbs | 2 +- packages/config-loader/package.json | 2 +- packages/config/package.json | 2 +- packages/core-api/package.json | 2 +- packages/core/package.json | 2 +- packages/dev-utils/package.json | 2 +- packages/test-utils-core/package.json | 2 +- packages/test-utils/package.json | 2 +- packages/theme/package.json | 2 +- plugins/auth-backend/package.json | 2 +- plugins/catalog-backend/package.json | 2 +- plugins/catalog/package.json | 2 +- plugins/circleci/package.json | 2 +- plugins/explore/package.json | 2 +- plugins/gitops-profiles/package.json | 2 +- plugins/graphiql/package.json | 2 +- plugins/identity-backend/package.json | 2 +- plugins/lighthouse/package.json | 2 +- plugins/register-component/package.json | 2 +- plugins/scaffolder-backend/package.json | 2 +- plugins/scaffolder/package.json | 2 +- plugins/sentry-backend/package.json | 2 +- plugins/sentry/package.json | 2 +- plugins/tech-radar/package.json | 2 +- plugins/techdocs/package.json | 2 +- plugins/welcome/package.json | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json index 63458d8c0e..a414ce0817 100644 --- a/packages/catalog-model/package.json +++ b/packages/catalog-model/package.json @@ -34,6 +34,6 @@ "yaml": "^1.9.2" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/cli/templates/default-app/plugins/welcome/package.json.hbs b/packages/cli/templates/default-app/plugins/welcome/package.json.hbs index d916677d33..904186ac60 100644 --- a/packages/cli/templates/default-app/plugins/welcome/package.json.hbs +++ b/packages/cli/templates/default-app/plugins/welcome/package.json.hbs @@ -37,6 +37,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/cli/templates/default-plugin/package.json.hbs b/packages/cli/templates/default-plugin/package.json.hbs index b04da6b793..d5728213e9 100644 --- a/packages/cli/templates/default-plugin/package.json.hbs +++ b/packages/cli/templates/default-plugin/package.json.hbs @@ -42,6 +42,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index fed39815f6..099d2e41de 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -41,6 +41,6 @@ "@types/yup": "^0.28.2" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/config/package.json b/packages/config/package.json index 8d9fc6771a..c1fe9fe2ec 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -37,6 +37,6 @@ "@types/node": "^12.0.0" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/core-api/package.json b/packages/core-api/package.json index 956dab3a4c..62db5db945 100644 --- a/packages/core-api/package.json +++ b/packages/core-api/package.json @@ -52,6 +52,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/core/package.json b/packages/core/package.json index 56a9376860..d89815b1f0 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -68,6 +68,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index f2ecde4f28..e18a9fbacf 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -50,6 +50,6 @@ "@types/node": "^12.0.0" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/test-utils-core/package.json b/packages/test-utils-core/package.json index 7b6177a66c..4fa463438e 100644 --- a/packages/test-utils-core/package.json +++ b/packages/test-utils-core/package.json @@ -40,6 +40,6 @@ "@types/node": "^12.0.0" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 477c501143..e86d95c7a1 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -48,6 +48,6 @@ "@types/node": "^12.0.0" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/packages/theme/package.json b/packages/theme/package.json index 6ac537458d..1262e4b977 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -34,6 +34,6 @@ "@backstage/cli": "^0.1.1-alpha.11" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index e6e4205156..9b276be91f 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -57,6 +57,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index b98175f782..4cd9db2542 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -49,7 +49,7 @@ "supertest": "^4.0.2" }, "files": [ - "dist/**/*.{js,d.ts}", + "dist", "migrations/**/*.{js,d.ts}" ] } diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 9764b2107c..0a6bcf08b6 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -54,6 +54,6 @@ "whatwg-fetch": "^3.0.0" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index ea9470e9fe..55a8e21938 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -57,6 +57,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 29ea27d175..5974640d6f 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -44,6 +44,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index 59b8ee3b53..c07ce68a0b 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -43,6 +43,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index 570cb4d12a..aeb6bfd20b 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -57,6 +57,6 @@ "react-router-dom": "6.0.0-alpha.5" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/identity-backend/package.json b/plugins/identity-backend/package.json index c7cf21a01d..d54a3ae7a4 100644 --- a/plugins/identity-backend/package.json +++ b/plugins/identity-backend/package.json @@ -37,6 +37,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index 693b36c3a9..0e2db61257 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -45,6 +45,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index 256764d4be..4188e7309e 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -47,6 +47,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 531ebcc9d6..8252fd3db7 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -47,6 +47,6 @@ "yaml": "^1.10.0" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index 9720494cd2..c930c5dacc 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -43,6 +43,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/sentry-backend/package.json b/plugins/sentry-backend/package.json index 48d3208a01..1cc8eb7f90 100644 --- a/plugins/sentry-backend/package.json +++ b/plugins/sentry-backend/package.json @@ -38,6 +38,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json index 31f3a221cc..108390f5c8 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -45,6 +45,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index 90bd1e84a4..b147cc8dd5 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -49,6 +49,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index d4498568f6..5b49c13538 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -42,6 +42,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index d0ddc85efd..ef1bcc2725 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -43,6 +43,6 @@ "jest-fetch-mock": "^3.0.3" }, "files": [ - "dist/**/*.{js,d.ts}" + "dist" ] } From dcaee077545ab0b56ee9d53ffbebe3fdb7e1c8a3 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 22:25:25 +0200 Subject: [PATCH 13/21] v0.1.1-alpha.12 --- lerna.json | 2 +- packages/app/package.json | 32 ++++++++++++------------- packages/backend-common/package.json | 6 ++--- packages/backend/package.json | 22 ++++++++--------- packages/catalog-model/package.json | 6 ++--- packages/cli/package.json | 6 ++--- packages/config-loader/package.json | 4 ++-- packages/config/package.json | 2 +- packages/core-api/package.json | 10 ++++---- packages/core/package.json | 12 +++++----- packages/dev-utils/package.json | 10 ++++---- packages/storybook/package.json | 4 ++-- packages/techdocs-cli/package.json | 4 ++-- packages/test-utils-core/package.json | 2 +- packages/test-utils/package.json | 10 ++++---- packages/theme/package.json | 4 ++-- plugins/auth-backend/package.json | 10 ++++---- plugins/catalog-backend/package.json | 8 +++---- plugins/catalog/package.json | 18 +++++++------- plugins/circleci/package.json | 10 ++++---- plugins/explore/package.json | 12 +++++----- plugins/gitops-profiles/package.json | 10 ++++---- plugins/graphiql/package.json | 12 +++++----- plugins/identity-backend/package.json | 6 ++--- plugins/lighthouse/package.json | 12 +++++----- plugins/register-component/package.json | 14 +++++------ plugins/scaffolder-backend/package.json | 8 +++---- plugins/scaffolder/package.json | 10 ++++---- plugins/sentry-backend/package.json | 6 ++--- plugins/sentry/package.json | 10 ++++---- plugins/tech-radar/package.json | 12 +++++----- plugins/techdocs/package.json | 10 ++++---- plugins/welcome/package.json | 10 ++++---- 33 files changed, 157 insertions(+), 157 deletions(-) diff --git a/lerna.json b/lerna.json index 540b51e483..9e00bb25a6 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": ["packages/*", "plugins/*"], "npmClient": "yarn", "useWorkspaces": true, - "version": "0.1.1-alpha.11" + "version": "0.1.1-alpha.12" } diff --git a/packages/app/package.json b/packages/app/package.json index 7a2f81e42f..06858b015b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,23 +1,23 @@ { "name": "example-app", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": true, "dependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/plugin-catalog": "^0.1.1-alpha.11", - "@backstage/plugin-circleci": "^0.1.1-alpha.11", - "@backstage/plugin-explore": "^0.1.1-alpha.11", - "@backstage/plugin-gitops-profiles": "^0.1.1-alpha.11", - "@backstage/plugin-lighthouse": "^0.1.1-alpha.11", - "@backstage/plugin-register-component": "^0.1.1-alpha.11", - "@backstage/plugin-scaffolder": "^0.1.1-alpha.11", - "@backstage/plugin-sentry": "^0.1.1-alpha.11", - "@backstage/plugin-tech-radar": "^0.1.1-alpha.11", - "@backstage/plugin-techdocs": "^0.1.1-alpha.11", - "@backstage/plugin-welcome": "^0.1.1-alpha.11", - "@backstage/test-utils": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/plugin-catalog": "^0.1.1-alpha.12", + "@backstage/plugin-circleci": "^0.1.1-alpha.12", + "@backstage/plugin-explore": "^0.1.1-alpha.12", + "@backstage/plugin-gitops-profiles": "^0.1.1-alpha.12", + "@backstage/plugin-lighthouse": "^0.1.1-alpha.12", + "@backstage/plugin-register-component": "^0.1.1-alpha.12", + "@backstage/plugin-scaffolder": "^0.1.1-alpha.12", + "@backstage/plugin-sentry": "^0.1.1-alpha.12", + "@backstage/plugin-tech-radar": "^0.1.1-alpha.12", + "@backstage/plugin-techdocs": "^0.1.1-alpha.12", + "@backstage/plugin-welcome": "^0.1.1-alpha.12", + "@backstage/test-utils": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "prop-types": "^15.7.2", diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index b81fc18ab6..b0aef88fea 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-common", "description": "Common functionality library for Backstage backends", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -29,7 +29,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.11", + "@backstage/config": "^0.1.1-alpha.12", "@types/cors": "^2.8.6", "@types/express": "^4.17.6", "compression": "^1.7.4", @@ -41,7 +41,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", "@types/compression": "^1.7.0", "@types/http-errors": "^1.6.3", "@types/morgan": "^1.9.0", diff --git a/packages/backend/package.json b/packages/backend/package.json index db8e7f8013..ec54da358c 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "example-backend", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "dist/index.cjs.js", "types": "src/index.ts", "private": true, @@ -17,22 +17,22 @@ "migrate:create": "knex migrate:make -x ts" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.11", - "@backstage/catalog-model": "^0.1.1-alpha.11", - "@backstage/config": "^0.1.1-alpha.11", - "@backstage/config-loader": "^0.1.1-alpha.11", - "@backstage/plugin-auth-backend": "^0.1.1-alpha.11", - "@backstage/plugin-catalog-backend": "^0.1.1-alpha.11", - "@backstage/plugin-identity-backend": "^0.1.1-alpha.11", - "@backstage/plugin-scaffolder-backend": "^0.1.1-alpha.11", - "@backstage/plugin-sentry-backend": "^0.1.1-alpha.11", + "@backstage/backend-common": "^0.1.1-alpha.12", + "@backstage/catalog-model": "^0.1.1-alpha.12", + "@backstage/config": "^0.1.1-alpha.12", + "@backstage/config-loader": "^0.1.1-alpha.12", + "@backstage/plugin-auth-backend": "^0.1.1-alpha.12", + "@backstage/plugin-catalog-backend": "^0.1.1-alpha.12", + "@backstage/plugin-identity-backend": "^0.1.1-alpha.12", + "@backstage/plugin-scaffolder-backend": "^0.1.1-alpha.12", + "@backstage/plugin-sentry-backend": "^0.1.1-alpha.12", "express": "^4.17.1", "knex": "^0.21.1", "sqlite3": "^4.2.0", "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", "@types/express": "^4.17.6", "@types/express-serve-static-core": "^4.17.5", "@types/helmet": "^0.0.47" diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json index a414ce0817..247727cee5 100644 --- a/packages/catalog-model/package.json +++ b/packages/catalog-model/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/catalog-model", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,14 +20,14 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.11", + "@backstage/config": "^0.1.1-alpha.12", "@types/yup": "^0.28.2", "lodash": "^4.17.15", "uuid": "^8.0.0", "yup": "^0.28.5" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", "@types/express": "^4.17.6", "@types/jest": "^25.2.2", "@types/lodash": "^4.14.151", diff --git a/packages/cli/package.json b/packages/cli/package.json index d8aec12323..bbc62d15a8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/cli", "description": "CLI for developing Backstage plugins and apps", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public" @@ -29,8 +29,8 @@ "backstage-cli": "bin/backstage-cli" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.11", - "@backstage/config-loader": "^0.1.1-alpha.11", + "@backstage/config": "^0.1.1-alpha.12", + "@backstage/config-loader": "^0.1.1-alpha.12", "@hot-loader/react-dom": "^16.13.0", "@lerna/package-graph": "^3.18.5", "@lerna/project": "^3.18.0", diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index 099d2e41de..08b72ce8c8 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/config-loader", "description": "Config loading functionality used by Backstage backend, and CLI", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public", @@ -30,7 +30,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.11", + "@backstage/config": "^0.1.1-alpha.12", "fs-extra": "^9.0.0", "yaml": "^1.9.2", "yup": "^0.28.5" diff --git a/packages/config/package.json b/packages/config/package.json index c1fe9fe2ec..ad31611fac 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/config", "description": "Config API used by Backstage core, backend, and CLI", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public", diff --git a/packages/core-api/package.json b/packages/core-api/package.json index 62db5db945..c6b25fc0f7 100644 --- a/packages/core-api/package.json +++ b/packages/core-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-api", "description": "Internal Core API used by Backstage plugins and apps", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public", @@ -29,8 +29,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/config": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@types/react": "^16.9", @@ -41,8 +41,8 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/test-utils-core": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/test-utils-core": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/packages/core/package.json b/packages/core/package.json index d89815b1f0..82ea259ba1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core", "description": "Core API used by Backstage plugins and apps", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public", @@ -29,9 +29,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.11", - "@backstage/core-api": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/config": "^0.1.1-alpha.12", + "@backstage/core-api": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -54,8 +54,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/test-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/test-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index e18a9fbacf..65f92242da 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/dev-utils", "description": "Utilities for developing Backstage plugins.", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public", @@ -29,10 +29,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/test-utils": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/test-utils": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@testing-library/jest-dom": "^5.7.0", diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 8601d9b5b5..060241d383 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "description": "Storybook build for core package", "private": true, "scripts": { @@ -14,7 +14,7 @@ ] }, "dependencies": { - "@backstage/theme": "^0.1.1-alpha.11" + "@backstage/theme": "^0.1.1-alpha.12" }, "devDependencies": { "@storybook/addon-actions": "^5.3.17", diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index fa756ac8c0..4258aee12e 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/techdocs-cli", "description": "CLI for running TechDocs locally.", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": true, "publishConfig": { "access": "public" @@ -28,7 +28,7 @@ "techdocs": "bin/techdocs-cli" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11" + "@backstage/cli": "^0.1.1-alpha.12" }, "files": [ "bin", diff --git a/packages/test-utils-core/package.json b/packages/test-utils-core/package.json index 4fa463438e..60e0a6bdbe 100644 --- a/packages/test-utils-core/package.json +++ b/packages/test-utils-core/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/test-utils-core", "description": "Utilities to test Backstage core", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public", diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index e86d95c7a1..51ab99fcb1 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/test-utils", "description": "Utilities to test Backstage plugins and apps.", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public", @@ -29,10 +29,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/core-api": "^0.1.1-alpha.11", - "@backstage/test-utils-core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/core-api": "^0.1.1-alpha.12", + "@backstage/test-utils-core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", diff --git a/packages/theme/package.json b/packages/theme/package.json index 1262e4b977..61bd0443d0 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/theme", "description": "material-ui theme for use with Backstage.", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public", @@ -31,7 +31,7 @@ "@material-ui/core": "^4.9.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11" + "@backstage/cli": "^0.1.1-alpha.12" }, "files": [ "dist" diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index 9b276be91f..2de098c7eb 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,9 +20,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.11", - "@backstage/config": "^0.1.1-alpha.11", - "@backstage/config-loader": "^0.1.1-alpha.11", + "@backstage/backend-common": "^0.1.1-alpha.12", + "@backstage/config": "^0.1.1-alpha.12", + "@backstage/config-loader": "^0.1.1-alpha.12", "@types/express": "^4.17.6", "body-parser": "^1.19.0", "compression": "^1.7.4", @@ -46,7 +46,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", "@types/body-parser": "^1.19.0", "@types/cookie-parser": "^1.4.2", "@types/jwt-decode": "2.2.1", diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index 4cd9db2542..fefd7f5956 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "mock-data": "./scripts/mock-data" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.11", - "@backstage/catalog-model": "^0.1.1-alpha.11", + "@backstage/backend-common": "^0.1.1-alpha.12", + "@backstage/catalog-model": "^0.1.1-alpha.12", "@types/express": "^4.17.6", "express": "^4.17.1", "express-promise-router": "^3.0.3", @@ -39,7 +39,7 @@ "yup": "^0.28.5" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", "@types/lodash": "^4.14.151", "@types/node-fetch": "^2.5.7", "@types/supertest": "^2.0.8", diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 0a6bcf08b6..c841b9dc7a 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,11 +21,11 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.11", - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/plugin-scaffolder": "^0.1.1-alpha.11", - "@backstage/plugin-sentry": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/catalog-model": "^0.1.1-alpha.12", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/plugin-scaffolder": "^0.1.1-alpha.12", + "@backstage/plugin-sentry": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -38,9 +38,9 @@ "swr": "^0.2.2" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", - "@backstage/test-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", + "@backstage/test-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/react-hooks": "^3.3.0", diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index 55a8e21938..a938b9728b 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-circleci", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,8 +30,8 @@ "postpack": "backstage-cli postpack" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -45,8 +45,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 5974640d6f..755f0e50c3 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-explore", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,9 +32,9 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", - "@backstage/test-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", + "@backstage/test-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index c07ce68a0b..bbf9b9c5d8 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-gitops-profiles", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,8 +32,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index aeb6bfd20b..0277363ad1 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-graphiql", "description": "Backstage plugin for browsing GraphQL APIs", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public", @@ -31,8 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -43,9 +43,9 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", - "@backstage/test-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", + "@backstage/test-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/identity-backend/package.json b/plugins/identity-backend/package.json index d54a3ae7a4..bc2e82bf94 100644 --- a/plugins/identity-backend/package.json +++ b/plugins/identity-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-identity-backend", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,7 +20,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.11", + "@backstage/backend-common": "^0.1.1-alpha.12", "@types/express": "^4.17.6", "compression": "^1.7.4", "cors": "^2.8.5", @@ -33,7 +33,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index 0e2db61257..67d8bf143e 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-lighthouse", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -33,9 +33,9 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", - "@backstage/test-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", + "@backstage/test-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index 4188e7309e..5c879ff8a1 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-register-component", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.11", - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/plugin-catalog": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/catalog-model": "^0.1.1-alpha.12", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/plugin-catalog": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -36,8 +36,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 8252fd3db7..459f70463c 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "mock-data": "./scripts/mock-data" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.11", - "@backstage/catalog-model": "^0.1.1-alpha.11", + "@backstage/backend-common": "^0.1.1-alpha.12", + "@backstage/catalog-model": "^0.1.1-alpha.12", "@types/express": "^4.17.6", "compression": "^1.7.4", "cors": "^2.8.5", @@ -38,7 +38,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", "@types/fs-extra": "^9.0.1", "@types/git-url-parse": "^9.0.0", "@types/nodegit": "0.26.5", diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index c930c5dacc..313242f2c0 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,8 +32,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/sentry-backend/package.json b/plugins/sentry-backend/package.json index 1cc8eb7f90..b897a80e9a 100644 --- a/plugins/sentry-backend/package.json +++ b/plugins/sentry-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-sentry-backend", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,7 +20,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.11", + "@backstage/backend-common": "^0.1.1-alpha.12", "@types/express": "^4.17.6", "axios": "^0.19.2", "compression": "^1.7.4", @@ -34,7 +34,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json index 108390f5c8..969445c1ec 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-sentry", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -34,8 +34,8 @@ "timeago.js": "^4.0.2" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index b147cc8dd5..660ad735bc 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-tech-radar", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,9 +21,9 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/test-utils-core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/test-utils-core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -36,8 +36,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index 5b49c13538..068eb1ee22 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -31,8 +31,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index ef1bcc2725..3fb10b64e3 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-welcome", - "version": "0.1.1-alpha.11", + "version": "0.1.1-alpha.12", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -21,8 +21,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.11", - "@backstage/theme": "^0.1.1-alpha.11", + "@backstage/core": "^0.1.1-alpha.12", + "@backstage/theme": "^0.1.1-alpha.12", "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,8 +32,8 @@ "react-use": "^14.2.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.11", - "@backstage/dev-utils": "^0.1.1-alpha.11", + "@backstage/cli": "^0.1.1-alpha.12", + "@backstage/dev-utils": "^0.1.1-alpha.12", "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^10.2.4", From 61f89dd90b4644e785046df29f209f2f6b578743 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2020 21:29:26 +0000 Subject: [PATCH 14/21] build(deps): bump yup from 0.28.5 to 0.29.1 Bumps [yup](https://github.com/jquense/yup) from 0.28.5 to 0.29.1. - [Release notes](https://github.com/jquense/yup/releases) - [Changelog](https://github.com/jquense/yup/blob/master/CHANGELOG.md) - [Commits](https://github.com/jquense/yup/compare/v0.28.5...v0.29.1) Signed-off-by: dependabot-preview[bot] --- packages/catalog-model/package.json | 2 +- packages/config-loader/package.json | 2 +- plugins/catalog-backend/package.json | 2 +- yarn.lock | 17 +++++------------ 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json index 247727cee5..889d9d2e02 100644 --- a/packages/catalog-model/package.json +++ b/packages/catalog-model/package.json @@ -24,7 +24,7 @@ "@types/yup": "^0.28.2", "lodash": "^4.17.15", "uuid": "^8.0.0", - "yup": "^0.28.5" + "yup": "^0.29.1" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index 08b72ce8c8..c652351c0e 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -33,7 +33,7 @@ "@backstage/config": "^0.1.1-alpha.12", "fs-extra": "^9.0.0", "yaml": "^1.9.2", - "yup": "^0.28.5" + "yup": "^0.29.1" }, "devDependencies": { "@types/jest": "^25.2.2", diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index fefd7f5956..1bfd72bdee 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -36,7 +36,7 @@ "winston": "^3.2.1", "yaml": "^1.9.2", "yn": "^4.0.0", - "yup": "^0.28.5" + "yup": "^0.29.1" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.12", diff --git a/yarn.lock b/yarn.lock index 7e990f4310..4f16520fc8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -884,14 +884,7 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2", "@babel/runtime@^7.9.6": - version "7.9.6" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz#a9102eb5cadedf3f31d08a9ecf294af7827ea29f" - integrity sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ== - dependencies: - regenerator-runtime "^0.13.4" - -"@babel/runtime@^7.5.4": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2", "@babel/runtime@^7.9.6": version "7.10.2" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.2.tgz#d103f21f2602497d38348a32e008637d506db839" integrity sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg== @@ -19702,10 +19695,10 @@ yn@^4.0.0: resolved "https://registry.npmjs.org/yn/-/yn-4.0.0.tgz#611480051ea43b510da1dfdbe177ed159f00a979" integrity sha512-huWiiCS4TxKc4SfgmTwW1K7JmXPPAmuXWYy4j9qjQo4+27Kni8mGhAAi1cloRWmBe2EqcLgt3IGqQoRL/MtPgg== -yup@^0.28.5: - version "0.28.5" - resolved "https://registry.npmjs.org/yup/-/yup-0.28.5.tgz#85cabb4000d3623ef69be81551190692e631a8a5" - integrity sha512-7JZcvpUGUxMKoaEtcoMEM8lCWRaueGNH/A3EhL/UWqfbFm3uloiI+x59Yq4nzhbbYWUTwAsCteaZOJ+VbqI1uw== +yup@^0.29.1: + version "0.29.1" + resolved "https://registry.npmjs.org/yup/-/yup-0.29.1.tgz#35d25aab470a0c3950f66040ba0ff4b1b6efe0d9" + integrity sha512-U7mPIbgfQWI6M3hZCJdGFrr+U0laG28FxMAKIgNvgl7OtyYuUoc4uy9qCWYHZjh49b8T7Ug8NNDdiMIEytcXrQ== dependencies: "@babel/runtime" "^7.9.6" fn-name "~3.0.0" From cd7c1efb13416763b2745407a3724b11cadbe406 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 21:18:28 +0200 Subject: [PATCH 15/21] plugins/graphiql: add GitHub endpoint with automatic scope detection --- plugins/graphiql/dev/index.tsx | 14 ++- .../graphiql/src/lib/api/GraphQLEndpoints.ts | 96 +++++++++++++++++++ 2 files changed, 108 insertions(+), 2 deletions(-) diff --git a/plugins/graphiql/dev/index.tsx b/plugins/graphiql/dev/index.tsx index 32d18b4f0b..efcf19a89d 100644 --- a/plugins/graphiql/dev/index.tsx +++ b/plugins/graphiql/dev/index.tsx @@ -15,15 +15,25 @@ */ import { createDevApp } from '@backstage/dev-utils'; +import { githubAuthApiRef, errorApiRef } from '@backstage/core'; import { plugin, GraphQLEndpoints, graphQlBrowseApiRef } from '../src'; createDevApp() .registerPlugin(plugin) .registerApiFactory({ implements: graphQlBrowseApiRef, - deps: {}, - factory() { + deps: { + errorApi: errorApiRef, + githubAuthApi: githubAuthApiRef, + }, + factory({ errorApi, githubAuthApi }) { return GraphQLEndpoints.from([ + GraphQLEndpoints.github({ + id: 'github', + title: 'GitHub', + errorApi, + githubAuthApi, + }), GraphQLEndpoints.create({ id: 'gitlab', title: 'GitLab', diff --git a/plugins/graphiql/src/lib/api/GraphQLEndpoints.ts b/plugins/graphiql/src/lib/api/GraphQLEndpoints.ts index c407d92289..ee0b4bfd4e 100644 --- a/plugins/graphiql/src/lib/api/GraphQLEndpoints.ts +++ b/plugins/graphiql/src/lib/api/GraphQLEndpoints.ts @@ -15,6 +15,7 @@ */ import { GraphQLBrowseApi, GraphQLEndpoint } from './types'; +import { ErrorApi, OAuthApi } from '@backstage/core'; // Helper for generic http endpoints export type EndpointConfig = { @@ -28,6 +29,23 @@ export type EndpointConfig = { headers?: { [name in string]: string }; }; +export type GithubEndpointConfig = { + id: string; + title: string; + /** + * Github GraphQL API url, defaults to https://api.github.com/graphql + */ + url?: string; + /** + * Errors will be posted to the ErrorApi if it is provided. + */ + errorApi?: ErrorApi; + /** + * GitHub Auth API used to authenticate requests. + */ + githubAuthApi: OAuthApi; +}; + export class GraphQLEndpoints implements GraphQLBrowseApi { // Create a support static create(config: EndpointConfig): GraphQLEndpoint { @@ -51,6 +69,84 @@ export class GraphQLEndpoints implements GraphQLBrowseApi { }; } + /** + * Creates a GitHub GraphQL endpoint that uses the GithubAuth API to authenticate requests. + * + * If a request requires more permissions than is granted by the existing session, + * the fetcher will automatically ask for the additional scopes that are required. + */ + static github(config: GithubEndpointConfig): GraphQLEndpoint { + const { + id, + title, + url = 'https://api.github.com/graphql', + errorApi, + githubAuthApi, + } = config; + type ResponseBody = { + errors?: Array<{ type: string; message: string }>; + }; + + return { + id, + title, + fetcher: async (params: any) => { + let retried = false; + + const doRequest = async (): Promise => { + const res = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${await githubAuthApi.getAccessToken()}`, + }, + body: JSON.stringify(params), + }); + if (!res.ok) { + throw new Error( + `Request failed with status ${res.status} ${res.statusText}`, + ); + } + const data = (await res.json()) as ResponseBody; + + if (!data.errors || retried) { + return data; + } + retried = true; + + const missingScopes = data.errors + .filter(({ type }) => type === 'INSUFFICIENT_SCOPES') + .flatMap(({ message }) => { + const scopesMatch = message.match( + /one of the following scopes: (\[.*?\])/, + ); + if (!scopesMatch) { + return []; + } + try { + const scopes = JSON.parse(scopesMatch[1].replace(/'/g, '"')); + return scopes; + } catch (error) { + if (errorApi) { + errorApi.post( + new Error( + `Failed to parse scope string "${scopesMatch[1]}", ${error}`, + ), + ); + } + return []; + } + }); + + await githubAuthApi.getAccessToken(missingScopes); + return doRequest(); + }; + + return await doRequest(); + }, + }; + } + static from(endpoints: GraphQLEndpoint[]) { return new GraphQLEndpoints(endpoints); } From c6b9d27a71a7d5e4842d000a4dc726772e49aeb7 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 21:25:40 +0200 Subject: [PATCH 16/21] dev-utils: add google and github auth APIs to default api factories --- packages/dev-utils/src/devApp/apiFactories.ts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/dev-utils/src/devApp/apiFactories.ts b/packages/dev-utils/src/devApp/apiFactories.ts index 967918d87a..7ac6aff261 100644 --- a/packages/dev-utils/src/devApp/apiFactories.ts +++ b/packages/dev-utils/src/devApp/apiFactories.ts @@ -24,6 +24,10 @@ import { AlertApiForwarder, oauthRequestApiRef, OAuthRequestManager, + GoogleAuth, + googleAuthApiRef, + GithubAuth, + githubAuthApiRef, } from '@backstage/core'; // TODO(rugvip): We should likely figure out how to reuse all of these between apps @@ -49,3 +53,25 @@ export const oauthRequestApiFactory = createApiFactory({ deps: {}, factory: () => new OAuthRequestManager(), }); + +export const googleAuthApiFactory = createApiFactory({ + implements: googleAuthApiRef, + deps: { oauthRequestApi: oauthRequestApiRef }, + factory: ({ oauthRequestApi }) => + GoogleAuth.create({ + apiOrigin: 'http://localhost:7000', + basePath: '/auth/', + oauthRequestApi, + }), +}); + +export const githubAuthApiFactory = createApiFactory({ + implements: githubAuthApiRef, + deps: { oauthRequestApi: oauthRequestApiRef }, + factory: ({ oauthRequestApi }) => + GithubAuth.create({ + apiOrigin: 'http://localhost:7000', + basePath: '/auth/', + oauthRequestApi, + }), +}); From 2b3713f7b64226127606e3b07c9661828080e11a Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 21:48:20 +0200 Subject: [PATCH 17/21] app: add graphiql plugin with gitlab and github endpoints --- packages/app/package.json | 1 + packages/app/src/apis.ts | 23 ++++++++++++++++++++++- packages/app/src/components/Root/Root.tsx | 6 ++++++ packages/app/src/plugins.ts | 1 + 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/packages/app/package.json b/packages/app/package.json index 06858b015b..6ccf48584f 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -9,6 +9,7 @@ "@backstage/plugin-circleci": "^0.1.1-alpha.12", "@backstage/plugin-explore": "^0.1.1-alpha.12", "@backstage/plugin-gitops-profiles": "^0.1.1-alpha.12", + "@backstage/plugin-graphiql": "^0.1.1-alpha.12", "@backstage/plugin-lighthouse": "^0.1.1-alpha.12", "@backstage/plugin-register-component": "^0.1.1-alpha.12", "@backstage/plugin-scaffolder": "^0.1.1-alpha.12", diff --git a/packages/app/src/apis.ts b/packages/app/src/apis.ts index 9bfc618216..5011b16eaf 100644 --- a/packages/app/src/apis.ts +++ b/packages/app/src/apis.ts @@ -45,6 +45,10 @@ import { CircleCIApi, circleCIApiRef } from '@backstage/plugin-circleci'; import { catalogApiRef, CatalogClient } from '@backstage/plugin-catalog'; import { gitOpsApiRef, GitOpsRestApi } from '@backstage/plugin-gitops-profiles'; +import { + graphQlBrowseApiRef, + GraphQLEndpoints, +} from '@backstage/plugin-graphiql'; export const apis = (config: ConfigApi) => { // eslint-disable-next-line no-console @@ -78,7 +82,7 @@ export const apis = (config: ConfigApi) => { }), ); - builder.add( + const githubAuthApi = builder.add( githubAuthApiRef, GithubAuth.create({ apiOrigin: 'http://localhost:7000', @@ -105,5 +109,22 @@ export const apis = (config: ConfigApi) => { builder.add(gitOpsApiRef, new GitOpsRestApi('http://localhost:3008')); + builder.add( + graphQlBrowseApiRef, + GraphQLEndpoints.from([ + GraphQLEndpoints.create({ + id: 'gitlab', + title: 'GitLab', + url: 'https://gitlab.com/api/graphql', + }), + GraphQLEndpoints.github({ + id: 'github', + title: 'GitHub', + errorApi, + githubAuthApi, + }), + ]), + ); + return builder.build(); }; diff --git a/packages/app/src/components/Root/Root.tsx b/packages/app/src/components/Root/Root.tsx index 453c98bc72..4b92f8281e 100644 --- a/packages/app/src/components/Root/Root.tsx +++ b/packages/app/src/components/Root/Root.tsx @@ -39,6 +39,7 @@ import { SidebarPinButton, } from '@backstage/core'; import { NavLink } from 'react-router-dom'; +import { graphiQLRouteRef } from '@backstage/plugin-graphiql'; const useSidebarLogoStyles = makeStyles({ root: { @@ -94,6 +95,11 @@ const Root: FC<{}> = ({ children }) => ( + diff --git a/packages/app/src/plugins.ts b/packages/app/src/plugins.ts index 05373d7d96..09cd117fc0 100644 --- a/packages/app/src/plugins.ts +++ b/packages/app/src/plugins.ts @@ -24,3 +24,4 @@ export { plugin as RegisterComponent } from '@backstage/plugin-register-componen export { plugin as Sentry } from '@backstage/plugin-sentry'; export { plugin as GitopsProfiles } from '@backstage/plugin-gitops-profiles'; export { plugin as TechDocs } from '@backstage/plugin-techdocs'; +export { plugin as GraphiQL } from '@backstage/plugin-graphiql'; From 96c4b7ffa5676ecb051722116c236c24b3c794ac Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 23 Jun 2020 21:48:40 +0200 Subject: [PATCH 18/21] plugins/graphiql: grayscale icon --- plugins/graphiql/src/assets/graphiql.icon.svg | 77 ++++--------------- 1 file changed, 16 insertions(+), 61 deletions(-) diff --git a/plugins/graphiql/src/assets/graphiql.icon.svg b/plugins/graphiql/src/assets/graphiql.icon.svg index 66aee7be5a..d847a573cf 100644 --- a/plugins/graphiql/src/assets/graphiql.icon.svg +++ b/plugins/graphiql/src/assets/graphiql.icon.svg @@ -1,64 +1,19 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + From afc2e3705692a9c7ab40b4217847c309ed6d7280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 24 Jun 2020 08:47:55 +0200 Subject: [PATCH 19/21] chore(catalog): move the entity examples to catalog-model --- .../catalog-model}/examples/artist-lookup-component.yaml | 0 .../catalog-model}/examples/playback-lib-component.yaml | 0 .../catalog-model}/examples/playback-order-component.yaml | 0 .../catalog-model}/examples/podcast-api-component.yaml | 0 .../catalog-model}/examples/queue-proxy-component.yaml | 0 .../catalog-model}/examples/searcher-component.yaml | 0 .../catalog-model}/examples/shuffle-api-component.yaml | 0 .../catalog-model}/examples/www-artist-component.yaml | 0 plugins/catalog-backend/scripts/mock-data | 2 +- 9 files changed, 1 insertion(+), 1 deletion(-) rename {plugins/catalog-backend => packages/catalog-model}/examples/artist-lookup-component.yaml (100%) rename {plugins/catalog-backend => packages/catalog-model}/examples/playback-lib-component.yaml (100%) rename {plugins/catalog-backend => packages/catalog-model}/examples/playback-order-component.yaml (100%) rename {plugins/catalog-backend => packages/catalog-model}/examples/podcast-api-component.yaml (100%) rename {plugins/catalog-backend => packages/catalog-model}/examples/queue-proxy-component.yaml (100%) rename {plugins/catalog-backend => packages/catalog-model}/examples/searcher-component.yaml (100%) rename {plugins/catalog-backend => packages/catalog-model}/examples/shuffle-api-component.yaml (100%) rename {plugins/catalog-backend => packages/catalog-model}/examples/www-artist-component.yaml (100%) diff --git a/plugins/catalog-backend/examples/artist-lookup-component.yaml b/packages/catalog-model/examples/artist-lookup-component.yaml similarity index 100% rename from plugins/catalog-backend/examples/artist-lookup-component.yaml rename to packages/catalog-model/examples/artist-lookup-component.yaml diff --git a/plugins/catalog-backend/examples/playback-lib-component.yaml b/packages/catalog-model/examples/playback-lib-component.yaml similarity index 100% rename from plugins/catalog-backend/examples/playback-lib-component.yaml rename to packages/catalog-model/examples/playback-lib-component.yaml diff --git a/plugins/catalog-backend/examples/playback-order-component.yaml b/packages/catalog-model/examples/playback-order-component.yaml similarity index 100% rename from plugins/catalog-backend/examples/playback-order-component.yaml rename to packages/catalog-model/examples/playback-order-component.yaml diff --git a/plugins/catalog-backend/examples/podcast-api-component.yaml b/packages/catalog-model/examples/podcast-api-component.yaml similarity index 100% rename from plugins/catalog-backend/examples/podcast-api-component.yaml rename to packages/catalog-model/examples/podcast-api-component.yaml diff --git a/plugins/catalog-backend/examples/queue-proxy-component.yaml b/packages/catalog-model/examples/queue-proxy-component.yaml similarity index 100% rename from plugins/catalog-backend/examples/queue-proxy-component.yaml rename to packages/catalog-model/examples/queue-proxy-component.yaml diff --git a/plugins/catalog-backend/examples/searcher-component.yaml b/packages/catalog-model/examples/searcher-component.yaml similarity index 100% rename from plugins/catalog-backend/examples/searcher-component.yaml rename to packages/catalog-model/examples/searcher-component.yaml diff --git a/plugins/catalog-backend/examples/shuffle-api-component.yaml b/packages/catalog-model/examples/shuffle-api-component.yaml similarity index 100% rename from plugins/catalog-backend/examples/shuffle-api-component.yaml rename to packages/catalog-model/examples/shuffle-api-component.yaml diff --git a/plugins/catalog-backend/examples/www-artist-component.yaml b/packages/catalog-model/examples/www-artist-component.yaml similarity index 100% rename from plugins/catalog-backend/examples/www-artist-component.yaml rename to packages/catalog-model/examples/www-artist-component.yaml diff --git a/plugins/catalog-backend/scripts/mock-data b/plugins/catalog-backend/scripts/mock-data index 76ca5cf7c2..01675db363 100755 --- a/plugins/catalog-backend/scripts/mock-data +++ b/plugins/catalog-backend/scripts/mock-data @@ -14,5 +14,5 @@ for URL in \ --location \ --request POST 'localhost:7000/catalog/locations' \ --header 'Content-Type: application/json' \ - --data-raw "{\"type\": \"github\", \"target\": \"https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/examples/${URL}\"}" + --data-raw "{\"type\": \"github\", \"target\": \"https://github.com/spotify/backstage/blob/master/packages/catalog-model/examples/${URL}\"}" done From 9396682f3a2c0b2a27dcb851e0a90d7ab0314978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 24 Jun 2020 09:34:25 +0200 Subject: [PATCH 20/21] feat(catalog): show owner and lifecycle in header --- .../src/components/EntityPage/EntityPage.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/plugins/catalog/src/components/EntityPage/EntityPage.tsx b/plugins/catalog/src/components/EntityPage/EntityPage.tsx index f57e470e57..e5db5b9230 100644 --- a/plugins/catalog/src/components/EntityPage/EntityPage.tsx +++ b/plugins/catalog/src/components/EntityPage/EntityPage.tsx @@ -19,23 +19,24 @@ import { Content, errorApiRef, Header, + HeaderLabel, HeaderTabs, Page, pageTheme, + PageTheme, Progress, useApi, - PageTheme, } from '@backstage/core'; import { SentryIssuesWidget } from '@backstage/plugin-sentry'; import { Grid } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React, { FC, useEffect, useState } from 'react'; +import { useNavigate, useParams } from 'react-router-dom'; import { useAsync } from 'react-use'; import { catalogApiRef } from '../..'; import { EntityContextMenu } from '../EntityContextMenu/EntityContextMenu'; import { EntityMetadataCard } from '../EntityMetadataCard/EntityMetadataCard'; import { UnregisterEntityDialog } from '../UnregisterEntityDialog/UnregisterEntityDialog'; -import { useParams, useNavigate } from 'react-router-dom'; const REDIRECT_DELAY = 1000; function headerProps( @@ -138,7 +139,19 @@ export const EntityPage: FC<{}> = () => { return (
- {entity && } + {entity && ( + <> + + + + + )}
{loading && } From b709889fb521012fe997538d2ee71eacd7682f1b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 24 Jun 2020 10:24:06 +0200 Subject: [PATCH 21/21] auth-backend: clean up comments + fix getting email from profile --- .../src/lib/PassportStrategyHelper.ts | 2 +- plugins/auth-backend/src/providers/types.ts | 22 +++++-------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/plugins/auth-backend/src/lib/PassportStrategyHelper.ts b/plugins/auth-backend/src/lib/PassportStrategyHelper.ts index bb6d1b5d42..46a386f419 100644 --- a/plugins/auth-backend/src/lib/PassportStrategyHelper.ts +++ b/plugins/auth-backend/src/lib/PassportStrategyHelper.ts @@ -31,7 +31,7 @@ export const makeProfileInfo = ( const { displayName } = profile; let email: string | undefined = undefined; - if (profile.emails) { + if (profile.emails && profile.emails.length > 0) { const [firstEmail] = profile.emails; email = firstEmail.value; } diff --git a/plugins/auth-backend/src/providers/types.ts b/plugins/auth-backend/src/providers/types.ts index 87ea88230c..81773bf9dc 100644 --- a/plugins/auth-backend/src/providers/types.ts +++ b/plugins/auth-backend/src/providers/types.ts @@ -238,8 +238,6 @@ export type OAuthPrivateInfo = { refreshToken: string; }; -// {type: 'authorization_response', response: {...}} - /** * Payload sent as a post message after the auth request is complete. * If successful then has a valid payload with Auth information else contains an error. @@ -271,22 +269,12 @@ export type RedirectInfo = { status?: number; }; -/* -metadata: - name: john -spec: - profile: - email: john.doe@example.com - displayName: John Doe - picture: https://example.com/avatars/john.doe - - identities: - - type: google - email: john.doe@gmail.com +/** + * Used to display login information to user, i.e. sidebar popup. + * + * It is also temporarily used as the profile of the signed-in user's Backstage + * identity, but we want to replace that with data from identity and/org catalog service */ - -// 1. Link to identity in catalog / within backstage -// 2. Display login information to user, i.e. sidebar popup export type ProfileInfo = { /** * Email ID of the signed in user.