feat: show Bedrock external ID in the provider edit form - #26919
Conversation
|
/coder-agents-review |
|
Chat: Review posted | View chat Review history
deep-review v0.9.0 | Round 1 | Last posted: Round 1, 4 findings (3 P3, 1 Note), COMMENT. Review Finding inventoryFindings
Contested and acknowledged(none) Round logRound 1Panel (16 reviewers). 2 P3, 1 Note new. 1 Nit dropped. Plus 1 P3 from Netero first pass. Reviewed against d2d0bce..a3b92b7. About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
Documentation CheckUpdates Needed
Automated review via Coder Agents |
There was a problem hiding this comment.
Clean, well-scoped change. The external ID is threaded as its own prop rather than as a form value, making the read-only contract structural. Tests cover all four relevant partitions. The existing CodeExample and Label components are reused correctly.
"I tried to build a case against framings 1 and 2 and could not." - Pariston
Severity summary: 3 P3, 1 Note.
docs/ai-coder/ai-gateway/providers.md:155
P3 [CRF-5] The "Assuming an IAM role" docs section never mentions the external ID the UI now surfaces.
"The docs walk operators through role assumption in three steps (create role, configure trust policy, enter the ARN). Step 2 says 'Configure the role's trust policy to allow the gateway's base identity to assume it' and stops there. The UI now shows an external ID with help text about adding it to the trust policy." (Leorio)
An operator following the docs to set up Bedrock role assumption gets no mention of the external ID or confused deputy prevention. The security hardening step is discoverable only through the edit form. Consider adding a step in the docs covering where to find the external ID and how to add the sts:ExternalId condition to the trust policy.
🤖
🤖 This review was automatically generated with Coder Agents.
| // The external ID is server-generated and returned on read when the Bedrock | ||
| // provider assumes a role. It is read-only: the form displays it but never | ||
| // submits it. |
There was a problem hiding this comment.
P3 [CRF-2] Comment restates what the generated type and the consuming component already document.
"The first sentence duplicates the JSDoc on
AIProviderBedrockSettings.external_idintypesGenerated.ts. The second sentence ('the form displays it but never submits it') describesProviderForm's behavior, not this function's." (Gon)
The comment documents consumer behavior ("the form displays it but never submits it"), creating a maintenance hazard: if the form changes, this comment silently misleads. Trim to the function's own contract:
// Server-generated STS external ID; read-only.🤖
| return undefined; | ||
| } | ||
| const s = provider.settings as SettingsWire | null; | ||
| return s?.external_id || undefined; |
There was a problem hiding this comment.
Note [CRF-4] External ID lifecycle outlives the role ARN it was generated from.
"The server preserves the external ID after role removal (
ensureBedrockExternalIDonly generates, never clears; the merge function carries it forward). The UI gate isediting && bedrockExternalId, with no check on whetherrole_arnis currently set." (Hisoka)
If an admin once set a role ARN, then cleared it, the external ID persists server-side. The UI renders "Add it to the assumed role's trust policy" next to an empty Role ARN field. Not a bug per se: the external ID is valid for future role configurations, and the text is forward-looking. Worth knowing.
🤖
…xternal ID review - Add EditBedrockWithExternalId Storybook story so the read-only external ID block on the Bedrock edit form has coverage (CRF-1). - Trim the bedrockExternalId comment to describe the function's own contract instead of restating the generated JSDoc and consumer behavior (CRF-2). Modified by Coder Agents on behalf of Jake Howell.
|
Addressed the actionable frontend review findings in d70b941:
Left as-is:
|
…-id-ui # Conflicts: # coderd/ai_providers_internal_test.go # coderd/ai_providers_test.go
|
@jakehwll thanks for the review and fixes! I'll add docs in a separate PR. |
Surfaces the server-generated STS external ID on the Bedrock provider edit form. When a provider assumes a role, the form shows the external ID read-only with a copy icon and a short note to add it to the target role's trust policy as an sts:ExternalId condition.
The value is display-only: it is passed to the form as its own prop rather than as an editable form value, so it is never submitted back. This matches the backend contract, where the external ID is server-owned and a changed value is rejected.
Builds on the backend in #26869. Follow-up to #26578.