chore: return safe copy of string slice in 'ParseStringSliceClaim' (#17439)

Claims parsed should be safe to mutate and filter. This was likely not
causing any bugs or issues, and just doing this out of precaution
This commit is contained in:
Steven Masley
2025-04-28 12:18:02 -05:00
committed by GitHub
parent 9167cbfe4c
commit 37c5e7c440
2 changed files with 14 additions and 1 deletions
+11
View File
@@ -136,6 +136,17 @@ func TestParseStringSliceClaim(t *testing.T) {
}
}
func TestParseStringSliceClaimReference(t *testing.T) {
t.Parallel()
var val any = []string{"a", "b", "c"}
parsed, err := idpsync.ParseStringSliceClaim(val)
require.NoError(t, err)
parsed[0] = ""
require.Equal(t, "a", val.([]string)[0], "should not modify original value")
}
func TestIsHTTPError(t *testing.T) {
t.Parallel()