fix: address Greptile review on PR 42461

- CHANGELOG: narrowed the fix's scope to unified_access_group only.
  litellm_access_group (legacy) calls /access_group/new, a completely
  different, unrelated endpoint (model_access_group_management_endpoints.py)
  that already returns 200 -- it was never affected. I'd wrongly assumed
  both resources shared the same /v1/access_group route; they don't.
- resource_team_test.go: removed the preamble comment above the new test,
  which restated what the table test already shows -- against repository
  guidance (AGENTS.md) that reserves comments for complex logic, tool
  inputs, or TODOs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Louis Vauterin 2026-09-22 13:32:08 +02:00
parent 822f853366
commit b80f46fcb8
No known key found for this signature in database
GPG key ID: 6A1E9E70E2315679
2 changed files with 1 additions and 8 deletions

View file

@ -57,7 +57,7 @@ longer signal it.
- **key**: Updates no longer send an empty `budget_duration`, which the proxy rejects with a 400; any update to a key without a configured `budget_duration` previously failed outright
- **key**: A config-supplied `key` value (write-only) is now forwarded to `/key/generate`; previously it was silently dropped and the proxy generated a random key instead
- **security**: The `litellm_key` data source and `litellm_key_block` resource normalize raw `sk-` keys to their SHA-256 token hash before building request URLs and resource IDs, so plaintext keys no longer land in reverse-proxy access logs, Terraform plan output, or state IDs
- **access_group, unified_access_group**: create now accepts any 2xx response instead of requiring exactly HTTP 200; `POST /v1/access_group` (and its `/v1/unified_access_group` alias) legitimately returns 201, so `litellm_access_group` and `litellm_unified_access_group` create previously succeeded on the proxy but failed in the provider, leaving the group out of state and forcing a `terraform import` to recover on the next apply's 409. Same fix and shape as the one already applied to `mcp_server`/`model`/`key`/`organization_member`; `handleResponse` (shared by several other resources) was the one status-check helper that fix didn't reach
- **unified_access_group**: create now accepts any 2xx response instead of requiring exactly HTTP 200; `POST /v1/unified_access_group` legitimately returns 201, so creation previously succeeded on the proxy but failed in the provider, leaving the group out of state and forcing a `terraform import` to recover on the next apply's 409. Same fix and shape as the one already applied to `mcp_server`/`model`/`key`/`organization_member`; `handleResponse` (shared by several other resources) was the one status-check helper that fix didn't reach. The legacy `litellm_access_group` resource calls the unrelated `/access_group/new` endpoint, which already returns 200, so it was never affected
### Changed

View file

@ -435,13 +435,6 @@ func TestTeamLimitTypesSentOnCreateOnly(t *testing.T) {
}
}
// handleResponse is shared by several resources (team, access_group,
// unified_access_group, agent, budget, guardrail, organization, prompt,
// search_tool, tag, team_block, key_block, team_member(_add), user), but only
// access_group/unified_access_group's create actually hits a non-200 success
// status in practice: POST /v1/access_group (and its /v1/unified_access_group
// alias) answers 201, same shape as the mcp_server/model/key/organization_member
// bug already fixed for handleAPIResponse/handleMCPAPIResponse/sendRequest.
func TestHandleResponseAcceptsFullSuccessRange(t *testing.T) {
tests := []struct {
name string