Beispiel #1
0
        public BooksEntityApp() : base("BookStore", CurrentVersion)
        {
            //Areas
            var booksArea = this.AddArea("books");
            var infoArea  = this.AddArea("info");
            var loginArea = this.AddArea("login");

            //main module
            MainModule = new BooksModule(booksArea);
            //Standard modules
            var dbInfoModule = new DbInfoModule(infoArea);

            //Job exec module - disabled for now
            //var jobExecModule = new Modules.JobExecution.JobExecutionModule(booksArea);

            // LoginModule
            var loginStt = new LoginModuleSettings(passwordExpirationPeriod: TimeSpan.FromDays(180));

            loginStt.RequiredPasswordStrength = PasswordStrength.Medium;
            loginStt.DefaultEmailFrom         = "*****@*****.**";

            var loginModule = new LoginModule(loginArea, loginStt);

            // Setup encrypted data module.
            var encrModule = new EncryptedDataModule(booksArea);
            //  Use TestGenerateCryptoKeys test in BasicTests project to generate
            // and print crypto keys for all algorithms.
            var cryptoKey   = "8E487AD4C490AC43DF15D33AB654E5A222A02C9C904BC51E48C4FE5B7D86F90A";
            var cryptoBytes = HexUtil.HexToByteArray(cryptoKey);

            encrModule.AddChannel(cryptoBytes); //creates default channel

            Instance = this;
        }
Beispiel #2
0
        public BooksEntityApp() : base("BookStore", CurrentVersion)
        {
            //Areas
            var booksArea = this.AddArea("books");
            var infoArea  = this.AddArea("info");
            var loginArea = this.AddArea("login");

            //main module
            MainModule = new BooksModule(booksArea);
            //Standard modules
            var dbInfoModule = new DbInfoModule(infoArea);

            //Job exec module - disabled for now
            //var jobExecModule = new Modules.JobExecution.JobExecutionModule(booksArea);

            // LoginModule
            var loginStt = new LoginModuleSettings(passwordExpirationPeriod: TimeSpan.FromDays(180));

            loginStt.RequiredPasswordStrength = PasswordStrength.Medium;
            loginStt.DefaultEmailFrom         = "*****@*****.**";

            var loginModule = new LoginModule(loginArea, loginStt);

            //api config - register controllers defined in Vita.Modules.Login assembly; books controllers are registered by BooksModule
            base.ApiConfiguration.RegisterControllerTypes(
                typeof(LoginController), typeof(PasswordResetController), typeof(LoginSelfServiceController), typeof(LoginAdministrationController)
                );
        }
Beispiel #3
0
        // We need to have a parameterless constructor (it might be internal) if we want to use vdbtool to generate DDL scripts
        internal BooksEntityApp() : base("BookStore", CurrentVersion)
        {
            //Areas
            var booksArea = this.AddArea("books");
            var infoArea  = this.AddArea("info");
            var loginArea = this.AddArea("login");

            //main module
            MainModule = new BooksModule(booksArea);
            //Standard modules
            var dbInfoModule = new DbInfoModule(infoArea);
            // Deprecatedl  EncryptedData was used by login module; now only to run migration script
            var cryptDataModule_Deprecated = new EncryptedDataModule(loginArea);
            //data history - we track history for book review, it is marked with WithHistory attribute
            var histModule = new DataHistoryModule(booksArea);

            // job execution module
            var jobExecModule = new Modules.JobExecution.JobExecutionModule(booksArea);

            // LoginModule
            var loginStt = new LoginModuleSettings(passwordExpirationPeriod: TimeSpan.FromDays(180));

            loginStt.RequiredPasswordStrength = PasswordStrength.Medium;
            loginStt.DefaultEmailFrom         = "*****@*****.**";

            var loginModule = new LoginModule(loginArea, loginStt);

            //Notification service
            var notificationService = new Vita.Modules.Notifications.NotificationService(this);

            // Authorization object
            Authorization = new BooksAuthorization(this);
            //api config - register controllers defined in Vita.Modules assembly; books controllers are registered by BooksModule
            base.ApiConfiguration.RegisterControllerTypes(
                typeof(LoginController), typeof(PasswordResetController), typeof(LoginSelfServiceController), typeof(LoginAdministrationController),
                typeof(LogsDataController), typeof(LogsPostController),
                typeof(DiagnosticsController), typeof(UserSessionInfoController)
                );
            LogsPostController.EnablePublicEvents = true;

            //logging app - linked to main app
            this.LoggingApp = new LoggingEntityApp("log");
            LoggingApp.LinkTo(this);

            //short expir period, just for testing
            var sessionStt = LoggingApp.GetConfig <UserSessionSettings>();

            sessionStt.SessionTimeout = TimeSpan.FromMinutes(5);
        }
Beispiel #4
0
        // We need to have a parameterless constructor (it might be internal) if we want to use vdbtool to generate DDL scripts
        internal BooksEntityApp()
            : base("BookStore", CurrentVersion)
        {
            //Areas
              var booksArea = this.AddArea("books");
              var infoArea = this.AddArea("info");
              var loginArea = this.AddArea("login");

              //main module
              MainModule = new BooksModule(booksArea);
              //Standard modules
              var dbInfoModule = new DbInfoModule(infoArea);
              var cryptModule = new EncryptedDataModule(loginArea); //EncryptedData is used by login module
              var templateModule = new TemplateModule(booksArea);
              // LoginModule
              var loginStt = new LoginModuleSettings(passwordExpirationPeriod: TimeSpan.FromDays(180));
              loginStt.RequiredPasswordStrength = PasswordStrength.Medium;
              loginStt.DefaultEmailFrom = "*****@*****.**";

              var loginModule = new LoginModule(loginArea, loginStt);
              //var oauthModule = new OAuthClientModule(loginArea);
              //data history - we track history for book review, it is marked with WithHistory attribute
              var histModule = new DataHistoryModule(booksArea);

              //Notification service
              var notificationService = new Vita.Modules.Notifications.NotificationService(this);
              // Authorization object - uses LoginModule's authorization objects
              Authorization = new BooksAuthorization(this, loginModule);
              //api config - register controllers defined in Vita.Modules assembly; books controllers are registered by BooksModule
              base.ApiConfiguration.RegisterControllerTypes(
            typeof(LoginController), typeof(PasswordResetController), typeof(LoginSelfServiceController), typeof(LoginAdministrationController),
            typeof(ClientErrorController), typeof(LoggingDataController), typeof(EventsPostController),
            typeof(DiagnosticsController)
            );

              //logging app - linked to main app
              this.LoggingApp = new LoggingEntityApp("log");
              LoggingApp.LinkTo(this);

              //short expir period, just for testing
              var sessionStt = LoggingApp.GetConfig<UserSessionSettings>();
              sessionStt.SessionTimeout = TimeSpan.FromMinutes(5);
        }