Add a REST API to create an organization
What does this MR do and why?
This change introduces a new POST API for organization creation. The
functionality is controlled by a feature flag named
allow_organization_creation
. The change also modifies workhorse to
enable file uploads on the /api/v4/organizations
endpoint.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- Enable the feature flags in the rails console:
Feature.enable(:allow_organization_creation)
Feature.enable(:ui_for_organizations)
- Install the workhorse changes:
cd gitlab/workhorse
make install
- Create an API token on https://gdk.test:3000/-/user_settings/personal_access_tokens with read/write API permissions.
- Create an organization with avatar using the following curl command:
curl "https://gdk.test:3000/api/v4/organizations" \
--header "PRIVATE-TOKEN: $GITLAB_API_TOKEN" \
--form "name=My New Organization" \
--form "path=my-new-organization" \
--form "description=This is a great new organization" \
--form "avatar=@/path-to-avatar.png"
Related to #470613 (closed)
Edited by Abdul Wadood