Skip to content

Commit b1c43cf

Browse files
author
awstools
committed
feat(client-kendra): This release adds AccessControlConfigurations which allow you to redefine your document level access control without the need for content re-indexing.
1 parent 36bccb8 commit b1c43cf

25 files changed

+2713
-444
lines changed

clients/client-kendra/src/Kendra.ts

Lines changed: 249 additions & 11 deletions
Large diffs are not rendered by default.

clients/client-kendra/src/KendraClient.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ import {
7474
ClearQuerySuggestionsCommandInput,
7575
ClearQuerySuggestionsCommandOutput,
7676
} from "./commands/ClearQuerySuggestionsCommand";
77+
import {
78+
CreateAccessControlConfigurationCommandInput,
79+
CreateAccessControlConfigurationCommandOutput,
80+
} from "./commands/CreateAccessControlConfigurationCommand";
7781
import { CreateDataSourceCommandInput, CreateDataSourceCommandOutput } from "./commands/CreateDataSourceCommand";
7882
import { CreateExperienceCommandInput, CreateExperienceCommandOutput } from "./commands/CreateExperienceCommand";
7983
import { CreateFaqCommandInput, CreateFaqCommandOutput } from "./commands/CreateFaqCommand";
@@ -83,6 +87,10 @@ import {
8387
CreateQuerySuggestionsBlockListCommandOutput,
8488
} from "./commands/CreateQuerySuggestionsBlockListCommand";
8589
import { CreateThesaurusCommandInput, CreateThesaurusCommandOutput } from "./commands/CreateThesaurusCommand";
90+
import {
91+
DeleteAccessControlConfigurationCommandInput,
92+
DeleteAccessControlConfigurationCommandOutput,
93+
} from "./commands/DeleteAccessControlConfigurationCommand";
8694
import { DeleteDataSourceCommandInput, DeleteDataSourceCommandOutput } from "./commands/DeleteDataSourceCommand";
8795
import { DeleteExperienceCommandInput, DeleteExperienceCommandOutput } from "./commands/DeleteExperienceCommand";
8896
import { DeleteFaqCommandInput, DeleteFaqCommandOutput } from "./commands/DeleteFaqCommand";
@@ -96,6 +104,10 @@ import {
96104
DeleteQuerySuggestionsBlockListCommandOutput,
97105
} from "./commands/DeleteQuerySuggestionsBlockListCommand";
98106
import { DeleteThesaurusCommandInput, DeleteThesaurusCommandOutput } from "./commands/DeleteThesaurusCommand";
107+
import {
108+
DescribeAccessControlConfigurationCommandInput,
109+
DescribeAccessControlConfigurationCommandOutput,
110+
} from "./commands/DescribeAccessControlConfigurationCommand";
99111
import { DescribeDataSourceCommandInput, DescribeDataSourceCommandOutput } from "./commands/DescribeDataSourceCommand";
100112
import { DescribeExperienceCommandInput, DescribeExperienceCommandOutput } from "./commands/DescribeExperienceCommand";
101113
import { DescribeFaqCommandInput, DescribeFaqCommandOutput } from "./commands/DescribeFaqCommand";
@@ -126,6 +138,10 @@ import {
126138
GetQuerySuggestionsCommandOutput,
127139
} from "./commands/GetQuerySuggestionsCommand";
128140
import { GetSnapshotsCommandInput, GetSnapshotsCommandOutput } from "./commands/GetSnapshotsCommand";
141+
import {
142+
ListAccessControlConfigurationsCommandInput,
143+
ListAccessControlConfigurationsCommandOutput,
144+
} from "./commands/ListAccessControlConfigurationsCommand";
129145
import { ListDataSourcesCommandInput, ListDataSourcesCommandOutput } from "./commands/ListDataSourcesCommand";
130146
import {
131147
ListDataSourceSyncJobsCommandInput,
@@ -168,6 +184,10 @@ import {
168184
import { SubmitFeedbackCommandInput, SubmitFeedbackCommandOutput } from "./commands/SubmitFeedbackCommand";
169185
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
170186
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
187+
import {
188+
UpdateAccessControlConfigurationCommandInput,
189+
UpdateAccessControlConfigurationCommandOutput,
190+
} from "./commands/UpdateAccessControlConfigurationCommand";
171191
import { UpdateDataSourceCommandInput, UpdateDataSourceCommandOutput } from "./commands/UpdateDataSourceCommand";
172192
import { UpdateExperienceCommandInput, UpdateExperienceCommandOutput } from "./commands/UpdateExperienceCommand";
173193
import { UpdateIndexCommandInput, UpdateIndexCommandOutput } from "./commands/UpdateIndexCommand";
@@ -189,19 +209,22 @@ export type ServiceInputTypes =
189209
| BatchGetDocumentStatusCommandInput
190210
| BatchPutDocumentCommandInput
191211
| ClearQuerySuggestionsCommandInput
212+
| CreateAccessControlConfigurationCommandInput
192213
| CreateDataSourceCommandInput
193214
| CreateExperienceCommandInput
194215
| CreateFaqCommandInput
195216
| CreateIndexCommandInput
196217
| CreateQuerySuggestionsBlockListCommandInput
197218
| CreateThesaurusCommandInput
219+
| DeleteAccessControlConfigurationCommandInput
198220
| DeleteDataSourceCommandInput
199221
| DeleteExperienceCommandInput
200222
| DeleteFaqCommandInput
201223
| DeleteIndexCommandInput
202224
| DeletePrincipalMappingCommandInput
203225
| DeleteQuerySuggestionsBlockListCommandInput
204226
| DeleteThesaurusCommandInput
227+
| DescribeAccessControlConfigurationCommandInput
205228
| DescribeDataSourceCommandInput
206229
| DescribeExperienceCommandInput
207230
| DescribeFaqCommandInput
@@ -214,6 +237,7 @@ export type ServiceInputTypes =
214237
| DisassociatePersonasFromEntitiesCommandInput
215238
| GetQuerySuggestionsCommandInput
216239
| GetSnapshotsCommandInput
240+
| ListAccessControlConfigurationsCommandInput
217241
| ListDataSourceSyncJobsCommandInput
218242
| ListDataSourcesCommandInput
219243
| ListEntityPersonasCommandInput
@@ -232,6 +256,7 @@ export type ServiceInputTypes =
232256
| SubmitFeedbackCommandInput
233257
| TagResourceCommandInput
234258
| UntagResourceCommandInput
259+
| UpdateAccessControlConfigurationCommandInput
235260
| UpdateDataSourceCommandInput
236261
| UpdateExperienceCommandInput
237262
| UpdateIndexCommandInput
@@ -246,19 +271,22 @@ export type ServiceOutputTypes =
246271
| BatchGetDocumentStatusCommandOutput
247272
| BatchPutDocumentCommandOutput
248273
| ClearQuerySuggestionsCommandOutput
274+
| CreateAccessControlConfigurationCommandOutput
249275
| CreateDataSourceCommandOutput
250276
| CreateExperienceCommandOutput
251277
| CreateFaqCommandOutput
252278
| CreateIndexCommandOutput
253279
| CreateQuerySuggestionsBlockListCommandOutput
254280
| CreateThesaurusCommandOutput
281+
| DeleteAccessControlConfigurationCommandOutput
255282
| DeleteDataSourceCommandOutput
256283
| DeleteExperienceCommandOutput
257284
| DeleteFaqCommandOutput
258285
| DeleteIndexCommandOutput
259286
| DeletePrincipalMappingCommandOutput
260287
| DeleteQuerySuggestionsBlockListCommandOutput
261288
| DeleteThesaurusCommandOutput
289+
| DescribeAccessControlConfigurationCommandOutput
262290
| DescribeDataSourceCommandOutput
263291
| DescribeExperienceCommandOutput
264292
| DescribeFaqCommandOutput
@@ -271,6 +299,7 @@ export type ServiceOutputTypes =
271299
| DisassociatePersonasFromEntitiesCommandOutput
272300
| GetQuerySuggestionsCommandOutput
273301
| GetSnapshotsCommandOutput
302+
| ListAccessControlConfigurationsCommandOutput
274303
| ListDataSourceSyncJobsCommandOutput
275304
| ListDataSourcesCommandOutput
276305
| ListEntityPersonasCommandOutput
@@ -289,6 +318,7 @@ export type ServiceOutputTypes =
289318
| SubmitFeedbackCommandOutput
290319
| TagResourceCommandOutput
291320
| UntagResourceCommandOutput
321+
| UpdateAccessControlConfigurationCommandOutput
292322
| UpdateDataSourceCommandOutput
293323
| UpdateExperienceCommandOutput
294324
| UpdateIndexCommandOutput
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { KendraClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KendraClient";
16+
import { CreateAccessControlConfigurationRequest, CreateAccessControlConfigurationResponse } from "../models/models_0";
17+
import {
18+
deserializeAws_json1_1CreateAccessControlConfigurationCommand,
19+
serializeAws_json1_1CreateAccessControlConfigurationCommand,
20+
} from "../protocols/Aws_json1_1";
21+
22+
export interface CreateAccessControlConfigurationCommandInput extends CreateAccessControlConfigurationRequest {}
23+
export interface CreateAccessControlConfigurationCommandOutput
24+
extends CreateAccessControlConfigurationResponse,
25+
__MetadataBearer {}
26+
27+
/**
28+
* <p>Creates an access configuration for your documents. This includes
29+
* user and group access information for your documents. This is useful
30+
* for user context filtering, where search results are filtered based
31+
* on the user or their group access to documents.</p>
32+
* <p>You can use this to re-configure your existing document level access
33+
* control without indexing all of your documents again. For example, your
34+
* index contains top-secret company documents that only certain employees
35+
* or users should access. One of these users leaves the company or switches
36+
* to a team that should be blocked from access to top-secret documents.
37+
* Your documents in your index still give this user access to top-secret
38+
* documents due to the user having access at the time your documents were
39+
* indexed. You can create a specific access control configuration for this
40+
* user with deny access. You can later update the access control
41+
* configuration to allow access in the case the user returns to the company
42+
* and re-joins the 'top-secret' team. You can re-configure access control
43+
* for your documents circumstances change.</p>
44+
* <p>To apply your access control configuration to certain documents, you call
45+
* the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html">BatchPutDocument</a>
46+
* API with the <code>AccessControlConfigurationId</code> included in the
47+
* <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Document.html">Document</a>
48+
* object. If you use an S3 bucket as a data source, you update the
49+
* <code>.metadata.json</code> with the <code>AccessControlConfigurationId</code>
50+
* and synchronize your data source. Amazon Kendra currently only supports
51+
* access control configuration for S3 data sources and documents indexed using the
52+
* <code>BatchPutDocument</code> API.</p>
53+
* @example
54+
* Use a bare-bones client and the command you need to make an API call.
55+
* ```javascript
56+
* import { KendraClient, CreateAccessControlConfigurationCommand } from "@aws-sdk/client-kendra"; // ES Modules import
57+
* // const { KendraClient, CreateAccessControlConfigurationCommand } = require("@aws-sdk/client-kendra"); // CommonJS import
58+
* const client = new KendraClient(config);
59+
* const command = new CreateAccessControlConfigurationCommand(input);
60+
* const response = await client.send(command);
61+
* ```
62+
*
63+
* @see {@link CreateAccessControlConfigurationCommandInput} for command's `input` shape.
64+
* @see {@link CreateAccessControlConfigurationCommandOutput} for command's `response` shape.
65+
* @see {@link KendraClientResolvedConfig | config} for KendraClient's `config` shape.
66+
*
67+
*/
68+
export class CreateAccessControlConfigurationCommand extends $Command<
69+
CreateAccessControlConfigurationCommandInput,
70+
CreateAccessControlConfigurationCommandOutput,
71+
KendraClientResolvedConfig
72+
> {
73+
// Start section: command_properties
74+
// End section: command_properties
75+
76+
constructor(readonly input: CreateAccessControlConfigurationCommandInput) {
77+
// Start section: command_constructor
78+
super();
79+
// End section: command_constructor
80+
}
81+
82+
/**
83+
* @internal
84+
*/
85+
resolveMiddleware(
86+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
87+
configuration: KendraClientResolvedConfig,
88+
options?: __HttpHandlerOptions
89+
): Handler<CreateAccessControlConfigurationCommandInput, CreateAccessControlConfigurationCommandOutput> {
90+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
91+
92+
const stack = clientStack.concat(this.middlewareStack);
93+
94+
const { logger } = configuration;
95+
const clientName = "KendraClient";
96+
const commandName = "CreateAccessControlConfigurationCommand";
97+
const handlerExecutionContext: HandlerExecutionContext = {
98+
logger,
99+
clientName,
100+
commandName,
101+
inputFilterSensitiveLog: CreateAccessControlConfigurationRequest.filterSensitiveLog,
102+
outputFilterSensitiveLog: CreateAccessControlConfigurationResponse.filterSensitiveLog,
103+
};
104+
const { requestHandler } = configuration;
105+
return stack.resolve(
106+
(request: FinalizeHandlerArguments<any>) =>
107+
requestHandler.handle(request.request as __HttpRequest, options || {}),
108+
handlerExecutionContext
109+
);
110+
}
111+
112+
private serialize(
113+
input: CreateAccessControlConfigurationCommandInput,
114+
context: __SerdeContext
115+
): Promise<__HttpRequest> {
116+
return serializeAws_json1_1CreateAccessControlConfigurationCommand(input, context);
117+
}
118+
119+
private deserialize(
120+
output: __HttpResponse,
121+
context: __SerdeContext
122+
): Promise<CreateAccessControlConfigurationCommandOutput> {
123+
return deserializeAws_json1_1CreateAccessControlConfigurationCommand(output, context);
124+
}
125+
126+
// Start section: command_body_extra
127+
// End section: command_body_extra
128+
}

clients/client-kendra/src/commands/CreateFaqCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface CreateFaqCommandOutput extends CreateFaqResponse, __MetadataBea
2323
* <p>Creates an new set of frequently asked question (FAQ) questions and answers.</p>
2424
* <p>Adding FAQs to an index is an asynchronous operation.</p>
2525
* <p>For an example of adding an FAQ to an index using Python and Java SDKs,
26-
* see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html#using-faq-file">Using you
26+
* see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html#using-faq-file">Using your
2727
* FAQ file</a>.</p>
2828
* @example
2929
* Use a bare-bones client and the command you need to make an API call.

clients/client-kendra/src/commands/CreateIndexCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface CreateIndexCommandInput extends CreateIndexRequest {}
2323
export interface CreateIndexCommandOutput extends CreateIndexResponse, __MetadataBearer {}
2424

2525
/**
26-
* <p>Creates a new Amazon Kendra index. Index creation is an asynchronous
26+
* <p>Creates an Amazon Kendra index. Index creation is an asynchronous
2727
* API. To determine if index creation has completed, check the
2828
* <code>Status</code> field returned from a call to
2929
* <code>DescribeIndex</code>. The <code>Status</code> field is set to
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { KendraClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KendraClient";
16+
import { DeleteAccessControlConfigurationRequest, DeleteAccessControlConfigurationResponse } from "../models/models_0";
17+
import {
18+
deserializeAws_json1_1DeleteAccessControlConfigurationCommand,
19+
serializeAws_json1_1DeleteAccessControlConfigurationCommand,
20+
} from "../protocols/Aws_json1_1";
21+
22+
export interface DeleteAccessControlConfigurationCommandInput extends DeleteAccessControlConfigurationRequest {}
23+
export interface DeleteAccessControlConfigurationCommandOutput
24+
extends DeleteAccessControlConfigurationResponse,
25+
__MetadataBearer {}
26+
27+
/**
28+
* <p>Deletes an access control configuration that you created for your
29+
* documents in an index. This includes user and group access information
30+
* for your documents. This is useful for user context filtering, where search
31+
* results are filtered based on the user or their group access to documents.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { KendraClient, DeleteAccessControlConfigurationCommand } from "@aws-sdk/client-kendra"; // ES Modules import
36+
* // const { KendraClient, DeleteAccessControlConfigurationCommand } = require("@aws-sdk/client-kendra"); // CommonJS import
37+
* const client = new KendraClient(config);
38+
* const command = new DeleteAccessControlConfigurationCommand(input);
39+
* const response = await client.send(command);
40+
* ```
41+
*
42+
* @see {@link DeleteAccessControlConfigurationCommandInput} for command's `input` shape.
43+
* @see {@link DeleteAccessControlConfigurationCommandOutput} for command's `response` shape.
44+
* @see {@link KendraClientResolvedConfig | config} for KendraClient's `config` shape.
45+
*
46+
*/
47+
export class DeleteAccessControlConfigurationCommand extends $Command<
48+
DeleteAccessControlConfigurationCommandInput,
49+
DeleteAccessControlConfigurationCommandOutput,
50+
KendraClientResolvedConfig
51+
> {
52+
// Start section: command_properties
53+
// End section: command_properties
54+
55+
constructor(readonly input: DeleteAccessControlConfigurationCommandInput) {
56+
// Start section: command_constructor
57+
super();
58+
// End section: command_constructor
59+
}
60+
61+
/**
62+
* @internal
63+
*/
64+
resolveMiddleware(
65+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
66+
configuration: KendraClientResolvedConfig,
67+
options?: __HttpHandlerOptions
68+
): Handler<DeleteAccessControlConfigurationCommandInput, DeleteAccessControlConfigurationCommandOutput> {
69+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
70+
71+
const stack = clientStack.concat(this.middlewareStack);
72+
73+
const { logger } = configuration;
74+
const clientName = "KendraClient";
75+
const commandName = "DeleteAccessControlConfigurationCommand";
76+
const handlerExecutionContext: HandlerExecutionContext = {
77+
logger,
78+
clientName,
79+
commandName,
80+
inputFilterSensitiveLog: DeleteAccessControlConfigurationRequest.filterSensitiveLog,
81+
outputFilterSensitiveLog: DeleteAccessControlConfigurationResponse.filterSensitiveLog,
82+
};
83+
const { requestHandler } = configuration;
84+
return stack.resolve(
85+
(request: FinalizeHandlerArguments<any>) =>
86+
requestHandler.handle(request.request as __HttpRequest, options || {}),
87+
handlerExecutionContext
88+
);
89+
}
90+
91+
private serialize(
92+
input: DeleteAccessControlConfigurationCommandInput,
93+
context: __SerdeContext
94+
): Promise<__HttpRequest> {
95+
return serializeAws_json1_1DeleteAccessControlConfigurationCommand(input, context);
96+
}
97+
98+
private deserialize(
99+
output: __HttpResponse,
100+
context: __SerdeContext
101+
): Promise<DeleteAccessControlConfigurationCommandOutput> {
102+
return deserializeAws_json1_1DeleteAccessControlConfigurationCommand(output, context);
103+
}
104+
105+
// Start section: command_body_extra
106+
// End section: command_body_extra
107+
}

0 commit comments

Comments
 (0)