feat(auth): support tenantless provisioning and gated self-service workspace creation
Allow deployments to register users without auto-creating a personal tenant, expose creation policy via /auth/me, and guide tenantless accounts through a workspace onboarding flow.
This commit is contained in:
@@ -24,11 +24,12 @@ const (
|
||||
ErrValidation ErrorCode = 1010
|
||||
|
||||
// Tenant related error codes (2000-2099)
|
||||
ErrTenantNotFound ErrorCode = 2000
|
||||
ErrTenantAlreadyExists ErrorCode = 2001
|
||||
ErrTenantInactive ErrorCode = 2002
|
||||
ErrTenantNameRequired ErrorCode = 2003
|
||||
ErrTenantInvalidStatus ErrorCode = 2004
|
||||
ErrTenantNotFound ErrorCode = 2000
|
||||
ErrTenantAlreadyExists ErrorCode = 2001
|
||||
ErrTenantInactive ErrorCode = 2002
|
||||
ErrTenantNameRequired ErrorCode = 2003
|
||||
ErrTenantInvalidStatus ErrorCode = 2004
|
||||
ErrTenantCreationDisabled ErrorCode = 2005
|
||||
|
||||
// Agent related error codes (2100-2199)
|
||||
ErrAgentMissingThinkingModel ErrorCode = 2100
|
||||
@@ -184,6 +185,16 @@ func NewTenantInactiveError() *AppError {
|
||||
}
|
||||
}
|
||||
|
||||
// NewTenantCreationDisabledError reports a deployment-policy denial for
|
||||
// ordinary self-service tenant creation.
|
||||
func NewTenantCreationDisabledError() *AppError {
|
||||
return &AppError{
|
||||
Code: ErrTenantCreationDisabled,
|
||||
Message: "self-service tenant creation is disabled; join a workspace by invitation",
|
||||
HTTPCode: http.StatusForbidden,
|
||||
}
|
||||
}
|
||||
|
||||
// Agent related errors
|
||||
func NewAgentMissingThinkingModelError() *AppError {
|
||||
return &AppError{
|
||||
|
||||
Reference in New Issue
Block a user