mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: change format of key from uuid to string to fix swagger issue (#19380)
ref: https://codercom.slack.com/archives/C014JH42DBJ/p1755192759211289 this change allows api keys to be deleted via swagger
This commit is contained in:
Generated
+2
-2
@@ -7383,7 +7383,7 @@ const docTemplate = `{
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"format": "string",
|
||||
"description": "Key ID",
|
||||
"name": "keyid",
|
||||
"in": "path",
|
||||
@@ -7420,7 +7420,7 @@ const docTemplate = `{
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"format": "string",
|
||||
"description": "Key ID",
|
||||
"name": "keyid",
|
||||
"in": "path",
|
||||
|
||||
Generated
+2
-2
@@ -6516,7 +6516,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"format": "string",
|
||||
"description": "Key ID",
|
||||
"name": "keyid",
|
||||
"in": "path",
|
||||
@@ -6551,7 +6551,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"format": "string",
|
||||
"description": "Key ID",
|
||||
"name": "keyid",
|
||||
"in": "path",
|
||||
|
||||
+2
-2
@@ -151,7 +151,7 @@ func (api *API) postAPIKey(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Produce json
|
||||
// @Tags Users
|
||||
// @Param user path string true "User ID, name, or me"
|
||||
// @Param keyid path string true "Key ID" format(uuid)
|
||||
// @Param keyid path string true "Key ID" format(string)
|
||||
// @Success 200 {object} codersdk.APIKey
|
||||
// @Router /users/{user}/keys/{keyid} [get]
|
||||
func (api *API) apiKeyByID(rw http.ResponseWriter, r *http.Request) {
|
||||
@@ -292,7 +292,7 @@ func (api *API) tokens(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Security CoderSessionToken
|
||||
// @Tags Users
|
||||
// @Param user path string true "User ID, name, or me"
|
||||
// @Param keyid path string true "Key ID" format(uuid)
|
||||
// @Param keyid path string true "Key ID" format(string)
|
||||
// @Success 204
|
||||
// @Router /users/{user}/keys/{keyid} [delete]
|
||||
func (api *API) deleteAPIKey(rw http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Generated
+8
-8
@@ -919,10 +919,10 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/{keyid} \
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | In | Type | Required | Description |
|
||||
|---------|------|--------------|----------|----------------------|
|
||||
| `user` | path | string | true | User ID, name, or me |
|
||||
| `keyid` | path | string(uuid) | true | Key ID |
|
||||
| Name | In | Type | Required | Description |
|
||||
|---------|------|----------------|----------|----------------------|
|
||||
| `user` | path | string | true | User ID, name, or me |
|
||||
| `keyid` | path | string(string) | true | Key ID |
|
||||
|
||||
### Example responses
|
||||
|
||||
@@ -965,10 +965,10 @@ curl -X DELETE http://coder-server:8080/api/v2/users/{user}/keys/{keyid} \
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | In | Type | Required | Description |
|
||||
|---------|------|--------------|----------|----------------------|
|
||||
| `user` | path | string | true | User ID, name, or me |
|
||||
| `keyid` | path | string(uuid) | true | Key ID |
|
||||
| Name | In | Type | Required | Description |
|
||||
|---------|------|----------------|----------|----------------------|
|
||||
| `user` | path | string | true | User ID, name, or me |
|
||||
| `keyid` | path | string(string) | true | Key ID |
|
||||
|
||||
### Responses
|
||||
|
||||
|
||||
Reference in New Issue
Block a user