@backstage/plugin-events-backend-module-azure 0.2.33-next.0 → 0.2.33-next.1

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,11 @@
1
1
  # @backstage/plugin-events-backend-module-azure
2
2
 
3
+ ## 0.2.33-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 9d23b9e: Added HTTP POST webhook ingress endpoint for Azure DevOps events, matching the pattern established by the GitHub events module. The ingress endpoint is only registered when `events.modules.azureDevOps.webhookSecret` is configured; without it, no route is exposed. Incoming requests are validated against the `x-ado-webhook-secret` custom header using timing-safe comparison.
8
+
3
9
  ## 0.2.33-next.0
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "events": {
6
+ "type": "object",
7
+ "properties": {
8
+ "modules": {
9
+ "type": "object",
10
+ "properties": {
11
+ "azureDevOps": {
12
+ "type": "object",
13
+ "properties": {
14
+ "webhookSecret": {
15
+ "type": "string",
16
+ "description": "Shared secret for validating incoming Azure DevOps webhook requests. Configure the same value as the `x-ado-webhook-secret` HTTP header in your Azure DevOps service hook subscription. Requests without a matching secret are rejected with 403.",
17
+ "visibility": "secret"
18
+ }
19
+ },
20
+ "description": "events-backend-module-azure plugin configuration."
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
package/dist/alpha.cjs.js CHANGED
@@ -2,11 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var eventsModuleAzureDevOpsEventRouter$1 = require('./service/eventsModuleAzureDevOpsEventRouter.cjs.js');
5
+ var backendPluginApi = require('@backstage/backend-plugin-api');
6
+ var eventsModuleAzureDevOpsEventRouter = require('./service/eventsModuleAzureDevOpsEventRouter.cjs.js');
6
7
 
7
- const _feature = eventsModuleAzureDevOpsEventRouter$1.eventsModuleAzureDevOpsEventRouter;
8
- const eventsModuleAzureDevOpsEventRouter = _feature;
8
+ const _feature = backendPluginApi.createBackendFeatureLoader({
9
+ loader() {
10
+ return [
11
+ import('./service/eventsModuleAzureDevOpsEventRouter.cjs.js'),
12
+ import('./service/eventsModuleAzureDevOpsWebhook.cjs.js')
13
+ ];
14
+ }
15
+ });
9
16
 
17
+ exports.eventsModuleAzureDevOpsEventRouter = eventsModuleAzureDevOpsEventRouter.default;
10
18
  exports.default = _feature;
11
- exports.eventsModuleAzureDevOpsEventRouter = eventsModuleAzureDevOpsEventRouter;
12
19
  //# sourceMappingURL=alpha.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { eventsModuleAzureDevOpsEventRouter as feature } from './service/eventsModuleAzureDevOpsEventRouter';\n\n/** @alpha */\nconst _feature = feature;\nexport default _feature;\n/** @alpha */\nexport const eventsModuleAzureDevOpsEventRouter = _feature;\n"],"names":["feature"],"mappings":";;;;;;AAmBA,MAAM,QAAA,GAAWA;AAGV,MAAM,kCAAA,GAAqC;;;;;"}
1
+ {"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { createBackendFeatureLoader } from '@backstage/backend-plugin-api';\nimport eventsModuleAzureDevOpsEventRouter from './service/eventsModuleAzureDevOpsEventRouter';\n\n/** @alpha */\nconst _feature = createBackendFeatureLoader({\n loader() {\n return [\n import('./service/eventsModuleAzureDevOpsEventRouter'),\n import('./service/eventsModuleAzureDevOpsWebhook'),\n ];\n },\n});\nexport default _feature;\n\n/** @alpha */\nexport { eventsModuleAzureDevOpsEventRouter };\n"],"names":["createBackendFeatureLoader"],"mappings":";;;;;;;AAoBA,MAAM,WAAWA,2CAAA,CAA2B;AAAA,EAC1C,MAAA,GAAS;AACP,IAAA,OAAO;AAAA,MACL,OAAO,qDAA8C,CAAA;AAAA,MACrD,OAAO,iDAA0C;AAAA,KACnD;AAAA,EACF;AACF,CAAC;;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,9 +1,15 @@
1
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
2
 
3
- /** @alpha */
4
- declare const _feature: _backstage_backend_plugin_api.BackendFeature;
3
+ /**
4
+ * Module for the events-backend plugin, adding an event router for Azure DevOps.
5
+ *
6
+ * Registers the `AzureDevOpsEventRouter`.
7
+ *
8
+ * @public
9
+ */
10
+ declare const _default: _backstage_backend_plugin_api.BackendFeature;
5
11
 
6
12
  /** @alpha */
7
- declare const eventsModuleAzureDevOpsEventRouter: _backstage_backend_plugin_api.BackendFeature;
13
+ declare const _feature: _backstage_backend_plugin_api.BackendFeature;
8
14
 
9
- export { _feature as default, eventsModuleAzureDevOpsEventRouter };
15
+ export { _feature as default, _default as eventsModuleAzureDevOpsEventRouter };
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var crypto = require('crypto');
4
+
5
+ function createAzureDevOpsWebhookValidator(config) {
6
+ const secret = config.getOptionalString(
7
+ "events.modules.azureDevOps.webhookSecret"
8
+ );
9
+ if (!secret) {
10
+ return void 0;
11
+ }
12
+ const secretBuffer = Buffer.from(secret);
13
+ return async (request, context) => {
14
+ const raw = request.headers["x-ado-webhook-secret"];
15
+ const headerSecret = Array.isArray(raw) ? raw[0] : raw;
16
+ const headerBuffer = typeof headerSecret === "string" ? Buffer.from(headerSecret) : void 0;
17
+ if (headerBuffer && headerBuffer.length === secretBuffer.length && crypto.timingSafeEqual(headerBuffer, secretBuffer)) {
18
+ return;
19
+ }
20
+ context.reject({
21
+ status: 403,
22
+ payload: { message: "invalid webhook secret" }
23
+ });
24
+ };
25
+ }
26
+
27
+ exports.createAzureDevOpsWebhookValidator = createAzureDevOpsWebhookValidator;
28
+ //# sourceMappingURL=createAzureDevOpsWebhookValidator.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createAzureDevOpsWebhookValidator.cjs.js","sources":["../../src/http/createAzureDevOpsWebhookValidator.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { timingSafeEqual } from 'crypto';\n\n/**\n * Validates incoming Azure DevOps webhook requests\n * using a shared secret sent via the `x-ado-webhook-secret` header.\n *\n * Configure the same secret in the Azure DevOps service hook\n * subscription (under HTTP Headers) and in the Backstage app-config\n * at `events.modules.azureDevOps.webhookSecret`.\n *\n * @param config - root config\n * @public\n */\nexport function createAzureDevOpsWebhookValidator(\n config: Config,\n): RequestValidator | undefined {\n const secret = config.getOptionalString(\n 'events.modules.azureDevOps.webhookSecret',\n );\n\n if (!secret) {\n return undefined;\n }\n\n const secretBuffer = Buffer.from(secret);\n\n return async (\n request: RequestDetails,\n context: RequestValidationContext,\n ): Promise<void> => {\n const raw = request.headers['x-ado-webhook-secret'];\n const headerSecret = Array.isArray(raw) ? raw[0] : raw;\n\n const headerBuffer =\n typeof headerSecret === 'string' ? Buffer.from(headerSecret) : undefined;\n\n if (\n headerBuffer &&\n headerBuffer.length === secretBuffer.length &&\n timingSafeEqual(headerBuffer, secretBuffer)\n ) {\n return;\n }\n\n context.reject({\n status: 403,\n payload: { message: 'invalid webhook secret' },\n });\n };\n}\n"],"names":["timingSafeEqual"],"mappings":";;;;AAmCO,SAAS,kCACd,MAAA,EAC8B;AAC9B,EAAA,MAAM,SAAS,MAAA,CAAO,iBAAA;AAAA,IACpB;AAAA,GACF;AAEA,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,MAAM,YAAA,GAAe,MAAA,CAAO,IAAA,CAAK,MAAM,CAAA;AAEvC,EAAA,OAAO,OACL,SACA,OAAA,KACkB;AAClB,IAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,OAAA,CAAQ,sBAAsB,CAAA;AAClD,IAAA,MAAM,eAAe,KAAA,CAAM,OAAA,CAAQ,GAAG,CAAA,GAAI,GAAA,CAAI,CAAC,CAAA,GAAI,GAAA;AAEnD,IAAA,MAAM,eACJ,OAAO,YAAA,KAAiB,WAAW,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,GAAI,MAAA;AAEjE,IAAA,IACE,YAAA,IACA,aAAa,MAAA,KAAW,YAAA,CAAa,UACrCA,sBAAA,CAAgB,YAAA,EAAc,YAAY,CAAA,EAC1C;AACA,MAAA;AAAA,IACF;AAEA,IAAA,OAAA,CAAQ,MAAA,CAAO;AAAA,MACb,MAAA,EAAQ,GAAA;AAAA,MACR,OAAA,EAAS,EAAE,OAAA,EAAS,wBAAA;AAAyB,KAC9C,CAAA;AAAA,EACH,CAAA;AACF;;;;"}
package/dist/index.cjs.js CHANGED
@@ -2,11 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var eventsModuleAzureDevOpsEventRouter = require('./service/eventsModuleAzureDevOpsEventRouter.cjs.js');
5
+ var backendPluginApi = require('@backstage/backend-plugin-api');
6
6
  var AzureDevOpsEventRouter = require('./router/AzureDevOpsEventRouter.cjs.js');
7
7
 
8
+ var index = backendPluginApi.createBackendFeatureLoader({
9
+ loader() {
10
+ return [
11
+ import('./service/eventsModuleAzureDevOpsEventRouter.cjs.js'),
12
+ import('./service/eventsModuleAzureDevOpsWebhook.cjs.js')
13
+ ];
14
+ }
15
+ });
8
16
 
9
-
10
- exports.default = eventsModuleAzureDevOpsEventRouter.eventsModuleAzureDevOpsEventRouter;
11
17
  exports.AzureDevOpsEventRouter = AzureDevOpsEventRouter.AzureDevOpsEventRouter;
18
+ exports.default = index;
12
19
  //# 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 \"azure\" for the Backstage backend plugin \"events-backend\"\n * adding an event router and webhook ingress for Azure DevOps.\n *\n * @packageDocumentation\n */\n\nimport { createBackendFeatureLoader } from '@backstage/backend-plugin-api';\n\nexport default createBackendFeatureLoader({\n loader() {\n return [\n import('./service/eventsModuleAzureDevOpsEventRouter'),\n import('./service/eventsModuleAzureDevOpsWebhook'),\n ];\n },\n});\n\nexport { AzureDevOpsEventRouter } from './router/AzureDevOpsEventRouter';\n"],"names":["createBackendFeatureLoader"],"mappings":";;;;;;;AAyBA,YAAeA,2CAAA,CAA2B;AAAA,EACxC,MAAA,GAAS;AACP,IAAA,OAAO;AAAA,MACL,OAAO,qDAA8C,CAAA;AAAA,MACrD,OAAO,iDAA0C;AAAA,KACnD;AAAA,EACF;AACF,CAAC,CAAA;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,6 @@
1
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
2
  import { SubTopicEventRouter, EventsService, EventParams } from '@backstage/plugin-events-node';
3
3
 
4
- /**
5
- * Module for the events-backend plugin, adding an event router for Azure DevOps.
6
- *
7
- * Registers the `AzureDevOpsEventRouter`.
8
- *
9
- * @public
10
- */
11
- declare const eventsModuleAzureDevOpsEventRouter: _backstage_backend_plugin_api.BackendFeature;
12
-
13
4
  /**
14
5
  * Subscribes to the generic `azureDevOps` topic
15
6
  * and publishes the events under the more concrete sub-topic
@@ -25,4 +16,6 @@ declare class AzureDevOpsEventRouter extends SubTopicEventRouter {
25
16
  protected determineSubTopic(params: EventParams): string | undefined;
26
17
  }
27
18
 
28
- export { AzureDevOpsEventRouter, eventsModuleAzureDevOpsEventRouter as default };
19
+ declare const _default: _backstage_backend_plugin_api.BackendFeature;
20
+
21
+ export { AzureDevOpsEventRouter, _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 AzureDevOpsEventRouter = require('../router/AzureDevOpsEventRouter.cjs.js');
6
8
 
7
- const eventsModuleAzureDevOpsEventRouter = backendPluginApi.createBackendModule({
9
+ var eventsModuleAzureDevOpsEventRouter = backendPluginApi.createBackendModule({
8
10
  pluginId: "events",
9
11
  moduleId: "azure-dev-ops-event-router",
10
12
  register(env) {
@@ -22,5 +24,5 @@ const eventsModuleAzureDevOpsEventRouter = backendPluginApi.createBackendModule(
22
24
  }
23
25
  });
24
26
 
25
- exports.eventsModuleAzureDevOpsEventRouter = eventsModuleAzureDevOpsEventRouter;
27
+ exports.default = eventsModuleAzureDevOpsEventRouter;
26
28
  //# sourceMappingURL=eventsModuleAzureDevOpsEventRouter.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventsModuleAzureDevOpsEventRouter.cjs.js","sources":["../../src/service/eventsModuleAzureDevOpsEventRouter.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 { AzureDevOpsEventRouter } from '../router/AzureDevOpsEventRouter';\n\n/**\n * Module for the events-backend plugin, adding an event router for Azure DevOps.\n *\n * Registers the `AzureDevOpsEventRouter`.\n *\n * @public\n */\nexport const eventsModuleAzureDevOpsEventRouter = createBackendModule({\n pluginId: 'events',\n moduleId: 'azure-dev-ops-event-router',\n register(env) {\n env.registerInit({\n deps: {\n events: eventsServiceRef,\n },\n async init({ events }) {\n const eventRouter = new AzureDevOpsEventRouter({\n events,\n });\n await eventRouter.subscribe();\n },\n });\n },\n});\n"],"names":["createBackendModule","eventsServiceRef","AzureDevOpsEventRouter"],"mappings":";;;;;;AA2BO,MAAM,qCAAqCA,oCAAA,CAAoB;AAAA,EACpE,QAAA,EAAU,QAAA;AAAA,EACV,QAAA,EAAU,4BAAA;AAAA,EACV,SAAS,GAAA,EAAK;AACZ,IAAA,GAAA,CAAI,YAAA,CAAa;AAAA,MACf,IAAA,EAAM;AAAA,QACJ,MAAA,EAAQC;AAAA,OACV;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAO,EAAG;AACrB,QAAA,MAAM,WAAA,GAAc,IAAIC,6CAAA,CAAuB;AAAA,UAC7C;AAAA,SACD,CAAA;AACD,QAAA,MAAM,YAAY,SAAA,EAAU;AAAA,MAC9B;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"eventsModuleAzureDevOpsEventRouter.cjs.js","sources":["../../src/service/eventsModuleAzureDevOpsEventRouter.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 { AzureDevOpsEventRouter } from '../router/AzureDevOpsEventRouter';\n\n/**\n * Module for the events-backend plugin, adding an event router for Azure DevOps.\n *\n * Registers the `AzureDevOpsEventRouter`.\n *\n * @public\n */\nexport default createBackendModule({\n pluginId: 'events',\n moduleId: 'azure-dev-ops-event-router',\n register(env) {\n env.registerInit({\n deps: {\n events: eventsServiceRef,\n },\n async init({ events }) {\n const eventRouter = new AzureDevOpsEventRouter({\n events,\n });\n await eventRouter.subscribe();\n },\n });\n },\n});\n"],"names":["createBackendModule","eventsServiceRef","AzureDevOpsEventRouter"],"mappings":";;;;;;;;AA2BA,yCAAeA,oCAAA,CAAoB;AAAA,EACjC,QAAA,EAAU,QAAA;AAAA,EACV,QAAA,EAAU,4BAAA;AAAA,EACV,SAAS,GAAA,EAAK;AACZ,IAAA,GAAA,CAAI,YAAA,CAAa;AAAA,MACf,IAAA,EAAM;AAAA,QACJ,MAAA,EAAQC;AAAA,OACV;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAO,EAAG;AACrB,QAAA,MAAM,WAAA,GAAc,IAAIC,6CAAA,CAAuB;AAAA,UAC7C;AAAA,SACD,CAAA;AACD,QAAA,MAAM,YAAY,SAAA,EAAU;AAAA,MAC9B;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC,CAAA;;;;"}
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var backendPluginApi = require('@backstage/backend-plugin-api');
6
+ var alpha = require('@backstage/plugin-events-node/alpha');
7
+ var createAzureDevOpsWebhookValidator = require('../http/createAzureDevOpsWebhookValidator.cjs.js');
8
+
9
+ var eventsModuleAzureDevOpsWebhook = backendPluginApi.createBackendModule({
10
+ pluginId: "events",
11
+ moduleId: "azure-dev-ops-webhook",
12
+ register(env) {
13
+ env.registerInit({
14
+ deps: {
15
+ config: backendPluginApi.coreServices.rootConfig,
16
+ events: alpha.eventsExtensionPoint
17
+ },
18
+ async init({ config, events }) {
19
+ const validator = createAzureDevOpsWebhookValidator.createAzureDevOpsWebhookValidator(config);
20
+ if (validator) {
21
+ events.addHttpPostIngress({
22
+ topic: "azureDevOps",
23
+ validator
24
+ });
25
+ }
26
+ }
27
+ });
28
+ }
29
+ });
30
+
31
+ exports.default = eventsModuleAzureDevOpsWebhook;
32
+ //# sourceMappingURL=eventsModuleAzureDevOpsWebhook.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventsModuleAzureDevOpsWebhook.cjs.js","sources":["../../src/service/eventsModuleAzureDevOpsWebhook.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { createAzureDevOpsWebhookValidator } from '../http/createAzureDevOpsWebhookValidator';\n\n/**\n * Module for the events-backend plugin,\n * registering an HTTP POST ingress for Azure DevOps webhook events.\n *\n * The ingress is only registered when\n * `events.modules.azureDevOps.webhookSecret` is configured.\n * Incoming requests are validated against the `x-ado-webhook-secret`\n * custom header using timing-safe comparison.\n *\n * @public\n */\nexport default createBackendModule({\n pluginId: 'events',\n moduleId: 'azure-dev-ops-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 = createAzureDevOpsWebhookValidator(config);\n if (validator) {\n events.addHttpPostIngress({\n topic: 'azureDevOps',\n validator,\n });\n }\n },\n });\n },\n});\n"],"names":["createBackendModule","coreServices","eventsExtensionPoint","createAzureDevOpsWebhookValidator"],"mappings":";;;;;;;;AAkCA,qCAAeA,oCAAA,CAAoB;AAAA,EACjC,QAAA,EAAU,QAAA;AAAA,EACV,QAAA,EAAU,uBAAA;AAAA,EACV,SAAS,GAAA,EAAK;AACZ,IAAA,GAAA,CAAI,YAAA,CAAa;AAAA,MACf,IAAA,EAAM;AAAA,QACJ,QAAQC,6BAAA,CAAa,UAAA;AAAA,QACrB,MAAA,EAAQC;AAAA,OACV;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAQ,QAAO,EAAG;AAC7B,QAAA,MAAM,SAAA,GAAYC,oEAAkC,MAAM,CAAA;AAC1D,QAAA,IAAI,SAAA,EAAW;AACb,UAAA,MAAA,CAAO,kBAAA,CAAmB;AAAA,YACxB,KAAA,EAAO,aAAA;AAAA,YACP;AAAA,WACD,CAAA;AAAA,QACH;AAAA,MACF;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-events-backend-module-azure",
3
- "version": "0.2.33-next.0",
3
+ "version": "0.2.33-next.1",
4
4
  "backstage": {
5
5
  "role": "backend-plugin-module",
6
6
  "pluginId": "events",
@@ -48,6 +48,7 @@
48
48
  }
49
49
  },
50
50
  "files": [
51
+ "config.schema.json",
51
52
  "dist"
52
53
  ],
53
54
  "scripts": {
@@ -61,11 +62,15 @@
61
62
  },
62
63
  "dependencies": {
63
64
  "@backstage/backend-plugin-api": "1.9.3-next.0",
65
+ "@backstage/config": "1.3.8",
64
66
  "@backstage/plugin-events-node": "0.4.24-next.0"
65
67
  },
66
68
  "devDependencies": {
67
69
  "@backstage/backend-test-utils": "1.11.5-next.0",
68
- "@backstage/cli": "0.36.4-next.0",
69
- "@backstage/plugin-events-backend-test-utils": "0.1.57-next.0"
70
- }
70
+ "@backstage/cli": "0.36.4-next.1",
71
+ "@backstage/plugin-events-backend": "0.6.4-next.0",
72
+ "@backstage/plugin-events-backend-test-utils": "0.1.57-next.0",
73
+ "supertest": "^7.0.0"
74
+ },
75
+ "configSchema": "config.schema.json"
71
76
  }