Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
d5913de
[WorkplaceAI] Add authz code-grant flow in Stack Connectors V2 (#246655)
seanstory Feb 4, 2026
01cf3be
[ResponseOps][Connectors] Add auth mode to auth types (#252307)
jcger Feb 9, 2026
c989b64
Merge branch 'main' of https://github.com/jcger/kibana into connector…
jcger Feb 9, 2026
6ae9569
[Workplace AI][PerUserAuth] Support connectors created in non default…
lorenabalan Feb 10, 2026
52cc7e8
[Workplace AI][PerUserAuth] Escape callback html and oauth state clie…
lorenabalan Feb 10, 2026
b8f0483
Merge branch 'main' into connectors-auth-code-grant
jcger Feb 10, 2026
2865111
[ResponseOps][Connectors] Add authMode to connector saved objects and…
js-jankisalvi Feb 12, 2026
f1e5cf2
[WorkplaceAI][PerUserAuth] Remove `redirectUri` from `oauth_state` SO…
lorenabalan Feb 12, 2026
a63cbfd
Merge branch 'main' into connectors-auth-code-grant
jcger Feb 16, 2026
fe99023
[WorkplaceAI][PerUserAuth] Add unit tests for OAuth Code Grant Flow (…
lorenabalan Feb 17, 2026
bfa8e7f
[ResponseOps][Connectors] Add authentication column to connectors tab…
js-jankisalvi Feb 17, 2026
7bc6b62
[Response Ops][Connectors] Add new user token SO (#252501)
jcger Feb 18, 2026
83c0328
Init commit
lorenabalan Feb 18, 2026
da1e500
Merge branch 'main' into connectors-auth-code-grant
dennis-tismenko Feb 18, 2026
846c86b
Add missing unit tests
lorenabalan Feb 18, 2026
6776339
Refactor common code and update unit tests
lorenabalan Feb 18, 2026
8041b7d
Get auth type from secrets
lorenabalan Feb 18, 2026
f393e79
Enable EARS auth on Google connector
lorenabalan Feb 18, 2026
c3ce4da
Enable Authorize button in the UI
lorenabalan Feb 18, 2026
49b890e
Bug fixes
lorenabalan Feb 19, 2026
df98a36
Merge branch 'main' into connectors-auth-code-grant
jcger Feb 20, 2026
6a19640
Fix OAuth State cleanup task
lorenabalan Feb 20, 2026
5b38f89
Set EARS base URL from config
lorenabalan Feb 20, 2026
5b7af60
Only specify provider in connector input
lorenabalan Feb 20, 2026
67c523c
Fix refresh logic
lorenabalan Feb 20, 2026
83491d4
Merge and fix conflicts
lorenabalan Feb 23, 2026
625d85a
Lint
lorenabalan Feb 23, 2026
b2412b2
Pass actual id to refresh flow as well
lorenabalan Feb 23, 2026
b5f4bf4
[WorkplaceAI][PerUserAuth] Add hooks for connector code grant OAuth f…
dennis-tismenko Feb 23, 2026
1b86769
Merge branch 'main' into connectors-auth-code-grant
dennis-tismenko Feb 23, 2026
b403663
Changes from node scripts/generate codeowners
kibanamachine Feb 23, 2026
f004982
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Feb 23, 2026
25a6409
Merge branch 'main' of github.com:jcger/kibana into connectors-auth-c…
jcger Feb 24, 2026
c942aef
Small fixes (#254557)
lorenabalan Feb 24, 2026
a4b08c0
fix SO count test + docs
jcger Feb 24, 2026
460ebf7
Merge branch 'connectors-auth-code-grant' of github.com:elastic/kiban…
jcger Feb 24, 2026
e8bcea2
Changes from make api-docs
kibanamachine Feb 24, 2026
e7e0dd0
add xpack.actions.auth.oauth_authorization_code.enabled flag
jcger Feb 24, 2026
2fd16c9
Changes from make api-docs
kibanamachine Feb 25, 2026
a47ef6d
FF effect on SO and authMode in GET connectors
jcger Feb 25, 2026
1207799
Merge branch 'connectors-auth-code-grant' of github.com:elastic/kiban…
jcger Feb 25, 2026
82a2597
[ResponseOps][Connectors] Use profileUid in actions client (#254589)
jcger Feb 25, 2026
92b7bb4
Merge branch 'main' into connectors-auth-code-grant
jcger Feb 25, 2026
3a192f0
fix tests
jcger Feb 25, 2026
354bd23
Merge branch 'connectors-auth-code-grant' of github.com:elastic/kiban…
jcger Feb 25, 2026
a386360
Merge branch 'main' of github.com:jcger/kibana into connectors-auth-c…
jcger Feb 25, 2026
abff0b5
reset core + docs
jcger Feb 25, 2026
ff13481
Changes from make api-docs
kibanamachine Feb 25, 2026
bf90b46
[ResponseOps][PerUserAuth] Delete user tokens on connector delete and…
js-jankisalvi Feb 25, 2026
ac6e2da
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine Feb 25, 2026
b1c1a81
Merge and fix conflicts, best effort
lorenabalan Feb 25, 2026
f2269a5
Post-merge fixes
lorenabalan Feb 25, 2026
0f3eb62
conditional schema models
jcger Feb 26, 2026
bc79bda
Merge branch 'main' into connectors-auth-code-grant
jcger Feb 26, 2026
e3bb9cd
[WorkplaceAI][PerUserAuth] Implement Encrypted Saved Objects recommen…
lorenabalan Feb 26, 2026
3bca053
Merge branch 'connectors-auth-code-grant' into lb/poc/ears-auth
lorenabalan Feb 26, 2026
78e721d
remove feature flag
jcger Feb 27, 2026
8d27c46
Changes from node scripts/check_mappings_update --fix
kibanamachine Feb 27, 2026
b40260b
Changes from make api-docs
kibanamachine Feb 27, 2026
bf8164d
update SO counter
jcger Feb 27, 2026
a8174bf
Merge branch 'lb/poc/ears-auth' of github.com:elastic/kibana into pr-…
jcger Feb 27, 2026
c13e3f9
set xpack.workplaceAIApp.ears.url flag
jcger Feb 27, 2026
b6d2faa
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine Feb 27, 2026
9b5b5f1
Fix; check for user tokens instead of shared ones
lorenabalan Feb 27, 2026
2c7d0e4
Merge branch 'lb/poc/ears-auth' of github.com:elastic/kibana into lb/…
lorenabalan Feb 27, 2026
2fe0512
fix tests
jcger Feb 27, 2026
fd873d4
remove kbn setting
jcger Feb 27, 2026
0eab256
trigger deployment, empty commit
lorenabalan Feb 27, 2026
e15fdb6
Merge branch 'lb/poc/ears-auth' of github.com:elastic/kibana into lb/…
lorenabalan Feb 27, 2026
ada770b
Merge branch 'main' into connectors-auth-code-grant
jcger Feb 27, 2026
a16ff65
Merge branch 'connectors-auth-code-grant' of github.com:elastic/kiban…
jcger Feb 27, 2026
6359806
wire wpai for label deploy
jcger Feb 27, 2026
4f3cd55
update SO count
jcger Feb 27, 2026
4cb6dff
EARS url in actions config
lorenabalan Feb 27, 2026
dd77ebe
Merge branch 'lb/poc/ears-auth' of github.com:elastic/kibana into lb/…
lorenabalan Feb 27, 2026
253a362
fix test
jcger Mar 2, 2026
ecf54b8
Update previous version of ESO
lorenabalan Mar 2, 2026
5168d91
Add new types to previouslyRegisteredTypes
lorenabalan Mar 2, 2026
b5cda98
Undo auth_mode on create in the test
lorenabalan Mar 2, 2026
cfc6c5f
trigger REVOKE to EARS when disconnecting a connector
lorenabalan Mar 2, 2026
999fe81
Fix test
lorenabalan Mar 3, 2026
e053bb2
Add more logs
lorenabalan Mar 4, 2026
4af4ecf
[Build] Pin shadow version for Chainguard image (#255691)
Ikuni17 Mar 3, 2026
13299f9
Update config
lorenabalan Mar 5, 2026
fe98754
Merge branch 'main' of github.com:jcger/kibana into connectors-auth-c…
jcger Mar 5, 2026
a5554d6
First pass at a google calendar source (#252740)
seanstory Mar 6, 2026
0135f44
Revert "trigger REVOKE to EARS when disconnecting a connector"
lorenabalan Mar 6, 2026
39c837d
EARS auth for Google data sources
lorenabalan Mar 6, 2026
736c7db
gmail data source
meghanmurphy1 Mar 2, 2026
92a0ae0
Enable EARS on GMail data source
lorenabalan Mar 6, 2026
638bef0
Merge branch 'main' into connectors-auth-code-grant
jcger Mar 9, 2026
dcde963
[ResponseOps][Connectors] Authorization Code - Remove feature flag (…
jcger Mar 9, 2026
9818ab6
Merge branch 'main' into connectors-auth-code-grant
jcger Mar 9, 2026
d7d1bfa
rollback limits + fix test
jcger Mar 9, 2026
02e131e
Merge branch 'connectors-auth-code-grant' of github.com:elastic/kiban…
jcger Mar 9, 2026
15d2c19
rename auth rate limit kbn setting to
jcger Mar 9, 2026
8999b5c
add missing fixture
jcger Mar 9, 2026
fe05a44
Merge branch 'main' into connectors-auth-code-grant
jcger Mar 10, 2026
3e36591
Undo CI pipeline changes for workplace_ai
lorenabalan Mar 10, 2026
66df421
Use discriminated union
lorenabalan Mar 10, 2026
44e1d47
removed unrelated code
jcger Mar 10, 2026
8081451
Reset lock mapping
lorenabalan Mar 10, 2026
d1c8066
Remove noisy type
lorenabalan Mar 10, 2026
a3ac3ae
fix test
jcger Mar 10, 2026
0b23084
Merge branch 'connectors-auth-code-grant' of github.com:elastic/kiban…
jcger Mar 10, 2026
3b58a2b
Merge branch 'connectors-auth-code-grant' into lb/poc/ears-auth
lorenabalan Mar 10, 2026
e72d8c3
Factor out duplicate code
lorenabalan Mar 10, 2026
1a59817
Isolate ears-related code
lorenabalan Mar 10, 2026
ce098bf
Refactor switches into one Strategy object
lorenabalan Mar 10, 2026
62c16cb
add missing authMode
jcger Mar 10, 2026
d136c1a
Merge branch 'main' into connectors-auth-code-grant
jcger Mar 10, 2026
6ae2892
Merge branch 'main' of github.com:jcger/kibana into connectors-auth-c…
jcger Mar 11, 2026
1425dce
Fix tests
lorenabalan Mar 10, 2026
d0cf87b
Refactor resolveEarsUrl
lorenabalan Mar 11, 2026
cc836cb
Merge branch 'connectors-auth-code-grant' into lb/poc/ears-auth
lorenabalan Mar 11, 2026
5d57743
Fix bad merge
lorenabalan Mar 11, 2026
55dffe2
Simplify ears url config handling
lorenabalan Mar 11, 2026
08fbe1a
Fix bad merge again
lorenabalan Mar 11, 2026
3eb6448
Clean up how we derive endpoints
lorenabalan Mar 11, 2026
e767818
Fix tests and remove discriminated union
lorenabalan Mar 11, 2026
34cfe1b
More minor cleaning up
lorenabalan Mar 11, 2026
7582df0
Fix authz endpoints
lorenabalan Mar 12, 2026
34708e5
fix refresh token
jcger Mar 12, 2026
97288d3
Merge branch 'main' of github.com:jcger/kibana into connectors-auth-c…
jcger Mar 12, 2026
84cce1b
Merge branch 'main' into connectors-auth-code-grant
jcger Mar 12, 2026
343bf64
Merge branch 'main' into connectors-auth-code-grant
jcger Mar 12, 2026
22f6f7b
update moon files
jcger Mar 12, 2026
184a1b4
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Mar 12, 2026
b95ddbb
Merge branch 'main' of github.com:jcger/kibana into connectors-auth-c…
jcger Mar 13, 2026
2d7309d
Merge branch 'connectors-auth-code-grant' into lb/poc/ears-auth
lorenabalan Mar 13, 2026
6030c89
solve conflicts
jcger Mar 13, 2026
354c11c
Merge branch 'main' of github.com:jcger/kibana into connectors-auth-c…
jcger Mar 13, 2026
3f46049
remove logs
jcger Mar 13, 2026
81d9c25
add test and reenable basic auth for client_secret_basic
jcger Mar 13, 2026
3324000
Merge branch 'main' into connectors-auth-code-grant
jcger Mar 16, 2026
798f72d
DRY providers and URL schema type
lorenabalan Mar 16, 2026
f8597ab
Merge branch 'main' into connectors-auth-code-grant
jcger Mar 16, 2026
a919e0b
Debug log and update docstring
lorenabalan Mar 16, 2026
5a560dd
Merge branch 'connectors-auth-code-grant' into lb/poc/ears-auth
lorenabalan Mar 16, 2026
dbb5ade
Update codeowners
lorenabalan Mar 16, 2026
a0ed2ea
Add README
lorenabalan Mar 16, 2026
7833754
Update imports
lorenabalan Mar 16, 2026
9a9e7a6
Update with EARS API version
lorenabalan Mar 16, 2026
0eeb9dd
Raise more generic error message
lorenabalan Mar 16, 2026
643e6e5
Fix tests
lorenabalan Mar 16, 2026
c98fc91
Fix bad merge
lorenabalan Mar 16, 2026
7cffe7c
Remove unused label
lorenabalan Mar 17, 2026
22e77aa
Add guard for connectorTokenClient
lorenabalan Mar 17, 2026
e509539
Put back discriminated union
lorenabalan Mar 17, 2026
89beff8
Remove leftover capitalize
lorenabalan Mar 17, 2026
f555c2e
Add API version
lorenabalan Mar 17, 2026
cb6b406
Trigger CI
lorenabalan Mar 18, 2026
f102ca7
Merge branch 'main' into lb/poc/ears-auth
lorenabalan Mar 19, 2026
3b960b4
Merge branch 'main' into lb/poc/ears-auth
lorenabalan Mar 19, 2026
f2408ee
Update readme with api version
lorenabalan Mar 19, 2026
09f6ae7
Update axiosInstance headers for future requests
lorenabalan Mar 19, 2026
b395e81
Fix useBasicAuth propagation
lorenabalan Mar 19, 2026
ea58466
Reset Google Drive connector
lorenabalan Mar 19, 2026
ee2a0f8
Merge branch 'lb/poc/ears-auth' into lb/poc/revoke-with-ears
lorenabalan Mar 19, 2026
7b4a079
Update config
lorenabalan Mar 19, 2026
bb9c340
Deduplicate
lorenabalan Mar 19, 2026
bd3da1a
Fix tests
lorenabalan Mar 19, 2026
268368a
Merge branch 'main' into lb/poc/ears-auth
lorenabalan Mar 19, 2026
3152684
Merge branch 'lb/poc/ears-auth' into lb/poc/revoke-with-ears
lorenabalan Mar 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2371,6 +2371,10 @@ x-pack/platform/plugins/shared/inference_endpoint @elastic/search-kibana
/x-pack/platform/test/fixtures/es_archives/alerting/8_2_0 @elastic/response-ops
/x-pack/solutions/**/test/serverless/**/test_suites/rules/ @elastic/response-ops

# EARS
/x-pack/platform/plugins/shared/actions/server/lib/ears @elastic/workchat-eng
/src/platform/packages/shared/kbn-connector-specs/src/auth_types/ears.ts @elastic/workchat-eng

# Connector Specs
src/platform/packages/shared/kbn-connector-specs/src/all_specs.ts
src/platform/packages/shared/kbn-connector-specs/src/connector_icons_map.ts
Expand All @@ -2382,6 +2386,7 @@ src/platform/packages/shared/kbn-connector-specs/src/specs/amazon_s3/** @elastic
src/platform/packages/shared/kbn-connector-specs/src/specs/atlassian/** @elastic/workchat-eng
src/platform/packages/shared/kbn-connector-specs/src/specs/brave_search/** @elastic/workchat-eng
src/platform/packages/shared/kbn-connector-specs/src/specs/github/** @elastic/workflows-eng
src/platform/packages/shared/kbn-connector-specs/src/specs/gmail/** @elastic/workchat-eng
src/platform/packages/shared/kbn-connector-specs/src/specs/google_calendar/** @elastic/workchat-eng
src/platform/packages/shared/kbn-connector-specs/src/specs/google_drive/** @elastic/workchat-eng
src/platform/packages/shared/kbn-connector-specs/src/specs/greynoise/** @elastic/workflows-eng
Expand Down
19 changes: 19 additions & 0 deletions config/serverless.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ uiSettings.overrides.defaultRoute: /app/elasticsearch
# Specify in telemetry the project type
telemetry.labels.serverless: search

# Alerts and LLM config
xpack.actions.enabledActionTypes:
['.email', '.index', '.slack', '.slack_api', '.jira', '.jira-cloud', '.webhook', '.teams', '.gen-ai', '.bedrock', '.gemini', '.inference', '.mcp', '.notion', '.github', '.gmail', '.google_drive', '.google_calendar', '.sharepoint-online']

# Customize empty page state for analytics apps
no_data_page.analyticsNoDataPageFlavor: 'serverless_search'

Expand Down Expand Up @@ -111,6 +115,9 @@ xpack.searchQueryRules.enabled: true
## Search Connectors in stack management
xpack.contentConnectors.ui.enabled: false

## OAuth with Elastic-owned apps
xpack.actions.ears.url: https://elastic-auth-redirect-service.eu-west-1.aws.svc.qa.elastic.cloud
Comment thread
seanstory marked this conversation as resolved.

# Elastic Managed LLMs
xpack.actions.preconfigured:
Anthropic-Claude-Sonnet-3-7:
Expand Down Expand Up @@ -293,3 +300,15 @@ xpack.actions.preconfigured:
inferenceId: ".google-gemini-3.0-flash-chat_completion"
providerConfig:
model_id: "google-gemini-3.0-flash"


uiSettings:
overrides:
'workflows:ui:enabled': true

logging:
loggers:
- name: plugins.actions
level: debug
appenders: [default]

7 changes: 7 additions & 0 deletions config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,10 @@ xpack.genAiSettings:
showAiBreadcrumb: false
showSpacesIntegration: false
showAiAssistantsVisibilitySetting: false

# Debug-level logging
logging:
loggers:
- name: plugins.actions
level: debug
appenders: [default]
Comment thread
seanstory marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [Figma](/reference/connectors-kibana/figma-action-type.md): Browse design files, inspect structure, render nodes as images, and explore team projects in Figma.
* [Jina Reader](/reference/connectors-kibana/jina-action-type.md): Convert web pages into markdown from their URL and search the web for better LLM grounding.
* [GitHub](/reference/connectors-kibana/github-action-type.md): Search code, issues, and pull requests, and access repository contents and metadata from GitHub.
* [Gmail](/reference/connectors-kibana/gmail-action-type.md): Search and read emails from Gmail.
* [Google Calendar](/reference/connectors-kibana/google-calendar-action-type.md): Search and access events and calendars in Google Calendar.
* [Google Drive](/reference/connectors-kibana/google-drive-action-type.md): Search and access files and folders in Google Drive.
* [Jira Cloud](/reference/connectors-kibana/jira-cloud-action-type.md): Search issues with JQL, retrieve project and issue details, and look up users in Jira Cloud.
Expand Down
58 changes: 58 additions & 0 deletions docs/reference/connectors-kibana/gmail-action-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
navigation_title: "Gmail"
mapped_pages:
- https://www.elastic.co/guide/en/kibana/current/gmail-action-type.html
applies_to:
stack: preview 9.4
serverless: preview
---

# Gmail connector [gmail-action-type]

The Gmail connector enables searching and reading emails from Gmail via the Gmail API.

Check warning on line 12 in docs/reference/connectors-kibana/gmail-action-type.md

View workflow job for this annotation

GitHub Actions / docs-preview / vale

Elastic.Latinisms: Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'.

## Create connectors in {{kib}} [define-gmail-ui]

You can create connectors in **{{stack-manage-app}} > {{connectors-ui}}**.

### Connector configuration [gmail-connector-configuration]

Gmail connectors use the following configuration:

Bearer Token
: A Google OAuth 2.0 access token with Gmail API scopes. See [Get API credentials](#gmail-api-credentials) for instructions.

## Test connectors [gmail-action-configuration]

You can test connectors when creating or editing the connector in {{kib}}. The test verifies connectivity by fetching the authenticated user's profile from the Gmail API.

The Gmail connector has the following actions:

Search messages
: Search for messages using Gmail search syntax.
- **query** (optional): Gmail search query (e.g. `from:user@example.com`, `is:unread`, `subject:report`, `after:2024/01/01`, `has:attachment`).
- **maxResults** (optional): Maximum number of messages to return (1–100). Defaults to 50.
- **pageToken** (optional): Pagination token from a previous response.

Get message
: Retrieve a single message by ID with full headers and body.
- **messageId** (required): The ID of the message to retrieve.
- **format** (optional): `minimal` (headers only), `full` (default), or `raw` (RFC 2822).

List messages
: List messages, optionally filtered by label.
- **maxResults** (optional): Maximum number of messages to return (1–100). Defaults to 50.
- **pageToken** (optional): Pagination token from a previous response.
- **labelIds** (optional): Array of label IDs (e.g. INBOX, SENT).

## Get API credentials [gmail-api-credentials]

To use the Gmail connector, you need a Google OAuth 2.0 access token with Gmail API scopes. You can obtain one using the [Google OAuth 2.0 Playground](https://developers.google.com/oauthplayground/):

1. Open the OAuth 2.0 Playground and ensure **Use your own OAuth credentials** is checked if you have a project.
2. In **Step 1 - Select & authorize APIs**, select the Gmail API v1 scope: `https://www.googleapis.com/auth/gmail.readonly` (or `https://www.googleapis.com/auth/gmail.metadata` for metadata only; use `https://mail.google.com/` for full access).

Check notice on line 53 in docs/reference/connectors-kibana/gmail-action-type.md

View workflow job for this annotation

GitHub Actions / docs-preview / vale

Elastic.Semicolons: Use semicolons judiciously.
3. Click **Authorize APIs** and sign in with your Google account.
4. In **Step 2 - Exchange authorization code for tokens**, click **Exchange authorization code for tokens**.
5. Copy the **Access token** and use it as the Bearer token when creating or activating the Gmail data source in Kibana.

The token expires after a short time (e.g. one hour). For long-lived access, use a refresh token flow or re-authorize as needed.

Check warning on line 58 in docs/reference/connectors-kibana/gmail-action-type.md

View workflow job for this annotation

GitHub Actions / docs-preview / vale

Elastic.Latinisms: Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'.
3 changes: 2 additions & 1 deletion docs/reference/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ toc:
- file: connectors-kibana/alienvault-otx-action-type.md
- file: connectors-kibana/amazon-s3-action-type.md
- file: connectors-kibana/brave-search-action-type.md
- file: connectors-kibana/figma-action-type.md
- file: connectors-kibana/firecrawl-action-type.md
- file: connectors-kibana/github-action-type.md
- file: connectors-kibana/gmail-action-type.md
- file: connectors-kibana/google-calendar-action-type.md
- file: connectors-kibana/figma-action-type.md
- file: connectors-kibana/google-drive-action-type.md
- file: connectors-kibana/greynoise-action-type.md
- file: connectors-kibana/jina-action-type.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const previouslyRegisteredTypes = [
'uptime-dynamic-settings',
'synthetics-dynamic-settings',
'uptime-synthetics-api-key',
'user_connector_token',
'url',
'usage-counter', // added in 8.16.0: richer mappings, located in .kibana_usage_counters
'usage-counters', // deprecated in favor of 'usage-counter'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export * as connectorsSpecs from './src/all_specs';
export type * from './src/connector_spec';

export * as authTypeSpecs from './src/all_auth_types';
export { EARS_PROVIDERS } from './src/auth_types/ears';

export { getConnectorSpec } from './src/get_connector_spec';
export { getWorkflowTemplatesForConnector } from './src/get_workflow_templates';
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export * from './auth_types/basic';
export * from './auth_types/none';
export * from './auth_types/oauth';
export * from './auth_types/oauth_authorization_code';
export { Ears } from './auth_types/ears';

// Skipping PFX and CRT exports for now as they will require updates to
// the formbuilder to support file upload fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ export * from './specs/firecrawl/firecrawl';
export * from './specs/zoom/zoom';
export * from './specs/zendesk/zendesk';
export * from './specs/amazon_s3/amazon_s3';
export * from './specs/gmail/gmail';
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* 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 { AxiosInstance } from 'axios';
import type { AuthContext, AuthTypeSpec } from '../connector_spec';
import * as i18n from './translations';

export const EARS_PROVIDERS = ['google', 'microsoft', 'slack'] as const;

const authSchema = z
.object({
provider: z.enum(EARS_PROVIDERS).meta({ hidden: true }),
scope: z.string().meta({ label: i18n.OAUTH_SCOPE_LABEL }).optional(),
})
.meta({ label: i18n.EARS_LABEL });

type AuthSchemaType = z.infer<typeof authSchema>;

/**
* EARS (Elastic Authentication Redirect Service) OAuth Flow
*
* EARS is an OAuth proxy that manages client credentials (clientId/clientSecret)
* on behalf of the user. Instead of users creating their own OAuth apps for each
* 3rd party, they can rely on the Elastic-owned apps for simplicity.
* Therefore, connectors using EARS don't require users to input any
* client credentials — EARS already knows them.
*
* EARS Redirect Flow:
* 1. On `/_start_oauth_flow`, Kibana builds EARS authorize URL with callback_uri, state, scope, pkce_challenge, pkce_method, and redirects to it
* 2. User visits EARS authorize URL → EARS redirects to OAuth provider and shows auth screen to user, in order for them to enter their credentials and authorize scopes
* 3. OAuth provider redirects back to EARS with authz code & state
* 4. EARS redirects to callback_uri (Kibana's `/_oauth_callback`) with authz code & state
* 5. Kibana then exchanges code via EARS token endpoint: POST {earsTokenUrl} with code & pkce_verifier in the JSON body
* 6. Tokens are auto-refreshed when expired during connector execution
*/
export const Ears: AuthTypeSpec<AuthSchemaType> = {
id: 'ears',
schema: authSchema,
authMode: 'per-user',
configure: async (
ctx: AuthContext,
axiosInstance: AxiosInstance,
secret: AuthSchemaType
): Promise<AxiosInstance> => {
let token;
try {
token = await ctx.getToken({
authType: 'ears',
provider: secret.provider,
scope: secret.scope,
});
} catch (error) {
throw new Error(
`Unable to retrieve/refresh the access token. User may need to re-authorize: ${error.message}`
);
}

if (!token) {
throw new Error(`No access token available. User must complete OAuth authorization flow.`);
}

// set global defaults
axiosInstance.defaults.headers.common.Authorization = token;

return axiosInstance;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const OAuth: AuthTypeSpec<AuthSchemaType> = {
let token;
try {
token = await ctx.getToken({
authType: 'oauth',
tokenUrl: secret.tokenUrl,
scope: secret.scope,
clientId: secret.clientId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const OAuthAuthorizationCode: AuthTypeSpec<AuthSchemaType> = {
let token;
try {
token = await ctx.getToken({
authType: 'oauth',
tokenUrl: secret.tokenUrl,
scope: secret.scope,
clientId: secret.clientId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,7 @@ export const AWS_SECRET_ACCESS_KEY_REQUIRED_MESSAGE = i18n.translate(
defaultMessage: 'Secret Access Key is required',
}
);

export const EARS_LABEL = i18n.translate('connectorSpecs.ears.label', {
defaultMessage: 'OAuth via Elastic-owned apps',
});
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ export const ConnectorIconsMap: Map<
'.amazon_s3',
lazy(() => import(/* webpackChunkName: "connectorIconAmazons3" */ './specs/amazon_s3/icon')),
],
['.gmail', lazy(() => import(/* webpackChunkName: "connectorIconGmail" */ './specs/gmail/icon'))],
]);
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export interface ConnectorMetadata {
// OAuth2, SSL/mTLS, AWS SigV4 → Phase 2 (see connector_rfc.ts)

// Auth schemas defined in ./auth_types
export interface GetTokenOpts {
export interface OAuthGetTokenOpts {
authType: 'oauth';
tokenUrl: string;
scope?: string;
clientId: string;
Expand All @@ -87,6 +88,14 @@ export interface GetTokenOpts {
tokenEndpointAuthMethod?: 'client_secret_post' | 'client_secret_basic';
}

export interface EarsGetTokenOpts {
authType: 'ears';
provider: string;
scope?: string;
}

export type GetTokenOpts = OAuthGetTokenOpts | EarsGetTokenOpts;

export interface AuthContext {
getCustomHostSettings: (url: string) => CustomHostSettings | undefined;
getToken: (opts: GetTokenOpts) => Promise<string | null>;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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 { GmailConnector } from './gmail';

describe('GmailConnector', () => {
it('has required metadata', () => {
expect(GmailConnector.metadata.id).toBe('.gmail');
expect(GmailConnector.metadata.displayName).toBe('Gmail');
expect(GmailConnector.metadata.supportedFeatureIds).toContain('workflows');
});

it('exposes searchMessages, getMessage, listMessages actions', () => {
expect(GmailConnector.actions.searchMessages).toBeDefined();
expect(GmailConnector.actions.getMessage).toBeDefined();
expect(GmailConnector.actions.listMessages).toBeDefined();
});

it('has a test handler', () => {
expect(GmailConnector.test?.handler).toBeDefined();
});
});
Loading
Loading