public LEOUploadModule(APIConnection connection, APIConnection priveligedConnection, ManagerConfiguration managerConfiguration, MetadataAuditLogStore auditLogStore) { this.connection = connection; this.managerConfiguration = managerConfiguration; // This privieged connection allows us to do things like add a user. this.privilegedConnection = priveligedConnection; this.auditLogStore = auditLogStore; }
public LEOUserItemQueryHandler( PathService pathService, APIConnection connection, IAuditLogStore auditLogStore, LEOUploadModule leoUploadModule, ManagerConfiguration managerConfiguration, FileService fileService) : base(pathService, connection, managerConfiguration, fileService) { this.auditLogStore = auditLogStore; this.LEOUploadModule = leoUploadModule; this.ManagerConfiguration = managerConfiguration; }
public EDiscovery(APIConnection connection, APIConnection priveligedConnection, ManagerConfiguration managerConfiguration, MetadataAuditLogStore auditLogStore) { this.connection = connection; this.managerConfiguration = managerConfiguration; // This priveleged connection is used specifically when we're upgrading to the edisc credentials. We really don't want anything else // in the pipeline to be able to use this. So to be safe we're creating a seperate connection in this case. this.privilegedConnection = priveligedConnection; this.auditLogStore = auditLogStore; }
public PathService( APIConnection connection, MetadataAuditLogStore auditLogStore, ViewSetService viewSetService, ModuleConfigurator moduleConfigurator, ManagerConfiguration managerConfiguration, FileService fileService ) : base(connection) { this.auditLogStore = auditLogStore; this.viewSetService = viewSetService; this.moduleConfigurator = moduleConfigurator; this.ManagerConfiguration = managerConfiguration; this.fileService = fileService; }
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) { // do something before the action executes Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); ActionExecutedContext resultContext = await next();//执行Action // do something after the action executes; resultContext.Result will be set stopwatch.Stop(); if (!Ignore) { try { AuditLogModel model = new AuditLogModel { CurrentUserId = context.HttpContext.User.Identity.IsAuthenticated ? context.HttpContext.User.FindFirst("sub").Value : string.Empty, Action = context.ActionDescriptor.DisplayName.ToSubstring(127), HttpMethod = context.HttpContext.Request.Method, IP = HttpHelper.GetIP(context.HttpContext), ExecuteDuration = (int)stopwatch.ElapsedMilliseconds, ExecuteTime = DateTime.Now, Arguments = context.ActionArguments.Count > 0 ? context.ActionArguments.ToJson().ToSubstring(1023) : string.Empty, Exception = resultContext.Exception?.Message.ToSubstring(127), Result = (resultContext.Result is JsonResult) ? (resultContext.Result as JsonResult).Value?.ToJson().ToSubstring(2047) : string.Empty }; IAuditLogStore store = context.HttpContext.RequestServices.GetService <IAuditLogStore>(); await store.SaveAsync(model); } catch (Exception ex) { throw ex; } } }
public override BaseItemQueryHandler GetInitialQueryHandler(PathIdentifier identifier, PathService pathService, APIConnection connection, IAuditLogStore auditLogStore, ManagerConfiguration managerConfiguration, FileService fileService) { if (identifier.PathKey == LOG_READER_PATH_KEY) { return(new LogReaderQueryHandler(pathService, connection, managerConfiguration, fileService, logReaderService)); } return(null); }
public EDiscoveryRootQueryHandler(PathService pathService, APIConnection connection, IAuditLogStore auditLogStore, EDiscovery eDiscovery, ManagerConfiguration managerConfiguration, FileService fileService) : base(pathService, connection, managerConfiguration, fileService) { this.auditLogStore = auditLogStore; this.eDiscovery = eDiscovery; this.ManagerConfiguration = managerConfiguration; }
public override BaseItemQueryHandler GetInitialQueryHandler(PathIdentifier identifier, PathService pathService, APIConnection connection, IAuditLogStore auditLogStore, ManagerConfiguration managerConfiguration, FileService fileService) { // If the user is leo user, we're going to use a special query handler that // will return only the files the user is allowed to see. if (LEOUploadUtility.IsUserLeo(connection.UserAccessIdentifiers)) { var userKey = connection.UserIdentifier.UserKey; // here we're going to do some basic security check. The userKey has a folder key on it. We need to make sure that matches. var userKeyTokens = userKey.Split(':').ToList(); // now this will be an array, of tokens, keep in mind userkeys can be something like Defendant:18337980:[email protected], so we want everything before the last ':' // so we can remove the last token, and then we'll be able to just join back everything else. userKeyTokens.RemoveAt(userKeyTokens.Count - 1); // also get rid of the leo: prefix userKeyTokens.RemoveAt(0); var folderKeyFromUser = String.Join(':', userKeyTokens); if (folderKeyFromUser != identifier.FolderKey) { throw (new UnauthorizedAccessException($"You're not authorized for this Folder userKey:{userKey} tried to access: {identifier.FolderKey}")); } return(new LEOUserItemQueryHandler(pathService, connection, auditLogStore, this, managerConfiguration, fileService)); } if (identifier.PathKey == LEOUploadUtility.LEO_UPLOAD_PATH_KEY) { return(new LEOUploadRootQueryHandler(pathService, connection, auditLogStore, this, managerConfiguration, fileService)); } return(null); }
public BaseItemQueryHandler GetActiveHandler(PathIdentifier identifier, List <IModule> activeModules, PathService pathService, IAuditLogStore auditLogStore, ManagerConfiguration managerConfiguration, FileService fileService) { var handler = new BaseItemQueryHandler(pathService, connection, managerConfiguration, fileService); foreach (var module in activeModules) { var initalHandler = module.GetInitialQueryHandler(identifier, pathService, connection, auditLogStore, managerConfiguration, fileService); if (initalHandler != null) { handler = initalHandler; } } foreach (var module in activeModules) { var overrideHandler = module.GetOverrideQueryHandler(identifier, pathService, connection, auditLogStore, managerConfiguration, fileService); if (overrideHandler != null) { handler = overrideHandler; } } return(handler); }
public override BaseItemQueryHandler GetInitialQueryHandler(PathIdentifier identifier, PathService pathService, APIConnection connection, IAuditLogStore auditLogStore, ManagerConfiguration managerConfiguration, FileService fileService) { // If the user is an eDiscovery user, we're going to use a special query handler that will return only the files the user is allowed to see. if (EDiscoveryUtility.IsUserEDiscovery(connection.UserAccessIdentifiers)) { var userKey = connection.UserIdentifier.UserKey; // here we're going to do some basic security check. The userKey has a folder key on it. We need to make sure that matches. var userKeyTokens = userKey.Split(':').ToList(); // now this will be an array, of tokens, keep in mind userkeys can be something like Defendant:18337980:[email protected], so we want everything before the last ':' // so we can remove the last token, and then we'll be able to just join back everything else. userKeyTokens.RemoveAt(userKeyTokens.Count - 1); var folderKeyFromUser = String.Join(':', userKeyTokens); if (folderKeyFromUser != identifier.FolderKey) { throw (new UnauthorizedAccessException($"You're not authorized for this eDiscovery Folder userKey:{userKey} tried to access: {identifier.FolderKey}")); } return(new EDiscoveryUserItemQueryHandler(pathService, connection, auditLogStore, this, managerConfiguration, fileService)); } if (identifier.PathKey == EDiscoveryUtility.E_DISCOVERY_PATH_KEY) { return(new EDiscoveryRootQueryHandler(pathService, connection, auditLogStore, this, managerConfiguration, fileService)); } if (identifier.PathKey != null && identifier.FullName.StartsWith(EDiscoveryUtility.E_DISCOVERY_NOT_SHARED_PATH_KEY)) { return(new EDiscoveryStagedItemQueryHandler(pathService, connection, managerConfiguration, fileService)); } if (identifier.PathKey != null && (identifier.FullName.StartsWith(EDiscoveryUtility.E_DISCOVERY_DATED_PACKAGE_PATH_KEY) || identifier.FullName.StartsWith(EDiscoveryUtility.E_DISCOVERY_ALL_PACKAGE_PATH_KEY))) { return(new EDiscoveryDatedPackageItemQueryHandler(pathService, connection, managerConfiguration, fileService)); } return(null); }
public virtual BaseItemQueryHandler GetOverrideQueryHandler(PathIdentifier identifier, PathService pathService, APIConnection connection, IAuditLogStore auditLogStore, ManagerConfiguration managerConfiguration, FileService fileService) { return(null); }
public AuthController(IAuthenticationService authenticationService, IJWTService jWTService, IAuditLogStore auditLogStore) { this._authenticationService = authenticationService; this._jWTService = jWTService; this._auditLogStore = auditLogStore; }