Implement private & public key in Project.ts model

This commit is contained in:
Mathias Wagner
2024-07-22 23:52:10 +02:00
parent f9a49139c3
commit ae09cd7b3f

View File

@ -15,6 +15,8 @@ export interface IProject {
name: string, name: string,
creatorId: ObjectId, creatorId: ObjectId,
validationKey: string, validationKey: string,
privateKey: string,
publicKey: string,
defaults: IProjectDefaults defaults: IProjectDefaults
} }
@ -35,6 +37,14 @@ const ProjectSchema = new Schema<IProject>({
type: String, type: String,
default: () => crypto.randomBytes(24).toString("hex") default: () => crypto.randomBytes(24).toString("hex")
}, },
privateKey: {
type: String,
required: true
},
publicKey: {
type: String,
required: true
},
defaults: { defaults: {
type: Object, type: Object,
default: { licenseKey: "NNUN-UUNN-UNUU-NUUN", groups: [], expirationDate: new Date(0), permissions: [], maxUses: -1 }, default: { licenseKey: "NNUN-UUNN-UNUU-NUUN", groups: [], expirationDate: new Date(0), permissions: [], maxUses: -1 },