Skip to content

Conversation

@jcger
Copy link
Contributor

@jcger jcger commented Dec 2, 2025

Summary

Fixes #244865 - The label prop was being passed by to the wrapped component instead of the wrapper component.

I also had to exclude empty labels from the callout logic. It was no issue before, but in the generator, the authType is hidden, users won't update it and therefore shouldn't show up in this callout.

Screenshot Screenshot 2025-12-02 at 13 20 53

QA

(optional) Add webhook connector
diff --git a/src/platform/packages/shared/kbn-connector-specs/src/all_specs.ts b/src/platform/packages/shared/kbn-connector-specs/src/all_specs.ts
index fefd2a67514e..534be6c8c3f5 100644
--- a/src/platform/packages/shared/kbn-connector-specs/src/all_specs.ts
+++ b/src/platform/packages/shared/kbn-connector-specs/src/all_specs.ts
@@ -13,3 +13,4 @@ export * from './specs/greynoise';
 export * from './specs/shodan';
 export * from './specs/urlvoid';
 export * from './specs/virustotal';
+export * from './specs/webhook';
diff --git a/src/platform/packages/shared/kbn-connector-specs/src/specs/webhook.ts b/src/platform/packages/shared/kbn-connector-specs/src/specs/webhook.ts
new file mode 100644
index 000000000000..b5f1e6375ae2
--- /dev/null
+++ b/src/platform/packages/shared/kbn-connector-specs/src/specs/webhook.ts
@@ -0,0 +1,80 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the "Elastic License
+ * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
+ * Public License v 1"; you may not use this file except in compliance with, at
+ * your election, the "Elastic License 2.0", the "GNU Affero General Public
+ * License v3.0 only", or the "Server Side Public License, v 1".
+ */
+
+import { z } from '@kbn/zod/v4';
+import type { ConnectorSpec } from '../connector_spec';
+
+export const SingleFileWebhookConnector: ConnectorSpec = {
+  metadata: {
+    id: '.sf-webhook',
+    displayName: 'Single File Webhook',
+    description: 'demo',
+    minimumLicense: 'gold',
+    supportedFeatureIds: ['workflows'],
+  },
+
+  schema: z.object({
+    method: z
+      .enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE'])
+      .meta({
+        label: 'Method',
+      })
+      .default('POST'),
+    url: z.url().meta({ label: 'URL', placeholder: 'https://...' }),
+    authType: z.string().meta({ disabled: true }),
+  }),
+
+  authTypes: ['none', 'basic', 'bearer'],
+
+  actions: {
+    submit: {
+      isTool: true,
+      input: z.object({
+        body: z.string(),
+      }),
+      handler: async (ctx, input) => {
+        try {
+          ctx.client.request({
+            method,
+            url,
+            data: input.body,
+          });
+
+          return {
+            ok: true,
+            message: 'Successfully connected to Single File Webhook',
+          };
+        } catch (error) {
+          return {
+            ok: false,
+            message: `Failed to connect: ${error}`,
+          };
+        }
+      },
+    },
+  },
+
+  test: {
+    handler: async (ctx) => {
+      try {
+        await ctx.client.get('https://webhook.site/fcc6fb22-63c1-4568-9be4-f453012bf8f5');
+        return {
+          ok: true,
+          message: 'Successfully connected to Single File Webhook',
+        };
+      } catch (error) {
+        return {
+          ok: false,
+          message: `Failed to connect: ${error}`,
+        };
+      }
+    },
+    description: 'Verifies webhook connection alive',
+  },
+};

Create/Edit a connector, check that the callout message at the bottom works as expected. It points out that the secrets need to be reentered on every update

@jcger jcger added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.3.0 labels Dec 2, 2025
const getSecretFields = (fields: FieldsMap): FieldsMap =>
Object.keys(fields)
.filter((fieldPath) => fieldPath.includes('secrets'))
.filter((fieldPath) => fieldPath.includes('secrets') && fields[fieldPath].label)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to exclude empty labels from the callout logic. It was no issue before, but in the generator, the authType is hidden, users won't update it and therefore shouldn't show up in this callout.

@jcger jcger added the Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// label Dec 2, 2025
@jcger jcger marked this pull request as ready for review December 2, 2025 14:50
@jcger jcger requested a review from a team as a code owner December 2, 2025 14:50
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@adcoelho
Copy link
Contributor

adcoelho commented Dec 2, 2025

The callout is missing for the bearer token :/ probably because it has no label

Screenshot 2025-12-02 at 16 05 17

@jcger
Copy link
Contributor Author

jcger commented Dec 3, 2025

The callout is missing for the bearer token :/ probably because it has no label

I added a label in 2296dbb

@jcger jcger enabled auto-merge (squash) December 3, 2025 11:04
@jcger jcger merged commit ee2ecb5 into elastic:main Dec 3, 2025
10 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
stackConnectors 826.2KB 826.3KB +93.0B
triggersActionsUi 1.5MB 1.5MB +36.0B
total +129.0B

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ResponseOps][SingleFileConnectors] Fix form callout message

3 participants