Merge branch 'master' into hchb/azgittags

This commit is contained in:
mo
2022-05-04 13:40:50 -05:00
473 changed files with 9214 additions and 2573 deletions
+13
View File
@@ -0,0 +1,13 @@
# @backstage/plugin-adr-backend
## 0.1.0-next.0
### Minor Changes
- e73075a301: Implement ADR plugin
### Patch Changes
- Updated dependencies
- @backstage/plugin-adr-common@0.1.0-next.0
- @backstage/backend-common@0.13.3-next.1
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-adr-backend",
"version": "0.0.0",
"version": "0.1.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -29,13 +29,13 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/backend-common": "^0.13.3-next.0",
"@backstage/backend-common": "^0.13.3-next.1",
"@backstage/catalog-client": "^1.0.1",
"@backstage/catalog-model": "^1.0.1",
"@backstage/config": "^1.0.0",
"@backstage/errors": "^1.0.0",
"@backstage/integration": "^1.2.0-next.0",
"@backstage/plugin-adr-common": "^0.0.0",
"@backstage/plugin-adr-common": "^0.1.0-next.0",
"@backstage/plugin-search-common": "^0.3.3",
"luxon": "^2.0.2",
"marked": "^4.0.14",
@@ -44,7 +44,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@types/marked": "^4.0.0",
"@types/supertest": "^2.0.8",
"supertest": "^6.1.3",
+7
View File
@@ -0,0 +1,7 @@
# @backstage/plugin-adr-common
## 0.1.0-next.0
### Minor Changes
- e73075a301: Implement ADR plugin
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-adr-common",
"description": "Common functionalities for the adr plugin",
"version": "0.0.0",
"version": "0.1.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -35,7 +35,7 @@
"@backstage/plugin-search-common": "^0.3.3"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0"
"@backstage/cli": "^0.17.1-next.1"
},
"files": [
"dist"
+16
View File
@@ -0,0 +1,16 @@
# @backstage/plugin-adr
## 0.1.0-next.0
### Minor Changes
- e73075a301: Implement ADR plugin
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/plugin-adr-common@0.1.0-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
- @backstage/integration-react@1.1.0-next.1
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-adr",
"version": "0.0.0",
"version": "0.1.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -22,11 +22,11 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/integration-react": "^1.1.0-next.0",
"@backstage/plugin-adr-common": "^0.0.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/integration-react": "^1.1.0-next.1",
"@backstage/plugin-adr-common": "^0.1.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -43,10 +43,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+11
View File
@@ -1,5 +1,16 @@
# @backstage/plugin-airbrake
## 0.3.5-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/test-utils@1.1.0-next.1
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
- @backstage/dev-utils@1.0.2-next.1
## 0.3.5-next.0
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-airbrake",
"version": "0.3.5-next.0",
"version": "0.3.5-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -24,11 +24,11 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -40,10 +40,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/app-defaults": "^1.0.1",
"@backstage/cli": "^0.17.1-next.0",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/app-defaults": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-allure
## 0.1.21-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.1.21-next.0
### Patch Changes
+8 -8
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-allure",
"description": "A Backstage plugin that integrates with Allure",
"version": "0.1.21-next.0",
"version": "0.1.21-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -26,9 +26,9 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -40,10 +40,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-analytics-module-ga
## 0.1.16-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
## 0.1.15
### Patch Changes
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-analytics-module-ga",
"version": "0.1.15",
"version": "0.1.16-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -25,8 +25,8 @@
},
"dependencies": {
"@backstage/config": "^1.0.0",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -38,10 +38,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-apache-airflow
## 0.1.13-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
## 0.1.12
### Patch Changes
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-apache-airflow",
"version": "0.1.12",
"version": "0.1.13-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -23,8 +23,8 @@
"clean": "backstage-cli package clean"
},
"dependencies": {
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
@@ -36,10 +36,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+13
View File
@@ -1,5 +1,18 @@
# @backstage/plugin-api-docs
## 0.8.5-next.1
### Patch Changes
- 2c279df4eb: Updated dependency `graphiql` to `^1.8.8`.
- 165790975d: Updated dependency `@asyncapi/react-component` to `1.0.0-next.37`.
- 7f6f97d151: Updated dependency `@asyncapi/react-component` to `1.0.0-next.38`.
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog@1.2.0-next.1
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.8.5-next.0
### Patch Changes
+1 -1
View File
@@ -156,7 +156,7 @@ The Swagger UI package by expects to have a route to `/oauth2-redirect.html` whi
the redirect callback for the OAuth2 Authorization Code flow, however, this file is not installed
by this plugin.
Grab a copy of [oauth2-redirect.html](https://github.com/swagger-api/swagger-ui/blob/master/dist/oauth2-redirect.html)
Grab a copy of [`oauth2-redirect.html`](https://github.com/swagger-api/swagger-ui/blob/master/dist/oauth2-redirect.html)
and put it in the `app/public/` directory in order to enable Swagger UI to complete this redirection.
This also may require you to adjust `Content Security Policy` header settings of your Backstage application, so that the script in `oauth2-redirect.html` can be executed. Since the script is static we can add the hash of it directly to our CSP policy, which we do by adding the following to the `csp` section of the app configuration:
+11 -11
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-api-docs",
"description": "A Backstage plugin that helps represent API entities in the frontend",
"version": "0.8.5-next.0",
"version": "0.8.5-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -33,17 +33,17 @@
"clean": "backstage-cli package clean"
},
"dependencies": {
"@asyncapi/react-component": "1.0.0-next.36",
"@asyncapi/react-component": "1.0.0-next.38",
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/plugin-catalog": "^1.2.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/plugin-catalog": "^1.2.0-next.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
"graphiql": "^1.5.12",
"graphiql": "^1.8.8",
"graphql": "^16.0.0",
"isomorphic-form-data": "^2.0.0",
"react-router": "6.0.0-beta.0",
@@ -56,10 +56,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+14
View File
@@ -1,5 +1,19 @@
# @backstage/plugin-auth-backend
## 0.13.1-next.1
### Patch Changes
- cac3ba68a2: Fixed a bug that was introduced in `0.13.1-next.0` which caused the `ent` claim of issued tokens to be dropped.
- 5d268623dd: Updates the OAuth2 Proxy provider to require less infrastructure configuration.
The auth result object of the OAuth2 Proxy now provides access to the request headers, both through the `headers` object as well as `getHeader` method. The existing logic that parses and extracts the user information from ID tokens is deprecated and will be removed in a future release. See the OAuth2 Proxy provider documentation for more details.
The OAuth2 Proxy provider now also has a default `authHandler` implementation that reads the display name and email from the incoming request headers.
- Updated dependencies
- @backstage/backend-common@0.13.3-next.1
## 0.13.1-next.0
### Patch Changes
+6 -3
View File
@@ -12,6 +12,7 @@ import { Config } from '@backstage/config';
import { Entity } from '@backstage/catalog-model';
import express from 'express';
import { GetEntitiesRequest } from '@backstage/catalog-client';
import { IncomingHttpHeaders } from 'http';
import { JsonValue } from '@backstage/types';
import { Logger } from 'winston';
import { PluginDatabaseManager } from '@backstage/backend-common';
@@ -376,7 +377,7 @@ export const createOAuth2Provider: (
// @public @deprecated (undocumented)
export const createOauth2ProxyProvider: (options: {
authHandler: AuthHandler<OAuth2ProxyResult<unknown>>;
authHandler?: AuthHandler<OAuth2ProxyResult<unknown>> | undefined;
signIn: {
resolver: SignInResolver<OAuth2ProxyResult<unknown>>;
};
@@ -563,9 +564,11 @@ export type Oauth2ProxyProviderOptions<JWTPayload> = {
};
// @public
export type OAuth2ProxyResult<JWTPayload> = {
export type OAuth2ProxyResult<JWTPayload = {}> = {
fullProfile: JWTPayload;
accessToken: string;
headers: IncomingHttpHeaders;
getHeader(name: string): string | undefined;
};
// Warning: (ae-missing-release-tag) "OAuthAdapter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -912,7 +915,7 @@ export const providers: Readonly<{
}>;
oauth2Proxy: Readonly<{
create: (options: {
authHandler: AuthHandler<OAuth2ProxyResult<unknown>>;
authHandler?: AuthHandler<OAuth2ProxyResult<unknown>> | undefined;
signIn: {
resolver: SignInResolver<OAuth2ProxyResult<unknown>>;
};
@@ -0,0 +1,44 @@
#!/usr/bin/env docker-compose -f
# This docker compose file can be used to try out the oauth2-proxy auth provider.
# You'll need to provide your own GitHub client ID and secret through
# GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET.
#
# The only modifications you need to make to run this example is to switch the
# SignInPage to the following:
#
# <ProxiedSignInPage {...props} provider="myproxy" />
#
# You also need to switch out the baseUrl and listen port of both the frontend and
# backend, but we can do that through env vars when running `yarn dev`:
#
# APP_CONFIG_app_baseUrl=http://localhost APP_CONFIG_app_listen_port=3000 \
# APP_CONFIG_backend_baseUrl=http://localhost APP_CONFIG_backend_listen_port=7007 yarn dev
#
# Once done, you can run the following from the root and then navigate to http://localhost
#
# ./plugins/auth-backend/examples/docker-compose.oauth2-proxy.yaml up
version: '3'
services:
proxy:
container_name: oauth2-proxy
image: quay.io/oauth2-proxy/oauth2-proxy:v7.2.1
# The below config assumes that you are running the frontend and backend
# in development mode, and that `host.docker.internal` resolves to the host machine.
command: >-
--cookie-secret=super-super-secret-cookie-secret
--cookie-secure=false
--http-address=0.0.0.0:80
--email-domain=*
--provider=github
--client-id=${GITHUB_CLIENT_ID}
--client-secret=${GITHUB_CLIENT_SECRET}
--redirect-url=http://localhost/oauth2/callback
--upstream=http://host.docker.internal:7007/api/,http://host.docker.internal:3000
ports:
- 80:80
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-auth-backend",
"description": "A Backstage backend plugin that handles authentication",
"version": "0.13.1-next.0",
"version": "0.13.1-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -34,7 +34,7 @@
},
"dependencies": {
"@backstage/plugin-auth-node": "^0.2.1-next.0",
"@backstage/backend-common": "^0.13.3-next.0",
"@backstage/backend-common": "^0.13.3-next.1",
"@backstage/catalog-client": "^1.0.1",
"@backstage/catalog-model": "^1.0.1",
"@backstage/config": "^1.0.0",
@@ -77,7 +77,7 @@
},
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.24-next.0",
"@backstage/cli": "^0.17.1-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@types/body-parser": "^1.19.0",
"@types/cookie-parser": "^1.4.2",
"@types/express-session": "^1.17.2",
@@ -47,7 +47,9 @@ describe('TokenFactory', () => {
});
await expect(factory.listPublicKeys()).resolves.toEqual({ keys: [] });
const token = await factory.issueToken({ claims: { sub: entityRef } });
const token = await factory.issueToken({
claims: { sub: entityRef, ent: [entityRef] },
});
const { keys } = await factory.listPublicKeys();
const keyStore = createLocalJWKSet({ keys: keys });
@@ -57,6 +59,7 @@ describe('TokenFactory', () => {
iss: 'my-issuer',
aud: 'backstage',
sub: entityRef,
ent: [entityRef],
iat: expect.any(Number),
exp: expect.any(Number),
});
@@ -89,7 +89,7 @@ export class TokenFactory implements TokenIssuer {
throw new AuthenticationError('No algorithm was provided in the key');
}
return new SignJWT({ iss, sub, aud, iat, exp })
return new SignJWT({ iss, sub, ent, aud, iat, exp })
.setProtectedHeader({ alg: key.alg, kid: key.kid })
.setIssuer(iss)
.setAudience(aud)
@@ -71,6 +71,8 @@ export class Auth0AuthProvider implements OAuthHandlers {
clientSecret: options.clientSecret,
callbackURL: options.callbackUrl,
domain: options.domain,
// We need passReqToCallback set to false to get params, but there's
// no matching type signature for that, so instead behold this beauty
passReqToCallback: false as true,
},
(
@@ -94,9 +94,7 @@ export class BitbucketAuthProvider implements OAuthHandlers {
clientID: options.clientId,
clientSecret: options.clientSecret,
callbackURL: options.callbackUrl,
// We need passReqToCallback set to false to get params, but there's
// no matching type signature for that, so instead behold this beauty
passReqToCallback: false as true,
passReqToCallback: false,
},
(
accessToken: any,
@@ -73,9 +73,7 @@ export class GoogleAuthProvider implements OAuthHandlers {
clientID: options.clientId,
clientSecret: options.clientSecret,
callbackURL: options.callbackUrl,
// We need passReqToCallback set to false to get params, but there's
// no matching type signature for that, so instead behold this beauty
passReqToCallback: false as true,
passReqToCallback: false,
},
(
accessToken: any,
@@ -83,7 +83,7 @@ export class MicrosoftAuthProvider implements OAuthHandlers {
callbackURL: options.callbackUrl,
authorizationURL: options.authorizationUrl,
tokenURL: options.tokenUrl,
passReqToCallback: false as true,
passReqToCallback: false,
},
(
accessToken: any,
@@ -25,7 +25,7 @@ import * as jose from 'jose';
import { Logger } from 'winston';
import { AuthHandler, AuthResolverContext, SignInResolver } from '../types';
import {
createOauth2ProxyProvider,
oauth2Proxy,
Oauth2ProxyAuthProvider,
OAuth2ProxyResult,
OAUTH2_PROXY_JWT_HEADER,
@@ -64,6 +64,9 @@ describe('Oauth2ProxyAuthProvider', () => {
mockRequest = {
body: {},
header: jest.fn(),
headers: {
'x-mock': 'mock',
},
} as unknown as jest.Mocked<express.Request>;
provider = new Oauth2ProxyAuthProvider<any>({
@@ -146,6 +149,10 @@ describe('Oauth2ProxyAuthProvider', () => {
result: {
accessToken: 'token',
fullProfile: decodedToken,
getHeader: expect.any(Function),
headers: {
'x-mock': 'mock',
},
},
},
{ _: 'resolver-context' },
@@ -167,7 +174,7 @@ describe('Oauth2ProxyAuthProvider', () => {
});
});
describe('createOauth2ProxyProvider()', () => {
describe('oauth2Proxy.create()', () => {
beforeEach(() => {
mockRequest.header.mockReturnValue(`Bearer token`);
authHandler.mockResolvedValue({
@@ -179,7 +186,7 @@ describe('Oauth2ProxyAuthProvider', () => {
});
it('should create a valid provider', async () => {
const factory = createOauth2ProxyProvider({
const factory = oauth2Proxy.create({
authHandler,
signIn: { resolver: signInResolver },
});
@@ -23,10 +23,17 @@ import {
AuthProviderRouteHandlers,
AuthResponse,
AuthResolverContext,
AuthHandlerResult,
} from '../types';
import { decodeJwt } from 'jose';
import { prepareBackstageIdentityResponse } from '../prepareBackstageIdentityResponse';
import { createAuthProviderIntegration } from '../createAuthProviderIntegration';
import { IncomingHttpHeaders } from 'http';
// NOTE: This may come in handy if you're doing work on this provider:
//
// plugins/auth-backend/examples/docker-compose.oauth2-proxy.yaml
//
export const OAUTH2_PROXY_JWT_HEADER = 'X-OAUTH2-PROXY-ID-TOKEN';
@@ -36,16 +43,41 @@ export const OAUTH2_PROXY_JWT_HEADER = 'X-OAUTH2-PROXY-ID-TOKEN';
*
* @public
*/
export type OAuth2ProxyResult<JWTPayload> = {
export type OAuth2ProxyResult<JWTPayload = {}> = {
/**
* Parsed and decoded JWT payload.
* The parsed payload of the `accessToken`. The token is only parsed, not verified.
*
* @deprecated Access through the `headers` instead. This will be removed in a future release.
*/
fullProfile: JWTPayload;
/**
* Raw JWT token
* The token received via the X-OAUTH2-PROXY-ID-TOKEN header. Will be an empty string
* if the header is not set. Note the this is typically an OpenID Connect token.
*
* @deprecated Access through the `headers` instead. This will be removed in a future release.
*/
accessToken: string;
/**
* The headers of the incoming request from the OAuth2 proxy. This will include
* both the headers set by the client as well as the ones added by the OAuth2 proxy.
* You should only trust the headers that are injected by the OAuth2 proxy.
*
* Useful headers to use to complete the sign-in are for example `x-forwarded-user`
* and `x-forwarded-email`. See the OAuth2 proxy documentation for more information
* about the available headers and how to enable them. In particular it is possible
* to forward access and identity tokens, which can be user for additional verification
* and lookups.
*/
headers: IncomingHttpHeaders;
/**
* Provides convenient access to the request headers.
*
* This call is simply forwarded to `req.get(name)`.
*/
getHeader(name: string): string | undefined;
};
/**
@@ -96,7 +128,23 @@ export class Oauth2ProxyAuthProvider<JWTPayload>
async refresh(req: express.Request, res: express.Response): Promise<void> {
try {
const result = this.getResult(req);
// TODO(Rugvip): This parsing was deprecated in 1.2 and should be removed in a future release.
const authHeader = req.header(OAUTH2_PROXY_JWT_HEADER);
const jwt = getBearerTokenFromAuthorizationHeader(authHeader);
const decodedJWT = jwt && (decodeJwt(jwt) as unknown as JWTPayload);
const result = {
fullProfile: decodedJWT || ({} as JWTPayload),
accessToken: jwt || '',
headers: req.headers,
getHeader(name: string) {
if (name.toLocaleLowerCase('en-US') === 'set-cookie') {
throw new Error('Access Set-Cookie via the headers object instead');
}
return req.get(name);
},
};
const response = await this.handleResult(result);
res.json(response);
} catch (e) {
@@ -131,24 +179,19 @@ export class Oauth2ProxyAuthProvider<JWTPayload>
profile,
};
}
}
private getResult(req: express.Request): OAuth2ProxyResult<JWTPayload> {
const authHeader = req.header(OAUTH2_PROXY_JWT_HEADER);
const jwt = getBearerTokenFromAuthorizationHeader(authHeader);
if (!jwt) {
throw new AuthenticationError(
`Missing or in incorrect format - Oauth2Proxy OIDC header: ${OAUTH2_PROXY_JWT_HEADER}`,
);
}
const decodedJWT = decodeJwt(jwt) as unknown as JWTPayload;
return {
fullProfile: decodedJWT,
accessToken: jwt,
};
}
async function defaultAuthHandler(
result: OAuth2ProxyResult<unknown>,
): Promise<AuthHandlerResult> {
return {
profile: {
email: result.getHeader('x-forwarded-email'),
displayName:
result.getHeader('x-forwarded-preferred-username') ||
result.getHeader('x-forwarded-user'),
},
};
}
/**
@@ -160,8 +203,12 @@ export const oauth2Proxy = createAuthProviderIntegration({
create<JWTPayload>(options: {
/**
* Configure an auth handler to generate a profile for the user.
*
* The default implementation uses the value of the `X-Forwarded-Preferred-Username`
* header as the display name, falling back to `X-Forwarded-User`, and the value of
* the `X-Forwarded-Email` header as the email address.
*/
authHandler: AuthHandler<OAuth2ProxyResult<JWTPayload>>;
authHandler?: AuthHandler<OAuth2ProxyResult<JWTPayload>>;
/**
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
@@ -179,7 +226,7 @@ export const oauth2Proxy = createAuthProviderIntegration({
return new Oauth2ProxyAuthProvider<JWTPayload>({
resolverContext,
signInResolver,
authHandler,
authHandler: authHandler ?? defaultAuthHandler,
});
};
},
@@ -76,7 +76,7 @@ export class OAuth2AuthProvider implements OAuthHandlers {
callbackURL: options.callbackUrl,
authorizationURL: options.authorizationUrl,
tokenURL: options.tokenUrl,
passReqToCallback: false as true,
passReqToCallback: false,
scope: options.scope,
customHeaders: options.includeBasicAuth
? {
@@ -146,7 +146,7 @@ export class OidcAuthProvider implements OAuthHandlers {
const strategy = new OidcStrategy(
{
client,
passReqToCallback: false as true,
passReqToCallback: false,
},
(
tokenset: TokenSet,
@@ -94,7 +94,7 @@ export class OktaAuthProvider implements OAuthHandlers {
clientSecret: options.clientSecret,
callbackURL: options.callbackUrl,
audience: options.audience,
passReqToCallback: false as true,
passReqToCallback: false,
store: this.store,
response_type: 'code',
},
@@ -71,7 +71,7 @@ export class OneLoginProvider implements OAuthHandlers {
clientID: options.clientId,
clientSecret: options.clientSecret,
callbackURL: options.callbackUrl,
passReqToCallback: false as true,
passReqToCallback: false,
},
(
accessToken: any,
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-azure-devops
## 0.1.21-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.1.21-next.0
### Patch Changes
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-azure-devops",
"version": "0.1.21-next.0",
"version": "0.1.21-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,11 +31,11 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/errors": "^1.0.0",
"@backstage/plugin-azure-devops-common": "^0.2.2",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -49,10 +49,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-badges
## 0.2.29-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.2.29-next.0
### Patch Changes
+8 -8
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-badges",
"description": "A Backstage plugin that generates README badges for your entities",
"version": "0.2.29-next.0",
"version": "0.2.29-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,10 +31,10 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/errors": "^1.0.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -46,10 +46,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+11
View File
@@ -1,5 +1,16 @@
# @backstage/plugin-bazaar
## 0.1.20-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/cli@0.17.1-next.1
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog@1.2.0-next.1
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.1.20-next.0
### Patch Changes
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-bazaar",
"version": "0.1.20-next.0",
"version": "0.1.20-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -26,11 +26,11 @@
"dependencies": {
"@backstage/catalog-client": "^1.0.1",
"@backstage/catalog-model": "^1.0.1",
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/plugin-catalog": "^1.2.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/plugin-catalog": "^1.2.0-next.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@date-io/luxon": "1.x",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -47,8 +47,8 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/dev-utils": "^1.0.2-next.1",
"@testing-library/jest-dom": "^5.10.1",
"cross-fetch": "^3.1.5"
},
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-bitrise
## 0.1.32-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.1.32-next.0
### Patch Changes
+8 -8
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-bitrise",
"description": "A Backstage plugin that integrates towards Bitrise",
"version": "0.1.32-next.0",
"version": "0.1.32-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -25,9 +25,9 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -43,10 +43,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
@@ -1,5 +1,14 @@
# @backstage/plugin-catalog-backend-module-gerrit
## 0.1.0-next.1
### Patch Changes
- 57f684f59c: Fix incorrect main path in `publishConfig`
- Updated dependencies
- @backstage/backend-common@0.13.3-next.1
- @backstage/plugin-catalog-backend@1.1.2-next.1
## 0.1.0-next.0
### Minor Changes
@@ -1,12 +1,12 @@
{
"name": "@backstage/plugin-catalog-backend-module-gerrit",
"version": "0.1.0-next.0",
"version": "0.1.0-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"backstage": {
@@ -28,13 +28,13 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/backend-common": "^0.13.3-next.0",
"@backstage/backend-common": "^0.13.3-next.1",
"@backstage/backend-tasks": "^0.3.1-next.0",
"@backstage/catalog-model": "^1.0.1",
"@backstage/config": "^1.0.0",
"@backstage/errors": "^1.0.0",
"@backstage/integration": "^1.2.0-next.0",
"@backstage/plugin-catalog-backend": "^1.1.2-next.0",
"@backstage/plugin-catalog-backend": "^1.1.2-next.1",
"fs-extra": "10.1.0",
"msw": "^0.35.0",
"node-fetch": "^2.6.7",
@@ -43,7 +43,7 @@
},
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.24-next.0",
"@backstage/cli": "^0.17.1-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@types/fs-extra": "^9.0.1"
},
"files": [
@@ -13,6 +13,7 @@ import { GitHubIntegrationConfig } from '@backstage/integration';
import { LocationSpec } from '@backstage/plugin-catalog-backend';
import { Logger } from 'winston';
import { ScmIntegrationRegistry } from '@backstage/integration';
import { TaskRunner } from '@backstage/backend-tasks';
// @public
export class GithubDiscoveryProcessor implements CatalogProcessor {
@@ -72,7 +73,7 @@ export class GithubMultiOrgReaderProcessor implements CatalogProcessor {
): Promise<boolean>;
}
// @public (undocumented)
// @public
export class GitHubOrgEntityProvider implements EntityProvider {
constructor(options: {
id: string;
@@ -86,17 +87,20 @@ export class GitHubOrgEntityProvider implements EntityProvider {
// (undocumented)
static fromConfig(
config: Config,
options: {
id: string;
orgUrl: string;
logger: Logger;
githubCredentialsProvider?: GithubCredentialsProvider;
},
options: GitHubOrgEntityProviderOptions,
): GitHubOrgEntityProvider;
// (undocumented)
getProviderName(): string;
// (undocumented)
read(): Promise<void>;
read(options?: { logger?: Logger }): Promise<void>;
}
// @public
export interface GitHubOrgEntityProviderOptions {
githubCredentialsProvider?: GithubCredentialsProvider;
id: string;
logger: Logger;
orgUrl: string;
schedule?: 'manual' | TaskRunner;
}
// @public
@@ -34,6 +34,7 @@
},
"dependencies": {
"@backstage/backend-common": "^0.13.3-next.0",
"@backstage/backend-tasks": "^0.3.1-next.0",
"@backstage/catalog-model": "^1.0.1",
"@backstage/config": "^1.0.0",
"@backstage/errors": "^1.0.0",
@@ -44,6 +45,7 @@
"lodash": "^4.17.21",
"msw": "^0.35.0",
"node-fetch": "^2.6.7",
"uuid": "^8.0.0",
"winston": "^3.2.1"
},
"devDependencies": {
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import { TaskRunner } from '@backstage/backend-tasks';
import {
ANNOTATION_LOCATION,
ANNOTATION_ORIGIN_LOCATION,
@@ -33,6 +34,7 @@ import {
} from '@backstage/plugin-catalog-backend';
import { graphql } from '@octokit/graphql';
import { merge } from 'lodash';
import * as uuid from 'uuid';
import { Logger } from 'winston';
import {
assignGroupsToUsers,
@@ -42,21 +44,64 @@ import {
parseGitHubOrgUrl,
} from './lib';
// TODO: Consider supporting an (optional) webhook that reacts on org changes
/** @public */
export class GitHubOrgEntityProvider implements EntityProvider {
private connection?: EntityProviderConnection;
private githubCredentialsProvider: GithubCredentialsProvider;
/**
* Options for {@link GitHubOrgEntityProvider}.
*
* @public
*/
export interface GitHubOrgEntityProviderOptions {
/**
* A unique, stable identifier for this provider.
*
* @example "production"
*/
id: string;
static fromConfig(
config: Config,
options: {
id: string;
orgUrl: string;
logger: Logger;
githubCredentialsProvider?: GithubCredentialsProvider;
},
) {
/**
* The target that this provider should consume.
*
* @example "https://github.com/backstage"
*/
orgUrl: string;
/**
* The refresh schedule to use.
*
* @defaultValue "manual"
* @remarks
*
* If you pass in 'manual', you are responsible for calling the `read` method
* manually at some interval.
*
* But more commonly you will pass in the result of
* {@link @backstage/backend-tasks#PluginTaskScheduler.createScheduledTaskRunner}
* to enable automatic scheduling of tasks.
*/
schedule?: 'manual' | TaskRunner;
/**
* The logger to use.
*/
logger: Logger;
/**
* Optionally supply a custom credentials provider, replacing the default one.
*/
githubCredentialsProvider?: GithubCredentialsProvider;
}
// TODO: Consider supporting an (optional) webhook that reacts on org changes
/**
* Ingests org data (users and groups) from GitHub.
*
* @public
*/
export class GitHubOrgEntityProvider implements EntityProvider {
private readonly credentialsProvider: GithubCredentialsProvider;
private connection?: EntityProviderConnection;
private scheduleFn?: () => Promise<void>;
static fromConfig(config: Config, options: GitHubOrgEntityProviderOptions) {
const integrations = ScmIntegrations.fromConfig(config);
const gitHubConfig = integrations.github.byUrl(options.orgUrl)?.config;
@@ -70,7 +115,7 @@ export class GitHubOrgEntityProvider implements EntityProvider {
target: options.orgUrl,
});
return new GitHubOrgEntityProvider({
const provider = new GitHubOrgEntityProvider({
id: options.id,
orgUrl: options.orgUrl,
logger,
@@ -79,6 +124,10 @@ export class GitHubOrgEntityProvider implements EntityProvider {
options.githubCredentialsProvider ||
DefaultGithubCredentialsProvider.fromIntegrations(integrations),
});
provider.schedule(options.schedule);
return provider;
}
constructor(
@@ -90,28 +139,36 @@ export class GitHubOrgEntityProvider implements EntityProvider {
githubCredentialsProvider?: GithubCredentialsProvider;
},
) {
this.githubCredentialsProvider =
this.credentialsProvider =
options.githubCredentialsProvider ||
SingleInstanceGithubCredentialsProvider.create(options.gitHubConfig);
SingleInstanceGithubCredentialsProvider.create(this.options.gitHubConfig);
}
/** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.getProviderName} */
getProviderName() {
return `GitHubOrgEntityProvider:${this.options.id}`;
}
/** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.connect} */
async connect(connection: EntityProviderConnection) {
this.connection = connection;
await this.scheduleFn?.();
}
async read() {
/**
* Runs one single complete ingestion. This is only necessary if you use
* manual scheduling.
*/
async read(options?: { logger?: Logger }) {
if (!this.connection) {
throw new Error('Not initialized');
}
const { markReadComplete } = trackProgress(this.options.logger);
const logger = options?.logger ?? this.options.logger;
const { markReadComplete } = trackProgress(logger);
const { headers, type: tokenType } =
await this.githubCredentialsProvider.getCredentials({
await this.credentialsProvider.getCredentials({
url: this.options.orgUrl,
});
const client = graphql.defaults({
@@ -144,6 +201,32 @@ export class GitHubOrgEntityProvider implements EntityProvider {
markCommitComplete();
}
private schedule(schedule: GitHubOrgEntityProviderOptions['schedule']) {
if (!schedule || schedule === 'manual') {
return;
}
this.scheduleFn = async () => {
const id = `${this.getProviderName()}:refresh`;
await schedule.run({
id,
fn: async () => {
const logger = this.options.logger.child({
class: GitHubOrgEntityProvider.prototype.constructor.name,
taskId: id,
taskInstanceId: uuid.v4(),
});
try {
await this.read({ logger });
} catch (error) {
logger.error(error);
}
},
});
};
}
}
// Helps wrap the timing and logging behaviors
@@ -42,6 +42,11 @@ type GraphQL = typeof graphql;
/**
* Extracts teams and users out of a GitHub org.
*
* @remarks
*
* Consider using {@link GitHubOrgEntityProvider} instead.
*
* @public
*/
export class GithubOrgReaderProcessor implements CatalogProcessor {
@@ -23,5 +23,6 @@
export { GithubDiscoveryProcessor } from './GithubDiscoveryProcessor';
export { GithubMultiOrgReaderProcessor } from './GithubMultiOrgReaderProcessor';
export { GitHubOrgEntityProvider } from './GitHubOrgEntityProvider';
export type { GitHubOrgEntityProviderOptions } from './GitHubOrgEntityProvider';
export { GithubOrgReaderProcessor } from './GithubOrgReaderProcessor';
export type { GithubMultiOrgConfig } from './lib';
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-catalog-backend
## 1.1.2-next.1
### Patch Changes
- 1ccbe081cc: Minor internal tweak to support TypeScript 4.6
- Updated dependencies
- @backstage/backend-common@0.13.3-next.1
## 1.1.2-next.0
### Patch Changes
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend",
"description": "The Backstage backend plugin that provides the Backstage catalog",
"version": "1.1.2-next.0",
"version": "1.1.2-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -34,7 +34,7 @@
"clean": "backstage-cli package clean"
},
"dependencies": {
"@backstage/backend-common": "^0.13.3-next.0",
"@backstage/backend-common": "^0.13.3-next.1",
"@backstage/catalog-client": "^1.0.1",
"@backstage/catalog-model": "^1.0.1",
"@backstage/config": "^1.0.0",
@@ -69,7 +69,7 @@
},
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.24-next.0",
"@backstage/cli": "^0.17.1-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/plugin-permission-common": "^0.6.0",
"@backstage/plugin-search-backend-node": "0.6.1-next.0",
"@types/core-js": "^2.5.4",
@@ -163,14 +163,14 @@ export class DefaultEntitiesCatalog implements EntitiesCatalog {
async entities(request?: EntitiesRequest): Promise<EntitiesResponse> {
const db = this.database;
let entitiesQuery = db<DbFinalEntitiesRow>('final_entities');
let entitiesQuery =
db<DbFinalEntitiesRow>('final_entities').select('final_entities.*');
if (request?.filter) {
entitiesQuery = parseFilter(request.filter, entitiesQuery, db);
}
// TODO: move final_entities to use entity_ref
entitiesQuery = entitiesQuery
.select('final_entities.*')
.whereNotNull('final_entities.final_entity')
.orderBy('entity_id', 'asc');
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-catalog-graph
## 0.2.17-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.2.17-next.0
### Patch Changes
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog-graph",
"version": "0.2.17-next.0",
"version": "0.2.17-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -26,9 +26,9 @@
"dependencies": {
"@backstage/catalog-client": "^1.0.1",
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -45,11 +45,11 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/plugin-catalog": "^1.2.0-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/plugin-catalog": "^1.2.0-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^8.0.0",
+4 -5
View File
@@ -37,23 +37,22 @@
"@backstage/catalog-model": "^1.0.1",
"@backstage/config": "^1.0.0",
"@backstage/types": "^1.0.0",
"graphql-modules": "^2.0.0",
"apollo-server": "^3.0.0",
"graphql": "^16.0.0",
"graphql-modules": "^2.0.0",
"graphql-tag": "^2.11.0",
"graphql-type-json": "^0.3.2",
"node-fetch": "^2.6.7",
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@graphql-codegen/cli": "^2.3.1",
"@graphql-codegen/graphql-modules-preset": "^2.3.2",
"@graphql-codegen/typescript": "^2.4.2",
"@graphql-codegen/typescript-resolvers": "^2.4.3",
"@graphql-codegen/graphql-modules-preset": "^2.3.2",
"@graphql-tools/schema": "^8.3.1",
"eslint-plugin-graphql": "^4.0.0",
"msw": "^0.35.0"
},
"files": [
+10
View File
@@ -1,5 +1,15 @@
# @backstage/plugin-catalog-import
## 0.8.8-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
- @backstage/integration-react@1.1.0-next.1
## 0.8.8-next.0
### Patch Changes
+9 -9
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-import",
"description": "A Backstage plugin the helps you import entities into your catalog",
"version": "0.8.8-next.0",
"version": "0.8.8-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -37,12 +37,12 @@
"@backstage/catalog-client": "^1.0.1",
"@backstage/catalog-model": "^1.0.1",
"@backstage/config": "^1.0.0",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/errors": "^1.0.0",
"@backstage/integration": "^1.2.0-next.0",
"@backstage/integration-react": "^1.1.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/integration-react": "^1.1.0-next.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
@@ -60,10 +60,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^8.0.0",
+10
View File
@@ -1,5 +1,15 @@
# @backstage/plugin-catalog-react
## 1.1.0-next.1
### Patch Changes
- 0418447669: Added menu parent role for menu items accessibility
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-permission-react@0.4.1-next.0
## 1.1.0-next.0
### Minor Changes
+7 -7
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-react",
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
"version": "1.1.0-next.0",
"version": "1.1.0-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -36,13 +36,13 @@
"dependencies": {
"@backstage/catalog-client": "^1.0.1",
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/errors": "^1.0.0",
"@backstage/integration": "^1.2.0-next.0",
"@backstage/plugin-catalog-common": "^1.0.1",
"@backstage/plugin-permission-common": "^0.6.0",
"@backstage/plugin-permission-react": "^0.4.0",
"@backstage/plugin-permission-react": "^0.4.1-next.0",
"@backstage/theme": "^0.2.15",
"@backstage/types": "^1.0.0",
"@backstage/version-bridge": "^1.0.1",
@@ -63,11 +63,11 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/plugin-catalog-common": "^1.0.1",
"@backstage/plugin-scaffolder-common": "^1.0.1",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^8.0.0",
@@ -242,7 +242,7 @@ export const UserListPicker = (props: UserListPickerProps) => {
{group.name}
</Typography>
<Card className={classes.groupWrapper}>
<List disablePadding dense>
<List disablePadding dense role="menu">
{group.items.map(item => (
<MenuItem
key={item.id}
@@ -253,6 +253,7 @@ export const UserListPicker = (props: UserListPickerProps) => {
className={classes.menuItem}
disabled={filterCounts[item.id] === 0}
data-testid={`user-picker-${item.id}`}
tabIndex={0}
>
{item.icon && (
<ListItemIcon className={classes.listIcon}>
+11
View File
@@ -1,5 +1,16 @@
# @backstage/plugin-catalog
## 1.2.0-next.1
### Patch Changes
- 051fc60258: Lighthouse was reporting this button as having invalid aria- values, as the popover doesn't exist until clicked. This adds additional labels to the button to make it valid aria
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
- @backstage/integration-react@1.1.0-next.1
## 1.2.0-next.0
### Minor Changes
+10 -10
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog",
"description": "The Backstage plugin for browsing the Backstage catalog",
"version": "1.2.0-next.0",
"version": "1.2.0-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -36,12 +36,12 @@
"dependencies": {
"@backstage/catalog-client": "^1.0.1",
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/errors": "^1.0.0",
"@backstage/integration-react": "^1.1.0-next.0",
"@backstage/integration-react": "^1.1.0-next.1",
"@backstage/plugin-catalog-common": "^1.0.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/plugin-search-common": "^0.3.3",
"@backstage/theme": "^0.2.15",
"@backstage/types": "^1.0.0",
@@ -60,11 +60,11 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/plugin-permission-react": "^0.4.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/plugin-permission-react": "^0.4.1-next.0",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
@@ -109,9 +109,12 @@ export function EntityContextMenu(props: EntityContextMenuProps) {
aria-label="more"
aria-controls="long-menu"
aria-haspopup="true"
aria-expanded={!!anchorEl}
role="button"
onClick={onOpen}
data-testid="menu-button"
className={classes.button}
id="long-menu"
>
<MoreVert />
</IconButton>
@@ -121,6 +124,7 @@ export function EntityContextMenu(props: EntityContextMenuProps) {
anchorEl={anchorEl}
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
transformOrigin={{ vertical: 'top', horizontal: 'right' }}
aria-labelledby="long-menu"
>
<MenuList>
{extraItems}
@@ -1,5 +1,13 @@
# @backstage/plugin-cicd-statistics-module-gitlab
## 0.1.1-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-cicd-statistics@0.1.7-next.1
## 0.1.1-next.0
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-cicd-statistics-module-gitlab",
"description": "CI/CD Statistics plugin module; Gitlab CICD",
"version": "0.1.1-next.0",
"version": "0.1.1-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -29,16 +29,16 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/plugin-cicd-statistics": "^0.1.7-next.0",
"@backstage/plugin-cicd-statistics": "^0.1.7-next.1",
"@gitbeaker/browser": "^35.6.0",
"@gitbeaker/core": "^35.6.0",
"luxon": "^2.0.2",
"p-limit": "^4.0.0",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/catalog-model": "^1.0.1"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0"
"@backstage/cli": "^0.17.1-next.1"
},
"files": [
"dist"
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-cicd-statistics
## 0.1.7-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.1.7-next.0
### Patch Changes
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-cicd-statistics",
"description": "A frontend plugin visualizing CI/CD pipeline statistics (build time)",
"version": "0.1.7-next.0",
"version": "0.1.7-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -38,8 +38,8 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@date-io/luxon": "^1.3.13",
"@material-ui/core": "^4.9.13",
"@material-ui/icons": "^4.11.2",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-circleci
## 0.3.5-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.3.5-next.0
### Patch Changes
+8 -8
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-circleci",
"description": "A Backstage plugin that integrates towards Circle CI",
"version": "0.3.5-next.0",
"version": "0.3.5-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -36,9 +36,9 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -55,10 +55,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-cloudbuild
## 0.3.5-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.3.5-next.0
### Patch Changes
+8 -8
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-cloudbuild",
"description": "A Backstage plugin that integrates towards Google Cloud Build",
"version": "0.3.5-next.0",
"version": "0.3.5-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -35,9 +35,9 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -52,10 +52,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-code-climate
## 0.1.5-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.1.5-next.0
### Patch Changes
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-code-climate",
"version": "0.1.5-next.0",
"version": "0.1.5-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -24,9 +24,9 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -40,9 +40,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-code-coverage
## 0.1.32-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
- @backstage/plugin-catalog-react@1.1.0-next.1
## 0.1.32-next.0
### Patch Changes
+8 -8
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-code-coverage",
"description": "A Backstage plugin that helps you keep track of your code coverage",
"version": "0.1.32-next.0",
"version": "0.1.32-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -26,10 +26,10 @@
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/config": "^1.0.0",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/errors": "^1.0.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.0-next.1",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -46,10 +46,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-config-schema
## 0.1.28-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
## 0.1.27
### Patch Changes
+7 -7
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-config-schema",
"description": "A Backstage plugin that lets you browse the configuration schema of your app",
"version": "0.1.27",
"version": "0.1.28-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -25,8 +25,8 @@
},
"dependencies": {
"@backstage/config": "^1.0.0",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/errors": "^1.0.0",
"@backstage/theme": "^0.2.15",
"@backstage/types": "^1.0.0",
@@ -41,10 +41,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-cost-insights
## 0.11.27-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
## 0.11.26
### Patch Changes
+7 -7
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-cost-insights",
"description": "A Backstage plugin that helps you keep track of your cloud spend",
"version": "0.11.26",
"version": "0.11.27-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -36,8 +36,8 @@
"dependencies": {
"@backstage/catalog-model": "^1.0.1",
"@backstage/config": "^1.0.0",
"@backstage/core-components": "^0.9.3",
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/core-components": "^0.9.4-next.0",
"@backstage/core-plugin-api": "^1.0.2-next.0",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -60,10 +60,10 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@backstage/core-app-api": "^1.0.1",
"@backstage/dev-utils": "^1.0.2-next.0",
"@backstage/test-utils": "^1.0.2-next.0",
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
+1 -1
View File
@@ -35,7 +35,7 @@ export class CostInsightsClient extends CostInsightsApi {
### Custom Setup
Default properties such as the title, subtitle and instructions page url can be overridden - even default UI such as chart itself. Additionally, alerts can be extended to support actions such as snoozing or dismissing.
Default properties such as the title, subtitle and instructions page URL can be overridden - even default UI such as chart itself. Additionally, alerts can be extended to support actions such as snoozing or dismissing.
![project-growth-alert-custom](../assets/project-growth-alert-custom.png)
@@ -0,0 +1,3 @@
module.exports = {
extends: [require.resolve('@backstage/cli/config/eslint.backend')],
};
@@ -0,0 +1,3 @@
# todo-list-backend
This package provides a starting point to demonstrate how plugin authors can use the Backstage permission framework. Refer to the [documentation](https://backstage.io/docs/permission/plugin-authors/01-setup) to get started.
@@ -0,0 +1,22 @@
## API Report File for "@internal/plugin-todo-list-backend"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import express from 'express';
import { IdentityClient } from '@backstage/plugin-auth-node';
import { Logger } from 'winston';
// @public
export function createRouter(options: RouterOptions): Promise<express.Router>;
// @public
export interface RouterOptions {
// (undocumented)
identity: IdentityClient;
// (undocumented)
logger: Logger;
}
// (No @packageDocumentation comment for this package)
```
@@ -0,0 +1,45 @@
{
"name": "@internal/plugin-todo-list-backend",
"version": "1.0.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"private": true,
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack",
"clean": "backstage-cli package clean"
},
"dependencies": {
"@backstage/backend-common": "^0.13.3-next.0",
"@backstage/config": "^1.0.0",
"@backstage/errors": "^1.0.0",
"@backstage/plugin-auth-node": "^0.2.1-next.0",
"@types/express": "^4.17.6",
"cross-fetch": "^3.1.5",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"uuid": "^8.3.2",
"winston": "^3.2.1",
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.0",
"@types/supertest": "^2.0.8",
"@types/uuid": "^8.0.0",
"msw": "^0.35.0",
"supertest": "^6.1.6"
},
"files": [
"dist"
]
}
@@ -0,0 +1,17 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './service/router';
@@ -0,0 +1,33 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getRootLogger } from '@backstage/backend-common';
import yn from 'yn';
import { startStandaloneServer } from './service/standaloneServer';
const port = process.env.PLUGIN_PORT ? Number(process.env.PLUGIN_PORT) : 7007;
const enableCors = yn(process.env.PLUGIN_CORS, { default: false });
const logger = getRootLogger();
startStandaloneServer({ port, enableCors, logger }).catch(err => {
logger.error(err);
process.exit(1);
});
process.on('SIGINT', () => {
logger.info('CTRL+C pressed; exiting.');
process.exit(0);
});
@@ -0,0 +1,47 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getVoidLogger } from '@backstage/backend-common';
import { IdentityClient } from '@backstage/plugin-auth-node';
import express from 'express';
import request from 'supertest';
import { createRouter } from './router';
describe('createRouter', () => {
let app: express.Express;
beforeAll(async () => {
const router = await createRouter({
logger: getVoidLogger(),
identity: {} as IdentityClient,
});
app = express().use(router);
});
beforeEach(() => {
jest.resetAllMocks();
});
describe('GET /health', () => {
it('returns ok', async () => {
const response = await request(app).get('/health');
expect(response.status).toEqual(200);
expect(response.body).toEqual({ status: 'ok' });
});
});
});
@@ -0,0 +1,100 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { errorHandler } from '@backstage/backend-common';
import express from 'express';
import Router from 'express-promise-router';
import { Logger } from 'winston';
import {
IdentityClient,
getBearerTokenFromAuthorizationHeader,
} from '@backstage/plugin-auth-node';
import { add, getAll, update } from './todos';
import { InputError } from '@backstage/errors';
/**
* Dependencies of the todo-list router
*
* @public
*/
export interface RouterOptions {
logger: Logger;
identity: IdentityClient;
}
/**
* Creates an express.Router with some endpoints
* for creating, editing and deleting todo items.
*
* @public
* @param options - the dependencies of the router
* @returns an express.Router
*
*/
export async function createRouter(
options: RouterOptions,
): Promise<express.Router> {
const { logger, identity } = options;
const router = Router();
router.use(express.json());
router.get('/health', (_, response) => {
logger.info('PONG!');
response.send({ status: 'ok' });
});
router.get('/todos', async (_req, res) => {
res.json(getAll());
});
router.post('/todos', async (req, res) => {
const token = getBearerTokenFromAuthorizationHeader(
req.header('authorization'),
);
let author: string | undefined = undefined;
const user = token ? await identity.authenticate(token) : undefined;
author = user?.identity.userEntityRef;
if (!isTodoCreateRequest(req.body)) {
throw new InputError('Invalid payload');
}
const todo = add({ title: req.body.title, author });
res.json(todo);
});
router.put('/todos', async (req, res) => {
if (!isTodoUpdateRequest(req.body)) {
throw new InputError('Invalid payload');
}
res.json(update(req.body));
});
router.use(errorHandler());
return router;
}
function isTodoCreateRequest(request: any): request is { title: string } {
return typeof request?.title === 'string';
}
function isTodoUpdateRequest(
request: any,
): request is { title: string; id: string } {
return typeof request?.id === 'string' && isTodoCreateRequest(request);
}
@@ -0,0 +1,61 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
createServiceBuilder,
loadBackendConfig,
SingleHostDiscovery,
} from '@backstage/backend-common';
import { IdentityClient } from '@backstage/plugin-auth-node';
import { Server } from 'http';
import { Logger } from 'winston';
import { createRouter } from './router';
export interface ServerOptions {
port: number;
enableCors: boolean;
logger: Logger;
}
export async function startStandaloneServer(
options: ServerOptions,
): Promise<Server> {
const logger = options.logger.child({ service: 'todo-list-backend' });
logger.debug('Starting application server...');
const config = await loadBackendConfig({ logger, argv: process.argv });
const discovery = SingleHostDiscovery.fromConfig(config);
const router = await createRouter({
logger,
identity: IdentityClient.create({
discovery,
issuer: await discovery.getExternalBaseUrl('auth'),
}),
});
let service = createServiceBuilder(module)
.setPort(options.port)
.addRouter('/todo-list', router);
if (options.enableCors) {
service = service.enableCors({ origin: 'http://localhost:3000' });
}
return await service.start().catch(err => {
logger.error(err);
process.exit(1);
});
}
module.hot?.accept();
@@ -0,0 +1,92 @@
/*
* Copyright 2022 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { v4 as uuid } from 'uuid';
import { NotFoundError } from '@backstage/errors';
export type Todo = {
title: string;
author?: string;
id: string;
timestamp: number;
};
export type TodoFilter = {
property: Exclude<keyof Todo, 'timestamp'>;
values: Array<string | undefined>;
};
export type TodoFilters =
| {
anyOf: TodoFilters[];
}
| { allOf: TodoFilters[] }
| { not: TodoFilters }
| TodoFilter;
const todos: { [key: string]: Todo } = {};
const matches = (todo: Todo, filters?: TodoFilters): boolean => {
if (!filters) {
return true;
}
if ('allOf' in filters) {
return filters.allOf.every(filter => matches(todo, filter));
}
if ('anyOf' in filters) {
return filters.anyOf.some(filter => matches(todo, filter));
}
if ('not' in filters) {
return !matches(todo, filters.not);
}
return filters.values.includes(todo[filters.property]);
};
export function add(todo: Omit<Todo, 'id' | 'timestamp'>) {
const id = uuid();
const obj: Todo = { ...todo, id, timestamp: Date.now() };
todos[id] = obj;
return obj;
}
export function getTodo(id: string) {
return todos[id];
}
export function update({ id, title }: { id: string; title: string }) {
let todo = todos[id];
if (!todo) {
throw new NotFoundError('Item not found');
}
todo = { ...todo, title, timestamp: Date.now() };
todos[id] = todo;
return todo;
}
export function getAll(filter?: TodoFilters) {
return Object.values(todos)
.filter(value => matches(value, filter))
.sort((a, b) => b.timestamp - a.timestamp);
}
// prepopulate the db
add({ title: 'just a note' });
add({ title: 'another note' });
@@ -0,0 +1,17 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export {};
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
@@ -0,0 +1,3 @@
# todo-list-common
This package provides a starting point to demonstrate how plugin authors can use the Backstage permission framework. Refer to the [documentation](https://backstage.io/docs/permission/plugin-authors/01-setup) to get started.
@@ -0,0 +1,12 @@
## API Report File for "@internal/plugin-todo-list-common"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { BasicPermission } from '@backstage/plugin-permission-common';
// @public
export const tempExamplePermission: BasicPermission;
// (No @packageDocumentation comment for this package)
```
@@ -0,0 +1,40 @@
{
"name": "@internal/plugin-todo-list-common",
"version": "1.0.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"private": true,
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "frontend-plugin"
},
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/plugin-permission-common": "^0.6.0"
},
"devDependencies": {
"@backstage/cli": "^0.17.1-next.1",
"@backstage/core-app-api": "^1.0.2-next.0",
"@backstage/dev-utils": "^1.0.2-next.1",
"@backstage/test-utils": "^1.1.0-next.1",
"@types/node": "^16.11.26",
"msw": "^0.35.0",
"cross-fetch": "^3.1.5"
},
"files": [
"dist"
]
}
@@ -0,0 +1,16 @@
/*
* Copyright 2022 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './permissions';
@@ -0,0 +1,27 @@
/*
* Copyright 2022 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createPermission } from '@backstage/plugin-permission-common';
/**
* An example of a permission.
*
* @public
*/
export const tempExamplePermission = createPermission({
name: 'temp.example.noop',
attributes: {},
});
+14
View File
@@ -0,0 +1,14 @@
module.exports = {
extends: [require.resolve('@backstage/cli/config/eslint')],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
optionalDependencies: true,
peerDependencies: true,
bundledDependencies: true,
},
],
},
};
+9
View File
@@ -0,0 +1,9 @@
# @internal/plugin-todo-list
## 1.0.1-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.9.4-next.0
- @backstage/core-plugin-api@1.0.2-next.0
+3
View File
@@ -0,0 +1,3 @@
# todo-list
This package provides a starting point to demonstrate how plugin authors can use the Backstage permission framework. Refer to the [documentation](https://backstage.io/docs/permission/plugin-authors/01-setup) to get started.
+23
View File
@@ -0,0 +1,23 @@
## API Report File for "@internal/plugin-todo-list"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="react" />
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { RouteRef } from '@backstage/core-plugin-api';
// @public
export const TodoListPage: () => JSX.Element;
// @public
export const todoListPlugin: BackstagePlugin<
{
root: RouteRef<undefined>;
},
{}
>;
// (No @packageDocumentation comment for this package)
```

Some files were not shown because too many files have changed in this diff Show More