Skip to content

Commit 0db4450

Browse files
committed
Make gen
1 parent ce9d54c commit 0db4450

File tree

9 files changed

+49
-16
lines changed

9 files changed

+49
-16
lines changed

coderd/apidoc/docs.go

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/querier.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/users.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func (api *API) postUser(rw http.ResponseWriter, r *http.Request) {
358358
return
359359
}
360360

361-
var loginType database.LoginType = "unknown"
361+
var loginType database.LoginType
362362
if req.DisableLogin {
363363
loginType = database.LoginTypeNone
364364
} else {

codersdk/apikey.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ const (
3232
LoginTypeGithub LoginType = "github"
3333
LoginTypeOIDC LoginType = "oidc"
3434
LoginTypeToken LoginType = "token"
35+
// LoginTypeNone is used if no login method is available for this user.
36+
// If this is set, the user has no method of logging in.
37+
// API keys can still be created by an owner and used by the user.
38+
// These keys would use the `LoginTypeToken` type.
39+
LoginTypeNone LoginType = "none"
3540
)
3641

3742
type APIKeyScope string

docs/api/schemas.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
15171517

15181518
```json
15191519
{
1520+
"disable_login": true,
15201521
"email": "user@example.com",
15211522
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
15221523
"password": "string",
@@ -1526,12 +1527,13 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
15261527

15271528
### Properties
15281529

1529-
| Name | Type | Required | Restrictions | Description |
1530-
| ----------------- | ------ | -------- | ------------ | ----------- |
1531-
| `email` | string | true | | |
1532-
| `organization_id` | string | false | | |
1533-
| `password` | string | true | | |
1534-
| `username` | string | true | | |
1530+
| Name | Type | Required | Restrictions | Description |
1531+
| ----------------- | ------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
1532+
| `disable_login` | boolean | false | | Disable login sets the user's login type to 'none'. This prevents the user from being able to use a password or any other authentication method to login. |
1533+
| `email` | string | true | | |
1534+
| `organization_id` | string | false | | |
1535+
| `password` | string | false | | |
1536+
| `username` | string | true | | |
15351537

15361538
## codersdk.CreateWorkspaceBuildRequest
15371539

@@ -2825,6 +2827,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
28252827
| `github` |
28262828
| `oidc` |
28272829
| `token` |
2830+
| `none` |
28282831

28292832
## codersdk.LoginWithPasswordRequest
28302833

docs/api/users.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ curl -X POST http://coder-server:8080/api/v2/users \
7676
7777
```json
7878
{
79+
"disable_login": true,
7980
"email": "user@example.com",
8081
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
8182
"password": "string",

docs/cli/users_create.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ coder users create [flags]
1010

1111
## Options
1212

13+
### --disable-login
14+
15+
| | |
16+
| ---- | ----------------- |
17+
| Type | <code>bool</code> |
18+
19+
Disabling login for a user prevents the user from authenticating themselves via a login. Authentication would require an api keys/token. Be careful when using this flag as it can lock the user out of their account.
20+
1321
### -e, --email
1422

1523
| | |

site/src/api/typesGenerated.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,8 +1396,14 @@ export type LogSource = "provisioner" | "provisioner_daemon"
13961396
export const LogSources: LogSource[] = ["provisioner", "provisioner_daemon"]
13971397

13981398
// From codersdk/apikey.go
1399-
export type LoginType = "github" | "oidc" | "password" | "token"
1400-
export const LoginTypes: LoginType[] = ["github", "oidc", "password", "token"]
1399+
export type LoginType = "github" | "none" | "oidc" | "password" | "token"
1400+
export const LoginTypes: LoginType[] = [
1401+
"github",
1402+
"none",
1403+
"oidc",
1404+
"password",
1405+
"token",
1406+
]
14011407

14021408
// From codersdk/provisionerdaemons.go
14031409
export type ProvisionerJobStatus =

0 commit comments

Comments
 (0)