diff --git a/plugins/badges-backend/README.md b/plugins/badges-backend/README.md index 4a5eb8f07e..71ff029f9c 100644 --- a/plugins/badges-backend/README.md +++ b/plugins/badges-backend/README.md @@ -127,7 +127,7 @@ app: obfuscate: true ``` -:warning: **Warning**: The only endpoint to be publicly available is the `/entity/:entityUuid/:badgeId` endpoint. The other endpoints are meant to be called from the frontend plugin. +:warning: **Warning**: The only endpoint to be publicly available is the `/entity/:entityUuid/:badgeId` endpoint. The other endpoints are meant for trusted internal users and should not be publicly exposed. > Note that you cannot use env vars to set the `obfuscate` value. It must be a boolean value and env vars are always strings. diff --git a/plugins/badges-backend/migrations/20230404_init.js b/plugins/badges-backend/migrations/20230404_init.js index f44b211038..3de6bfc248 100644 --- a/plugins/badges-backend/migrations/20230404_init.js +++ b/plugins/badges-backend/migrations/20230404_init.js @@ -26,5 +26,8 @@ exports.up = async function up(knex) { }; exports.down = async function down(knex) { + await knex.schema.alterTable('badges', table => { + table.dropIndex('', 'badges_uuid_index'); + }); await knex.schema.dropTable('badges'); }; diff --git a/plugins/badges-backend/src/tests/router-obfuscated.test.ts b/plugins/badges-backend/src/service/router-obfuscated.test.ts similarity index 99% rename from plugins/badges-backend/src/tests/router-obfuscated.test.ts rename to plugins/badges-backend/src/service/router-obfuscated.test.ts index 1253e59157..d5f18ab470 100644 --- a/plugins/badges-backend/src/tests/router-obfuscated.test.ts +++ b/plugins/badges-backend/src/service/router-obfuscated.test.ts @@ -25,7 +25,7 @@ import { import { CatalogApi } from '@backstage/catalog-client'; import type { Entity } from '@backstage/catalog-model'; import { Config, ConfigReader } from '@backstage/config'; -import { createRouter } from '../service/router'; +import { createRouter } from './router'; import { BadgeBuilder } from '../lib'; import { BackstageIdentityResponse, diff --git a/plugins/badges-backend/src/tests/router.test.ts b/plugins/badges-backend/src/service/router.test.ts similarity index 99% rename from plugins/badges-backend/src/tests/router.test.ts rename to plugins/badges-backend/src/service/router.test.ts index a44281e9fa..962d01e4d8 100644 --- a/plugins/badges-backend/src/tests/router.test.ts +++ b/plugins/badges-backend/src/service/router.test.ts @@ -25,7 +25,7 @@ import { import { CatalogApi } from '@backstage/catalog-client'; import type { Entity } from '@backstage/catalog-model'; import { Config, ConfigReader } from '@backstage/config'; -import { createRouter } from '../service/router'; +import { createRouter } from './router'; import { BadgeBuilder } from '../lib'; import { BackstageIdentityResponse, diff --git a/plugins/badges/README.md b/plugins/badges/README.md index a33ddec063..4b8ff38d47 100644 --- a/plugins/badges/README.md +++ b/plugins/badges/README.md @@ -34,7 +34,9 @@ Please note that if you have already set badges in your repositories and you act Please note that the backend part needs to be configured to support obfuscation. See the [backend plugin documentation](../badges-backend/README.md) for more details. -Also, you need to allow your frontend to access the configuration : +Also, you need to allow your frontend to access the configuration see : + +Example implementation would be in : `packages/app/src/config.d.ts` ```typescript export interface Config { @@ -51,6 +53,16 @@ export interface Config { } ``` +then include in the `packages/app/package.json` : + +```json +"files": [ + "dist", + "config.d.ts" + ], +"configSchema": "config.d.ts", +``` + ## Sample Badges Here are some samples of badges for the `artists-lookup` service in the Demo Backstage site: