mirror of
https://github.com/gnmyt/LicenseAPI.git
synced 2026-01-11 18:51:47 +00:00
Implement private & public key in Project.ts model
This commit is contained in:
@ -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 },
|
||||||
|
|||||||
Reference in New Issue
Block a user