Ejemplo n.º 1
0
        private bool ValidateAndCleanRequestMessage(WorkflowAuthorisationArgs args)
        {
            if (args == null)
            {
                return(false);
            }

            return(_WorkflowAuthorisationTokenValidator.IsValid(args.Token));
        }
Ejemplo n.º 2
0
        public IActionResult Execute(WorkflowAuthorisationArgs args)
        {
            if (!ValidateAndCleanRequestMessage(args))
            {
                return(new BadRequestResult());
            }

            _WorkflowAuthorisationWriter.Execute(args);
            return(new OkResult());
        }
        public async Task Execute(WorkflowAuthorisationArgs args)
        {
            var Workflow = _DbContextProvider.Current.Set <KeysFirstWorkflowEntity>()
                           .Where(x => x.AuthorisationToken == args.Token)
                           .Take(1)
                           .ToArray()
                           .SingleOrDefault();

            if (Workflow == null)
            {
                //TODO log a miss.
                return;
            }

            Workflow.Authorised = true;
            _DbContextProvider.Current.Update(Workflow);
        }