public void ProcessRequest(GDPRMessage message)
        {
            this.Request = message;

            GDPRSubject s = new GDPRSubject(message.Subject);

            switch (message.GetType().Name)
            {
            case "DeleteMessage":
                this.RecordDeleteIn(message.Subject);
                break;

            case "DataRequestMessage":
                List <GDPRSubject> customers = this.RecordSearch(s);

                foreach (GDPRSubject c in customers)
                {
                    string storageLocation = this.ExportData(c.ApplicationSubjectId);

                    //send a export message...
                    ExportMessage em = new ExportMessage();
                    em.ApplicationId        = Request.ApplicationId;
                    em.ApplicationSubjectId = c.ApplicationSubjectId;
                    em.SubjectRequestId     = Request.SubjectRequestId;
                    em.Subject    = Request.Subject;
                    em.BlobUrl    = storageLocation;
                    this.Response = em;

                    MasterGDPRHelper.SendMessage(em);
                }
                break;
            }
        }
        public string SubjectHold([FromUri] string applicationId, [FromUri] string subjectId, [FromUri] string emailAddress)
        {
            try
            {
                GDPRMessage msg = new GDPRMessage();

                HoldMessage dm = new HoldMessage();
                dm.ApplicationId        = applicationId;
                dm.ApplicationSubjectId = subjectId;
                dm.Direction            = "in";
                msg = dm;

                GDPRSubject s = new GDPRSubject();
                s.Email     = emailAddress;
                msg.Subject = s;

                MasterGDPRHelper.SendMessage(msg);
            }
            catch
            {
                return("Failure");
            }

            return("Success");
        }
Ejemplo n.º 3
0
        void GetAllRecords()
        {
            List <Customer> customers = e.Customers.ToList();

            foreach (Customer c in customers)
            {
                CreateMessage cm = new CreateMessage();
                cm.ApplicationSubjectId = c.CustomerId.ToString();
                cm.ApplicationId        = this.ApplicationId.ToString();
                MasterGDPRHelper.SendMessage(cm);
            }
        }
Ejemplo n.º 4
0
        static void CheckForChanges()
        {
            foreach (Application a in MasterGDPRHelper.GDPRDatabase.Applications)
            {
                if (a.IsActive)
                {
                    Type            t   = Type.GetType(a.ProcessorClass + ",GDPR.Util");
                    GDPRApplication app = (GDPRApplication)Activator.CreateInstance(t);

                    List <GDPRMessage> messages = app.GetChanges(a.ChangeDate);

                    foreach (GDPRMessage msg in messages)
                    {
                        MasterGDPRHelper.SendMessage(msg);
                    }

                    MasterGDPRHelper.UpdateApplicationChangeDate(a.ApplicationId, DateTime.Now);
                }
            }
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            //create the user in the system...
            Setup();

            //Check for new additions (non http outgoing trigger based system like Azure SQL)
            CheckForChanges();

            //send a notify message...
            NotifyMessage nm = new NotifyMessage();

            nm.Direction = "out";
            GDPRSubject s = new GDPRSubject();

            s.Email         = "*****@*****.**";
            nm.Subject      = s;
            nm.Title        = "CRM Compromised";
            nm.ShortMessage = "CRM Compromised";
            nm.LongMessage  = "As of this morning we have noticed abnormal activity in our system that looks hacker related.  We will notify you of future updates.";
            MasterGDPRHelper.SendMessage(nm);

            //send me my data request...
            DataSubjectQueryMessage dsqm = new DataSubjectQueryMessage();

            s            = new GDPRSubject();
            s.Email      = "*****@*****.**";
            dsqm.Subject = s;
            MasterGDPRHelper.SendMessage(dsqm);

            //delete request...
            DataSubjectDeleteMessage dsdm = new DataSubjectDeleteMessage();

            s            = new GDPRSubject();
            s.Email      = "*****@*****.**";
            dsdm.Subject = s;
            MasterGDPRHelper.SendMessage(dsdm);
        }