Skip to content

Commit 3ef1d1f

Browse files
committed
feat: add OAuth credential type to add identity TUI wizard (#464)
* feat: add OAuth credential type to add identity TUI wizard * fix: add OIDC well-known suffix validation to identity TUI discovery URL * refactor: reuse identity screen for OAuth credential creation in gateway target flow * fix: correct deploy step ordering and credential count display * fix: allow identity creation without existing agents * fix: rename MCP gateway references to gateway in UI text * fix: add missing newline to identity types
1 parent 08a9fa0 commit 3ef1d1f

16 files changed

Lines changed: 559 additions & 378 deletions

src/cli/commands/add/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export function registerAdd(program: Command) {
265265
// Subcommand: add gateway
266266
addCmd
267267
.command('gateway')
268-
.description('Add an MCP gateway to the project')
268+
.description('Add a gateway to the project')
269269
.option('--name <name>', 'Gateway name')
270270
.option('--description <desc>', 'Gateway description')
271271
.option('--authorizer-type <type>', 'Authorizer type: NONE or CUSTOM_JWT', 'NONE')

src/cli/operations/identity/create-identity.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ export async function getAllCredentialNames(): Promise<string[]> {
108108
}
109109
}
110110

111+
/**
112+
* Get list of existing credentials with full type information from the project.
113+
*/
114+
export async function getAllCredentials(): Promise<Credential[]> {
115+
try {
116+
const configIO = new ConfigIO();
117+
const project = await configIO.readProjectSpec();
118+
return project.credentials;
119+
} catch {
120+
return [];
121+
}
122+
}
123+
111124
/**
112125
* Create a credential resource and add it to the project.
113126
* Writes the credential config to agentcore.json and secrets to .env.local.

src/cli/tui/components/CredentialSourcePrompt.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,18 @@ export function CredentialSourcePrompt({
137137
<Box flexDirection="column" gap={1}>
138138
<Text bold>Identity Provider Setup</Text>
139139
<Text dimColor>
140-
{missingCredentials.length} identity provider{missingCredentials.length > 1 ? 's' : ''} configured:
140+
{new Set(missingCredentials.map(c => c.providerName)).size} identity provider
141+
{new Set(missingCredentials.map(c => c.providerName)).size > 1 ? 's' : ''} configured:
141142
</Text>
142143
<Box flexDirection="column" marginLeft={2}>
143-
{missingCredentials.map(cred => (
144-
<Text key={cred.envVarName} dimColor>
145-
{cred.providerName}
144+
{[...new Set(missingCredentials.map(c => c.providerName))].map(name => (
145+
<Text key={name} dimColor>
146+
{name}
146147
</Text>
147148
))}
148149
</Box>
149150
<Box marginTop={1}>
150-
<Text dimColor>How would you like to provide the API keys?</Text>
151+
<Text dimColor>How would you like to provide the credentials?</Text>
151152
</Box>
152153
<Box marginTop={1}>
153154
<SelectList items={SOURCE_OPTIONS} selectedIndex={selectedIndex} />

0 commit comments

Comments
 (0)