Skip to content

Commit

Permalink
Align native box connector configs
Browse files Browse the repository at this point in the history
  • Loading branch information
seanstory committed Dec 6, 2024
1 parent 132eb81 commit 8b1d303
Showing 1 changed file with 42 additions and 83 deletions.
125 changes: 42 additions & 83 deletions packages/kbn-search-connectors/types/native_connectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ const ENABLE_DOCUMENT_LEVEL_SECURITY_LABEL = translate(
}
);

const;

const getEnableDocumentLevelSecurityTooltip = (serviceName: string) =>
translate('searchConnectors.nativeConnectors.enableDLS.tooltip', {
defaultMessage:
Expand All @@ -107,6 +109,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 +251,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 +298,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 +332,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 +364,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

0 comments on commit 8b1d303

Please sign in to comment.