public void IsAllowed_AskForInexistentRule_ShouldReturnFalse()
 {
     var urlGuard = new UrlFilter (_urlRules);
       Assert.That (urlGuard.IsAllowed ("http://this/is/not/allowed.html"), Is.False);
 }
 public void IsAllowed_AskForPermittedUrl3_ShouldReturnTrue()
 {
     var urlGuard = new UrlFilter (_urlRules);
       Assert.That (urlGuard.IsAllowed ("http://this/is/allowed.html?key=value"), Is.True);
 }
 public void IsAllowed_AskForWildcardedUrl3_ShouldReturnTrue()
 {
     var urlGuard = new UrlFilter (_urlRules);
       Assert.That (urlGuard.IsAllowed ("http://this/is/also/allowed.html"), Is.True);
 }
 public void IsAllowed_AskForWildcardedUrl_ShouldReturnTrue()
 {
     var urlGuard = new UrlFilter (_urlRules);
       Assert.That (urlGuard.IsAllowed ("http://fhis/is/allowed-and-valid"), Is.True);
 }
 public void IsAllowed_AskForSSLOnlyUrlWithSSL3_ShouldReturnTrue()
 {
     var urlGuard = new UrlFilter (_urlRules);
       Assert.That (urlGuard.IsAllowed ("https://this/is/secure.html"), Is.True);
 }
 public void IsAllowed_AskForProhibitedUrl_ShouldReturnFalse()
 {
     var urlGuard = new UrlFilter (_urlRules);
       Assert.That (urlGuard.IsAllowed ("http://not/allowed.html"), Is.False);
 }
 public void IsAllowed_AskForProhibitedUrl3_ShouldReturnFalse()
 {
     var urlGuard = new UrlFilter (_urlRules);
       Assert.That (urlGuard.IsAllowed ("ftp://another.test.de/badapp"), Is.False);
 }
 public void IsAllowed_AskForProhibitedUrl2_ShouldReturnFalse()
 {
     var urlGuard = new UrlFilter (_urlRules);
       Assert.That (urlGuard.IsAllowed ("http://some.stuff.test.com/badapp"), Is.False);
 }
        public void LoadFrom(Uri manifestLocation)
        {
            ArgumentUtility.CheckNotNull ("manifestLocation", manifestLocation);

              var configuration = DesktopGapConfigurationProvider.Create (String.Empty, manifestLocation.ToString()).GetConfiguration();

              Application = new ApplicationInfo
                    {
                        Name = configuration.Application.Name,
                        BaseUri = configuration.Application.GetBaseUri(),
                        IconUri = configuration.Application.GetIconUri(),
                        ManifestUri = manifestLocation,
                        AllowCloseHomeTab = configuration.Application.AllowCloseHomeTab,
                        AlwaysShowUrl = configuration.Application.AlwaysShowUrl,
                        AlwaysOpenHomeUrl = configuration.Application.AlwaysOpenHomeUrl,
                        HomeUri = configuration.Application.GetHomeUri()
                    };

              var thirdPartyUrlRules = configuration.Security.NonApplicationUrlRules;
              var applicationUrlRules = configuration.Security.ApplicationUrlRules;
              var startUpUrlRules = configuration.Security.StartupUrlRules;

              var resourceUrls = thirdPartyUrlRules.Union (applicationUrlRules);

              var addInRules = configuration.Security.AddInRules;

              ResourceFilter = new UrlFilter (resourceUrls);
              NonApplicationUrlFilter = new UrlFilter (thirdPartyUrlRules);
              AddInAllowedFilter = new UrlFilter (applicationUrlRules);
              StartUpFilter = new UrlFilter (startUpUrlRules);
              AddInFilter = new AddInFilter (addInRules);

              HomeTabColorCode = configuration.Application.TabColors.Home;
              NonApplicationTabColorCode = configuration.Application.TabColors.NonApplication;
              ApplicationTabColorCode = configuration.Application.TabColors.Application;

              EnableResourceFilter = configuration.Security.EnableResourceFilter;
        }