registry/internal/api
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Radoslav Dimitrov dfaa8f3b82
auth/oidc: test slice-typed extra claims comparison (#1245)
## Summary
Follow-up to #1238 (closes #988). Adds direct unit-test coverage for the
`claimMatches` helper, which was the actual change in #1238.

`claimMatches` and `toAnySlice` are unexported, so the tests live in
`oidc_internal_test.go` (`package auth`) — same pattern as
`http_internal_test.go`. Cases covered:

- scalar/scalar match and mismatch
- scalar actual against array expected (both directions of overlap)
- array actual against scalar expected
- **array/array** — pre-#1238 this combination panicked with `comparing
uncomparable type []interface {}`
- `[]string` typed slice (exercises the typed-slice branch of
`toAnySlice`, which `[]any` skips)
- non-string scalars (int, bool)
- empty actual array

Test values use single letters (`x`, `y`, `p`, `q`) rather than role
labels — only the relationships matter, and short tokens keep `goconst`
quiet.

## Test plan
- [x] `go test ./internal/api/handlers/v0/auth/...` — all 13 subtests
pass
- [x] `golangci-lint run ./internal/api/handlers/v0/auth/...` — no new
issues vs main
2026-05-04 06:52:12 -04:00
..
handlers/v0 auth/oidc: test slice-typed extra claims comparison (#1245) 2026-05-04 06:52:12 -04:00
router security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
cors_test.go feat: add CORS support to registry API (#711) 2025-10-27 18:07:13 +00:00
openapi_compliance_test.go Ensure tests are failing CI (#840) 2025-12-11 09:56:57 +02:00
server.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
server_test.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00