feat: backend support for creating and storing service accounts (#22698)

Add is_service_account column to users table with CHECK constraints
enforcing login_type='none' and empty email for service accounts.
Update user creation API to validate service account constraints.

Related to:
https://linear.app/codercom/issue/PLAT-27/feat-backend-support-for-creating-and-storing-service-accounts
This commit is contained in:
George K
2026-03-11 10:19:08 -07:00
committed by GitHub
parent e96cd5cbb2
commit e5c19d0af4
28 changed files with 522 additions and 87 deletions
+4 -1
View File
@@ -14312,7 +14312,6 @@ const docTemplate = `{
"codersdk.CreateUserRequestWithOrgs": {
"type": "object",
"required": [
"email",
"username"
],
"properties": {
@@ -14342,6 +14341,10 @@ const docTemplate = `{
"password": {
"type": "string"
},
"service_account": {
"description": "Service accounts are admin-managed accounts that cannot login.",
"type": "boolean"
},
"user_status": {
"description": "UserStatus defaults to UserStatusDormant.",
"allOf": [
+5 -1
View File
@@ -12856,7 +12856,7 @@
},
"codersdk.CreateUserRequestWithOrgs": {
"type": "object",
"required": ["email", "username"],
"required": ["username"],
"properties": {
"email": {
"type": "string",
@@ -12884,6 +12884,10 @@
"password": {
"type": "string"
},
"service_account": {
"description": "Service accounts are admin-managed accounts that cannot login.",
"type": "boolean"
},
"user_status": {
"description": "UserStatus defaults to UserStatusDormant.",
"allOf": [