コード例 #1
0
        public void SetUp()
        {
            theSettings = new AuthenticationSettings();
            theSystemTime = new SettableClock();

            theRule = new LockedOutRule(theSettings, theSystemTime);
        }
コード例 #2
0
        public void apply_a_custome_exclusion_and_it_does_not_apply_to_login_page()
        {
            var settings = new AuthenticationSettings();
            var chain = new RoutedChain("foo");
            chain.AddToEnd(ActionCall.For<LoginController>(x => x.get_login(null)));
            settings.ShouldBeExcluded(chain).ShouldBeTrue();

            settings.ExcludeChains = c => c.Calls.Count() == 5; // just need a fake

            settings.ShouldBeExcluded(chain).ShouldBeTrue();
        }
コード例 #3
0
        public void apply_a_custom_exclusion()
        {
            var chain = new RoutedChain("foo");
            chain.AddToEnd(ActionCall.For<AuthenticatedEndpoints>(x => x.get_tag()));

            var settings = new AuthenticationSettings();

            settings.ShouldBeExcluded(chain).ShouldBeFalse();

            settings.ExcludeChains = c => typeof (HtmlTag) == c.ResourceType();

            settings.ShouldBeExcluded(chain).ShouldBeTrue();
        }
コード例 #4
0
ファイル: ILockedOutRule.cs プロジェクト: maniacs-sfa/fubumvc
 public LockedOutRule(AuthenticationSettings settings, ISystemTime systemTime)
 {
     _settings   = settings;
     _systemTime = systemTime;
 }
コード例 #5
0
 public LockedOutRule(AuthenticationSettings settings, ISystemTime systemTime)
 {
     _settings = settings;
     _systemTime = systemTime;
 }
コード例 #6
0
        public void exclude_by_default_if_the_input_type_is_marked_as_NotAuthenticated()
        {
            var chain = new RoutedChain("bar");
            chain.AddToEnd(ActionCall.For<AuthenticatedEndpoints>(x => x.post_something(null)));

            var settings = new AuthenticationSettings();

            settings.ShouldBeExcluded(chain).ShouldBeTrue();
        }
コード例 #7
0
        public void exclude_by_default_actions_marked_as_pass_through()
        {
            var chain = new RoutedChain("foo");
            chain.AddToEnd(ActionCall.For<AuthenticatedEndpoints>(x => x.get_pass_through_authentication()));

            var settings = new AuthenticationSettings();

            settings.ShouldBeExcluded(chain).ShouldBeTrue();
        }
コード例 #8
0
 public void excludes_is_always_false_with_no_exclusions()
 {
     var settings = new AuthenticationSettings();
     settings.ShouldBeExcluded(new RoutedChain("foo")).ShouldBeFalse();
 }