Beispiel #1
0
 public AuditActor(string machineName, string machineIP, string userName, string authenticationType, DateTime timeStampUtc, AuditActor onBehalfOf)
 {
     MachineName = machineName;
     UserName = userName;
     AuthenticationType = authenticationType;
     TimestampUtc = timeStampUtc;
     OnBehalfOf = onBehalfOf;
 }
Beispiel #2
0
 public AuditActor(string machineName, string machineIP, string userName, string authenticationType, DateTime timeStampUtc, AuditActor onBehalfOf)
 {
     MachineName        = machineName;
     UserName           = userName;
     AuthenticationType = authenticationType;
     TimestampUtc       = timeStampUtc;
     OnBehalfOf         = onBehalfOf;
 }
Beispiel #3
0
        protected override async Task <AuditActor> GetActor()
        {
            // Construct an actor representing the user the service is acting on behalf of
            AuditActor onBehalfOf = null;

            if (_onBehalfOfThunk != null)
            {
                onBehalfOf = await _onBehalfOfThunk();
            }
            return(await AuditActor.GetCurrentMachineActor(onBehalfOf));
        }
Beispiel #4
0
        public static async Task<AuditActor> GetCurrentMachineActor(AuditActor onBehalfOf)
        {
            // Try to get local IP
            string ipAddress = await GetLocalIP();

            return new AuditActor(
                Environment.MachineName,
                ipAddress,
                String.Format(@"{0}\{1}", Environment.UserDomainName, Environment.UserName),
                "MachineUser",
                DateTime.UtcNow,
                onBehalfOf);
        }
Beispiel #5
0
        public static async Task <AuditActor> GetCurrentMachineActor(AuditActor onBehalfOf)
        {
            // Try to get local IP
            string ipAddress = await GetLocalIP();

            return(new AuditActor(
                       Environment.MachineName,
                       ipAddress,
                       String.Format(@"{0}\{1}", Environment.UserDomainName, Environment.UserName),
                       "MachineUser",
                       DateTime.UtcNow,
                       onBehalfOf));
        }
Beispiel #6
0
 protected virtual Task <AuditActor> GetActor()
 {
     return(AuditActor.GetCurrentMachineActor());
 }