Repository navigation
Conversation
Update stored the request's scopes as a Go string slice inside the unstructured object. SetNestedMap deep-copies what it is given and the deep copy only accepts JSON-shaped values, so it panicked and every update that carried scopes answered an empty 500. Scopes are now converted to the interface slice form on both create and update, and tests pin the conversion and the panic it avoids. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APpgCYzvB1vEntdFm3py2n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PUT /admin/identity-providers/{name}answered an empty 500 whenever the body carriedscopes. The handler stored the request's[]stringinside the unstructured object andunstructured.SetNestedMapdeep-copies its argument withruntime.DeepCopyJSONValue, which panics on a Go string slice.[]interface{}on create and updateSetNestedMapand reads back; a raw[]stringstill panics (so the helper is provably needed); empty inputReproduced live on butler-beta: an update with the provider's own current scopes returned 500; the same update without
scopesreturned 200 with an identical spec. Found while staging the Portal identity provider edit slice (butler-portal #79).Not for merge as part of the parity train; staged for maintainer review.
Test plan
go build ./...go test ./internal/api/handlers/ -run 'Scopes|SetNestedMap|ToUnstructured'PUTan identity provider withscopesset and confirm 200 and the scopes on the object🤖 Generated with Claude Code
https://claude.ai/code/session_01APpgCYzvB1vEntdFm3py2n