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