Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ export interface IAccesses {
* @default false
*/
sharingDomainEnabled?: boolean;

/**
* The name of the Search API SAML identity provider used to authenticate Search Page viewers.
*/
samlProvider?: string;
}

export interface ISortCriteria {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ describe('NextGenSearchPages', () => {
domains: ['domain1', 'domain2'],
sharingDomainEnabled: true,
sharingLinkEnabled: true,
samlProvider: 'oktaIntegratorDev',
},
layout: SearchPageLayout.List,
style: {
Expand Down
6 changes: 6 additions & 0 deletions src/resources/Search/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
RestQueryParams,
RestQueryResult,
RestTokenParams,
SearchApiSamlIdentityProvider,
SearchListFieldsParams,
SearchListFieldsResponse,
SearchResponse,
Expand All @@ -18,11 +19,16 @@ import {ListFieldValuesBodyQueryParams, PostSearchQuerySuggestBodyParams} from '

export default class Search extends Resource {
static baseUrl = `/rest/search/v2`;
static authenticationBaseUrl = `/rest/organizations/${API.orgPlaceholder}/authentication`;

createToken(tokenParams: RestTokenParams) {
return this.api.post<TokenModel>(`${Search.baseUrl}/token?organizationId=${API.orgPlaceholder}`, tokenParams);
}

listSamlIdentityProviders(): Promise<SearchApiSamlIdentityProvider[]> {
return this.api.get<SearchApiSamlIdentityProvider[]>(`${Search.authenticationBaseUrl}/saml`);
}

listFields(params?: SearchListFieldsParams) {
return this.api.get<SearchListFieldsResponse>(
this.buildPath(
Expand Down
11 changes: 11 additions & 0 deletions src/resources/Search/SearchInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2781,3 +2781,14 @@ export interface RestFacetSearchResponse {
*/
moreValuesAvailable: boolean;
}

export interface SearchApiSamlIdentityProvider {
/**
* Unique identifier of the SAML provider.
*/
id: string;
/**
* Unique name of the SAML proivder used to connect via the Search API.
*/
name: string;
}
Comment thread
mikegron marked this conversation as resolved.
9 changes: 9 additions & 0 deletions src/resources/Search/test/Search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,13 @@ describe('Search', () => {
Object.defineProperty(api, 'organizationId', {value: tempOrganizationId, writable: true});
});
});

describe('listSamlIdentityProviders', () => {
it('should make a GET call to the Search API SAML providers endpoint', async () => {
await search.listSamlIdentityProviders();

expect(api.get).toHaveBeenCalledTimes(1);
expect(api.get).toHaveBeenCalledWith('/rest/organizations/{organizationName}/authentication/saml');
});
});
});
Loading