Add password aging

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2025-11-26 20:39:02 +05:00
parent c5066da56d
commit 3be5ea8d74
40 changed files with 221 additions and 92 deletions
@@ -1,10 +0,0 @@
{
"changes": [
{
"packageName": "@hcengineering/client-resources",
"comment": "Add support for custom exclude filters",
"type": "patch"
}
],
"packageName": "@hcengineering/client-resources"
}
@@ -1,10 +0,0 @@
{
"changes": [
{
"packageName": "@hcengineering/client-resources",
"comment": "formatting",
"type": "none"
}
],
"packageName": "@hcengineering/client-resources"
}
@@ -1,10 +0,0 @@
{
"changes": [
{
"packageName": "@hcengineering/client",
"comment": "Add support for custom exclude filters",
"type": "patch"
}
],
"packageName": "@hcengineering/client"
}
+20
View File
@@ -1,6 +1,26 @@
{
"name": "@hcengineering/account-client",
"entries": [
{
"version": "0.7.20",
"tag": "@hcengineering/account-client_v0.7.20",
"date": "Wed, 26 Nov 2025 15:28:11 GMT",
"comments": {
"patch": [
{
"comment": "Add password aging"
}
],
"dependency": [
{
"comment": "Updating dependency \"@hcengineering/core\" from `^0.7.22` to `0.7.23`"
},
{
"comment": "Updating dependency \"@hcengineering/platform\" from `^0.7.18` to `0.7.19`"
}
]
}
},
{
"version": "0.7.19",
"tag": "@hcengineering/account-client_v0.7.19",
+8 -1
View File
@@ -1,6 +1,13 @@
# Change Log - @hcengineering/account-client
This log was last generated on Thu, 30 Oct 2025 08:41:42 GMT and should not be manually modified.
This log was last generated on Wed, 26 Nov 2025 15:28:11 GMT and should not be manually modified.
## 0.7.20
Wed, 26 Nov 2025 15:28:11 GMT
### Patches
- Add password aging
## 0.7.19
Thu, 30 Oct 2025 08:41:42 GMT
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@hcengineering/account-client",
"version": "0.7.19",
"version": "0.7.20",
"main": "lib/index.js",
"svelte": "src/index.ts",
"types": "types/index.d.ts",
@@ -43,8 +43,8 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/platform": "workspace:^0.7.18"
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/platform": "workspace:^0.7.19"
},
"repository": "https://github.com/hcengineering/huly.core",
"publishConfig": {
+20
View File
@@ -232,6 +232,8 @@ export interface AccountClient {
addEmailSocialId: (email: string) => Promise<OtpInfo>
addHulyAssistantSocialId: () => Promise<PersonId>
refreshHulyAssistantToken: () => Promise<void>
updatePasswordAgingRule: (days: number) => Promise<void>
checkPasswordAging: () => Promise<boolean>
setMyProfile: (profile: Partial<Omit<UserProfile, 'personUuid'>>) => Promise<void>
getUserProfile: (personUuid?: PersonUuid) => Promise<PersonWithProfile | null>
@@ -508,6 +510,24 @@ class AccountClientImpl implements AccountClient {
await this.rpc(request)
}
async updatePasswordAgingRule (days: number): Promise<void> {
const request = {
method: 'updatePasswordAgingRule' as const,
params: { days }
}
await this.rpc(request)
}
async checkPasswordAging (): Promise<boolean> {
const request = {
method: 'checkPasswordAging' as const,
params: {}
}
return await this.rpc(request)
}
async signUpJoin (
email: string,
password: string,
+1
View File
@@ -41,6 +41,7 @@ export interface LoginInfoWorkspace {
role: AccountRole | null
progress?: number
branding?: string
passwordAgingRule?: number // in days
}
export interface LoginInfoWithWorkspaces extends LoginInfo {
+2 -2
View File
@@ -40,8 +40,8 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/platform": "workspace:^0.7.19",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/analytics": "workspace:^0.7.17",
"@hcengineering/measurements-otlp": "workspace:^0.7.17",
"winston": "^3.11.0",
+1 -1
View File
@@ -40,7 +40,7 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/platform": "workspace:^0.7.18"
"@hcengineering/platform": "workspace:^0.7.19"
},
"repository": "https://github.com/hcengineering/huly.core",
"publishConfig": {
+5 -5
View File
@@ -52,12 +52,12 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/account-client": "workspace:^0.7.19",
"@hcengineering/client": "workspace:^0.7.17",
"@hcengineering/client-resources": "workspace:^0.7.17",
"@hcengineering/account-client": "workspace:^0.7.20",
"@hcengineering/client": "workspace:^0.7.18",
"@hcengineering/client-resources": "workspace:^0.7.18",
"@hcengineering/collaborator-client": "workspace:^0.7.17",
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/platform": "workspace:^0.7.19",
"@hcengineering/text": "workspace:^0.7.18",
"@hcengineering/text-markdown": "workspace:^0.7.20",
"snappyjs": "^0.7.0"
+31
View File
@@ -1,6 +1,37 @@
{
"name": "@hcengineering/client-resources",
"entries": [
{
"version": "0.7.18",
"tag": "@hcengineering/client-resources_v0.7.18",
"date": "Wed, 26 Nov 2025 15:28:11 GMT",
"comments": {
"patch": [
{
"comment": "Add password aging"
},
{
"comment": "Add support for custom exclude filters"
}
],
"none": [
{
"comment": "formatting"
}
],
"dependency": [
{
"comment": "Updating dependency \"@hcengineering/client\" from `^0.7.17` to `0.7.18`"
},
{
"comment": "Updating dependency \"@hcengineering/core\" from `^0.7.22` to `0.7.23`"
},
{
"comment": "Updating dependency \"@hcengineering/platform\" from `^0.7.18` to `0.7.19`"
}
]
}
},
{
"version": "0.7.17",
"tag": "@hcengineering/client-resources_v0.7.17",
+9 -1
View File
@@ -1,6 +1,14 @@
# Change Log - @hcengineering/client-resources
This log was last generated on Mon, 27 Oct 2025 13:27:12 GMT and should not be manually modified.
This log was last generated on Wed, 26 Nov 2025 15:28:11 GMT and should not be manually modified.
## 0.7.18
Wed, 26 Nov 2025 15:28:11 GMT
### Patches
- Add password aging
- Add support for custom exclude filters
## 0.7.17
Mon, 27 Oct 2025 13:27:12 GMT
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@hcengineering/client-resources",
"version": "0.7.17",
"version": "0.7.18",
"main": "lib/index.js",
"svelte": "src/index.ts",
"types": "types/index.d.ts",
@@ -45,9 +45,9 @@
},
"dependencies": {
"@hcengineering/analytics": "workspace:^0.7.17",
"@hcengineering/client": "workspace:^0.7.17",
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/client": "workspace:^0.7.18",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/platform": "workspace:^0.7.19",
"@hcengineering/rpc": "workspace:^0.7.17",
"snappyjs": "^0.7.0"
},
+3 -11
View File
@@ -55,7 +55,7 @@ import core, {
TxResult,
type WorkspaceUuid
} from '@hcengineering/core'
import platform, { getMetadata, PlatformError, Severity, Status, UNAUTHORIZED } from '@hcengineering/platform'
import platform, { getMetadata, PlatformError, Severity, Status } from '@hcengineering/platform'
import { HelloRequest, HelloResponse, type RateLimitInfo, ReqId, type Response, RPCHandler } from '@hcengineering/rpc'
import { uncompress } from 'snappyjs'
@@ -304,7 +304,7 @@ class Connection implements ClientConnection {
}
if (resp.error !== undefined) {
if (resp.error?.code === UNAUTHORIZED.code || resp.terminate === true) {
if (resp.terminate === true) {
if (
resp.error.code !== platform.status.WorkspaceArchived &&
resp.error.code !== platform.status.WorkspaceNotFound
@@ -313,15 +313,7 @@ class Connection implements ClientConnection {
}
this.closed = true
this.websocket?.close()
if (resp.error?.code === UNAUTHORIZED.code) {
this.opt?.onUnauthorized?.()
}
if (resp.error?.code === platform.status.WorkspaceArchived) {
this.opt?.onArchived?.()
}
if (resp.error?.code === platform.status.WorkspaceMigration) {
this.opt?.onMigration?.()
}
this.opt?.onError?.(resp.error.code)
}
if (resp.id !== undefined) {
+23
View File
@@ -1,6 +1,29 @@
{
"name": "@hcengineering/client",
"entries": [
{
"version": "0.7.18",
"tag": "@hcengineering/client_v0.7.18",
"date": "Wed, 26 Nov 2025 15:28:11 GMT",
"comments": {
"patch": [
{
"comment": "Add password aging"
},
{
"comment": "Add support for custom exclude filters"
}
],
"dependency": [
{
"comment": "Updating dependency \"@hcengineering/platform\" from `^0.7.18` to `0.7.19`"
},
{
"comment": "Updating dependency \"@hcengineering/core\" from `^0.7.22` to `0.7.23`"
}
]
}
},
{
"version": "0.7.17",
"tag": "@hcengineering/client_v0.7.17",
+9 -1
View File
@@ -1,6 +1,14 @@
# Change Log - @hcengineering/client
This log was last generated on Mon, 27 Oct 2025 13:27:12 GMT and should not be manually modified.
This log was last generated on Wed, 26 Nov 2025 15:28:11 GMT and should not be manually modified.
## 0.7.18
Wed, 26 Nov 2025 15:28:11 GMT
### Patches
- Add password aging
- Add support for custom exclude filters
## 0.7.17
Mon, 27 Oct 2025 13:27:12 GMT
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@hcengineering/client",
"version": "0.7.17",
"version": "0.7.18",
"main": "lib/index.js",
"svelte": "src/index.ts",
"types": "types/index.d.ts",
@@ -41,8 +41,8 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/core": "workspace:^0.7.22"
"@hcengineering/platform": "workspace:^0.7.19",
"@hcengineering/core": "workspace:^0.7.23"
},
"repository": "https://github.com/hcengineering/huly.core",
"publishConfig": {
+2 -4
View File
@@ -14,7 +14,7 @@
//
import type { Client, ClientConnectEvent, MeasureContext, TxPersistenceStore } from '@hcengineering/core'
import { type Plugin, type Resource, type Metadata, plugin } from '@hcengineering/platform'
import { type Metadata, type Plugin, plugin, type Resource, type StatusCode } from '@hcengineering/platform'
/**
* @public
@@ -61,9 +61,7 @@ export interface ClientFactoryOptions {
connectionTimeout?: number
onHello?: (serverVersion?: string) => boolean
onUpgrade?: () => void
onUnauthorized?: () => void
onArchived?: () => void
onMigration?: () => void
onError?: (err: StatusCode) => void
onConnect?: (event: ClientConnectEvent, lastTx: string | undefined, data: any) => Promise<void>
ctx?: MeasureContext
onDialTimeout?: () => void | Promise<void>
+1 -1
View File
@@ -43,7 +43,7 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22"
"@hcengineering/core": "workspace:^0.7.23"
},
"repository": "https://github.com/hcengineering/huly.core",
"publishConfig": {
+17
View File
@@ -1,6 +1,23 @@
{
"name": "@hcengineering/core",
"entries": [
{
"version": "0.7.23",
"tag": "@hcengineering/core_v0.7.23",
"date": "Wed, 26 Nov 2025 15:28:11 GMT",
"comments": {
"patch": [
{
"comment": "Add password aging"
}
],
"dependency": [
{
"comment": "Updating dependency \"@hcengineering/platform\" from `^0.7.18` to `0.7.19`"
}
]
}
},
{
"version": "0.7.22",
"tag": "@hcengineering/core_v0.7.22",
+8 -1
View File
@@ -1,6 +1,13 @@
# Change Log - @hcengineering/core
This log was last generated on Thu, 06 Nov 2025 09:09:58 GMT and should not be manually modified.
This log was last generated on Wed, 26 Nov 2025 15:28:11 GMT and should not be manually modified.
## 0.7.23
Wed, 26 Nov 2025 15:28:11 GMT
### Patches
- Add password aging
## 0.7.22
Thu, 06 Nov 2025 09:09:58 GMT
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@hcengineering/core",
"version": "0.7.22",
"version": "0.7.23",
"main": "lib/index.js",
"svelte": "src/index.ts",
"types": "types/index.d.ts",
@@ -45,7 +45,7 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/platform": "workspace:^0.7.19",
"@hcengineering/analytics": "workspace:^0.7.17",
"@hcengineering/measurements": "workspace:^0.7.18",
"fast-equals": "^5.2.2"
+1
View File
@@ -863,6 +863,7 @@ export interface WorkspaceInfo {
billingAccount?: PersonUuid // Should always be set for NEW workspaces
allowReadOnlyGuest?: boolean // Should always be set for NEW workspaces
allowGuestSignUp?: boolean // Should always be set for NEW workspaces
passwordAgingRule?: number // in days
}
export interface BackupStatus {
+9 -3
View File
@@ -119,7 +119,9 @@ function $update (document: Doc, keyval: Record<string, PropertyType>): void {
}
// Ensure doc[key] is an array before attempting to update
if (!Array.isArray(doc[key])) {
Analytics.handleError(new Error(`$update operation on non-array field: ${key}, value: ${JSON.stringify(doc[key])}`))
Analytics.handleError(
new Error(`$update operation on non-array field: ${key}, value: ${JSON.stringify(doc[key])}`)
)
doc[key] = []
continue
}
@@ -142,14 +144,18 @@ function $inc (document: Doc, keyval: Record<string, number>): void {
const cur = doc[key] ?? 0
// Ensure current value is a number
if (typeof cur !== 'number' || isNaN(cur)) {
Analytics.handleError(new Error(`$inc operation on non-numeric field: ${key}, value: ${JSON.stringify(doc[key])}`))
Analytics.handleError(
new Error(`$inc operation on non-numeric field: ${key}, value: ${JSON.stringify(doc[key])}`)
)
doc[key] = keyval[key]
continue
}
const increment = keyval[key]
// Ensure increment value is a valid number
if (typeof increment !== 'number' || isNaN(increment)) {
Analytics.handleError(new Error(`$inc operation with invalid increment: ${key}, increment: ${JSON.stringify(increment)}`))
Analytics.handleError(
new Error(`$inc operation with invalid increment: ${key}, increment: ${JSON.stringify(increment)}`)
)
continue
}
doc[key] = cur + increment
+1 -1
View File
@@ -43,7 +43,7 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/retry": "workspace:^0.7.17"
},
"repository": "https://github.com/hcengineering/huly.core",
+3 -3
View File
@@ -36,12 +36,12 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/platform": "workspace:^0.7.19",
"@hcengineering/storage": "workspace:^0.7.17",
"@hcengineering/analytics": "workspace:^0.7.17",
"@hcengineering/rank": "workspace:^0.7.17",
"@hcengineering/account-client": "workspace:^0.7.19",
"@hcengineering/account-client": "workspace:^0.7.20",
"toposort": "^2.0.2",
"fast-equals": "^5.2.2"
},
+12
View File
@@ -1,6 +1,18 @@
{
"name": "@hcengineering/platform",
"entries": [
{
"version": "0.7.19",
"tag": "@hcengineering/platform_v0.7.19",
"date": "Wed, 26 Nov 2025 15:28:11 GMT",
"comments": {
"patch": [
{
"comment": "Add password aging"
}
]
}
},
{
"version": "0.7.18",
"tag": "@hcengineering/platform_v0.7.18",
+8 -1
View File
@@ -1,6 +1,13 @@
# Change Log - @hcengineering/platform
This log was last generated on Fri, 31 Oct 2025 20:11:13 GMT and should not be manually modified.
This log was last generated on Wed, 26 Nov 2025 15:28:11 GMT and should not be manually modified.
## 0.7.19
Wed, 26 Nov 2025 15:28:11 GMT
### Patches
- Add password aging
## 0.7.18
Fri, 31 Oct 2025 20:11:13 GMT
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hcengineering/platform",
"version": "0.7.18",
"version": "0.7.19",
"main": "lib/index.js",
"svelte": "src/index.ts",
"types": "types/index.d.ts",
+1
View File
@@ -143,6 +143,7 @@ export default plugin(platformId, {
Unauthorized: '' as StatusCode, // 401
TokenExpired: '' as StatusCode, // 401
TokenNotActive: '' as StatusCode<{ notBefore: number }>, // 401
PasswordExpired: '' as StatusCode, // 401
Conflict: '' as StatusCode, // 409
ExpiredLink: '' as StatusCode,
UnknownMethod: '' as StatusCode<{ method: string }>,
+2 -2
View File
@@ -40,8 +40,8 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/platform": "workspace:^0.7.19",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/analytics": "workspace:^0.7.17",
"fast-equals": "^5.2.2"
},
+1 -1
View File
@@ -40,7 +40,7 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/core": "workspace:^0.7.23",
"lexorank": "~1.0.4"
},
"repository": "https://github.com/hcengineering/huly.core",
+2 -2
View File
@@ -41,8 +41,8 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/platform": "workspace:^0.7.19",
"msgpackr": "^1.11.2"
},
"repository": "https://github.com/hcengineering/huly.core",
+1 -1
View File
@@ -42,7 +42,7 @@
"@types/jest": "^29.5.5"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22"
"@hcengineering/core": "workspace:^0.7.23"
},
"repository": "https://github.com/hcengineering/huly.core",
"publishConfig": {
+2 -2
View File
@@ -35,8 +35,8 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/platform": "workspace:^0.7.19",
"@hcengineering/core": "workspace:^0.7.23",
"fast-equals": "^5.2.2"
},
"files": [
+1 -1
View File
@@ -42,7 +42,7 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/core": "workspace:^0.7.23",
"fast-equals": "^5.2.2",
"hash-it": "^6.0.0"
},
+1 -1
View File
@@ -43,7 +43,7 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/text": "workspace:^0.7.18",
"@hcengineering/text-core": "workspace:^0.7.18",
"yjs": "^13.6.27",
+1 -1
View File
@@ -41,7 +41,7 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/text-core": "workspace:^0.7.18",
"@tiptap/core": "^2.11.7",
"@tiptap/html": "^2.11.7",
+2 -2
View File
@@ -42,8 +42,8 @@
"eslint-plugin-svelte": "^2.35.1"
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.22",
"@hcengineering/platform": "workspace:^0.7.18",
"@hcengineering/core": "workspace:^0.7.23",
"@hcengineering/platform": "workspace:^0.7.19",
"jwt-simple": "^0.5.6",
"uuid": "^8.3.2"
},