Skip to content

Commit 3bf082c

Browse files
authored
feat(identity): add identity scaffolding and CRUDL operations for api key (#1811)
* feat(identity): add identity scaffolding and CRUDL operations for api key * fix: update identity test fixture to match new CoreClient signature * fix: update fixtures with write account plus README additions
1 parent ef5a9f5 commit 3bf082c

40 files changed

Lines changed: 745 additions & 5 deletions

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ agentcore # interactive TUI
4949
│ ├── list
5050
│ ├── update
5151
│ └── delete
52+
├── identity # manage AgentCore Identity resources
53+
│ └── api-key-credential-provider
54+
│ ├── create # create an API key credential provider
55+
│ ├── get # get an API key credential provider
56+
│ ├── list # list API key credential providers
57+
│ ├── update # update an API key credential provider
58+
│ └── delete # delete an API key credential provider
5259
├── runtime # inspect deployed AgentCore Runtimes
5360
│ ├── get # fetch a Runtime by id
5461
│ ├── list # list Runtimes (server-side paginated)
@@ -101,6 +108,13 @@ agentcore runtime version get --id <runtimeId> --version <version>
101108
agentcore runtime version list --id <runtimeId> --max-results 20
102109
agentcore runtime endpoint get --id <runtimeId> --qualifier DEFAULT
103110
agentcore runtime endpoint list --id <runtimeId> --max-results 20
111+
112+
# Manage API key credential providers
113+
agentcore identity api-key-credential-provider create --name my-provider --api-key <key>
114+
agentcore identity api-key-credential-provider get --name my-provider
115+
agentcore identity api-key-credential-provider list --max-results 10
116+
agentcore identity api-key-credential-provider update --name my-provider --api-key <new-key>
117+
agentcore identity api-key-credential-provider delete --name my-provider
104118
```
105119

106120
---

src/components/RouterScreen.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ describe("navigation", () => {
8787
const r = renderScreen("/agentcore");
8888
await waitForText(r.lastFrame, "❯ harness");
8989

90+
await r.press("down");
91+
await waitForText(r.lastFrame, "❯ identity");
92+
9093
await r.press("down");
9194
await waitForText(r.lastFrame, "❯ runtime");
9295
r.unmount();

src/core/identity.tsx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import {
2+
CreateApiKeyCredentialProviderCommand,
3+
DeleteApiKeyCredentialProviderCommand,
4+
GetApiKeyCredentialProviderCommand,
5+
ListApiKeyCredentialProvidersCommand,
6+
UpdateApiKeyCredentialProviderCommand,
7+
type CreateApiKeyCredentialProviderResponse,
8+
type DeleteApiKeyCredentialProviderResponse,
9+
type GetApiKeyCredentialProviderResponse,
10+
type ListApiKeyCredentialProvidersResponse,
11+
type UpdateApiKeyCredentialProviderResponse,
12+
} from "@aws-sdk/client-bedrock-agentcore-control";
13+
import type { CoreIdentityClient } from "../handlers/identity/types";
14+
import type { AwsClients, CoreOptions } from "./types";
15+
import { toClientConfig } from "./utils";
16+
17+
export class IdentityClient implements CoreIdentityClient {
18+
constructor(private readonly clients: AwsClients) {}
19+
20+
async createApiKeyCredentialProvider(
21+
name: string,
22+
apiKey: string,
23+
options: CoreOptions,
24+
): Promise<CreateApiKeyCredentialProviderResponse> {
25+
return this.clients
26+
.control(toClientConfig(options))
27+
.send(new CreateApiKeyCredentialProviderCommand({ name, apiKey }));
28+
}
29+
30+
async getApiKeyCredentialProvider(
31+
name: string,
32+
options: CoreOptions,
33+
): Promise<GetApiKeyCredentialProviderResponse> {
34+
return this.clients
35+
.control(toClientConfig(options))
36+
.send(new GetApiKeyCredentialProviderCommand({ name }));
37+
}
38+
39+
async listApiKeyCredentialProviders(
40+
nextToken: string | undefined,
41+
maxResults: number | undefined,
42+
options: CoreOptions,
43+
): Promise<ListApiKeyCredentialProvidersResponse> {
44+
return this.clients
45+
.control(toClientConfig(options))
46+
.send(new ListApiKeyCredentialProvidersCommand({ nextToken, maxResults }));
47+
}
48+
49+
async updateApiKeyCredentialProvider(
50+
name: string,
51+
apiKey: string,
52+
options: CoreOptions,
53+
): Promise<UpdateApiKeyCredentialProviderResponse> {
54+
return this.clients
55+
.control(toClientConfig(options))
56+
.send(new UpdateApiKeyCredentialProviderCommand({ name, apiKey }));
57+
}
58+
59+
async deleteApiKeyCredentialProvider(
60+
name: string,
61+
options: CoreOptions,
62+
): Promise<DeleteApiKeyCredentialProviderResponse> {
63+
return this.clients
64+
.control(toClientConfig(options))
65+
.send(new DeleteApiKeyCredentialProviderCommand({ name }));
66+
}
67+
}

src/core/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { BedrockAgentCoreControlClient } from "@aws-sdk/client-bedrock-agentcore
22
import { BedrockAgentCoreClient } from "@aws-sdk/client-bedrock-agentcore";
33
import { IAMClient } from "@aws-sdk/client-iam";
44
import { HarnessClient } from "./harness";
5+
import { IdentityClient } from "./identity";
56
import { RuntimeClient } from "./runtime";
67
import type {
78
AwsClients,
@@ -45,6 +46,7 @@ export class CoreClient implements AwsClients {
4546

4647
// Feature-scoped sub-clients. Access as e.g. `coreClient.harness.getHarness(...)`.
4748
readonly harness: HarnessClient = new HarnessClient(this);
49+
readonly identity: IdentityClient = new IdentityClient(this);
4850
readonly runtime: RuntimeClient = new RuntimeClient(this);
4951

5052
readonly projectManager: ProjectManager;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { CommandKey, type DefaultHandle } from "../../router";
2-
import type { AppIO } from "../types";
1+
import { CommandKey, type DefaultHandle } from "../router";
2+
import type { AppIO } from "./types";
33

44
export function createHelpDefault(io: AppIO): DefaultHandle {
55
return async (ctx) => {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"apiKeySecretArn": {
3+
"secretArn": "arn:aws:secretsmanager:us-west-2:685197708687:secret:bedrock-agentcore-identity!default/apikey/agentcore-cli-identity-fixture-2-29a3e5b6-qiRJxb"
4+
},
5+
"name": "agentcore-cli-identity-fixture-2",
6+
"credentialProviderArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:token-vault/default/apikeycredentialprovider/agentcore-cli-identity-fixture-2",
7+
"apiKeySecretSource": "MANAGED"
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"apiKeySecretArn": {
3+
"secretArn": "arn:aws:secretsmanager:us-west-2:685197708687:secret:bedrock-agentcore-identity!default/apikey/agentcore-cli-identity-fixture-34b3f8a9-cHh41n"
4+
},
5+
"name": "agentcore-cli-identity-fixture",
6+
"credentialProviderArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:token-vault/default/apikeycredentialprovider/agentcore-cli-identity-fixture",
7+
"apiKeySecretSource": "MANAGED"
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"apiKeySecretArn": {
3+
"secretArn": "arn:aws:secretsmanager:us-west-2:685197708687:secret:bedrock-agentcore-identity!default/apikey/agentcore-cli-identity-fixture-34b3f8a9-cHh41n"
4+
},
5+
"name": "agentcore-cli-identity-fixture",
6+
"credentialProviderArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:token-vault/default/apikeycredentialprovider/agentcore-cli-identity-fixture",
7+
"createdTime": {
8+
"$date": "2026-07-23T16:31:54.009Z"
9+
},
10+
"lastUpdatedTime": {
11+
"$date": "2026-07-23T16:31:54.009Z"
12+
},
13+
"apiKeySecretSource": "MANAGED"
14+
}

0 commit comments

Comments
 (0)