mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00
🔐 feat: Group schema support, refine user schema security, and improve types (#9070)
* feat: Add groupSchema and update userSchema to hide sensitive fields * chore: Bump version of @librechat/data-schemas to 0.0.16
This commit is contained in:
parent
d711fc7852
commit
c78fd0fc83
5 changed files with 11 additions and 10 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -51874,7 +51874,7 @@
|
||||||
},
|
},
|
||||||
"packages/data-schemas": {
|
"packages/data-schemas": {
|
||||||
"name": "@librechat/data-schemas",
|
"name": "@librechat/data-schemas",
|
||||||
"version": "0.0.15",
|
"version": "0.0.16",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-alias": "^5.1.0",
|
"@rollup/plugin-alias": "^5.1.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@librechat/data-schemas",
|
"name": "@librechat/data-schemas",
|
||||||
"version": "0.0.15",
|
"version": "0.0.16",
|
||||||
"description": "Mongoose schemas and models for LibreChat",
|
"description": "Mongoose schemas and models for LibreChat",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.cjs",
|
"main": "dist/index.cjs",
|
||||||
|
|
|
@ -23,3 +23,4 @@ export { default as toolCallSchema } from './toolCall';
|
||||||
export { default as transactionSchema } from './transaction';
|
export { default as transactionSchema } from './transaction';
|
||||||
export { default as userSchema } from './user';
|
export { default as userSchema } from './user';
|
||||||
export { default as memorySchema } from './memory';
|
export { default as memorySchema } from './memory';
|
||||||
|
export { default as groupSchema } from './group';
|
||||||
|
|
|
@ -51,6 +51,7 @@ const userSchema = new Schema<IUser>(
|
||||||
trim: true,
|
trim: true,
|
||||||
minlength: 8,
|
minlength: 8,
|
||||||
maxlength: 128,
|
maxlength: 128,
|
||||||
|
select: false,
|
||||||
},
|
},
|
||||||
avatar: {
|
avatar: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -114,6 +115,7 @@ const userSchema = new Schema<IUser>(
|
||||||
},
|
},
|
||||||
totpSecret: {
|
totpSecret: {
|
||||||
type: String,
|
type: String,
|
||||||
|
select: false,
|
||||||
},
|
},
|
||||||
backupCodes: {
|
backupCodes: {
|
||||||
type: [BackupCodeSchema],
|
type: [BackupCodeSchema],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { Document, Types } from 'mongoose';
|
import { Document } from 'mongoose';
|
||||||
|
|
||||||
export type Group = {
|
export interface IGroup extends Document {
|
||||||
/** The name of the group */
|
/** The name of the group */
|
||||||
name: string;
|
name: string;
|
||||||
/** Optional description of the group */
|
/** Optional description of the group */
|
||||||
|
@ -15,9 +15,7 @@ export type Group = {
|
||||||
source: 'local' | 'entra';
|
source: 'local' | 'entra';
|
||||||
/** External ID (e.g., Entra ID) - required for non-local sources */
|
/** External ID (e.g., Entra ID) - required for non-local sources */
|
||||||
idOnTheSource?: string;
|
idOnTheSource?: string;
|
||||||
};
|
/** Timestamps */
|
||||||
|
createdAt?: Date;
|
||||||
export type IGroup = Group &
|
updatedAt?: Date;
|
||||||
Document & {
|
}
|
||||||
_id: Types.ObjectId;
|
|
||||||
};
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue