-
Notifications
You must be signed in to change notification settings - Fork 35
feat: add admin API to create organizations #962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Pull Request Test Coverage Report for Build 14611456311Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds an admin API endpoint enabling platform administrators to create organizations and register organization owners automatically. Key changes include:
- Adding a new gRPC method (AdminCreateOrganization) and corresponding HTTP gateway handlers.
- Extending the organization service with an AdminCreate method and updating related mock implementations.
- Enhancing authorization and error handling for admin organization creation.
Reviewed Changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
proto/v1beta1/admin_grpc.pb.go | Added AdminCreateOrganization method and related server/client logic. |
proto/v1beta1/admin.pb.gw.go | Implemented HTTP gateway handlers for the new admin creation endpoint. |
pkg/server/interceptors/authorization.go | Added authorization for the new admin endpoint. |
internal/api/v1beta1/org.go | Introduced AdminCreateOrganization API handler with error handling. |
internal/api/v1beta1/mocks/organization_service.go | Added mocks for the AdminCreate method. |
core/user/service.go | Exposed IsValidEmail function as public. |
core/organization/service.go | Added AdminCreate method with user creation and org ownership assignment. |
core/organization/mocks/user_service.go | Extended user service mocks to support Create and GetByEmail. |
Files not reviewed (2)
- Makefile: Language not supported
- proto/apidocs.swagger.yaml: Language not supported
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add Admin Organization Creation API
Summary
Changes
This PR introduces the ability for platform administrators to create organizations and designate ownership without requiring the owner to be an existing authenticated user. Key changes include:
Added
AdminCreate
method in the organization service that:Added unit tests for the new functionality
Updated authorization interceptors to secure the admin endpoint
Enhanced error handling for various edge cases
Example Usage
Response:
Testing
Related Issues
raystack/proton#404