@backstage/plugin-events-backend-module-github 0.2.18 → 0.3.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @backstage/plugin-events-backend-module-github
2
2
 
3
+ ## 0.3.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/backend-plugin-api@1.3.1-next.0
9
+ - @backstage/plugin-events-node@0.4.11-next.0
10
+ - @backstage/config@1.3.2
11
+
12
+ ## 0.3.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 317ceb7: **BREAKING ALPHA**: Modules from `events-backend-module-github` and `events-backend-module-gitlab` are now exported as `default` instead of being a named export. In addition, they have been moved from `aplha` to `public`.
17
+
18
+ ### Patch Changes
19
+
20
+ - 735fe12: Don't hard fail for not configuring `webhookSecret` for the GitHub and GitLab events backend. Instead, we don't add the ingress.
21
+ - Updated dependencies
22
+ - @backstage/backend-plugin-api@1.3.0
23
+ - @backstage/config@1.3.2
24
+ - @backstage/plugin-events-node@0.4.10
25
+
3
26
  ## 0.2.18
4
27
 
5
28
  ### Patch Changes
package/config.d.ts CHANGED
@@ -27,6 +27,8 @@ export interface Config {
27
27
  * See https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks
28
28
  * for more details.
29
29
  *
30
+ * Webhook listener will only be enabled if this is set.
31
+ *
30
32
  * @visibility secret
31
33
  */
32
34
  webhookSecret?: string;
@@ -3,7 +3,12 @@
3
3
  var webhooksMethods = require('@octokit/webhooks-methods');
4
4
 
5
5
  function createGithubSignatureValidator(config) {
6
- const secret = config.getString("events.modules.github.webhookSecret");
6
+ const secret = config.getOptionalString(
7
+ "events.modules.github.webhookSecret"
8
+ );
9
+ if (!secret) {
10
+ return void 0;
11
+ }
7
12
  return async (request, context) => {
8
13
  const signature = request.headers["x-hub-signature-256"];
9
14
  if (!signature || !await webhooksMethods.verify(
@@ -1 +1 @@
1
- {"version":3,"file":"createGithubSignatureValidator.cjs.js","sources":["../../src/http/createGithubSignatureValidator.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport {\n RequestDetails,\n RequestValidationContext,\n RequestValidator,\n} from '@backstage/plugin-events-node';\nimport { verify } from '@octokit/webhooks-methods';\n\n/**\n * Validates that the request received is the expected GitHub request\n * using the signature received with the `x-hub-signature-256` header\n * which is based on a secret token configured at GitHub and here.\n *\n * See https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks\n * for more details.\n *\n * @param config - root config\n * @public\n */\nexport function createGithubSignatureValidator(\n config: Config,\n): RequestValidator {\n const secret = config.getString('events.modules.github.webhookSecret');\n\n return async (\n request: RequestDetails,\n context: RequestValidationContext,\n ): Promise<void> => {\n const signature = request.headers['x-hub-signature-256'] as\n | string\n | undefined;\n\n if (\n !signature ||\n !(await verify(\n secret,\n request.raw.body.toString(request.raw.encoding),\n signature,\n ))\n ) {\n context.reject({\n status: 403,\n payload: { message: 'invalid signature' },\n });\n }\n };\n}\n"],"names":["verify"],"mappings":";;;;AAmCO,SAAS,+BACd,MACkB,EAAA;AAClB,EAAM,MAAA,MAAA,GAAS,MAAO,CAAA,SAAA,CAAU,qCAAqC,CAAA;AAErE,EAAO,OAAA,OACL,SACA,OACkB,KAAA;AAClB,IAAM,MAAA,SAAA,GAAY,OAAQ,CAAA,OAAA,CAAQ,qBAAqB,CAAA;AAIvD,IACE,IAAA,CAAC,SACD,IAAA,CAAE,MAAMA,sBAAA;AAAA,MACN,MAAA;AAAA,MACA,QAAQ,GAAI,CAAA,IAAA,CAAK,QAAS,CAAA,OAAA,CAAQ,IAAI,QAAQ,CAAA;AAAA,MAC9C;AAAA,KAEF,EAAA;AACA,MAAA,OAAA,CAAQ,MAAO,CAAA;AAAA,QACb,MAAQ,EAAA,GAAA;AAAA,QACR,OAAA,EAAS,EAAE,OAAA,EAAS,mBAAoB;AAAA,OACzC,CAAA;AAAA;AACH,GACF;AACF;;;;"}
1
+ {"version":3,"file":"createGithubSignatureValidator.cjs.js","sources":["../../src/http/createGithubSignatureValidator.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport {\n RequestDetails,\n RequestValidationContext,\n RequestValidator,\n} from '@backstage/plugin-events-node';\nimport { verify } from '@octokit/webhooks-methods';\n\n/**\n * Validates that the request received is the expected GitHub request\n * using the signature received with the `x-hub-signature-256` header\n * which is based on a secret token configured at GitHub and here.\n *\n * See https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks\n * for more details.\n *\n * @param config - root config\n * @public\n */\nexport function createGithubSignatureValidator(\n config: Config,\n): RequestValidator | undefined {\n const secret = config.getOptionalString(\n 'events.modules.github.webhookSecret',\n );\n if (!secret) {\n return undefined;\n }\n\n return async (\n request: RequestDetails,\n context: RequestValidationContext,\n ): Promise<void> => {\n const signature = request.headers['x-hub-signature-256'] as\n | string\n | undefined;\n\n if (\n !signature ||\n !(await verify(\n secret,\n request.raw.body.toString(request.raw.encoding),\n signature,\n ))\n ) {\n context.reject({\n status: 403,\n payload: { message: 'invalid signature' },\n });\n }\n };\n}\n"],"names":["verify"],"mappings":";;;;AAmCO,SAAS,+BACd,MAC8B,EAAA;AAC9B,EAAA,MAAM,SAAS,MAAO,CAAA,iBAAA;AAAA,IACpB;AAAA,GACF;AACA,EAAA,IAAI,CAAC,MAAQ,EAAA;AACX,IAAO,OAAA,KAAA,CAAA;AAAA;AAGT,EAAO,OAAA,OACL,SACA,OACkB,KAAA;AAClB,IAAM,MAAA,SAAA,GAAY,OAAQ,CAAA,OAAA,CAAQ,qBAAqB,CAAA;AAIvD,IACE,IAAA,CAAC,SACD,IAAA,CAAE,MAAMA,sBAAA;AAAA,MACN,MAAA;AAAA,MACA,QAAQ,GAAI,CAAA,IAAA,CAAK,QAAS,CAAA,OAAA,CAAQ,IAAI,QAAQ,CAAA;AAAA,MAC9C;AAAA,KAEF,EAAA;AACA,MAAA,OAAA,CAAQ,MAAO,CAAA;AAAA,QACb,MAAQ,EAAA,GAAA;AAAA,QACR,OAAA,EAAS,EAAE,OAAA,EAAS,mBAAoB;AAAA,OACzC,CAAA;AAAA;AACH,GACF;AACF;;;;"}
package/dist/index.cjs.js CHANGED
@@ -1,10 +1,21 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var backendPluginApi = require('@backstage/backend-plugin-api');
3
6
  var createGithubSignatureValidator = require('./http/createGithubSignatureValidator.cjs.js');
4
7
  var GithubEventRouter = require('./router/GithubEventRouter.cjs.js');
5
8
 
6
-
9
+ var index = backendPluginApi.createBackendFeatureLoader({
10
+ loader() {
11
+ return [
12
+ import('./service/eventsModuleGithubEventRouter.cjs.js'),
13
+ import('./service/eventsModuleGithubWebhook.cjs.js')
14
+ ];
15
+ }
16
+ });
7
17
 
8
18
  exports.createGithubSignatureValidator = createGithubSignatureValidator.createGithubSignatureValidator;
9
19
  exports.GithubEventRouter = GithubEventRouter.GithubEventRouter;
20
+ exports.default = index;
10
21
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The module `github` for the Backstage backend plugin \"events-backend\"\n * adding an event router and signature validator for GitHub.\n *\n * @packageDocumentation\n */\nimport { createBackendFeatureLoader } from '@backstage/backend-plugin-api';\n\nexport default createBackendFeatureLoader({\n loader() {\n return [\n import('./service/eventsModuleGithubEventRouter'),\n import('./service/eventsModuleGithubWebhook'),\n ];\n },\n});\n\nexport { createGithubSignatureValidator } from './http/createGithubSignatureValidator';\nexport { GithubEventRouter } from './router/GithubEventRouter';\n"],"names":["createBackendFeatureLoader"],"mappings":";;;;;;;;AAwBA,YAAeA,2CAA2B,CAAA;AAAA,EACxC,MAAS,GAAA;AACP,IAAO,OAAA;AAAA,MACL,OAAO,gDAAyC,CAAA;AAAA,MAChD,OAAO,4CAAqC;AAAA,KAC9C;AAAA;AAEJ,CAAC,CAAA;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
1
2
  import { Config } from '@backstage/config';
2
3
  import { RequestValidator, SubTopicEventRouter, EventsService, EventParams } from '@backstage/plugin-events-node';
3
4
 
@@ -12,7 +13,7 @@ import { RequestValidator, SubTopicEventRouter, EventsService, EventParams } fro
12
13
  * @param config - root config
13
14
  * @public
14
15
  */
15
- declare function createGithubSignatureValidator(config: Config): RequestValidator;
16
+ declare function createGithubSignatureValidator(config: Config): RequestValidator | undefined;
16
17
 
17
18
  /**
18
19
  * Subscribes to the generic `github` topic
@@ -29,4 +30,6 @@ declare class GithubEventRouter extends SubTopicEventRouter {
29
30
  protected determineSubTopic(params: EventParams): string | undefined;
30
31
  }
31
32
 
32
- export { GithubEventRouter, createGithubSignatureValidator };
33
+ declare const _default: _backstage_backend_plugin_api.BackendFeature;
34
+
35
+ export { GithubEventRouter, createGithubSignatureValidator, _default as default };
@@ -1,10 +1,12 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var backendPluginApi = require('@backstage/backend-plugin-api');
4
6
  var pluginEventsNode = require('@backstage/plugin-events-node');
5
7
  var GithubEventRouter = require('../router/GithubEventRouter.cjs.js');
6
8
 
7
- const eventsModuleGithubEventRouter = backendPluginApi.createBackendModule({
9
+ var eventsModuleGithubEventRouter = backendPluginApi.createBackendModule({
8
10
  pluginId: "events",
9
11
  moduleId: "github-event-router",
10
12
  register(env) {
@@ -20,5 +22,5 @@ const eventsModuleGithubEventRouter = backendPluginApi.createBackendModule({
20
22
  }
21
23
  });
22
24
 
23
- exports.eventsModuleGithubEventRouter = eventsModuleGithubEventRouter;
25
+ exports.default = eventsModuleGithubEventRouter;
24
26
  //# sourceMappingURL=eventsModuleGithubEventRouter.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventsModuleGithubEventRouter.cjs.js","sources":["../../src/service/eventsModuleGithubEventRouter.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport { eventsServiceRef } from '@backstage/plugin-events-node';\nimport { GithubEventRouter } from '../router/GithubEventRouter';\n\n/**\n * Module for the events-backend plugin, adding an event router for GitHub.\n *\n * Registers the `GithubEventRouter`.\n *\n * @alpha\n */\nexport const eventsModuleGithubEventRouter = createBackendModule({\n pluginId: 'events',\n moduleId: 'github-event-router',\n register(env) {\n env.registerInit({\n deps: {\n events: eventsServiceRef,\n },\n async init({ events }) {\n const eventRouter = new GithubEventRouter({ events });\n await eventRouter.subscribe();\n },\n });\n },\n});\n"],"names":["createBackendModule","eventsServiceRef","GithubEventRouter"],"mappings":";;;;;;AA2BO,MAAM,gCAAgCA,oCAAoB,CAAA;AAAA,EAC/D,QAAU,EAAA,QAAA;AAAA,EACV,QAAU,EAAA,qBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,MAAQ,EAAAC;AAAA,OACV;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAU,EAAA;AACrB,QAAA,MAAM,WAAc,GAAA,IAAIC,mCAAkB,CAAA,EAAE,QAAQ,CAAA;AACpD,QAAA,MAAM,YAAY,SAAU,EAAA;AAAA;AAC9B,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"eventsModuleGithubEventRouter.cjs.js","sources":["../../src/service/eventsModuleGithubEventRouter.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport { eventsServiceRef } from '@backstage/plugin-events-node';\nimport { GithubEventRouter } from '../router/GithubEventRouter';\n\n/**\n * Module for the events-backend plugin, adding an event router for GitHub.\n *\n * Registers the `GithubEventRouter`.\n *\n * @public\n */\nexport default createBackendModule({\n pluginId: 'events',\n moduleId: 'github-event-router',\n register(env) {\n env.registerInit({\n deps: {\n events: eventsServiceRef,\n },\n async init({ events }) {\n const eventRouter = new GithubEventRouter({ events });\n await eventRouter.subscribe();\n },\n });\n },\n});\n"],"names":["createBackendModule","eventsServiceRef","GithubEventRouter"],"mappings":";;;;;;;;AA2BA,oCAAeA,oCAAoB,CAAA;AAAA,EACjC,QAAU,EAAA,QAAA;AAAA,EACV,QAAU,EAAA,qBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,MAAQ,EAAAC;AAAA,OACV;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAU,EAAA;AACrB,QAAA,MAAM,WAAc,GAAA,IAAIC,mCAAkB,CAAA,EAAE,QAAQ,CAAA;AACpD,QAAA,MAAM,YAAY,SAAU,EAAA;AAAA;AAC9B,KACD,CAAA;AAAA;AAEL,CAAC,CAAA;;;;"}
@@ -1,10 +1,12 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var backendPluginApi = require('@backstage/backend-plugin-api');
4
6
  var alpha = require('@backstage/plugin-events-node/alpha');
5
7
  var createGithubSignatureValidator = require('../http/createGithubSignatureValidator.cjs.js');
6
8
 
7
- const eventsModuleGithubWebhook = backendPluginApi.createBackendModule({
9
+ var eventsModuleGithubWebhook = backendPluginApi.createBackendModule({
8
10
  pluginId: "events",
9
11
  moduleId: "github-webhook",
10
12
  register(env) {
@@ -14,14 +16,17 @@ const eventsModuleGithubWebhook = backendPluginApi.createBackendModule({
14
16
  events: alpha.eventsExtensionPoint
15
17
  },
16
18
  async init({ config, events }) {
17
- events.addHttpPostIngress({
18
- topic: "github",
19
- validator: createGithubSignatureValidator.createGithubSignatureValidator(config)
20
- });
19
+ const validator = createGithubSignatureValidator.createGithubSignatureValidator(config);
20
+ if (validator) {
21
+ events.addHttpPostIngress({
22
+ topic: "github",
23
+ validator
24
+ });
25
+ }
21
26
  }
22
27
  });
23
28
  }
24
29
  });
25
30
 
26
- exports.eventsModuleGithubWebhook = eventsModuleGithubWebhook;
31
+ exports.default = eventsModuleGithubWebhook;
27
32
  //# sourceMappingURL=eventsModuleGithubWebhook.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventsModuleGithubWebhook.cjs.js","sources":["../../src/service/eventsModuleGithubWebhook.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { eventsExtensionPoint } from '@backstage/plugin-events-node/alpha';\nimport { createGithubSignatureValidator } from '../http/createGithubSignatureValidator';\n\n/**\n * Module for the events-backend plugin,\n * registering an HTTP POST ingress with request validator\n * which verifies the webhook signature based on a secret.\n *\n * @alpha\n */\nexport const eventsModuleGithubWebhook = createBackendModule({\n pluginId: 'events',\n moduleId: 'github-webhook',\n register(env) {\n env.registerInit({\n deps: {\n config: coreServices.rootConfig,\n events: eventsExtensionPoint,\n },\n async init({ config, events }) {\n events.addHttpPostIngress({\n topic: 'github',\n validator: createGithubSignatureValidator(config),\n });\n },\n });\n },\n});\n"],"names":["createBackendModule","coreServices","eventsExtensionPoint","createGithubSignatureValidator"],"mappings":";;;;;;AA8BO,MAAM,4BAA4BA,oCAAoB,CAAA;AAAA,EAC3D,QAAU,EAAA,QAAA;AAAA,EACV,QAAU,EAAA,gBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,QAAQC,6BAAa,CAAA,UAAA;AAAA,QACrB,MAAQ,EAAAC;AAAA,OACV;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAQ,QAAU,EAAA;AAC7B,QAAA,MAAA,CAAO,kBAAmB,CAAA;AAAA,UACxB,KAAO,EAAA,QAAA;AAAA,UACP,SAAA,EAAWC,8DAA+B,MAAM;AAAA,SACjD,CAAA;AAAA;AACH,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"eventsModuleGithubWebhook.cjs.js","sources":["../../src/service/eventsModuleGithubWebhook.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { eventsExtensionPoint } from '@backstage/plugin-events-node/alpha';\nimport { createGithubSignatureValidator } from '../http/createGithubSignatureValidator';\n\n/**\n * Module for the events-backend plugin,\n * registering an HTTP POST ingress with request validator\n * which verifies the webhook signature based on a secret.\n *\n * @public\n */\nexport default createBackendModule({\n pluginId: 'events',\n moduleId: 'github-webhook',\n register(env) {\n env.registerInit({\n deps: {\n config: coreServices.rootConfig,\n events: eventsExtensionPoint,\n },\n async init({ config, events }) {\n const validator = createGithubSignatureValidator(config);\n if (validator) {\n events.addHttpPostIngress({\n topic: 'github',\n validator,\n });\n }\n },\n });\n },\n});\n"],"names":["createBackendModule","coreServices","eventsExtensionPoint","createGithubSignatureValidator"],"mappings":";;;;;;;;AA8BA,gCAAeA,oCAAoB,CAAA;AAAA,EACjC,QAAU,EAAA,QAAA;AAAA,EACV,QAAU,EAAA,gBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,QAAQC,6BAAa,CAAA,UAAA;AAAA,QACrB,MAAQ,EAAAC;AAAA,OACV;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAQ,QAAU,EAAA;AAC7B,QAAM,MAAA,SAAA,GAAYC,8DAA+B,MAAM,CAAA;AACvD,QAAA,IAAI,SAAW,EAAA;AACb,UAAA,MAAA,CAAO,kBAAmB,CAAA;AAAA,YACxB,KAAO,EAAA,QAAA;AAAA,YACP;AAAA,WACD,CAAA;AAAA;AACH;AACF,KACD,CAAA;AAAA;AAEL,CAAC,CAAA;;;;"}
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@backstage/plugin-events-backend-module-github",
3
- "version": "0.2.18",
3
+ "version": "0.3.1-next.0",
4
4
  "backstage": {
5
5
  "role": "backend-plugin-module",
6
6
  "pluginId": "events",
7
- "pluginPackage": "@backstage/plugin-events-backend"
7
+ "pluginPackage": "@backstage/plugin-events-backend",
8
+ "features": {
9
+ ".": "@backstage/BackendFeature"
10
+ }
8
11
  },
9
12
  "publishConfig": {
10
13
  "access": "public"
@@ -18,26 +21,19 @@
18
21
  "license": "Apache-2.0",
19
22
  "exports": {
20
23
  ".": {
24
+ "backstage": "@backstage/BackendFeature",
21
25
  "require": "./dist/index.cjs.js",
22
26
  "types": "./dist/index.d.ts",
23
27
  "default": "./dist/index.cjs.js"
24
28
  },
25
- "./alpha": {
26
- "require": "./dist/alpha.cjs.js",
27
- "types": "./dist/alpha.d.ts",
28
- "default": "./dist/alpha.cjs.js"
29
- },
30
29
  "./package.json": "./package.json"
31
30
  },
32
31
  "main": "./dist/index.cjs.js",
33
32
  "types": "./dist/index.d.ts",
34
33
  "typesVersions": {
35
34
  "*": {
36
- "*": [
37
- "dist/index.d.ts"
38
- ],
39
- "alpha": [
40
- "dist/alpha.d.ts"
35
+ "package.json": [
36
+ "package.json"
41
37
  ]
42
38
  }
43
39
  },
@@ -55,15 +51,15 @@
55
51
  "test": "backstage-cli package test"
56
52
  },
57
53
  "dependencies": {
58
- "@backstage/backend-plugin-api": "^1.2.1",
59
- "@backstage/config": "^1.3.2",
60
- "@backstage/plugin-events-node": "^0.4.9",
54
+ "@backstage/backend-plugin-api": "1.3.1-next.0",
55
+ "@backstage/config": "1.3.2",
56
+ "@backstage/plugin-events-node": "0.4.11-next.0",
61
57
  "@octokit/webhooks-methods": "^3.0.0"
62
58
  },
63
59
  "devDependencies": {
64
- "@backstage/backend-test-utils": "^1.3.1",
65
- "@backstage/cli": "^0.31.0",
66
- "@backstage/plugin-events-backend-test-utils": "^0.1.42"
60
+ "@backstage/backend-test-utils": "1.5.0-next.0",
61
+ "@backstage/cli": "0.32.1-next.0",
62
+ "@backstage/plugin-events-backend-test-utils": "0.1.44-next.0"
67
63
  },
68
64
  "configSchema": "config.d.ts"
69
65
  }
package/dist/alpha.cjs.js DELETED
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- var eventsModuleGithubEventRouter = require('./service/eventsModuleGithubEventRouter.cjs.js');
4
- var eventsModuleGithubWebhook = require('./service/eventsModuleGithubWebhook.cjs.js');
5
-
6
-
7
-
8
- exports.eventsModuleGithubEventRouter = eventsModuleGithubEventRouter.eventsModuleGithubEventRouter;
9
- exports.eventsModuleGithubWebhook = eventsModuleGithubWebhook.eventsModuleGithubWebhook;
10
- //# sourceMappingURL=alpha.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alpha.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
package/dist/alpha.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
-
3
- /**
4
- * Module for the events-backend plugin, adding an event router for GitHub.
5
- *
6
- * Registers the `GithubEventRouter`.
7
- *
8
- * @alpha
9
- */
10
- declare const eventsModuleGithubEventRouter: _backstage_backend_plugin_api.BackendFeature;
11
-
12
- /**
13
- * Module for the events-backend plugin,
14
- * registering an HTTP POST ingress with request validator
15
- * which verifies the webhook signature based on a secret.
16
- *
17
- * @alpha
18
- */
19
- declare const eventsModuleGithubWebhook: _backstage_backend_plugin_api.BackendFeature;
20
-
21
- export { eventsModuleGithubEventRouter, eventsModuleGithubWebhook };