✨ add requestSignature to Config
This commit is contained in:
parent
e1ec11d4b5
commit
bff8f0f642
@ -20,7 +20,7 @@
|
|||||||
"discord-open-source"
|
"discord-open-source"
|
||||||
],
|
],
|
||||||
"author": "Fosscord",
|
"author": "Fosscord",
|
||||||
"license": "ISC",
|
"license": "GPLV3",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/fosscord/fosscord-server-util/issues"
|
"url": "https://github.com/fosscord/fosscord-server-util/issues"
|
||||||
},
|
},
|
||||||
|
@ -11,6 +11,7 @@ export const PublicUserProjection = {
|
|||||||
public_flags: true,
|
public_flags: true,
|
||||||
avatar: true,
|
avatar: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface User {
|
export interface User {
|
||||||
id: string;
|
id: string;
|
||||||
username: string; // username max length 32, min 2
|
username: string; // username max length 32, min 2
|
||||||
@ -22,6 +23,7 @@ export interface User {
|
|||||||
premium: boolean; // if user bought nitro
|
premium: boolean; // if user bought nitro
|
||||||
premium_type: number; // nitro level
|
premium_type: number; // nitro level
|
||||||
bot: boolean; // if user is bot
|
bot: boolean; // if user is bot
|
||||||
|
bio: string; // short description of the user (max 190 chars)
|
||||||
system: boolean; // shouldn't be used, the api sents this field type true, if the genetaed message comes from a system generated author
|
system: boolean; // shouldn't be used, the api sents this field type true, if the genetaed message comes from a system generated author
|
||||||
nsfw_allowed: boolean; // if the user is older than 18 (resp. Config)
|
nsfw_allowed: boolean; // if the user is older than 18 (resp. Config)
|
||||||
mfa_enabled: boolean; // if multi factor authentication is enabled
|
mfa_enabled: boolean; // if multi factor authentication is enabled
|
||||||
@ -42,7 +44,7 @@ export interface User {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Privat user data:
|
// Private user data:
|
||||||
export interface UserData {
|
export interface UserData {
|
||||||
valid_tokens_since: Date; // all tokens with a previous issue date are invalid
|
valid_tokens_since: Date; // all tokens with a previous issue date are invalid
|
||||||
relationships: Relationship[];
|
relationships: Relationship[];
|
||||||
@ -138,6 +140,7 @@ export const UserSchema = new Schema({
|
|||||||
premium: Boolean,
|
premium: Boolean,
|
||||||
premium_type: Number,
|
premium_type: Number,
|
||||||
bot: Boolean,
|
bot: Boolean,
|
||||||
|
bio: String,
|
||||||
system: Boolean,
|
system: Boolean,
|
||||||
nsfw_allowed: Boolean,
|
nsfw_allowed: Boolean,
|
||||||
mfa_enabled: Boolean,
|
mfa_enabled: Boolean,
|
||||||
|
@ -79,6 +79,7 @@ export interface DefaultOptions {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
security: {
|
security: {
|
||||||
|
requestSignature: string;
|
||||||
jwtSecret: string;
|
jwtSecret: string;
|
||||||
forwadedFor: string | null; // header to get the real user ip address
|
forwadedFor: string | null; // header to get the real user ip address
|
||||||
captcha: {
|
captcha: {
|
||||||
@ -93,7 +94,7 @@ export interface DefaultOptions {
|
|||||||
};
|
};
|
||||||
register: {
|
register: {
|
||||||
email: {
|
email: {
|
||||||
necessary: boolean;
|
necessary: boolean; // we have to use necessary instead of required as the cli tool uses json schema and can't use required
|
||||||
allowlist: boolean;
|
allowlist: boolean;
|
||||||
blocklist: boolean;
|
blocklist: boolean;
|
||||||
domains: string[];
|
domains: string[];
|
||||||
@ -164,6 +165,7 @@ export const DefaultOptions: DefaultOptions = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
security: {
|
security: {
|
||||||
|
requestSignature: crypto.randomBytes(32).toString("base64"),
|
||||||
jwtSecret: crypto.randomBytes(256).toString("base64"),
|
jwtSecret: crypto.randomBytes(256).toString("base64"),
|
||||||
forwadedFor: null,
|
forwadedFor: null,
|
||||||
// forwadedFor: "X-Forwarded-For" // nginx/reverse proxy
|
// forwadedFor: "X-Forwarded-For" // nginx/reverse proxy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user