chore: implement api for creating custom roles (#13298)

api endpoint (gated by experiment) to create custom_roles
This commit is contained in:
Steven Masley
2024-05-16 13:47:47 -05:00
committed by GitHub
parent 85de0e966d
commit ad8c314130
33 changed files with 1009 additions and 132 deletions

87
coderd/apidoc/docs.go generated
View File

@ -4286,6 +4286,32 @@ const docTemplate = `{
}
}
}
},
"patch": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Members"
],
"summary": "Upsert a custom site-wide role",
"operationId": "upsert-a-custom-site-wide-role",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Role"
}
}
}
}
}
},
"/users/{user}": {
@ -9547,17 +9573,20 @@ const docTemplate = `{
"enum": [
"example",
"auto-fill-parameters",
"multi-organization"
"multi-organization",
"custom-roles"
],
"x-enum-comments": {
"ExperimentAutoFillParameters": "This should not be taken out of experiments until we have redesigned the feature.",
"ExperimentCustomRoles": "Allows creating runtime custom roles",
"ExperimentExample": "This isn't used for anything.",
"ExperimentMultiOrganization": "Requires organization context for interactions, default org is assumed."
},
"x-enum-varnames": [
"ExperimentExample",
"ExperimentAutoFillParameters",
"ExperimentMultiOrganization"
"ExperimentMultiOrganization",
"ExperimentCustomRoles"
]
},
"codersdk.ExternalAuth": {
@ -10372,7 +10401,7 @@ const docTemplate = `{
"roles": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Role"
"$ref": "#/definitions/codersdk.SlimRole"
}
},
"updated_at": {
@ -10452,6 +10481,21 @@ const docTemplate = `{
}
}
},
"codersdk.Permission": {
"type": "object",
"properties": {
"action": {
"$ref": "#/definitions/codersdk.RBACAction"
},
"negate": {
"description": "Negate makes this a negative permission",
"type": "boolean"
},
"resource_type": {
"$ref": "#/definitions/codersdk.RBACResource"
}
}
},
"codersdk.PostOAuth2ProviderAppRequest": {
"type": "object",
"required": [
@ -11094,6 +11138,28 @@ const docTemplate = `{
},
"name": {
"type": "string"
},
"organization_permissions": {
"description": "map[\u003corg_id\u003e] -\u003e Permissions",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Permission"
}
}
},
"site_permissions": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Permission"
}
},
"user_permissions": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Permission"
}
}
}
},
@ -11160,6 +11226,17 @@ const docTemplate = `{
}
}
},
"codersdk.SlimRole": {
"type": "object",
"properties": {
"display_name": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"codersdk.SupportConfig": {
"type": "object",
"properties": {
@ -11677,7 +11754,7 @@ const docTemplate = `{
"roles": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Role"
"$ref": "#/definitions/codersdk.SlimRole"
}
},
"status": {
@ -12214,7 +12291,7 @@ const docTemplate = `{
"roles": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Role"
"$ref": "#/definitions/codersdk.SlimRole"
}
},
"status": {