Example #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
            {
                // Kill status bar underlay added by FormsAppCompatActivity
                // Must be done before calling FormsAppCompatActivity.OnCreate()
                var statusBarHeightInfo = typeof(FormsAppCompatActivity).GetField("statusBarHeight", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
                if (statusBarHeightInfo == null)
                {
                    statusBarHeightInfo = typeof(FormsAppCompatActivity).GetField("_statusBarHeight", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
                }
                statusBarHeightInfo?.SetValue(this, 0);
            }

            this.Window.AddFlags(WindowManagerFlags.Fullscreen | WindowManagerFlags.TurnScreenOn);

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);

            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Abstractions.Init(this);
            LoadApplication(new App());
        }
 public override void AfterDelete(string key, Abstractions.Data.TransactionInformation transactionInformation)
 {
     using (Database.DisableAllTriggersForCurrentThread())
     {
         SizeQuotaConfiguration.GetConfiguration(Database).AfterDelete();
     }
 }
Example #3
0
		public override void Respond(Abstractions.IHttpContext context)
		{
			var prefetcherDocs = Database.IndexingExecuter.PrefetchingBehavior.DebugGetDocumentsInPrefetchingQueue().ToArray();
			var compareToCollection = new Dictionary<Etag, int>();

			for (int i = 1; i < prefetcherDocs.Length; i++)
				compareToCollection.Add(prefetcherDocs[i-1].Etag, prefetcherDocs[i].Etag.CompareTo(prefetcherDocs[i-1].Etag));

			if (compareToCollection.Any(x => x.Value < 0))
			{
				context.WriteJson(new
				{
					HasCorrectlyOrderedEtags = true,
					EtagsWithKeys = prefetcherDocs.ToDictionary(x => x.Etag, x => x.Key)
				});
			}
			else
			{
				context.WriteJson(new
				{
					HasCorrectlyOrderedEtags = false,
					IncorrectlyOrderedEtags = compareToCollection.Where(x => x.Value < 0),
					EtagsWithKeys = prefetcherDocs.ToDictionary(x => x.Etag, x => x.Key)
				});
			}
		}
 //
 // This method is invoked when the application has loaded and is ready to run. In this
 // method you should instantiate the window, load the UI into it and then make the window
 // visible.
 //
 // You have 17 seconds to return from this method, or iOS will terminate your application.
 //
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     global::Xamarin.Forms.Forms.Init();
     LoadApplication(new App());
     Abstractions.Init();
     return(base.FinishedLaunching(app, options));
 }
        public override void OnPut(string key, Json.Linq.RavenJObject document, Json.Linq.RavenJObject metadata, Abstractions.Data.TransactionInformation transactionInformation)
        {
            if (metadata.Remove(Constants.RavenReplicationConflictDocumentForcePut))
                return;

            metadata.Remove(Constants.RavenReplicationConflictDocument); // or conflict documents
        }
    public static void UpdateFrom(this View nativeControl, Abstractions.RoundedBoxView formsControl,
      string propertyChanged)
    {
      if (nativeControl == null || formsControl == null)
        return;

      if (propertyChanged == Abstractions.RoundedBoxView.CornerRadiusProperty.PropertyName)
      {
        nativeControl.UpdateCornerRadius(formsControl.CornerRadius);
      }
      if (propertyChanged == VisualElement.BackgroundColorProperty.PropertyName)
      {
        var background = nativeControl.Background as GradientDrawable;

        if (background != null)
        {
          background.SetColor(formsControl.BackgroundColor.ToAndroid());
        }
      }

      if (propertyChanged == Abstractions.RoundedBoxView.BorderColorProperty.PropertyName)
      {
        nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness);
      }

      if (propertyChanged == Abstractions.RoundedBoxView.BorderThicknessProperty.PropertyName)
      {
        nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness);
      }
    }
		public override ReadVetoResult AllowRead(string key, Json.Linq.RavenJObject metadata, ReadOperation operation, Abstractions.Data.TransactionInformation transactionInformation)
		{
			if (operation == ReadOperation.Index  && metadata.ContainsKey(Constants.RavenReplicationConflictDocument))
			{
				return ReadVetoResult.Ignore;
			}
			return ReadVetoResult.Allowed;
		}
Example #8
0
        public override string ToJs(Knowledge knowledge)
        {
            return($@"
{Mains.Select(x => x.ToJs(knowledge)).Glue("\n")}

{Abstractions.Select(x => x.ToJs(knowledge)).Glue("\n")}
");
        }
            public Batcher(DocumentDatabase database, Abstractions.Data.ScriptedIndexResults scriptedIndexResults, HashSet<string> forEntityNames)
            {
                this.database = database;
                this.scriptedIndexResults = scriptedIndexResults;
                this.forEntityNames = forEntityNames;

                if (Log.IsDebugEnabled)
                    Log.Debug("Created ScriptedIndexResultsBatcher for {0}", scriptedIndexResults.Id);
            }
    public static void InitializeFrom(this UIView nativeControl, Abstractions.RoundedBoxView formsControl)
    {
      if (nativeControl == null || formsControl == null)
        return;

      nativeControl.Layer.MasksToBounds = true;
      nativeControl.Layer.CornerRadius = (float) formsControl.CornerRadius;
      nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness);
    }
    public static void InitializeFrom(this Rectangle nativeControl, Abstractions.RoundedBoxView formsControl)
    {
      if (nativeControl == null || formsControl == null)
        return;

      nativeControl.UpdateCornerRadius(formsControl.CornerRadius);
      nativeControl.UpdateBackgroundColor(formsControl.BackgroundColor);
      nativeControl.UpdateBorderThickness(formsControl.BorderThickness, formsControl.HeightRequest, formsControl.WidthRequest);
    }
        private static void ValidateCustomCacheConfiguration(Abstractions.Immutable.StormpathConfiguration config)
        {
            config.Client.CacheManager.DefaultTtl.Should().Be(Abstractions.Default.Configuration.Client.CacheManager.DefaultTtl); // the default
            config.Client.CacheManager.DefaultTti.Should().Be(Abstractions.Default.Configuration.Client.CacheManager.DefaultTti); // the default

            config.Client.CacheManager.Caches["application"].Ttl.Should().Be(450);
            config.Client.CacheManager.Caches["application"].Tti.Should().Be(700);
            config.Client.CacheManager.Caches["directory"].Ttl.Should().Be(200);
            config.Client.CacheManager.Caches["directory"].Tti.Should().Be(300);
        }
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);
            Abstractions.Init();
            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());
        }
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            Abstractions.Init();
            CachedImageRenderer.Init();
            AnimationViewRenderer.Init();
            Rg.Plugins.Popup.Popup.Init();
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Example #15
0
		public override VetoResult AllowPut(string key, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata, Abstractions.Data.TransactionInformation transactionInformation)
		{
			if(key.Contains(@"\"))
				return VetoResult.Deny(@"Document name cannot contain '\' but attempted to save with: " + key);
			if(string.Equals(key, "Raven/Databases/System", StringComparison.OrdinalIgnoreCase))
				return
					VetoResult.Deny(
						@"Cannot create a tenant database with the name 'System', that name is reserved for the actual system database");

			return VetoResult.Allowed;
		}
Example #16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Abstractions.Init(this);
            LoadApplication(new App());
        }
Example #17
0
 public override void OnPut(string key, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata, Abstractions.Data.TransactionInformation transactionInformation)
 {
     using (Database.DisableAllTriggersForCurrentThread())
     {
         Database.TransactionalStorage.Batch(accessor =>
         {
             var tombstone = accessor.Lists.Read(Constants.RavenPeriodicBackupsDocsTombstones, key);
             if (tombstone == null)
                 return;
             accessor.Lists.Remove(Constants.RavenPeriodicBackupsDocsTombstones, key);
         });
     }
 }
    public static void InitializeFrom(this View nativeControl, Abstractions.RoundedBoxView formsControl)
    {
      if (nativeControl == null || formsControl == null)
        return;

      var background = new GradientDrawable();

      background.SetColor(formsControl.BackgroundColor.ToAndroid());

      nativeControl.Background = background;

      nativeControl.UpdateCornerRadius(formsControl.CornerRadius);
      nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness);
    }
Example #19
0
		public override void Respond(Abstractions.IHttpContext context)
		{
			if (context.User.IsAdministrator() == false)
			{
				context.SetStatusToUnauthorized();
				context.WriteJson(new
				{
					Error = "The operation '" + context.GetRequestUrl() +"' is only available to administrators"
				});
				return;
			}

			RespondToAdmin(context);
		}
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Abstractions.Init(this);
            CachedImageRenderer.Init(false);
            AnimationViewRenderer.Init();
            Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
 public override VetoResult AllowPut(string key, Json.Linq.RavenJObject document, Json.Linq.RavenJObject metadata, Abstractions.Data.TransactionInformation transactionInformation)
 {
     if (metadata.ContainsKey(Constants.RavenReplicationConflictDocument) && metadata.ContainsKey(Constants.RavenReplicationConflictDocumentForcePut) == false)
         return VetoResult.Deny("You cannot PUT a document with metadata " + Constants.RavenReplicationConflictDocument);
     JsonDocument documentByKey = null;
     Database.TransactionalStorage.Batch(accessor =>
     {
         documentByKey = accessor.Documents.DocumentByKey(key);
     });
     if (documentByKey == null)
         return VetoResult.Allowed;
     if (documentByKey.Metadata.ContainsKey(Constants.RavenReplicationConflictDocument))
         return VetoResult.Deny("Conflict documents (with " + Constants.RavenReplicationConflictDocument +
                             ") are read only and can only be modified by RavenDB when you resolve the conflict");
     return VetoResult.Allowed;
 }
    public static void InitializeFrom(this Border nativeControl, Abstractions.RoundedBoxView formsControl)
    {
      if (nativeControl == null || formsControl == null)
        return;

      nativeControl.Height = formsControl.HeightRequest;
      nativeControl.Width = formsControl.WidthRequest;
      nativeControl.UpdateCornerRadius(formsControl.CornerRadius);
      nativeControl.UpdateBorderColor(formsControl.BorderColor);
      
      var rectangle = new Rectangle();

      rectangle.InitializeFrom(formsControl);

      nativeControl.Child = rectangle;
    }
    public static void InitializeFrom(this View nativeControl, Abstractions.RoundedBoxView formsControl)
    {
      if (nativeControl == null || formsControl == null)
        return;

      var background = new GradientDrawable();

      background.SetColor(formsControl.BackgroundColor.ToAndroid());

	  if (Build.VERSION.SdkInt >= BuildVersionCodes.JellyBean) {
		nativeControl.Background = background;
	  } else {
		nativeControl.SetBackgroundDrawable(background);
	  }

      nativeControl.UpdateCornerRadius(formsControl.CornerRadius);
      nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness);
    }
    public static void UpdateFrom(this Border nativeControl, Abstractions.RoundedBoxView formsControl,
      string propertyChanged)
    {
      if (nativeControl == null || formsControl == null)
        return;

      if (propertyChanged == Abstractions.RoundedBoxView.CornerRadiusProperty.PropertyName)
      {
        nativeControl.UpdateCornerRadius(formsControl.CornerRadius);

        var rect = nativeControl.Child as Rectangle;

        if (rect != null)
        {
          rect.UpdateCornerRadius(formsControl.CornerRadius);
        }

      }
      if (propertyChanged == VisualElement.BackgroundColorProperty.PropertyName)
      {
        var rect = nativeControl.Child as Rectangle;

        if (rect != null)
        {
          rect.UpdateBackgroundColor(formsControl.BackgroundColor);
        }
      }

      if (propertyChanged == Abstractions.RoundedBoxView.BorderColorProperty.PropertyName)
      {
        nativeControl.Background = formsControl.BorderColor.ToBrush();
      }

      if (propertyChanged == Abstractions.RoundedBoxView.BorderThicknessProperty.PropertyName)
      {
        var rect = nativeControl.Child as Rectangle;

        if (rect != null)
        {
          rect.UpdateBorderThickness(formsControl.BorderThickness, formsControl.HeightRequest, formsControl.WidthRequest);
        }
      }
    }
    public static void UpdateFrom(this UIView nativeControl, Abstractions.RoundedBoxView formsControl,
      string propertyChanged)
    {
      if (nativeControl == null || formsControl == null)
        return;

      if (propertyChanged == Abstractions.RoundedBoxView.CornerRadiusProperty.PropertyName)
      {
        nativeControl.Layer.CornerRadius = (float) formsControl.CornerRadius;
      }

      if (propertyChanged == Abstractions.RoundedBoxView.BorderColorProperty.PropertyName)
      {
        nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness);
      }

      if (propertyChanged == Abstractions.RoundedBoxView.BorderThicknessProperty.PropertyName)
      {
        nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness);
      }
    }
Example #26
0
		protected override void SetupDestination(Abstractions.Replication.ReplicationDestination replicationDestination)
		{
			replicationDestination.Username = "******";
			replicationDestination.Password = "******";
		}
Example #27
0
        /// <summary>
        /// query for already set user profile quota
        /// </summary>
        /// <param name="where"></param>
        /// <param name="name"></param>
        /// <returns>true on already set</returns>
        public static Boolean QueryQuota(Abstractions.WindowsApi.pInvokes.structenums.RegistryLocation where, string name)
        {
            LibraryLogging.Info("query Quota for {0}", name);
            try
            {
                using (RegistryKey key = Abstractions.WindowsApi.pInvokes.GetRegistryLocation(where).OpenSubKey(name + @"\Software\Microsoft\Windows\CurrentVersion\Policies\System"))
                {
                    if (key.GetValue("EnableProfileQuota") == null)
                    {
                        return false;
                    }
                }
            }
            catch (Exception ex)
            {
                LibraryLogging.Error("Can't get profile quota for {0} Error:{1}", name, ex.Message);
                return false;
            }

            return true;
        }
 public Batcher(DocumentDatabase database, Abstractions.Data.ScriptedIndexResults scriptedIndexResults, HashSet<string> forEntityNames)
 {
     this.database = database;
     this.scriptedIndexResults = scriptedIndexResults;
     this.forEntityNames = forEntityNames;
 }
Example #29
0
        /// <summary>
        /// sets user profile quota
        /// </summary>
        /// <param name="where">ROOTKEY hklm or hku</param>
        /// <param name="name">SubKey name</param>
        /// <param name="quota">if 0 means the profile quota GPO it will be deleted</param>
        /// <returns>false on error</returns>
        public static Boolean SetQuota(Abstractions.WindowsApi.pInvokes.structenums.RegistryLocation where, string name, uint quota)
        {
            LibraryLogging.Info("set Quota for {0}", name);
            try
            {
                using (RegistryKey key = Abstractions.WindowsApi.pInvokes.GetRegistryLocation(where).CreateSubKey(name + @"\Software\Microsoft\Windows\CurrentVersion\Policies\System"))
                {
                    if (quota > 0)
                    {
                        key.SetValue("EnableProfileQuota", 1, RegistryValueKind.DWord);
                        //key.SetValue("ProfileQuotaMessage", "You have exceeded your profile storage space. Before you can log off, you need to move some items from your profile to network or local storage.", RegistryValueKind.String);
                        key.SetValue("MaxProfileSize", quota, RegistryValueKind.DWord);
                        key.SetValue("IncludeRegInProQuota", 1, RegistryValueKind.DWord);
                        key.SetValue("WarnUser", 1, RegistryValueKind.DWord);
                        key.SetValue("WarnUserTimeout", 5, RegistryValueKind.DWord);
                    }
                    else
                    {
                        key.DeleteValue("EnableProfileQuota", false);
                        key.DeleteValue("ProfileQuotaMessage", false);
                        key.DeleteValue("MaxProfileSize", false);
                        key.DeleteValue("IncludeRegInProQuota", false);
                        key.DeleteValue("WarnUser", false);
                        key.DeleteValue("WarnUserTimeout", false);
                    }
                }
            }
            catch (Exception ex)
            {
                LibraryLogging.Error("Can't set profile quota for {0} Error:{1}", name, ex.Message);
                return false;
            }

            return true;
        }
        private static void ThrowIfInvalidApplicationHref(Abstractions.Immutable.ApplicationConfiguration app)
        {
            if (string.IsNullOrEmpty(app?.Href))
            {
                return; // Skip validation
            }

            bool contains = app.Href.IndexOf("/applications/", StringComparison.OrdinalIgnoreCase) >= 0;
            if (!contains)
            {
                throw new ConfigurationException($"'{app.Href}' is not a valid Stormpath Application href.");
            }
        }
		public override void AfterDelete(string key, Abstractions.Data.TransactionInformation transactionInformation)
		{
			SizeQuotaConfiguration.GetConfiguration(Database).AfterDelete();
		}
        private static void ValidateConfig(Abstractions.Immutable.StormpathConfiguration config)
        {
            // Client section
            config.Client.ApiKey.Id.Should().Be("modified-foobar");
            config.Client.ApiKey.Secret.Should().Be("modified-barbaz");

            config.Client.CacheManager.Enabled.Should().BeFalse();
            config.Client.CacheManager.DefaultTtl.Should().Be(500);
            config.Client.CacheManager.DefaultTti.Should().Be(600);

            config.Client.CacheManager.Caches.Should().HaveCount(2);
            config.Client.CacheManager.Caches["application"].Ttl.Should().Be(450);
            config.Client.CacheManager.Caches["application"].Tti.Should().Be(700);
            config.Client.CacheManager.Caches["directory"].Ttl.Should().Be(200);
            config.Client.CacheManager.Caches["directory"].Tti.Should().Be(300);

            config.Client.BaseUrl.Should().Be("https://api.foo.com/v1");
            config.Client.ConnectionTimeout.Should().Be(90);
            config.Client.AuthenticationScheme.Should().Be(ClientAuthenticationScheme.Basic);

            config.Client.Proxy.Port.Should().Be(8088);
            config.Client.Proxy.Host.Should().Be("proxy.foo.bar");
            config.Client.Proxy.Username.Should().Be("foo");
            config.Client.Proxy.Password.Should().Be("bar");

            // Application section
            config.Application.Href.Should().Be("https://api.foo.com/v1/applications/foo");
            config.Application.Name.Should().Be("Lightsabers Galore");

            // Web section
            config.Web.ServerUri.Should().Be("https://localhost:9000");
            config.Web.BasePath.Should().Be("#/");

            config.Web.Oauth2.Enabled.Should().BeFalse();
            config.Web.Oauth2.Uri.Should().Be("/oauth2/token");
            config.Web.Oauth2.Client_Credentials.Enabled.Should().BeFalse();
            config.Web.Oauth2.Client_Credentials.AccessToken.Ttl.Should().Be(3601);
            config.Web.Oauth2.Password.Enabled.Should().BeFalse();
            config.Web.Oauth2.Password.ValidationStrategy.Should().Be(WebOauth2TokenValidationStrategy.Stormpath);

            config.Web.AccessTokenCookie.Name.Should().Be("accessToken");
            config.Web.AccessTokenCookie.HttpOnly.Should().BeFalse();
            config.Web.AccessTokenCookie.Secure.Should().BeFalse();
            config.Web.AccessTokenCookie.Path.Should().Be("/bar");
            config.Web.AccessTokenCookie.Domain.Should().Be("foo.bar");

            config.Web.RefreshTokenCookie.Name.Should().Be("refreshToken");
            config.Web.RefreshTokenCookie.HttpOnly.Should().BeFalse();
            config.Web.RefreshTokenCookie.Secure.Should().BeTrue();
            config.Web.RefreshTokenCookie.Path.Should().Be("/foo");
            config.Web.RefreshTokenCookie.Domain.Should().Be("baz.qux");

            config.Web.Produces.ShouldBeEquivalentTo(
                new List<string>()
            {
                "foo/bar",
            },
                opt => opt.WithStrictOrdering()
            );

            config.Web.Register.Enabled.Should().BeFalse();
            config.Web.Register.Uri.Should().Be("/register1");
            config.Web.Register.NextUri.Should().Be("/1");
            config.Web.Register.AutoLogin.Should().BeTrue();
            config.Web.Register.View.Should().Be("registerView");
            config.Web.Register.Form.Fields.Should().HaveCount(1);

            config.Web.Register.Form.Fields["email"].Enabled.Should().BeFalse();
            config.Web.Register.Form.Fields["email"].Visible.Should().BeFalse();
            config.Web.Register.Form.Fields["email"].Label.Should().Be("I Can Has Email");
            config.Web.Register.Form.Fields["email"].Placeholder.Should().Be("Can Has?");
            config.Web.Register.Form.Fields["email"].Required.Should().BeFalse();
            config.Web.Register.Form.Fields["email"].Type.Should().Be("text");

            config.Web.Register.Form.FieldOrder.ShouldBeEquivalentTo(new List<string>()
            {
                "email",
                "hidden",
            },
                opt => opt.WithStrictOrdering()
            );

            config.Web.VerifyEmail.Enabled.Should().BeTrue();
            config.Web.VerifyEmail.Uri.Should().Be("/verify1");
            config.Web.VerifyEmail.NextUri.Should().Be("/login2");
            config.Web.VerifyEmail.View.Should().Be("verifyView");

            config.Web.Login.Enabled.Should().BeFalse();
            config.Web.Login.Uri.Should().Be("/login3");
            config.Web.Login.NextUri.Should().Be("/3");
            config.Web.Login.View.Should().Be("loginView");

            config.Web.Login.Form.Fields["password"].Enabled.Should().BeFalse();
            config.Web.Login.Form.Fields["password"].Visible.Should().BeFalse();
            config.Web.Login.Form.Fields["password"].Label.Should().Be("Password?");
            config.Web.Login.Form.Fields["password"].Placeholder.Should().Be("Maybe");
            config.Web.Login.Form.Fields["password"].Required.Should().BeFalse();
            config.Web.Login.Form.Fields["password"].Type.Should().Be("email");
            config.Web.Login.Form.Fields.Should().HaveCount(1);

            config.Web.Login.Form.FieldOrder.ShouldBeEquivalentTo(new List<string>()
            {
                "password"
            },
                opt => opt.WithStrictOrdering()
            );

            config.Web.Logout.Enabled.Should().BeFalse();
            config.Web.Logout.Uri.Should().Be("/logout4");
            config.Web.Logout.NextUri.Should().Be("/4");

            config.Web.ForgotPassword.Enabled.Should().BeTrue();
            config.Web.ForgotPassword.Uri.Should().Be("/forgot5");
            config.Web.ForgotPassword.NextUri.Should().Be("/login?status=forgot!");
            config.Web.ForgotPassword.View.Should().Be("forgot-password-view");

            config.Web.ChangePassword.Enabled.Should().BeTrue();
            config.Web.ChangePassword.Uri.Should().Be("/change6");
            config.Web.ChangePassword.NextUri.Should().Be("/login?status=reset?");
            config.Web.ChangePassword.View.Should().Be("change-password-view");
            config.Web.ChangePassword.ErrorUri.Should().Be("/forgot?status=invalid_sptoken:(");

            config.Web.IdSite.Enabled.Should().BeTrue();
            config.Web.IdSite.LoginUri.Should().Be("/456");
            config.Web.IdSite.ForgotUri.Should().Be("/#/forgot789");
            config.Web.IdSite.RegisterUri.Should().Be("/#/register0");

            config.Web.Callback.Enabled.Should().BeFalse();
            config.Web.Callback.Uri.Should().Be("/stormpath-callback");

            config.Web.Social["facebook"].Uri.Should().Be("/callbackz/facebook");
            config.Web.Social["facebook"].Scope.Should().Be("email birthday");
            config.Web.Social["github"].Uri.Should().Be("/callbackz/github");
            config.Web.Social["github"].Scope.Should().Be("user:everything");
            config.Web.Social["google"].Uri.Should().Be("/callbackz/google");
            config.Web.Social["google"].Scope.Should().Be("email profile friends");
            config.Web.Social["linkedin"].Uri.Should().Be("/callbackz/linkedin");
            config.Web.Social["linkedin"].Scope.Should().Be("email interests");

            config.Web.Me.Enabled.Should().BeFalse();
            config.Web.Me.Uri.Should().Be("/myself");

            config.Web.Me.Expand.Should().HaveCount(1);
            config.Web.Me.Expand["directory"].Should().BeTrue();
        }
 public override RouteData GetRouteData(Abstractions.IHttpContext context)
 {
     return null;
 }
 public override RouteData GetRouteData(Abstractions.IHttpContext context)
 {
     return new RouteData() { Data = Name };
 }
Example #35
0
		protected override void SetupDestination(Abstractions.Replication.ReplicationDestination replicationDestination)
		{
			replicationDestination.ApiKey = "Ayende/abc";
		}
        private static void ThrowIfMissingCredentials(Abstractions.Immutable.ClientConfiguration client)
        {
            //logger.Trace("Validating API credentials");

            if (client?.ApiKey == null)
            {
                throw new ConfigurationException("API key cannot be empty.");
            }

            if (string.IsNullOrEmpty(client.ApiKey.Id))
            {
                throw new ConfigurationException("API key ID is required.");
            }

            if (string.IsNullOrEmpty(client.ApiKey.Secret))
            {
                throw new ConfigurationException("API key secret is required.");
            }
        }
 public NupkgLocalPackageLoader(Abstractions.IFileSystem fileSystem, Abstractions.INugetHelper nugetHelper)
 {
     _fileSystem = fileSystem;
     _nugetHelper = nugetHelper;
 }