chore!: allow CreateUser to accept multiple organizations (#14383)

* chore: allow CreateUser to accept multiple organizations

In a multi-org deployment, it makes more sense to allow for multiple
org memberships to be assigned at create. The legacy param will still
be honored.

* Handle sdk deprecation better by maintaining cli functions
This commit is contained in:
Steven Masley
2024-08-23 16:23:51 -05:00
committed by GitHub
parent af125c3795
commit c8eacc6df7
28 changed files with 597 additions and 367 deletions

18
coderd/apidoc/docs.go generated
View File

@ -4875,7 +4875,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/codersdk.CreateUserRequest"
"$ref": "#/definitions/codersdk.CreateUserRequestWithOrgs"
}
}
],
@ -9449,17 +9449,13 @@ const docTemplate = `{
}
}
},
"codersdk.CreateUserRequest": {
"codersdk.CreateUserRequestWithOrgs": {
"type": "object",
"required": [
"email",
"username"
],
"properties": {
"disable_login": {
"description": "DisableLogin sets the user's login type to 'none'. This prevents the user\nfrom being able to use a password or any other authentication method to login.\nDeprecated: Set UserLoginType=LoginTypeDisabled instead.",
"type": "boolean"
},
"email": {
"type": "string",
"format": "email"
@ -9475,9 +9471,13 @@ const docTemplate = `{
"name": {
"type": "string"
},
"organization_id": {
"type": "string",
"format": "uuid"
"organization_ids": {
"description": "OrganizationIDs is a list of organization IDs that the user should be a member of.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"password": {
"type": "string"