feat: replace Redpanda Admin API with Kafka SCRAM API for user management#2325
feat: replace Redpanda Admin API with Kafka SCRAM API for user management#2325
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf CI / validate (pull_request).
|
e8672e8 to
f777361
Compare
graham-rp
left a comment
There was a problem hiding this comment.
I'd love to extract some of the duplication from v1 and v1alpha2, but LGTM
| return NewConnectErrorFromKafkaErrorCode(kafkaErr.Code, nil) | ||
| } | ||
| return NewConnectError( | ||
| connect.CodeInternal, |
There was a problem hiding this comment.
nit: Is there anything we'd expect that's not an internal error?
There was a problem hiding this comment.
Good call — the non-*kerr.Error path catches transport/connection-level failures (e.g. broker unreachable, timeouts) which aren't Kafka protocol errors. CodeInternal fits since these are infrastructure issues rather than client mistakes. Added a clarifying comment to the docstring.
| // Add pagination | ||
| sort.SliceStable(filteredUsers, func(i, j int) bool { | ||
| return filteredUsers[i].Name < filteredUsers[j].Name | ||
| slices.SortStableFunc(filteredUsers, func(a, b *v1.ListUsersResponse_User) int { |
There was a problem hiding this comment.
Wasn't this already sorted above?
There was a problem hiding this comment.
You're right — described.Sorted() already returns users sorted by name, and filtering preserves that order. Removed the redundant sort.
…ment Replace all Redpanda Admin API calls in the user service (v1, v1alpha2, and REST handlers) with Kafka SCRAM protocol operations (DescribeUserSCRAMCredentials / AlterUserSCRAMCredentials). This removes the dependency on the Redpanda Admin API for user management, making the user service work across Redpanda and non-Redpanda Kafka clusters. - Add DescribeUserSCRAMCredentials and AlterUserSCRAMs to console servicer - Add NewConnectErrorFromKafkaError helper for Kafka error translation - ListUsers now uses DescribeUserSCRAMCredentials and returns mechanism - CreateUser/UpdateUser use AlterUserSCRAMs with UpsertSCRAM - DeleteUser describes credentials first, then deletes all mechanisms - REST handlers no longer gate behind RedpandaClientProvider - Remove HasRedpandaAPI from user endpoint compatibility checks - Update proto annotations from API_REDPANDA_ADMIN to API_KAFKA - Add unit tests using kfake and update integration tests
f777361 to
8c2aa69
Compare
Summary
DescribeUserSCRAMCredentials/AlterUserSCRAMCredentialsKafka protocol operationsAPI_REDPANDA_ADMIN→API_KAFKAto reflect the new API dependencyTest plan
kfake(create, list, update, delete)