mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 10:45:58 +00:00
Patch service account UI in audit logs, add lastUsed for API keys and service accounts/tokens
This commit is contained in:
@@ -3,6 +3,7 @@ import { Schema, model, Types } from 'mongoose';
|
||||
export interface IAPIKeyData {
|
||||
name: string;
|
||||
user: Types.ObjectId;
|
||||
lastUsed: Date;
|
||||
expiresAt: Date;
|
||||
secretHash: string;
|
||||
}
|
||||
@@ -18,6 +19,9 @@ const apiKeyDataSchema = new Schema<IAPIKeyData>(
|
||||
ref: 'User',
|
||||
required: true
|
||||
},
|
||||
lastUsed: {
|
||||
type: Date
|
||||
},
|
||||
expiresAt: {
|
||||
type: Date
|
||||
},
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface IServiceAccount extends Document {
|
||||
organization: Types.ObjectId;
|
||||
user: Types.ObjectId;
|
||||
publicKey: string;
|
||||
lastUsed: Date;
|
||||
expiresAt: Date;
|
||||
secretHash: string;
|
||||
}
|
||||
@@ -30,6 +31,9 @@ const serviceAccountSchema = new Schema<IServiceAccount>(
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
lastUsed: {
|
||||
type: Date
|
||||
},
|
||||
expiresAt: {
|
||||
type: Date
|
||||
},
|
||||
@@ -44,6 +48,6 @@ const serviceAccountSchema = new Schema<IServiceAccount>(
|
||||
}
|
||||
);
|
||||
|
||||
const ServiceAccount = model<IServiceAccount>('ServiceAcount', serviceAccountSchema);
|
||||
const ServiceAccount = model<IServiceAccount>('ServiceAccount', serviceAccountSchema);
|
||||
|
||||
export default ServiceAccount;
|
||||
@@ -7,6 +7,7 @@ export interface IServiceTokenData extends Document {
|
||||
environment: string;
|
||||
user: Types.ObjectId;
|
||||
serviceAccount: Types.ObjectId;
|
||||
lastUsed: Date;
|
||||
expiresAt: Date;
|
||||
secretHash: string;
|
||||
encryptedKey: string;
|
||||
@@ -26,7 +27,7 @@ const serviceTokenDataSchema = new Schema<IServiceTokenData>(
|
||||
ref: 'Workspace',
|
||||
required: true
|
||||
},
|
||||
environment: { // TODO: adapt to upcoming environment id
|
||||
environment: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
@@ -38,6 +39,9 @@ const serviceTokenDataSchema = new Schema<IServiceTokenData>(
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'ServiceAccount'
|
||||
},
|
||||
lastUsed: {
|
||||
type: Date
|
||||
},
|
||||
expiresAt: {
|
||||
type: Date
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user