Skip to content

Commit

Permalink
Merge pull request #1202 from DEVTomatoCake/fix/password-mfacode-schemas
Browse files Browse the repository at this point in the history
Fixes for password, mfa code & email validation schemas
  • Loading branch information
Puyodead1 authored Aug 30, 2024
2 parents efd3816 + 1d98b2f commit 3a63ae8
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 21 deletions.
29 changes: 29 additions & 0 deletions assets/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
"type": "string"
},
"code": {
"minLength": 6,
"maxLength": 6,
"type": "string"
}
},
Expand Down Expand Up @@ -174,6 +176,8 @@
"type": "object",
"properties": {
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
}
},
Expand Down Expand Up @@ -5606,6 +5610,8 @@
"type": "string"
},
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"undelete": {
Expand Down Expand Up @@ -5986,6 +5992,8 @@
"type": "object",
"properties": {
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"regenerate": {
Expand Down Expand Up @@ -6022,6 +6030,8 @@
"type": "object",
"properties": {
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"token": {
Expand Down Expand Up @@ -6359,6 +6369,8 @@
"type": "object",
"properties": {
"code": {
"minLength": 6,
"maxLength": 6,
"type": "string"
}
},
Expand All @@ -6370,9 +6382,13 @@
"type": "object",
"properties": {
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"code": {
"minLength": 6,
"maxLength": 6,
"type": "string"
},
"secret": {
Expand Down Expand Up @@ -6497,15 +6513,22 @@
"nullable": true
},
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"new_password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"code": {
"minLength": 6,
"maxLength": 6,
"type": "string"
},
"email": {
"format": "email",
"type": "string"
},
"discriminator": {
Expand Down Expand Up @@ -10945,6 +10968,12 @@
},
"tags": [
"scheduled-maintenances"
],
"x-badges": [
{
"label": "Spacebar-only",
"color": "red"
}
]
}
},
Expand Down
23 changes: 23 additions & 0 deletions assets/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
"type": "string"
},
"code": {
"minLength": 6,
"maxLength": 6,
"type": "string"
}
},
Expand Down Expand Up @@ -155,6 +157,8 @@
"type": "object",
"properties": {
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
}
},
Expand Down Expand Up @@ -87935,6 +87939,8 @@
"type": "string"
},
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"undelete": {
Expand Down Expand Up @@ -122124,6 +122130,8 @@
"type": "object",
"properties": {
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"regenerate": {
Expand Down Expand Up @@ -131818,6 +131826,8 @@
"type": "object",
"properties": {
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"token": {
Expand Down Expand Up @@ -190102,6 +190112,8 @@
"type": "object",
"properties": {
"code": {
"minLength": 6,
"maxLength": 6,
"type": "string"
}
},
Expand Down Expand Up @@ -194942,9 +194954,13 @@
"type": "object",
"properties": {
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"code": {
"minLength": 6,
"maxLength": 6,
"type": "string"
},
"secret": {
Expand Down Expand Up @@ -214395,15 +214411,22 @@
]
},
"password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"new_password": {
"minLength": 1,
"maxLength": 72,
"type": "string"
},
"code": {
"minLength": 6,
"maxLength": 6,
"type": "string"
},
"email": {
"format": "email",
"type": "string"
},
"discriminator": {
Expand Down
10 changes: 7 additions & 3 deletions src/util/schemas/ApplicationAuthorizeSchema.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
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
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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/>.
*/
Expand All @@ -21,5 +21,9 @@ export interface ApplicationAuthorizeSchema {
guild_id: string;
permissions: string;
captcha_key?: string;
/**
* @minLength 6
* @maxLength 6
*/
code?: string; // 2fa code
}
10 changes: 7 additions & 3 deletions src/util/schemas/BackupCodesChallengeSchema.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
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
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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/>.
*/

export interface BackupCodesChallengeSchema {
/**
* @minLength 1
* @maxLength 72
*/
password: string;
}
10 changes: 7 additions & 3 deletions src/util/schemas/LoginSchema.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
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
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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/>.
*/

export interface LoginSchema {
login: string;
/**
* @minLength 1
* @maxLength 72
*/
password: string;
undelete?: boolean;
captcha_key?: string;
Expand Down
10 changes: 7 additions & 3 deletions src/util/schemas/MfaCodesSchema.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
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
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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/>.
*/

export interface MfaCodesSchema {
/**
* @minLength 1
* @maxLength 72
*/
password: string;
regenerate?: boolean;
}
10 changes: 7 additions & 3 deletions src/util/schemas/PasswordResetSchema.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
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
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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/>.
*/

export interface PasswordResetSchema {
/**
* @minLength 1
* @maxLength 72
*/
password: string;
token: string;
}
10 changes: 7 additions & 3 deletions src/util/schemas/TotpDisableSchema.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
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
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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/>.
*/

export interface TotpDisableSchema {
/**
* @minLength 6
* @maxLength 6
*/
code: string;
}
Loading

0 comments on commit 3a63ae8

Please sign in to comment.