[Workplace Search] Send kibana_host when calling /reauth_prepare (#95529)
* WIP almost there? * Fix server route validation * fix account route * Fix test expectations Co-authored-by: scottybollinger <scotty.bollinger@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
28410539b5
commit
4c89da2b45
|
@ -458,7 +458,12 @@ describe('AddSourceLogic', () => {
|
|||
AddSourceLogic.actions.getSourceReConnectData('github');
|
||||
|
||||
expect(http.get).toHaveBeenCalledWith(
|
||||
'/api/workplace_search/org/sources/github/reauth_prepare'
|
||||
'/api/workplace_search/org/sources/github/reauth_prepare',
|
||||
{
|
||||
query: {
|
||||
kibana_host: '',
|
||||
},
|
||||
}
|
||||
);
|
||||
await nextTick();
|
||||
expect(setSourceConnectDataSpy).toHaveBeenCalledWith(sourceConnectData);
|
||||
|
@ -648,7 +653,12 @@ describe('AddSourceLogic', () => {
|
|||
AddSourceLogic.actions.getSourceReConnectData('123');
|
||||
|
||||
expect(http.get).toHaveBeenCalledWith(
|
||||
'/api/workplace_search/account/sources/123/reauth_prepare'
|
||||
'/api/workplace_search/account/sources/123/reauth_prepare',
|
||||
{
|
||||
query: {
|
||||
kibana_host: '',
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -418,8 +418,12 @@ export const AddSourceLogic = kea<MakeLogicType<AddSourceValues, AddSourceAction
|
|||
? `/api/workplace_search/org/sources/${sourceId}/reauth_prepare`
|
||||
: `/api/workplace_search/account/sources/${sourceId}/reauth_prepare`;
|
||||
|
||||
const query = {
|
||||
kibana_host: kibanaHost,
|
||||
} as HttpFetchQuery;
|
||||
|
||||
try {
|
||||
const response = await HttpLogic.values.http.get(route);
|
||||
const response = await HttpLogic.values.http.get(route, { query });
|
||||
actions.setSourceConnectData(response);
|
||||
} catch (e) {
|
||||
flashAPIErrors(e);
|
||||
|
|
|
@ -194,6 +194,9 @@ export function registerAccountSourceReauthPrepareRoute({
|
|||
params: schema.object({
|
||||
id: schema.string(),
|
||||
}),
|
||||
query: schema.object({
|
||||
kibana_host: schema.string(),
|
||||
}),
|
||||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
|
@ -539,6 +542,9 @@ export function registerOrgSourceReauthPrepareRoute({
|
|||
params: schema.object({
|
||||
id: schema.string(),
|
||||
}),
|
||||
query: schema.object({
|
||||
kibana_host: schema.string(),
|
||||
}),
|
||||
},
|
||||
},
|
||||
enterpriseSearchRequestHandler.createRequest({
|
||||
|
|
Loading…
Reference in a new issue