|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 | import { createBackend } from '@backstage/backend-defaults'; |
17 | | -import { mockServices } from '@backstage/backend-test-utils'; |
18 | | -import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; |
19 | | - |
20 | | -// TEMPLATE NOTE: |
21 | | -// This is the development setup for your plugin that wires up a |
22 | | -// minimal backend that can use both real and mocked plugins and services. |
23 | | -// |
24 | | -// Start up the backend by running `yarn start` in the package directory. |
25 | | -// Once it's up and running, try out the following requests: |
26 | | -// |
27 | | -// Create a new todo item, standalone or for the sample component: |
28 | | -// |
29 | | -// curl http://localhost:7007/api/x2a/todos -H 'Content-Type: application/json' -d '{"title": "My Todo"}' |
30 | | -// curl http://localhost:7007/api/x2a/todos -H 'Content-Type: application/json' -d '{"title": "My Todo", "entityRef": "component:default/sample"}' |
31 | | -// |
32 | | -// List TODOs: |
33 | | -// |
34 | | -// curl http://localhost:7007/api/x2a/todos |
35 | | -// |
36 | | -// Explicitly make an unauthenticated request, or with service auth: |
37 | | -// |
38 | | -// curl http://localhost:7007/api/x2a/todos -H 'Authorization: Bearer mock-none-token' |
39 | | -// curl http://localhost:7007/api/x2a/todos -H 'Authorization: Bearer mock-service-token' |
| 17 | +// import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; |
40 | 18 |
|
41 | 19 | const backend = createBackend(); |
42 | 20 |
|
| 21 | +// TODO: Needs more work, failing: |
| 22 | +// - The @backstage/plugin-permission-backend in PluginPermissionMetadataCollector.permissionFactory() calls FetchUrlReader constructor with no params which is not supported (options are mandatory). Causing access to undefined. |
| 23 | +// backend.add(import('@backstage/plugin-permission-backend')); |
| 24 | +// backend.add(import('@backstage-community/plugin-rbac-backend')) |
| 25 | + |
43 | 26 | // TEMPLATE NOTE: |
44 | 27 | // Mocking the auth and httpAuth service allows you to call your plugin API without |
45 | 28 | // having to authenticate. |
46 | 29 | // |
47 | 30 | // If you want to use real auth, you can install the following instead: |
48 | | -// backend.add(import('@backstage/plugin-auth-backend')); |
49 | | -// backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); |
50 | | -backend.add(mockServices.auth.factory()); |
51 | | -backend.add(mockServices.httpAuth.factory()); |
| 31 | +backend.add(import('@backstage/plugin-auth-backend')); |
| 32 | +backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); |
| 33 | +backend.add(import('@backstage/plugin-auth-backend-module-github-provider')); |
| 34 | +// backend.add(mockServices.auth.factory()); |
| 35 | +// backend.add(mockServices.httpAuth.factory()); |
52 | 36 |
|
53 | | -// TEMPLATE NOTE: |
54 | | -// Rather than using a real catalog you can use a mock with a fixed set of entities. |
55 | | -backend.add( |
56 | | - catalogServiceMock.factory({ |
57 | | - entities: [ |
58 | | - { |
59 | | - apiVersion: 'backstage.io/v1alpha1', |
60 | | - kind: 'Component', |
61 | | - metadata: { |
62 | | - name: 'sample', |
63 | | - title: 'Sample Component', |
64 | | - }, |
65 | | - spec: { |
66 | | - type: 'service', |
67 | | - }, |
68 | | - }, |
69 | | - ], |
70 | | - }), |
71 | | -); |
| 37 | +backend.add(import('@backstage/plugin-catalog-backend')); |
72 | 38 |
|
73 | 39 | backend.add(import('../src')); |
74 | 40 |
|
|
0 commit comments