1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 11:43:07 +01:00

Merge pull request #1202 from DEVTomatoCake/fix/password-mfacode-schemas

Fixes for password, mfa code & email validation schemas
This commit is contained in:
Puyodead1 2024-08-30 08:53:30 -04:00 committed by GitHub
commit 3a63ae89cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 120 additions and 21 deletions

View File

@ -102,6 +102,8 @@
"type": "string" "type": "string"
}, },
"code": { "code": {
"minLength": 6,
"maxLength": 6,
"type": "string" "type": "string"
} }
}, },
@ -174,6 +176,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
} }
}, },
@ -5606,6 +5610,8 @@
"type": "string" "type": "string"
}, },
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"undelete": { "undelete": {
@ -5986,6 +5992,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"regenerate": { "regenerate": {
@ -6022,6 +6030,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"token": { "token": {
@ -6359,6 +6369,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"code": { "code": {
"minLength": 6,
"maxLength": 6,
"type": "string" "type": "string"
} }
}, },
@ -6370,9 +6382,13 @@
"type": "object", "type": "object",
"properties": { "properties": {
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"code": { "code": {
"minLength": 6,
"maxLength": 6,
"type": "string" "type": "string"
}, },
"secret": { "secret": {
@ -6497,15 +6513,22 @@
"nullable": true "nullable": true
}, },
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"new_password": { "new_password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"code": { "code": {
"minLength": 6,
"maxLength": 6,
"type": "string" "type": "string"
}, },
"email": { "email": {
"format": "email",
"type": "string" "type": "string"
}, },
"discriminator": { "discriminator": {
@ -10945,6 +10968,12 @@
}, },
"tags": [ "tags": [
"scheduled-maintenances" "scheduled-maintenances"
],
"x-badges": [
{
"label": "Spacebar-only",
"color": "red"
}
] ]
} }
}, },

View File

@ -75,6 +75,8 @@
"type": "string" "type": "string"
}, },
"code": { "code": {
"minLength": 6,
"maxLength": 6,
"type": "string" "type": "string"
} }
}, },
@ -155,6 +157,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
} }
}, },
@ -87935,6 +87939,8 @@
"type": "string" "type": "string"
}, },
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"undelete": { "undelete": {
@ -122124,6 +122130,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"regenerate": { "regenerate": {
@ -131818,6 +131826,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"token": { "token": {
@ -190102,6 +190112,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"code": { "code": {
"minLength": 6,
"maxLength": 6,
"type": "string" "type": "string"
} }
}, },
@ -194942,9 +194954,13 @@
"type": "object", "type": "object",
"properties": { "properties": {
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"code": { "code": {
"minLength": 6,
"maxLength": 6,
"type": "string" "type": "string"
}, },
"secret": { "secret": {
@ -214395,15 +214411,22 @@
] ]
}, },
"password": { "password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"new_password": { "new_password": {
"minLength": 1,
"maxLength": 72,
"type": "string" "type": "string"
}, },
"code": { "code": {
"minLength": 6,
"maxLength": 6,
"type": "string" "type": "string"
}, },
"email": { "email": {
"format": "email",
"type": "string" "type": "string"
}, },
"discriminator": { "discriminator": {

View File

@ -1,17 +1,17 @@
/* /*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors Copyright (C) 2023 Spacebar and Spacebar Contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
@ -21,5 +21,9 @@ export interface ApplicationAuthorizeSchema {
guild_id: string; guild_id: string;
permissions: string; permissions: string;
captcha_key?: string; captcha_key?: string;
/**
* @minLength 6
* @maxLength 6
*/
code?: string; // 2fa code code?: string; // 2fa code
} }

View File

@ -1,21 +1,25 @@
/* /*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors Copyright (C) 2023 Spacebar and Spacebar Contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
export interface BackupCodesChallengeSchema { export interface BackupCodesChallengeSchema {
/**
* @minLength 1
* @maxLength 72
*/
password: string; password: string;
} }

View File

@ -1,23 +1,27 @@
/* /*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors Copyright (C) 2023 Spacebar and Spacebar Contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
export interface LoginSchema { export interface LoginSchema {
login: string; login: string;
/**
* @minLength 1
* @maxLength 72
*/
password: string; password: string;
undelete?: boolean; undelete?: boolean;
captcha_key?: string; captcha_key?: string;

View File

@ -1,22 +1,26 @@
/* /*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors Copyright (C) 2023 Spacebar and Spacebar Contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
export interface MfaCodesSchema { export interface MfaCodesSchema {
/**
* @minLength 1
* @maxLength 72
*/
password: string; password: string;
regenerate?: boolean; regenerate?: boolean;
} }

View File

@ -1,22 +1,26 @@
/* /*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors Copyright (C) 2023 Spacebar and Spacebar Contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
export interface PasswordResetSchema { export interface PasswordResetSchema {
/**
* @minLength 1
* @maxLength 72
*/
password: string; password: string;
token: string; token: string;
} }

View File

@ -1,21 +1,25 @@
/* /*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors Copyright (C) 2023 Spacebar and Spacebar Contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
export interface TotpDisableSchema { export interface TotpDisableSchema {
/**
* @minLength 6
* @maxLength 6
*/
code: string; code: string;
} }

View File

@ -1,23 +1,31 @@
/* /*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors Copyright (C) 2023 Spacebar and Spacebar Contributors
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
export interface TotpEnableSchema { export interface TotpEnableSchema {
/**
* @minLength 1
* @maxLength 72
*/
password: string; password: string;
/**
* @minLength 6
* @maxLength 6
*/
code?: string; code?: string;
secret?: string; secret?: string;
} }

View File

@ -25,9 +25,24 @@ export interface UserModifySchema {
bio?: string; bio?: string;
accent_color?: number; accent_color?: number;
banner?: string | null; banner?: string | null;
/**
* @minLength 1
* @maxLength 72
*/
password?: string; password?: string;
/**
* @minLength 1
* @maxLength 72
*/
new_password?: string; new_password?: string;
/**
* @minLength 6
* @maxLength 6
*/
code?: string; code?: string;
/**
* @TJS-format email
*/
email?: string; email?: string;
/** /**
* @minLength 4 * @minLength 4