-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enterprise Search] Update config data endpoint to v2 #76970
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ interface IReturn extends IInitialAppData { | |
* useful various settings (e.g. product access, external URL) | ||
* needed by the Kibana plugin at the setup stage | ||
*/ | ||
const ENDPOINT = '/api/ent/v1/internal/client_config'; | ||
const ENDPOINT = '/api/ent/v2/internal/client_config'; | ||
|
||
export const callEnterpriseSearchConfigAPI = async ({ | ||
config, | ||
|
@@ -67,44 +67,60 @@ export const callEnterpriseSearchConfigAPI = async ({ | |
publicUrl: stripTrailingSlash(data?.settings?.external_url), | ||
readOnlyMode: !!data?.settings?.read_only_mode, | ||
ilmEnabled: !!data?.settings?.ilm_enabled, | ||
isFederatedAuth: !!data?.settings?.is_federated_auth, // i.e., not standard auth | ||
configuredLimits: { | ||
maxDocumentByteSize: data?.settings?.configured_limits?.max_document_byte_size, | ||
maxEnginesPerMetaEngine: data?.settings?.configured_limits?.max_engines_per_meta_engine, | ||
appSearch: { | ||
engine: { | ||
maxDocumentByteSize: | ||
data?.settings?.configured_limits?.app_search?.engine?.document_size_in_bytes, | ||
maxEnginesPerMetaEngine: | ||
data?.settings?.configured_limits?.app_search?.engine?.source_engines_per_meta_engine, | ||
}, | ||
}, | ||
Comment on lines
+72
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
workplaceSearch: { | ||
customApiSource: { | ||
maxDocumentByteSize: | ||
data?.settings?.configured_limits?.workplace_search?.custom_api_source | ||
?.document_size_in_bytes, | ||
totalFields: | ||
data?.settings?.configured_limits?.workplace_search?.custom_api_source?.total_fields, | ||
}, | ||
}, | ||
Comment on lines
+80
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @scottybollinger Not sure if Workplace Search actually uses this configured limit data anywhere in the UI but I figured I might as well add it! |
||
}, | ||
appSearch: { | ||
accountId: data?.settings?.app_search?.account_id, | ||
onBoardingComplete: !!data?.settings?.app_search?.onboarding_complete, | ||
accountId: data?.current_user?.app_search?.account?.id, | ||
onBoardingComplete: !!data?.current_user?.app_search?.account?.onboarding_complete, | ||
role: { | ||
id: data?.current_user?.app_search_role?.id, | ||
roleType: data?.current_user?.app_search_role?.role_type, | ||
id: data?.current_user?.app_search?.role?.id, | ||
roleType: data?.current_user?.app_search?.role?.role_type, | ||
ability: { | ||
accessAllEngines: !!data?.current_user?.app_search_role?.ability?.access_all_engines, | ||
destroy: data?.current_user?.app_search_role?.ability?.destroy || [], | ||
manage: data?.current_user?.app_search_role?.ability?.manage || [], | ||
edit: data?.current_user?.app_search_role?.ability?.edit || [], | ||
view: data?.current_user?.app_search_role?.ability?.view || [], | ||
credentialTypes: data?.current_user?.app_search_role?.ability?.credential_types || [], | ||
accessAllEngines: !!data?.current_user?.app_search?.role?.ability?.access_all_engines, | ||
destroy: data?.current_user?.app_search?.role?.ability?.destroy || [], | ||
manage: data?.current_user?.app_search?.role?.ability?.manage || [], | ||
edit: data?.current_user?.app_search?.role?.ability?.edit || [], | ||
view: data?.current_user?.app_search?.role?.ability?.view || [], | ||
credentialTypes: data?.current_user?.app_search?.role?.ability?.credential_types || [], | ||
availableRoleTypes: | ||
data?.current_user?.app_search_role?.ability?.available_role_types || [], | ||
data?.current_user?.app_search?.role?.ability?.available_role_types || [], | ||
}, | ||
}, | ||
}, | ||
workplaceSearch: { | ||
canCreateInvitations: !!data?.settings?.workplace_search?.can_create_invitations, | ||
isFederatedAuth: !!data?.settings?.workplace_search?.is_federated_auth, | ||
organization: { | ||
name: data?.settings?.workplace_search?.organization?.name, | ||
defaultOrgName: data?.settings?.workplace_search?.organization?.default_org_name, | ||
name: data?.current_user?.workplace_search?.organization?.name, | ||
defaultOrgName: data?.current_user?.workplace_search?.organization?.default_org_name, | ||
}, | ||
fpAccount: { | ||
id: data?.settings?.workplace_search?.fp_account.id, | ||
groups: data?.settings?.workplace_search?.fp_account.groups || [], | ||
isAdmin: !!data?.settings?.workplace_search?.fp_account?.is_admin, | ||
canCreatePersonalSources: !!data?.settings?.workplace_search?.fp_account | ||
account: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @scottybollinger - FYI, Brian renamed That being said, this change only affects the initial data/config endpoint & doesn't preclude you from using |
||
id: data?.current_user?.workplace_search?.account?.id, | ||
groups: data?.current_user?.workplace_search?.account?.groups || [], | ||
isAdmin: !!data?.current_user?.workplace_search?.account?.is_admin, | ||
canCreatePersonalSources: !!data?.current_user?.workplace_search?.account | ||
?.can_create_personal_sources, | ||
isCurated: !!data?.settings?.workplace_search?.fp_account.is_curated, | ||
viewedOnboardingPage: !!data?.settings?.workplace_search?.fp_account | ||
.viewed_onboarding_page, | ||
canCreateInvitations: !!data?.current_user?.workplace_search?.account | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @scottybollinger FYI - |
||
?.can_create_invitations, | ||
isCurated: !!data?.current_user?.workplace_search?.account?.is_curated, | ||
viewedOnboardingPage: !!data?.current_user?.workplace_search?.account | ||
?.viewed_onboarding_page, | ||
}, | ||
}, | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brian moved this to a top-level setting, not just nested under a Workplace Search specific key - I agree with him in this case since it affects both AS & WS.
So just an FYI @scottybollinger that the location of
isFederatedAuth
has moved, if that's okay