Skip to content

Dataplane Roles API#1750

Merged
bojand merged 14 commits into
masterfrom
bd/dataplane_api_roles
May 6, 2025
Merged

Dataplane Roles API#1750
bojand merged 14 commits into
masterfrom
bd/dataplane_api_roles

Conversation

@bojand
Copy link
Copy Markdown
Contributor

@bojand bojand commented May 1, 2025

Add definition for the Roles Dataplane API.
The existing Console Roles API wraps the new Dataplane API, consistent with other similar APIs.
Hook up unimplemented API.
Few drive-by fixes.

Might need some help fixing frontend.
I assume the existing UX functionality is covered by frontend tests.

Comment thread backend/pkg/api/routes.go
dataplanev1alpha2connect.RegisterUserServiceHandlerGatewayServer(gwMux, userSvcV1alpha2, connectgateway.WithInterceptors(hookOutput.Interceptors...))
dataplanev1alpha2connect.RegisterTransformServiceHandlerGatewayServer(gwMux, transformSvcV1alpha2, connectgateway.WithInterceptors(hookOutput.Interceptors...))
dataplanev1alpha2connect.RegisterKafkaConnectServiceHandlerGatewayServer(gwMux, kafkaConnectSvcV1alpha2, connectgateway.WithInterceptors(hookOutput.Interceptors...))
dataplanev1alpha2connect.RegisterCloudStorageServiceHandlerGatewayServer(gwMux, cloudStorageSvcV1Alpha2, connectgateway.WithInterceptors(hookOutput.Interceptors...))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a bug and omission where never registered cloud storage API with gateway mux?

rpc ListRoleMembers(ListRoleMembersRequest) returns (ListRoleMembersResponse) {
option (redpanda.api.auth.v1.authorization) = {
required_permission: PERMISSION_ADMIN
required_permission: PERMISSION_VIEW
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should ListRoles, GetRole, and ListRoleMembers be available for viewer permissions?

required_permission: PERMISSION_VIEW
api: API_REDPANDA_ADMIN
};
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should ListRoles, GetRole, and ListRoleMembers be available for viewer permissions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be admin as well I think. We did this change as well with ListTransforms to make this a call that requires admin permissions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed all permissions to be PERMISSION_ADMIN

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / push-module (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 5, 2025, 1:49 PM


// Page size.
int32 page_size = 2 [(buf.validate.field).int32 = {
gte: -1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not greater or equal to 1? Do we not paginate for -1 page size?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where we support it, this seems to be pattern to indicate retrieval of all items, and no pagination is needed. It's less ambiguous than 0.

Comment thread proto/redpanda/api/dataplane/v1/security.proto

if (Features.rolesApi) {
await client.deleteRole({ roleName: name, deleteAcls });
await client.deleteRole({ request: { roleName: name, deleteAcls } });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these changes we already merged protobuf V2 into main branch so it might require some small syntax updates. If you need help with it, let me know, we need to rebase this PR

@@ -0,0 +1,85 @@
// @generated by protoc-gen-connect-es v1.2.0 with parameter "target=ts,import_extension="
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These protos may need regenerating after rebasing so that we use new connect-es/protobuf-es version

Comment thread taskfiles/proto.yaml Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 All looks good here

@bojand bojand merged commit ac48eba into master May 6, 2025
11 checks passed
@bojand bojand deleted the bd/dataplane_api_roles branch May 6, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants