mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 19:28:35 +00:00
Add v1 audit log backend models and wiring to push secrets
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as Sentry from '@sentry/node';
|
||||
import {
|
||||
Log
|
||||
} from '../models';
|
||||
|
||||
|
||||
export const getLogs = async (req: Request, res: Response) => {
|
||||
// get logs
|
||||
|
||||
console.log('getLogs');
|
||||
let logs;
|
||||
try {
|
||||
const { workspaceId } = req.params;
|
||||
|
||||
logs = await Log.find({
|
||||
workspace: workspaceId
|
||||
});
|
||||
} catch (err) {
|
||||
Sentry.setUser({ email: req.user.email });
|
||||
Sentry.captureException(err);
|
||||
return res.status(400).send({
|
||||
message: 'Failed to get audit logs'
|
||||
});
|
||||
}
|
||||
|
||||
return res.status(200).send({
|
||||
logs
|
||||
});
|
||||
}
|
||||
@@ -14,7 +14,6 @@ import * as stripeController from './stripeController';
|
||||
import * as userActionController from './userActionController';
|
||||
import * as userController from './userController';
|
||||
import * as workspaceController from './workspaceController';
|
||||
import * as logController from './logController';
|
||||
|
||||
export {
|
||||
authController,
|
||||
@@ -32,6 +31,5 @@ export {
|
||||
stripeController,
|
||||
userActionController,
|
||||
userController,
|
||||
workspaceController,
|
||||
logController
|
||||
workspaceController
|
||||
};
|
||||
|
||||
@@ -389,7 +389,9 @@ export const pushWorkspaceSecrets = async (req: Request, res: Response) => {
|
||||
userId: req.user._id,
|
||||
workspaceId,
|
||||
environment,
|
||||
secrets
|
||||
secrets,
|
||||
channel: channel ? channel : 'cli',
|
||||
ipAddress: req.ip
|
||||
});
|
||||
|
||||
await pushKeys({
|
||||
|
||||
Reference in New Issue
Block a user