mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Add support for encrypted second password hashes
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user