feat: add flag to disable password auth (#5991)

Adds a flag --disable-password-auth that prevents the password login
endpoint from working unless the user has the "owner" (aka. site admin)
role.

Adds a subcommand `coder server create-admin-user` which creates a user
directly in the database with the "owner" role, the "admin" role in
every organization, and password auth. This is to avoid lock-out
situations where all accounts have the login type set to an identity
provider and nobody can login.
This commit is contained in:
Dean Sheather
2023-02-07 01:58:21 +11:00
committed by GitHub
parent 968d7e4dc5
commit 4fe221a700
21 changed files with 1352 additions and 542 deletions

3
coderd/apidoc/docs.go generated
View File

@ -6012,6 +6012,9 @@ const docTemplate = `{
"derp": {
"$ref": "#/definitions/codersdk.DERP"
},
"disable_password_auth": {
"$ref": "#/definitions/codersdk.DeploymentConfigField-bool"
},
"disable_path_apps": {
"$ref": "#/definitions/codersdk.DeploymentConfigField-bool"
},

View File

@ -5343,6 +5343,9 @@
"derp": {
"$ref": "#/definitions/codersdk.DERP"
},
"disable_password_auth": {
"$ref": "#/definitions/codersdk.DeploymentConfigField-bool"
},
"disable_path_apps": {
"$ref": "#/definitions/codersdk.DeploymentConfigField-bool"
},