mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 17:30:06 +00:00
Continue developing service token v2
This commit is contained in:
@@ -23,6 +23,10 @@ export interface ISecret {
|
||||
secretValueIV: string;
|
||||
secretValueTag: string;
|
||||
secretValueHash: string;
|
||||
secretCommentCiphertext?: string;
|
||||
secretCommentIV?: string;
|
||||
secretCommentTag?: string;
|
||||
secretCommentHash?: string;
|
||||
}
|
||||
|
||||
const secretSchema = new Schema<ISecret>(
|
||||
@@ -82,6 +86,22 @@ const secretSchema = new Schema<ISecret>(
|
||||
secretValueHash: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
secretCommentCiphertext: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
secretCommentIV: {
|
||||
type: String, // symmetric
|
||||
required: false
|
||||
},
|
||||
secretCommentTag: {
|
||||
type: String, // symmetric
|
||||
required: false
|
||||
},
|
||||
secretCommentHash: {
|
||||
type: String,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ export interface IServiceTokenData {
|
||||
name: string;
|
||||
workspace: Types.ObjectId;
|
||||
environment: string; // TODO: adapt to upcoming environment id
|
||||
user: Types.ObjectId;
|
||||
expiresAt: Date;
|
||||
prefix: string;
|
||||
serviceTokenHash: string;
|
||||
@@ -28,6 +29,11 @@ const serviceTokenDataSchema = new Schema<IServiceTokenData>(
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
user: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'User',
|
||||
required: true
|
||||
},
|
||||
expiresAt: {
|
||||
type: Date
|
||||
},
|
||||
@@ -38,7 +44,8 @@ const serviceTokenDataSchema = new Schema<IServiceTokenData>(
|
||||
serviceTokenHash: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true
|
||||
required: true,
|
||||
select: true
|
||||
},
|
||||
encryptedKey: {
|
||||
type: String,
|
||||
|
||||
Reference in New Issue
Block a user