diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 3bc4897147ee5..87391fe14e309 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -587,44 +587,6 @@ const docTemplate = `{ } } }, - "/groups": { - "get": { - "security": [ - { - "CoderSessionToken": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get groups", - "operationId": "get-groups", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Group" - } - } - } - } - } - }, "/groups/{group}": { "get": { "security": [ diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 73cb41bdad2ad..2046aff0425b7 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -501,40 +501,6 @@ } } }, - "/groups": { - "get": { - "security": [ - { - "CoderSessionToken": [] - } - ], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get groups", - "operationId": "get-groups", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Group" - } - } - } - } - } - }, "/groups/{group}": { "get": { "security": [ diff --git a/docs/api/enterprise.md b/docs/api/enterprise.md index 486bc213d1fc4..07f7cf407c98d 100644 --- a/docs/api/enterprise.md +++ b/docs/api/enterprise.md @@ -148,99 +148,6 @@ curl -X GET http://coder-server:8080/api/v2/entitlements \ To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Get groups - -### Code samples - -```shell -# Example request using curl -curl -X GET http://coder-server:8080/api/v2/groups \ - -H 'Accept: application/json' \ - -H 'Coder-Session-Token: API_KEY' -``` - -`GET /groups` - -### Parameters - -| Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | -| `organization` | path | string(uuid) | true | Organization ID | - -### Example responses - -> 200 Response - -```json -[ - { - "avatar_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string" - } - ], - "status": "active", - "username": "string" - } - ], - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "quota_allowance": 0 - } -] -``` - -### Responses - -| Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------- | -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Group](schemas.md#codersdkgroup) | - -

Response Schema

- -Status Code **200** - -| Name | Type | Required | Restrictions | Description | -| --------------------- | ---------------------------------------------------- | -------- | ------------ | ----------- | -| `[array item]` | array | false | | | -| `» avatar_url` | string | false | | | -| `» id` | string(uuid) | false | | | -| `» members` | array | false | | | -| `»» avatar_url` | string(uri) | false | | | -| `»» created_at` | string(date-time) | true | | | -| `»» email` | string(email) | true | | | -| `»» id` | string(uuid) | true | | | -| `»» last_seen_at` | string(date-time) | false | | | -| `»» organization_ids` | array | false | | | -| `»» roles` | array | false | | | -| `»»» display_name` | string | false | | | -| `»»» name` | string | false | | | -| `»» status` | [codersdk.UserStatus](schemas.md#codersdkuserstatus) | false | | | -| `»» username` | string | true | | | -| `» name` | string | false | | | -| `» organization_id` | string(uuid) | false | | | -| `» quota_allowance` | integer | false | | | - -#### Enumerated Values - -| Property | Value | -| -------- | ----------- | -| `status` | `active` | -| `status` | `suspended` | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - ## Get group by name ### Code samples diff --git a/enterprise/coderd/coderd.go b/enterprise/coderd/coderd.go index 62d22866c118b..de4750ed19cf4 100644 --- a/enterprise/coderd/coderd.go +++ b/enterprise/coderd/coderd.go @@ -89,13 +89,13 @@ func New(ctx context.Context, options *Options) (*API, error) { r.Post("/", api.postWorkspaceProxy) r.Get("/", api.workspaceProxies) // TODO: Add specific workspace proxy endpoints. - //r.Route("/{proxyName}", func(r chi.Router) { + // r.Route("/{proxyName}", func(r chi.Router) { // r.Use( // httpmw.ExtractWorkspaceProxyByNameParam(api.Database), // ) // // r.Get("/", api.workspaceProxyByName) - //}) + // }) }) r.Route("/organizations/{organization}/groups", func(r chi.Router) { r.Use( diff --git a/enterprise/coderd/groups.go b/enterprise/coderd/groups.go index de9d280fa28cb..84d4754b67d51 100644 --- a/enterprise/coderd/groups.go +++ b/enterprise/coderd/groups.go @@ -350,14 +350,6 @@ func (api *API) groupsByOrganization(rw http.ResponseWriter, r *http.Request) { api.groups(rw, r) } -// @Summary Get groups -// @ID get-groups -// @Security CoderSessionToken -// @Produce json -// @Tags Enterprise -// @Param organization path string true "Organization ID" format(uuid) -// @Success 200 {array} codersdk.Group -// @Router /groups [get] func (api *API) groups(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/enterprise/coderd/workspaceproxy.go b/enterprise/coderd/workspaceproxy.go index e23f94e10af26..570d2be6ef824 100644 --- a/enterprise/coderd/workspaceproxy.go +++ b/enterprise/coderd/workspaceproxy.go @@ -6,13 +6,13 @@ import ( "net/http" "net/url" + "github.com/google/uuid" "golang.org/x/xerrors" "github.com/coder/coder/coderd/audit" "github.com/coder/coder/coderd/database" "github.com/coder/coder/coderd/httpapi" "github.com/coder/coder/codersdk" - "github.com/google/uuid" ) // @Summary Create workspace proxy diff --git a/enterprise/coderd/workspaceproxy_test.go b/enterprise/coderd/workspaceproxy_test.go index 3cffc4f44da98..b8ca10dd26f70 100644 --- a/enterprise/coderd/workspaceproxy_test.go +++ b/enterprise/coderd/workspaceproxy_test.go @@ -4,13 +4,13 @@ import ( "testing" "github.com/moby/moby/pkg/namesgenerator" + "github.com/stretchr/testify/require" "github.com/coder/coder/coderd/coderdtest" "github.com/coder/coder/codersdk" "github.com/coder/coder/enterprise/coderd/coderdenttest" "github.com/coder/coder/enterprise/coderd/license" "github.com/coder/coder/testutil" - "github.com/stretchr/testify/require" ) func TestWorkspaceProxyCRUD(t *testing.T) {