Skip to content

Commit

Permalink
Align native box connector configs (#203241)
Browse files Browse the repository at this point in the history
## Summary

Raised in [this community slack
post](https://elasticstack.slack.com/archives/C06U8G8NJBY/p1733445905372799?thread_ts=1733378189.186729&cid=C06U8G8NJBY),
the Native Connector definition from Kibana was using some config fields
(`app_key`, `app_secret`) that didn't align with what the connector
itself expects (`client_id`, `client_secret`). There were also a number
of configurations defined here that are not used by the Box connector
(`use_document_level_security`, `include_inherited_users_and_groups`,
`use_text_extraction_service`, `retry_count`, `path`)

This change moves to align this definition with the source of truth in
the connectors codebase:
https://github.com/elastic/connectors/blob/38c2fdbfe71330d6e95de33a30bf114c29ae4cae/connectors/sources/box.py#L263-L311

T

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)

(cherry picked from commit db56f01)
  • Loading branch information
seanstory committed Dec 18, 2024
1 parent 471a3d1 commit e07bef1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 104 deletions.
123 changes: 40 additions & 83 deletions packages/kbn-search-connectors/types/native_connectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ const PERSONAL_ACCESS_TOKEN = 'personal_access_token';

const GITHUB_APP = 'github_app';

const BOX_FREE = 'box_free';
const BOX_ENTERPRISE = 'box_enterprise';

export const NATIVE_CONNECTOR_DEFINITIONS: Record<string, NativeConnector | undefined> = {
azure_blob_storage: {
configuration: {
Expand Down Expand Up @@ -246,31 +249,42 @@ export const NATIVE_CONNECTOR_DEFINITIONS: Record<string, NativeConnector | unde
},
box: {
configuration: {
path: {
default_value: null,
is_enterprise: {
default_value: BOX_FREE,
depends_on: [],
display: TEXTBOX,
label: translate('searchConnectors.nativeConnectors.box.pathLabel', {
defaultMessage: 'Path to fetch files/folders',
display: DROPDOWN,
label: translate('searchConnectors.nativeConnectors.box.accountType', {
defaultMessage: 'Box Account',
}),
options: [],
order: 1,
required: false,
options: [
{
label: translate('searchConnectors.nativeConnectors.box.boxFreeAccount', {
defaultMessage: 'Box Free Account',
}),
value: BOX_FREE,
},
{
label: translate('searchConnectors.nativeConnectors.box.boxEnterpriseAccount', {
defaultMessage: 'Box Enterprise Account',
}),
value: BOX_ENTERPRISE,
},
],
required: true,
sensitive: false,
tooltip: translate('searchConnectors.nativeConnectors.box.pathTooltip', {
defaultMessage: 'Path is ignored when Advanced Sync Rules are used. ',
}),
tooltip: null,
order: 1,
type: STRING,
ui_restrictions: [],
validations: [],
value: '',
value: BOX_FREE,
},
app_key: {
client_id: {
default_value: null,
depends_on: [],
display: TEXTBOX,
label: translate('searchConnectors.nativeConnectors.box.appKeyLabel', {
defaultMessage: 'App Key',
label: translate('searchConnectors.nativeConnectors.box.clientIdLabel', {
defaultMessage: 'Client ID',
}),
options: [],
order: 2,
Expand All @@ -282,12 +296,12 @@ export const NATIVE_CONNECTOR_DEFINITIONS: Record<string, NativeConnector | unde
validations: [],
value: '',
},
app_secret: {
client_secret: {
default_value: null,
depends_on: [],
display: TEXTBOX,
label: translate('searchConnectors.nativeConnectors.box.appSecretLabel', {
defaultMessage: 'App secret',
label: translate('searchConnectors.nativeConnectors.box.clientSecretLabel', {
defaultMessage: 'Client Secret',
}),
options: [],
order: 3,
Expand Down Expand Up @@ -316,18 +330,20 @@ export const NATIVE_CONNECTOR_DEFINITIONS: Record<string, NativeConnector | unde
validations: [],
value: '',
},
retry_count: {
default_value: 3,
depends_on: [],
display: NUMERIC,
label: RETRIES_PER_REQUEST_LABEL,
enterprise_id: {
default_value: null,
depends_on: [{ field: 'is_enterprise', value: BOX_ENTERPRISE }],
display: TEXTBOX,
label: translate('searchConnectors.nativeConnectors.box.enterpriseIdLabel', {
defaultMessage: 'Enterprise ID',
}),
options: [],
order: 5,
required: false,
sensitive: false,
tooltip: null,
type: INTEGER,
ui_restrictions: ['advanced'],
ui_restrictions: [],
validations: [],
value: '',
},
Expand All @@ -346,65 +362,6 @@ export const NATIVE_CONNECTOR_DEFINITIONS: Record<string, NativeConnector | unde
validations: [],
value: '',
},
use_text_extraction_service: {
default_value: null,
depends_on: [],
display: TOGGLE,
label: USE_TEXT_EXTRACTION_SERVICE_LABEL,
options: [],
order: 7,
required: true,
sensitive: false,
tooltip: USE_TEXT_EXTRACTION_SERVICE_TOOLTIP,
type: BOOLEAN,
ui_restrictions: ['advanced'],
validations: [],
value: false,
},
use_document_level_security: {
default_value: null,
depends_on: [],
display: TOGGLE,
label: ENABLE_DOCUMENT_LEVEL_SECURITY_LABEL,
options: [],
order: 8,
required: true,
sensitive: false,
tooltip: getEnableDocumentLevelSecurityTooltip(
translate('searchConnectors.nativeConnectors.boxTooltip.name', {
defaultMessage: 'Box',
})
),
type: BOOLEAN,
ui_restrictions: [],
validations: [],
value: false,
},
include_inherited_users_and_groups: {
default_value: null,
depends_on: [
{
field: 'use_document_level_security',
value: true,
},
],
display: TOGGLE,
label: translate('searchConnectors.nativeConnectors.box.includeInheritedUsersLabel', {
defaultMessage: 'Include groups and inherited users',
}),
options: [],
order: 9,
required: true,
sensitive: false,
tooltip: translate('searchConnectors.nativeConnectors.box.includeInheritedUsersTooltip', {
defaultMessage:
'Include groups and inherited users when indexing permissions. Enabling this configurable field will cause a significant performance degradation.',
}),
type: BOOLEAN,
ui_restrictions: [],
validations: [],
value: false,
},
},
features: {},
name: translate('searchConnectors.nativeConnectors.box.name', {
Expand Down
7 changes: 0 additions & 7 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -7165,15 +7165,8 @@
"searchConnectors.nativeConnectors.azureBlobStorage.blobEndpointLabel": "Point de terminaison Blob",
"searchConnectors.nativeConnectors.azureBlobStorage.containerNameLabel": "Liste des conteneurs",
"searchConnectors.nativeConnectors.azureBlobStorage.name": "Stockage Blob Azure",
"searchConnectors.nativeConnectors.box.appKeyLabel": "Clé d’application",
"searchConnectors.nativeConnectors.box.appSecretLabel": "Secret d’application",
"searchConnectors.nativeConnectors.box.includeInheritedUsersLabel": "Inclure les groupes et les utilisateurs hérités",
"searchConnectors.nativeConnectors.box.includeInheritedUsersTooltip": "Incluez les groupes et les utilisateurs hérités lors de l'indexation des autorisations. L'activation de ce champ configurable entraînera une dégradation significative des performances.",
"searchConnectors.nativeConnectors.box.name": "Box",
"searchConnectors.nativeConnectors.box.pathLabel": "Chemin permettant de récupérer les fichiers/dossiers",
"searchConnectors.nativeConnectors.box.pathTooltip": "Le chemin est ignoré lorsque des règles de synchronisation avancées sont appliquées.",
"searchConnectors.nativeConnectors.box.refreshTokenLabel": "Token d'actualisation",
"searchConnectors.nativeConnectors.boxTooltip.name": "Box",
"searchConnectors.nativeConnectors.confluence.indexLabelsLabel": "Activer les étiquettes d'indexation",
"searchConnectors.nativeConnectors.confluence.indexLabelsTooltip": "Activer cette option augmentera le nombre d'appels réseau vers la source et peut diminuer les performances",
"searchConnectors.nativeConnectors.confluence.name": "Confluence",
Expand Down
7 changes: 0 additions & 7 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -7158,15 +7158,8 @@
"searchConnectors.nativeConnectors.azureBlobStorage.blobEndpointLabel": "Blobエンドポイント",
"searchConnectors.nativeConnectors.azureBlobStorage.containerNameLabel": "コンテナーのリスト",
"searchConnectors.nativeConnectors.azureBlobStorage.name": "Azure Blob Storage",
"searchConnectors.nativeConnectors.box.appKeyLabel": "アプリキー",
"searchConnectors.nativeConnectors.box.appSecretLabel": "アプリシークレット",
"searchConnectors.nativeConnectors.box.includeInheritedUsersLabel": "グループと継承されたユーザーを含める",
"searchConnectors.nativeConnectors.box.includeInheritedUsersTooltip": "権限をインデックス化するときに、グループと検証されたユーザーを含めます。この構成可能なフィールドを有効化すると、重大なパフォーマンスの劣化が発生します。",
"searchConnectors.nativeConnectors.box.name": "Box",
"searchConnectors.nativeConnectors.box.pathLabel": "ファイル/フォルダーを取得するためのパス",
"searchConnectors.nativeConnectors.box.pathTooltip": "詳細同期ルールが使用されている場合、パスは無視されます。",
"searchConnectors.nativeConnectors.box.refreshTokenLabel": "トークンの更新",
"searchConnectors.nativeConnectors.boxTooltip.name": "Box",
"searchConnectors.nativeConnectors.confluence.indexLabelsLabel": "ラベルのインデックス化を有効化",
"searchConnectors.nativeConnectors.confluence.indexLabelsTooltip": "これを有効化すると、ソースに対するネットワーク呼び出しの回数が増え、パフォーマンスが低下する可能性があります",
"searchConnectors.nativeConnectors.confluence.name": "Confluence",
Expand Down
7 changes: 0 additions & 7 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -7171,15 +7171,8 @@
"searchConnectors.nativeConnectors.azureBlobStorage.blobEndpointLabel": "Blob 终端",
"searchConnectors.nativeConnectors.azureBlobStorage.containerNameLabel": "容器列表",
"searchConnectors.nativeConnectors.azureBlobStorage.name": "Azure Blob 存储",
"searchConnectors.nativeConnectors.box.appKeyLabel": "应用密钥",
"searchConnectors.nativeConnectors.box.appSecretLabel": "应用机密",
"searchConnectors.nativeConnectors.box.includeInheritedUsersLabel": "包括组和继承的用户",
"searchConnectors.nativeConnectors.box.includeInheritedUsersTooltip": "在索引权限时包括组和继承的用户。启用这个可配置字段会导致性能大幅降级。",
"searchConnectors.nativeConnectors.box.name": "Box",
"searchConnectors.nativeConnectors.box.pathLabel": "用于提取文件/文件夹的路径",
"searchConnectors.nativeConnectors.box.pathTooltip": "使用高级同步规则时,将忽略路径。",
"searchConnectors.nativeConnectors.box.refreshTokenLabel": "刷新令牌",
"searchConnectors.nativeConnectors.boxTooltip.name": "Box",
"searchConnectors.nativeConnectors.confluence.indexLabelsLabel": "启用索引标签",
"searchConnectors.nativeConnectors.confluence.indexLabelsTooltip": "启用此项将增加对源的网络调用的数量,并可能会降低性能",
"searchConnectors.nativeConnectors.confluence.name": "Confluence",
Expand Down

0 comments on commit e07bef1

Please sign in to comment.