Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f12415

Browse files
committed
Fix
1 parent 03ba246 commit 1f12415

File tree

6 files changed

+57
-50
lines changed

6 files changed

+57
-50
lines changed

coderd/apidoc/docs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,7 @@ const docTemplate = `{
20042004
"application/json"
20052005
],
20062006
"tags": [
2007-
"Authentication"
2007+
"Authorization"
20082008
],
20092009
"summary": "Log in user",
20102010
"operationId": "log-in-user",

coderd/apidoc/swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@
17611761
}
17621762
],
17631763
"produces": ["application/json"],
1764-
"tags": ["Authentication"],
1764+
"tags": ["Authorization"],
17651765
"summary": "Log in user",
17661766
"operationId": "log-in-user",
17671767
"parameters": [

coderd/users.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ func (api *API) organizationByUserAndName(rw http.ResponseWriter, r *http.Reques
991991
// @ID log-in-user
992992
// @Security CoderSessionToken
993993
// @Produce json
994-
// @Tags Authentication
994+
// @Tags Authorization
995995
// @Param request body codersdk.LoginWithPasswordRequest true "Login request"
996996
// @Success 201 {object} codersdk.LoginWithPasswordResponse
997997
// @Router /users/login [post]

docs/api/authentication.md

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,14 @@
11
# Authentication
22

3-
> This page is incomplete, stay tuned.
3+
Long-lived tokens can be generated to perform actions on behalf of your user account:
44

5-
## Log in user
6-
7-
### Code samples
8-
9-
```shell
10-
# Example request using curl
11-
curl -X POST http://coder-server:8080/api/v2/users/login \
12-
-H 'Content-Type: application/json' \
13-
-H 'Accept: application/json' \
14-
-H 'Coder-Session-Token: API_KEY'
15-
```
16-
17-
`POST /users/login`
18-
19-
> Body parameter
20-
21-
```json
22-
{
23-
"email": "string",
24-
"password": "string"
25-
}
5+
```console
6+
coder tokens create
267
```
278

28-
### Parameters
9+
You can use tokens with the Coder's REST API using the `Coder-Session-Token` HTTP header.
2910

30-
| Name | In | Type | Required | Description |
31-
| ------ | ---- | -------------------------------------------------------------------------------- | -------- | ------------- |
32-
| `body` | body | [codersdk.LoginWithPasswordRequest](schemas.md#codersdkloginwithpasswordrequest) | true | Login request |
33-
34-
### Example responses
35-
36-
> 201 Response
37-
38-
```json
39-
{
40-
"session_token": "string"
41-
}
11+
```console
12+
curl 'http://coder-server:8080/api/v2/workspaces' \
13+
-H 'Coder-Session-Token: *****'
4214
```
43-
44-
### Responses
45-
46-
| Status | Meaning | Description | Schema |
47-
| ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------------------------------------------------- |
48-
| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.LoginWithPasswordResponse](schemas.md#codersdkloginwithpasswordresponse) |
49-
50-
To perform this operation, you must be authenticated. [Learn more](authentication.md).

docs/api/authorization.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,50 @@ curl -X POST http://coder-server:8080/api/v2/authcheck \
6767
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AuthorizationResponse](schemas.md#codersdkauthorizationresponse) |
6868

6969
To perform this operation, you must be authenticated. [Learn more](authentication.md).
70+
71+
## Log in user
72+
73+
### Code samples
74+
75+
```shell
76+
# Example request using curl
77+
curl -X POST http://coder-server:8080/api/v2/users/login \
78+
-H 'Content-Type: application/json' \
79+
-H 'Accept: application/json' \
80+
-H 'Coder-Session-Token: API_KEY'
81+
```
82+
83+
`POST /users/login`
84+
85+
> Body parameter
86+
87+
```json
88+
{
89+
"email": "string",
90+
"password": "string"
91+
}
92+
```
93+
94+
### Parameters
95+
96+
| Name | In | Type | Required | Description |
97+
| ------ | ---- | -------------------------------------------------------------------------------- | -------- | ------------- |
98+
| `body` | body | [codersdk.LoginWithPasswordRequest](schemas.md#codersdkloginwithpasswordrequest) | true | Login request |
99+
100+
### Example responses
101+
102+
> 201 Response
103+
104+
```json
105+
{
106+
"session_token": "string"
107+
}
108+
```
109+
110+
### Responses
111+
112+
| Status | Meaning | Description | Schema |
113+
| ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------------------------------------------------- |
114+
| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.LoginWithPasswordResponse](schemas.md#codersdkloginwithpasswordresponse) |
115+
116+
To perform this operation, you must be authenticated. [Learn more](authentication.md).

docs/manifest.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,6 @@
373373
"title": "Users",
374374
"path": "./api/users.md"
375375
},
376-
{
377-
"title": "Authentication",
378-
"path": "./api/authentication.md"
379-
},
380376
{
381377
"title": "Builds",
382378
"path": "./api/builds.md"

0 commit comments

Comments
 (0)