Add support for encrypted second password hashes

This commit is contained in:
Jonas Lochmann
2022-09-12 02:00:00 +02:00
parent f725a7bda3
commit a86a0abb05
50 changed files with 1067 additions and 185 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2020 Jonas Lochmann
* Copyright (C) 2019 - 2022 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { assertParentPasswordValid, ParentPassword, ParentPasswordValidationException } from '../api/schema'
import { assertParentPasswordValid, EncryptableParentPassword, ParentPasswordValidationException } from '../api/schema'
import { ParentAction } from './basetypes'
import { InvalidActionParameterException } from './meta/exception'
import { assertIdWithinFamily } from './meta/util'
@@ -26,14 +26,14 @@ export class AddUserAction extends ParentAction {
readonly userId: string
readonly name: string
readonly userType: 'parent' | 'child'
readonly password?: ParentPassword
readonly password?: EncryptableParentPassword
readonly timeZone: string
constructor ({ userId, name, userType, password, timeZone }: {
userId: string
name: string
userType: 'parent' | 'child'
password?: ParentPassword
password?: EncryptableParentPassword
timeZone: string
}) {
super()
@@ -85,6 +85,6 @@ export interface SerializedAddUserAction {
name: string
userType: 'parent' | 'child'
userId: string
password?: ParentPassword
password?: EncryptableParentPassword
timeZone: string
}
+5 -5
View File
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2020 Jonas Lochmann
* Copyright (C) 2019 - 2022 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -15,17 +15,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { assertParentPasswordValid, ParentPassword, ParentPasswordValidationException } from '../api/schema'
import { assertParentPasswordValid, EncryptableParentPassword, ParentPasswordValidationException } from '../api/schema'
import { ChildAction } from './basetypes'
import { InvalidActionParameterException } from './meta/exception'
const actionType = 'ChildChangePasswordAction'
export class ChildChangePasswordAction extends ChildAction {
readonly password: ParentPassword
readonly password: EncryptableParentPassword
constructor ({ password }: {
password: ParentPassword
password: EncryptableParentPassword
}) {
super()
@@ -50,5 +50,5 @@ export class ChildChangePasswordAction extends ChildAction {
export interface SerializedChildChangePasswordAction {
type: 'CHILD_CHANGE_PASSWORD'
password: ParentPassword
password: EncryptableParentPassword
}
+5 -5
View File
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2020 Jonas Lochmann
* Copyright (C) 2019 - 2022 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { assertParentPasswordValid, ParentPassword, ParentPasswordValidationException } from '../api/schema'
import { assertParentPasswordValid, EncryptableParentPassword, ParentPasswordValidationException } from '../api/schema'
import { ParentAction } from './basetypes'
import { InvalidActionParameterException } from './meta/exception'
import { assertIdWithinFamily } from './meta/util'
@@ -24,11 +24,11 @@ const actionType = 'SetChildPasswordAction'
export class SetChildPasswordAction extends ParentAction {
readonly childUserId: string
readonly newPassword: ParentPassword
readonly newPassword: EncryptableParentPassword
constructor ({ childUserId, newPassword }: {
childUserId: string
newPassword: ParentPassword
newPassword: EncryptableParentPassword
}) {
super()
@@ -60,5 +60,5 @@ export class SetChildPasswordAction extends ParentAction {
export interface SerializedSetChildPasswordAction {
type: 'SET_CHILD_PASSWORD'
childId: string
newPassword: ParentPassword
newPassword: EncryptableParentPassword
}