Skip to content

Commit

Permalink
feat(client-kendra): Amazon Kendra now provides Oauth2 support for Sh…
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Jul 21, 2022
1 parent 3c22d7a commit de0697a
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 103 deletions.
30 changes: 14 additions & 16 deletions clients/client-kendra/src/Kendra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,16 @@ export class Kendra extends KendraClient {
* user and group access information for your documents. This is useful
* for user context filtering, where search results are filtered based
* on the user or their group access to documents.</p>
* <p>You can use this to re-configure your existing document level access
* control without indexing all of your documents again. For example, your
* index contains top-secret company documents that only certain employees
* or users should access. One of these users leaves the company or switches
* to a team that should be blocked from access to top-secret documents.
* Your documents in your index still give this user access to top-secret
* documents due to the user having access at the time your documents were
* indexed. You can create a specific access control configuration for this
* user with deny access. You can later update the access control
* configuration to allow access in the case the user returns to the company
* and re-joins the 'top-secret' team. You can re-configure access control
* for your documents circumstances change.</p>
* <p>You can use this to re-configure your existing document level access control without
* indexing all of your documents again. For example, your index contains top-secret
* company documents that only certain employees or users should access. One of these users
* leaves the company or switches to a team that should be blocked from accessing
* top-secret documents. The user still has access to top-secret documents because the user
* had access when your documents were previously indexed. You
* can create a specific access control configuration for the user with deny
* access. You can later update the access control configuration to allow access if the
* user returns to the company and re-joins the 'top-secret' team. You can re-configure
* access control for your documents as circumstances change.</p>
* <p>To apply your access control configuration to certain documents, you call
* the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html">BatchPutDocument</a>
* API with the <code>AccessControlConfigurationId</code> included in the
Expand Down Expand Up @@ -2176,12 +2174,12 @@ export class Kendra extends KendraClient {
* suddenly returns to their previous team and should no longer have access to top secret
* documents. You can update the access control configuration to re-configure access
* control for your documents as circumstances change.</p>
* <p>You call the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html">BatchPutDocument</a>
* API to apply the updated access control configuration, with the
* <code>AccessControlConfigurationId</code> included in the
* <p>You call the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html">BatchPutDocument</a> API to
* apply the updated access control configuration, with the
* <code>AccessControlConfigurationId</code> included in the
* <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Document.html">Document</a>
* object. If you use an S3 bucket as a data source, you synchronize your data source to
* apply the the <code>AccessControlConfigurationId</code> in the <code>.metadata.json</code> file.
* apply the <code>AccessControlConfigurationId</code> in the <code>.metadata.json</code> file.
* Amazon Kendra currently only supports access control configuration for S3 data
* sources and documents indexed using the <code>BatchPutDocument</code> API.</p>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,16 @@ export interface CreateAccessControlConfigurationCommandOutput
* user and group access information for your documents. This is useful
* for user context filtering, where search results are filtered based
* on the user or their group access to documents.</p>
* <p>You can use this to re-configure your existing document level access
* control without indexing all of your documents again. For example, your
* index contains top-secret company documents that only certain employees
* or users should access. One of these users leaves the company or switches
* to a team that should be blocked from access to top-secret documents.
* Your documents in your index still give this user access to top-secret
* documents due to the user having access at the time your documents were
* indexed. You can create a specific access control configuration for this
* user with deny access. You can later update the access control
* configuration to allow access in the case the user returns to the company
* and re-joins the 'top-secret' team. You can re-configure access control
* for your documents circumstances change.</p>
* <p>You can use this to re-configure your existing document level access control without
* indexing all of your documents again. For example, your index contains top-secret
* company documents that only certain employees or users should access. One of these users
* leaves the company or switches to a team that should be blocked from accessing
* top-secret documents. The user still has access to top-secret documents because the user
* had access when your documents were previously indexed. You
* can create a specific access control configuration for the user with deny
* access. You can later update the access control configuration to allow access if the
* user returns to the company and re-joins the 'top-secret' team. You can re-configure
* access control for your documents as circumstances change.</p>
* <p>To apply your access control configuration to certain documents, you call
* the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html">BatchPutDocument</a>
* API with the <code>AccessControlConfigurationId</code> included in the
Expand Down
3 changes: 1 addition & 2 deletions clients/client-kendra/src/commands/QueryCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import {
} from "@aws-sdk/types";

import { KendraClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KendraClient";
import { QueryResult } from "../models/models_0";
import { QueryRequest } from "../models/models_1";
import { QueryRequest, QueryResult } from "../models/models_1";
import { deserializeAws_json1_1QueryCommand, serializeAws_json1_1QueryCommand } from "../protocols/Aws_json1_1";

export interface QueryCommandInput extends QueryRequest {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ export interface UpdateAccessControlConfigurationCommandOutput
* suddenly returns to their previous team and should no longer have access to top secret
* documents. You can update the access control configuration to re-configure access
* control for your documents as circumstances change.</p>
* <p>You call the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html">BatchPutDocument</a>
* API to apply the updated access control configuration, with the
* <code>AccessControlConfigurationId</code> included in the
* <p>You call the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html">BatchPutDocument</a> API to
* apply the updated access control configuration, with the
* <code>AccessControlConfigurationId</code> included in the
* <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Document.html">Document</a>
* object. If you use an S3 bucket as a data source, you synchronize your data source to
* apply the the <code>AccessControlConfigurationId</code> in the <code>.metadata.json</code> file.
* apply the <code>AccessControlConfigurationId</code> in the <code>.metadata.json</code> file.
* Amazon Kendra currently only supports access control configuration for S3 data
* sources and documents indexed using the <code>BatchPutDocument</code> API.</p>
* @example
Expand Down
88 changes: 28 additions & 60 deletions clients/client-kendra/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4104,6 +4104,11 @@ export namespace ServiceNowConfiguration {
});
}

export enum SharePointOnlineAuthenticationType {
HTTP_BASIC = "HTTP_BASIC",
OAUTH2 = "OAUTH2",
}

export enum SharePointVersion {
SHAREPOINT_2013 = "SHAREPOINT_2013",
SHAREPOINT_2016 = "SHAREPOINT_2016",
Expand Down Expand Up @@ -4133,6 +4138,10 @@ export interface SharePointConfiguration {
* domain name as part of the credentials. For
* more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/data-source-sharepoint.html">Using a
* Microsoft SharePoint Data Source</a>.</p>
* <p>You can also provide OAuth authentication credentials of user name,
* password, client ID, and client secret. For more information, see
* <a href="https://docs.aws.amazon.com/kendra/latest/dg/data-source-sharepoint.html#sharepoint-authentication">Authentication
* for a SharePoint data source</a>.</p>
*/
SecretArn: string | undefined;

Expand Down Expand Up @@ -4207,6 +4216,14 @@ export interface SharePointConfiguration {
* this to connect to SharePoint.</p>
*/
SslCertificateS3Path?: S3Path;

/**
* <p>Whether you want to connect to SharePoint using basic authentication of
* user name and password, or OAuth authentication of user name, password,
* client ID, and client secret. You can use OAuth authentication for
* SharePoint Online.</p>
*/
AuthenticationType?: SharePointOnlineAuthenticationType | string;
}

export namespace SharePointConfiguration {
Expand Down Expand Up @@ -5906,7 +5923,8 @@ export interface DescribeAccessControlConfigurationRequest {
IndexId: string | undefined;

/**
* <p>The identifier of the access control configuration you want to get information on.</p>
* <p>The identifier of the access control configuration
* you want to get information on.</p>
*/
Id: string | undefined;
}
Expand Down Expand Up @@ -5945,8 +5963,8 @@ export interface DescribeAccessControlConfigurationResponse {
AccessControlList?: Principal[];

/**
* <p>The list of <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Principal.html">principal</a> lists that
* define the hierarchy for which documents users should have access to.</p>
* <p>The list of <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Principal.html">principal</a>
* lists that define the hierarchy for which documents users should have access to.</p>
*/
HierarchicalAccessControlList?: HierarchicalPrincipal[];
}
Expand Down Expand Up @@ -7654,10 +7672,10 @@ export interface ListAccessControlConfigurationsRequest {
IndexId: string | undefined;

/**
* <p>If the previous response was incomplete (because there is more data
* to retrieve), Amazon Kendra returns a pagination token in the response.
* You can use this pagination token to retrieve the next set of access
* control configurations.</p>
* <p>If the previous response was incomplete (because
* there's more data to retrieve), Amazon Kendra returns a pagination token
* in the response. You can use this pagination token to retrieve the next set
* of access control configurations.</p>
*/
NextToken?: string;

Expand All @@ -7678,9 +7696,9 @@ export namespace ListAccessControlConfigurationsRequest {

export interface ListAccessControlConfigurationsResponse {
/**
* <p>If the response is truncated, Amazon Kendra returns this token
* that you can use in the subsequent request to retrieve the next set of
* access control configurations.</p>
* <p>If the response is truncated, Amazon Kendra returns this
* token, which you can use in the subsequent request to retrieve the
* next set of access control configurations.</p>
*/
NextToken?: string;

Expand Down Expand Up @@ -10328,53 +10346,3 @@ export namespace AttributeFilter {
...obj,
});
}

export interface QueryResult {
/**
* <p>The unique identifier for the search. You use <code>QueryId</code>
* to identify the search when using the feedback API.</p>
*/
QueryId?: string;

/**
* <p>The results of the search.</p>
*/
ResultItems?: QueryResultItem[];

/**
* <p>Contains the facet results. A <code>FacetResult</code> contains the
* counts for each attribute key that was specified in the
* <code>Facets</code> input parameter.</p>
*/
FacetResults?: FacetResult[];

/**
* <p>The total number of items found by the search; however, you can only
* retrieve up to 100 items. For example, if the search found 192 items,
* you can only retrieve the first 100 of the items.</p>
*/
TotalNumberOfResults?: number;

/**
* <p>A list of warning codes and their messages on problems with your query.</p>
* <p>Amazon Kendra currently only supports one type of warning, which is a warning
* on invalid syntax used in the query. For examples of invalid query syntax,
* see <a href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax">Searching
* with advanced query syntax</a>.</p>
*/
Warnings?: Warning[];

/**
* <p>A list of information related to suggested spell corrections for a query.</p>
*/
SpellCorrectedQueries?: SpellCorrectedQuery[];
}

export namespace QueryResult {
/**
* @internal
*/
export const filterSensitiveLog = (obj: QueryResult): any => ({
...obj,
});
}
54 changes: 54 additions & 0 deletions clients/client-kendra/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,66 @@ import {
AttributeFilter,
DocumentRelevanceConfiguration,
Facet,
FacetResult,
QueryResultItem,
QueryResultType,
SortingConfiguration,
SpellCorrectedQuery,
SpellCorrectionConfiguration,
UserContext,
Warning,
} from "./models_0";

export interface QueryResult {
/**
* <p>The unique identifier for the search. You use <code>QueryId</code>
* to identify the search when using the feedback API.</p>
*/
QueryId?: string;

/**
* <p>The results of the search.</p>
*/
ResultItems?: QueryResultItem[];

/**
* <p>Contains the facet results. A <code>FacetResult</code> contains the
* counts for each attribute key that was specified in the
* <code>Facets</code> input parameter.</p>
*/
FacetResults?: FacetResult[];

/**
* <p>The total number of items found by the search; however, you can only
* retrieve up to 100 items. For example, if the search found 192 items,
* you can only retrieve the first 100 of the items.</p>
*/
TotalNumberOfResults?: number;

/**
* <p>A list of warning codes and their messages on problems with your query.</p>
* <p>Amazon Kendra currently only supports one type of warning, which is a warning
* on invalid syntax used in the query. For examples of invalid query syntax,
* see <a href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax">Searching
* with advanced query syntax</a>.</p>
*/
Warnings?: Warning[];

/**
* <p>A list of information related to suggested spell corrections for a query.</p>
*/
SpellCorrectedQueries?: SpellCorrectedQuery[];
}

export namespace QueryResult {
/**
* @internal
*/
export const filterSensitiveLog = (obj: QueryResult): any => ({
...obj,
});
}

export interface QueryRequest {
/**
* <p>The unique identifier of the index to search. The identifier is
Expand Down
5 changes: 3 additions & 2 deletions clients/client-kendra/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ import {
Principal,
ProxyConfiguration,
PutPrincipalMappingRequest,
QueryResult,
QueryResultItem,
QuerySuggestionsBlockListSummary,
QuipConfiguration,
Expand Down Expand Up @@ -420,7 +419,7 @@ import {
WebCrawlerConfiguration,
WorkDocsConfiguration,
} from "../models/models_0";
import { QueryRequest } from "../models/models_1";
import { QueryRequest, QueryResult } from "../models/models_1";

export const serializeAws_json1_1AssociateEntitiesToExperienceCommand = async (
input: AssociateEntitiesToExperienceCommandInput,
Expand Down Expand Up @@ -7290,6 +7289,7 @@ const serializeAws_json1_1ServiceNowServiceCatalogConfiguration = (

const serializeAws_json1_1SharePointConfiguration = (input: SharePointConfiguration, context: __SerdeContext): any => {
return {
...(input.AuthenticationType != null && { AuthenticationType: input.AuthenticationType }),
...(input.CrawlAttachments != null && { CrawlAttachments: input.CrawlAttachments }),
...(input.DisableLocalGroups != null && { DisableLocalGroups: input.DisableLocalGroups }),
...(input.DocumentTitleFieldName != null && { DocumentTitleFieldName: input.DocumentTitleFieldName }),
Expand Down Expand Up @@ -10761,6 +10761,7 @@ const deserializeAws_json1_1SharePointConfiguration = (
context: __SerdeContext
): SharePointConfiguration => {
return {
AuthenticationType: __expectString(output.AuthenticationType),
CrawlAttachments: __expectBoolean(output.CrawlAttachments),
DisableLocalGroups: __expectBoolean(output.DisableLocalGroups),
DocumentTitleFieldName: __expectString(output.DocumentTitleFieldName),
Expand Down

0 comments on commit de0697a

Please sign in to comment.