feat: replace credentialProviderName with outboundAuth for harness gateway tools#1083
feat: replace credentialProviderName with outboundAuth for harness gateway tools#1083
Conversation
…teway tools The CLI's harness schema for agentcore_gateway tools had a credentialProviderName field that didn't exist in the harness service model. The service expects an outboundAuth union with three members: awsIam (SigV4), none, and oauth (Bearer token via AgentCore Identity). - Replace credentialProviderName with outboundAuth union in harness schema (awsIam | none | oauth with providerArn, scopes, grantType, customParameters) - Add superRefine to reject legacy credentialProviderName with migration message - Add --outbound-auth, --provider-arn, --scopes, --grant-type flags to `agentcore add tool` command - Add outbound auth type selection to TUI harness wizard (3 new steps) - Update HarnessPrimitive to build outboundAuth config from options - Add schema tests for all outboundAuth variants and mapper round-trip tests
When --outbound-auth is set to awsIam or none, the CLI now rejects --provider-arn, --scopes, and --grant-type instead of silently ignoring them.
- CLI help: indicate awsIam is the default when --outbound-auth is omitted, add scope format examples to --scopes description - TUI: mark AWS IAM option as "(default)" in gateway auth selector
Coverage Report
|
|
Silent OAuth fallback in In The TUI path can produce this state today:
The CLI flag path ( A few options to fix:
Option 1 + 2 together is probably the safest — make the primitive strict about its invariants, and catch bad input earlier in the TUI for a better UX. |
|
Missing IAM permission for OAuth outbound auth in CDK-vended harness execution role This PR enables users to configure Looking at Since This is cross-repo so it doesn't necessarily need to land in this PR, but it should either:
Worth calling out explicitly in the PR description either way so the full fix isn't lost. |
tejaskash
left a comment
There was a problem hiding this comment.
Good PR -- fixes a real customer issue with a clean, well-tested approach. Three items to consider.
|
^ these can be follow up PRs |
Summary
credentialProviderNamefield on harness gateway tool config with the correctoutboundAuthunion to match the harness service model (Loopy)outboundAuthwith three variants:awsIam(SigV4),none, andoauth(Bearer token via AgentCore Identity)--outbound-auth,--provider-arn,--scopes,--grant-type) toagentcore add toolsuperRefineto reject legacycredentialProviderNamewith a helpful migration messageContext
A customer reported that configuring a harness gateway tool to authenticate to a CUSTOM_JWT gateway via OAuth always fell back to SigV4, resulting in 401s. Investigation revealed the CLI schema had
credentialProviderName(modeled after agent code gen) instead ofoutboundAuth(the actual service model). Seebugbash/harness-gateway-auth-analysis.mdfor the full analysis.Changes
src/schema/schemas/primitives/harness.tscredentialProviderNamewithoutboundAuthunion schema + superRefine migration messagesrc/schema/schemas/primitives/index.tssrc/schema/schemas/agentcore-project.tssrc/cli/commands/add/tool-command.ts--outbound-auth,--provider-arn,--scopes,--grant-typeflags with DX improvementssrc/cli/commands/add/tool-action.tssrc/cli/primitives/HarnessPrimitive.tssrc/cli/tui/screens/harness/types.tssrc/cli/tui/screens/harness/useAddHarnessWizard.tssrc/cli/tui/screens/harness/AddHarnessScreen.tsxsrc/cli/tui/screens/harness/AddHarnessFlow.tsxsrc/schema/schemas/primitives/__tests__/harness.test.tssrc/cli/operations/deploy/imperative/deployers/__tests__/harness-mapper.test.tsTest plan
agentcore validatesurfaces credentialProviderName migration message