Exemplo n.º 1
0
 protected NegationVerificationProvider(IVerificationProvider <TOwner> verificationProvider)
     : base(isNegation: true)
 {
     Timeout       = verificationProvider.Timeout;
     RetryInterval = verificationProvider.RetryInterval;
     Strategy      = verificationProvider.Strategy;
 }
Exemplo n.º 2
0
        internal TVerificationProvider ApplySettings(IVerificationProvider <TOwner> verificationProvider)
        {
            Timeout       = verificationProvider.Timeout;
            RetryInterval = verificationProvider.RetryInterval;

            return((TVerificationProvider)this);
        }
Exemplo n.º 3
0
 public AuthController(IAntiforgery antiForgeryService, ILocalAuthenticationService authService, IOptions <Toucan.Server.Config> serverConfig, ISignupService signupService, IVerificationProvider verificationProvider, ITokenProviderService <Token> tokenService)
 {
     this.antiForgeryService   = antiForgeryService;
     this.authService          = authService;
     this.serverConfig         = serverConfig.Value;
     this.signupService        = signupService;
     this.tokenService         = tokenService;
     this.verificationProvider = verificationProvider;
 }
Exemplo n.º 4
0
        public ManageController(IVerificationProvider verification, IMapper mapper, IUsersService usersService)
        {
            Guard.WhenArgument(verification, nameof(verification)).IsNull().Throw();
            Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw();
            Guard.WhenArgument(usersService, nameof(usersService)).IsNull().Throw();


            this.verification = verification;
            this.mapper       = mapper;
            this.usersService = usersService;
        }
Exemplo n.º 5
0
        protected virtual void Configure(ConfigSource config)
        {
            tokenStore             = (ITokenStore)ConfigureComponent(config.GetChild("tokenStore"), typeof(ITokenStore), typeof(HeapTokenStore));
            callbackStore          = (ICallbackStore)ConfigureComponent(config.GetChild("callbackStore"), typeof(ICallbackStore), typeof(HeapCallbackStore));
            consumerStore          = (IConsumerStore)ConfigureComponent(config.GetChild("consumerStore"), typeof(IConsumerStore), typeof(HeapConsumerStore));
            requestIdValidator     = (IRequestIdValidator)ConfigureComponent(config.GetChild("requestIdValidator"), typeof(IRequestIdValidator), typeof(HeapRequestIdValidator));
            resourceAccessVerifier = (IResourceAccessVerifier)ConfigureComponent(config.GetChild("resourceAccessVerifier"), typeof(IResourceAccessVerifier), null);
            tokenGenerator         = (ITokenGenerator)ConfigureComponent(config.GetChild("tokenGenerator"), typeof(ITokenGenerator), typeof(GuidTokenGenerator));
            verificationProvider   = (IVerificationProvider)ConfigureComponent(config.GetChild("verificationProvider"), typeof(IVerificationProvider), typeof(MD5HashVerificationProvider));

            allowOutOfBandCallback = config.GetBoolean("oobCallback");
        }
        public AdminPanelController(IVerificationProvider verificationProvider, IMapper mapper, IUsersService usersService, IAnimalsService animalsService)
        {
            Guard.WhenArgument(verificationProvider, nameof(verificationProvider)).IsNull().Throw();
            Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw();
            Guard.WhenArgument(usersService, nameof(usersService)).IsNull().Throw();
            Guard.WhenArgument(animalsService, nameof(animalsService)).IsNull().Throw();

            this.verificationProvider = verificationProvider;
            this.mapper         = mapper;
            this.usersService   = usersService;
            this.animalsService = animalsService;
        }
Exemplo n.º 7
0
        public ManageController(IVerificationProvider verification, IMapper mapper, IUsersService usersService,
                                IComputersService computersService, ILaptopsService laptopsService, IDisplaysService displaysService)
        {
            Guard.WhenArgument(verification, nameof(verification)).IsNull().Throw();
            Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw();
            Guard.WhenArgument(usersService, nameof(usersService)).IsNull().Throw();
            Guard.WhenArgument(computersService, nameof(computersService)).IsNull().Throw();
            Guard.WhenArgument(laptopsService, nameof(laptopsService)).IsNull().Throw();
            Guard.WhenArgument(displaysService, nameof(displaysService)).IsNull().Throw();

            this.verification     = verification;
            this.mapper           = mapper;
            this.usersService     = usersService;
            this.computersService = computersService;
            this.laptopsService   = laptopsService;
            this.displaysService  = displaysService;
        }
Exemplo n.º 8
0
        public ProductController(IMapper mapper, IPrintersService printersService,
                                 IImpactPrintersService impactPrinterService, IEngraversService engraversService,
                                 IVinylCuttersService vinylCuttersService, IVerificationProvider verification)
        {
            Guard.WhenArgument(verification, nameof(verification)).IsNull().Throw();
            Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw();
            Guard.WhenArgument(printersService, nameof(printersService)).IsNull().Throw();
            Guard.WhenArgument(impactPrinterService, nameof(impactPrinterService)).IsNull().Throw();
            Guard.WhenArgument(engraversService, nameof(engraversService)).IsNull().Throw();
            Guard.WhenArgument(vinylCuttersService, nameof(vinylCuttersService)).IsNull().Throw();

            this.mapper                = mapper;
            this.printersService       = printersService;
            this.impactPrintersService = impactPrinterService;
            this.engraversService      = engraversService;
            this.vinylCuttersService   = vinylCuttersService;
            this.verification          = verification;
        }
        public static IDataVerificationProvider <TData, TOwner> WithSettings <TData, TOwner>(
            this IDataVerificationProvider <TData, TOwner> should,
            IVerificationProvider <TOwner> sourceVerificationProvider)
            where TOwner : PageObject <TOwner>
        {
            should.CheckNotNull(nameof(should));
            sourceVerificationProvider.CheckNotNull(nameof(sourceVerificationProvider));

            IDataVerificationProvider <TData, TOwner> resultVerificationProvider =
                sourceVerificationProvider.IsNegation && !should.IsNegation
                    ? GetNegationVerificationProvider(should)
                    : should;

            resultVerificationProvider.Timeout       = sourceVerificationProvider.Timeout;
            resultVerificationProvider.RetryInterval = sourceVerificationProvider.RetryInterval;

            return(resultVerificationProvider);
        }
Exemplo n.º 10
0
        public async Task <string> IssueCode(IVerificationProvider provider, IUser user)
        {
            Verification verification = await this.GetPendingVerificationForUser(user);

            if (verification == null)
            {
                verification = new Verification()
                {
                    Code   = Guid.NewGuid().ToString(),
                    UserId = user.UserId
                };

                this.db.Verification.Add(verification);
                this.db.SaveChanges();
            }

            string code = verification.Code;

            provider.Send(user, code);

            return(code);
        }
Exemplo n.º 11
0
        public AdminController(IHttpContextProvider httpContext, IVerificationProvider verification,
                               IUsersService usersService, IMapper mapper, IPrintersService printersService,
                               IImpactPrintersService impactPrinterService, IEngraversService engraversService,
                               IVinylCuttersService vinylCuttersService)
        {
            Guard.WhenArgument(httpContext, nameof(httpContext)).IsNull().Throw();
            Guard.WhenArgument(verification, nameof(verification)).IsNull().Throw();
            Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw();
            Guard.WhenArgument(printersService, nameof(printersService)).IsNull().Throw();
            Guard.WhenArgument(impactPrinterService, nameof(impactPrinterService)).IsNull().Throw();
            Guard.WhenArgument(engraversService, nameof(engraversService)).IsNull().Throw();
            Guard.WhenArgument(vinylCuttersService, nameof(vinylCuttersService)).IsNull().Throw();
            Guard.WhenArgument(usersService, nameof(usersService)).IsNull().Throw();

            this.httpContext          = httpContext;
            this.verification         = verification;
            this.usersService         = usersService;
            this.mapper               = mapper;
            this.printersService      = printersService;
            this.impactPrinterService = impactPrinterService;
            this.engraversService     = engraversService;
            this.vinylCuttersService  = vinylCuttersService;
        }
 protected NegationUIComponentVerificationProvider(TComponent component, IVerificationProvider <TOwner> verificationProvider)
     : base(verificationProvider)
 {
     Component = component;
 }
Exemplo n.º 13
0
 public SignupService(DbContextBase db, ICryptoService crypto, IVerificationProvider verificationProvider)
 {
     this.db     = db;
     this.crypto = crypto;
     this.verificationProvider = verificationProvider;
 }
 internal NegationPageObjectVerificationProvider(TPageObject pageObject, IVerificationProvider <TPageObject> verificationProvider)
     : base(pageObject, verificationProvider)
 {
 }
Exemplo n.º 15
0
 public AccountController(IVerificationProvider verificationProvider)
 {
     Guard.WhenArgument(verificationProvider, nameof(verificationProvider)).IsNull().Throw();
     this.verificationProvider = verificationProvider;
 }
Exemplo n.º 16
0
 internal NegationUIComponentVerificationProvider(TComponent component, IVerificationProvider <TOwner> verificationProvider)
     : base(component, verificationProvider)
 {
 }
Exemplo n.º 17
0
        protected virtual void Configure(ConfigSource config)
        {
            tokenStore = (ITokenStore)ConfigureComponent(config.GetChild("tokenStore"), typeof(ITokenStore), typeof(HeapTokenStore));
            callbackStore = (ICallbackStore)ConfigureComponent(config.GetChild("callbackStore"), typeof(ICallbackStore), typeof(HeapCallbackStore));
            consumerStore = (IConsumerStore)ConfigureComponent(config.GetChild("consumerStore"), typeof(IConsumerStore), typeof(HeapConsumerStore));
            requestIdValidator = (IRequestIdValidator)ConfigureComponent(config.GetChild("requestIdValidator"), typeof(IRequestIdValidator), typeof(HeapRequestIdValidator));
            resourceAccessVerifier = (IResourceAccessVerifier)ConfigureComponent(config.GetChild("resourceAccessVerifier"), typeof(IResourceAccessVerifier), null);
            tokenGenerator = (ITokenGenerator)ConfigureComponent(config.GetChild("tokenGenerator"), typeof(ITokenGenerator), typeof(GuidTokenGenerator));
            verificationProvider = (IVerificationProvider)ConfigureComponent(config.GetChild("verificationProvider"), typeof(IVerificationProvider), typeof(MD5HashVerificationProvider));

            allowOutOfBandCallback = config.GetBoolean("oobCallback");
        }
 internal NegationDataVerificationProvider(IDataProvider <TData, TOwner> dataProvider, IVerificationProvider <TOwner> verificationProvider)
     : base(verificationProvider)
 {
     DataProvider = dataProvider;
 }
Exemplo n.º 19
0
 internal NegationFieldVerificationProvider(TField control, IVerificationProvider <TOwner> verificationProvider)
     : base(control, verificationProvider)
 {
 }