public SecurityDescriptorTargetViewModel(SecurityDescriptorTarget model, SecurityDescriptorTargetViewModelDisplaySettings displaySettings, INotificationChannelSelectionViewModelFactory notificationChannelFactory, IFileSelectionViewModelFactory fileSelectionViewModelFactory, IAppPathProvider appPathProvider, ILogger <SecurityDescriptorTargetViewModel> logger, IDialogCoordinator dialogCoordinator, IModelValidator <SecurityDescriptorTargetViewModel> validator, IDirectory directory, IDomainTrustProvider domainTrustProvider, IDiscoveryServices discoveryServices, ILocalSam localSam, IObjectSelectionProvider objectSelectionProvider, ScriptTemplateProvider scriptTemplateProvider, IAmsLicenseManager licenseManager, IShellExecuteProvider shellExecuteProvider)
        {
            this.directory                  = directory;
            this.Model                      = model;
            this.logger                     = logger;
            this.dialogCoordinator          = dialogCoordinator;
            this.notificationChannelFactory = notificationChannelFactory;
            this.Validator                  = validator;
            this.domainTrustProvider        = domainTrustProvider;
            this.discoveryServices          = discoveryServices;
            this.localSam                   = localSam;
            this.displaySettings            = displaySettings ?? new SecurityDescriptorTargetViewModelDisplaySettings();
            this.objectSelectionProvider    = objectSelectionProvider;
            this.scriptTemplateProvider     = scriptTemplateProvider;
            this.licenseManager             = licenseManager;
            this.shellExecuteProvider       = shellExecuteProvider;

            this.Script = fileSelectionViewModelFactory.CreateViewModel(model, () => model.Script, appPathProvider.ScriptsPath);
            this.Script.DefaultFileExtension = "ps1";
            this.Script.Filter           = "PowerShell script|*.ps1";
            this.Script.NewFileContent   = this.scriptTemplateProvider.GetAuthorizationResponse;
            this.Script.ShouldValidate   = false;
            this.Script.PropertyChanged += Script_PropertyChanged;
            this.Initialization          = this.Initialize();
        }
        public AuthenticationViewModel(AuthenticationOptions model, ILogger <AuthenticationViewModel> logger, INotifyModelChangedEventPublisher eventPublisher, IDialogCoordinator dialogCoordinator, IX509Certificate2ViewModelFactory x509ViewModelFactory, IDirectory directory, IShellExecuteProvider shellExecuteProvider, IObjectSelectionProvider objectSelectionProvider, IProtectedSecretProvider secretProvider)
        {
            this.shellExecuteProvider = shellExecuteProvider;
            this.model                   = model;
            this.dialogCoordinator       = dialogCoordinator;
            this.x509ViewModelFactory    = x509ViewModelFactory;
            this.logger                  = logger;
            this.directory               = directory;
            this.eventPublisher          = eventPublisher;
            this.objectSelectionProvider = objectSelectionProvider;
            this.secretProvider          = secretProvider;

            this.DisplayName = "Authentication";

            model.Iwa ??= new IwaAuthenticationProviderOptions();
            model.Oidc ??= new OidcAuthenticationProviderOptions();
            model.WsFed ??= new WsFedAuthenticationProviderOptions();
            model.ClientCert ??= new CertificateAuthenticationProviderOptions();
            model.ClientCert.TrustedIssuers ??= new List <string>();
            model.ClientCert.RequiredEkus ??= new List <string>();
            model.AllowedPrincipals ??= new List <string>();

            this.TrustedIssuers    = new BindableCollection <X509Certificate2ViewModel>();
            this.RequiredEkus      = new BindableCollection <string>(model.ClientCert.RequiredEkus);
            this.AllowedPrincipals = new BindableCollection <SecurityIdentifierViewModel>();
        }
Beispiel #3
0
 public JitGroupMappingViewModelFactory(Func <IModelValidator <JitGroupMappingViewModel> > validator, IObjectSelectionProvider objectSelectionProvider, ILogger <JitGroupMappingViewModel> logger, IDialogCoordinator dialogCoordinator, IDiscoveryServices discoveryServices)
 {
     this.objectSelectionProvider = objectSelectionProvider;
     this.validator         = validator;
     this.logger            = logger;
     this.dialogCoordinator = dialogCoordinator;
     this.discoveryServices = discoveryServices;
 }
 public JitGroupMappingViewModel(JitGroupMapping model, ILogger <JitGroupMappingViewModel> logger, IDialogCoordinator dialogCoordinator, IModelValidator <JitGroupMappingViewModel> validator, IDiscoveryServices discoveryServices, IObjectSelectionProvider objectSelectionProvider)
 {
     this.logger                  = logger;
     this.dialogCoordinator       = dialogCoordinator;
     this.Model                   = model;
     this.objectSelectionProvider = objectSelectionProvider;
     this.Validator               = validator;
     this.discoveryServices       = discoveryServices;
 }
 public ImportWizardRuleSettingsViewModel(INotificationChannelSelectionViewModelFactory notificationChannelFactory, ILogger <ImportWizardRuleSettingsViewModel> logger, IDialogCoordinator dialogCoordinator, IModelValidator <ImportWizardRuleSettingsViewModel> validator, IDirectory directory, IObjectSelectionProvider objectSelectionProvider, IShellExecuteProvider shellExecuteProvider)
 {
     this.directory                  = directory;
     this.logger                     = logger;
     this.dialogCoordinator          = dialogCoordinator;
     this.notificationChannelFactory = notificationChannelFactory;
     this.Validator                  = validator;
     this.objectSelectionProvider    = objectSelectionProvider;
     this.shellExecuteProvider       = shellExecuteProvider;
     this.Initialization             = this.Initialize();
 }
 public ImportWizardImportContainerViewModel(ILogger <ImportWizardImportContainerViewModel> logger, IDialogCoordinator dialogCoordinator, IModelValidator <ImportWizardImportContainerViewModel> validator, IObjectSelectionProvider objectSelectionProvider, IDiscoveryServices discoveryServices, IDirectory directory, IWindowsServiceProvider windowsServiceProvider, IShellExecuteProvider shellExecuteProvider)
 {
     this.logger                  = logger;
     this.dialogCoordinator       = dialogCoordinator;
     this.discoveryServices       = discoveryServices;
     this.objectSelectionProvider = objectSelectionProvider;
     this.directory               = directory;
     this.Validator               = validator;
     this.windowsServiceProvider  = windowsServiceProvider;
     this.shellExecuteProvider    = shellExecuteProvider;
     this.Initialization          = this.Initialize();
 }
Beispiel #7
0
 public SecurityDescriptorTargetViewModelFactory(IDialogCoordinator dialogCoordinator, IAppPathProvider appPathProvider, INotificationChannelSelectionViewModelFactory channelSelectionViewModelFactory, IFileSelectionViewModelFactory fileSelectionViewModelFactory, ILogger <SecurityDescriptorTargetViewModel> logger, IDiscoveryServices discoveryServices, IDomainTrustProvider domainTrustProvider, IDirectory directory, ILocalSam localsam, IObjectSelectionProvider objectSelectionProvider, Func <IModelValidator <SecurityDescriptorTargetViewModel> > validator, ScriptTemplateProvider scriptTemplateProvider, IAmsLicenseManager licenseManager, IShellExecuteProvider shellExecuteProvider)
 {
     this.dialogCoordinator = dialogCoordinator;
     this.appPathProvider   = appPathProvider;
     this.channelSelectionViewModelFactory = channelSelectionViewModelFactory;
     this.fileSelectionViewModelFactory    = fileSelectionViewModelFactory;
     this.logger                  = logger;
     this.directory               = directory;
     this.discoveryServices       = discoveryServices;
     this.domainTrustProvider     = domainTrustProvider;
     this.localSam                = localsam;
     this.objectSelectionProvider = objectSelectionProvider;
     this.validator               = validator;
     this.scriptTemplateProvider  = scriptTemplateProvider;
     this.licenseManager          = licenseManager;
     this.shellExecuteProvider    = shellExecuteProvider;
 }
Beispiel #8
0
        public JitConfigurationViewModel(JitConfigurationOptions jitOptions, IDialogCoordinator dialogCoordinator, IJitGroupMappingViewModelFactory groupMappingFactory, INotifyModelChangedEventPublisher eventPublisher, IJitDomainStatusViewModelFactory jitDomainStatusFactory, IWindowsServiceProvider windowsServiceProvider, IShellExecuteProvider shellExecuteProvider, IDomainTrustProvider domainTrustProvider, IDiscoveryServices discoveryServices, IObjectSelectionProvider objectSelectionProvider, IScriptTemplateProvider scriptTemplateProvider)
        {
            this.shellExecuteProvider    = shellExecuteProvider;
            this.dialogCoordinator       = dialogCoordinator;
            this.jitOptions              = jitOptions;
            this.groupMappingFactory     = groupMappingFactory;
            this.jitDomainStatusFactory  = jitDomainStatusFactory;
            this.windowsServiceProvider  = windowsServiceProvider;
            this.eventPublisher          = eventPublisher;
            this.domainTrustProvider     = domainTrustProvider;
            this.discoveryServices       = discoveryServices;
            this.objectSelectionProvider = objectSelectionProvider;
            this.scriptTemplateProvider  = scriptTemplateProvider;

            this.DisplayName   = "Just-in-time access";
            this.GroupMappings = new BindableCollection <JitGroupMappingViewModel>();
            this.Domains       = new BindableCollection <JitDomainStatusViewModel>();
        }
        public HostingViewModel(HostingOptions model, IDialogCoordinator dialogCoordinator, IWindowsServiceProvider windowsServiceProvider, ILogger <HostingViewModel> logger, IModelValidator <HostingViewModel> validator, IAppPathProvider pathProvider, INotifyModelChangedEventPublisher eventPublisher, ICertificateProvider certProvider, IShellExecuteProvider shellExecuteProvider, IEventAggregator eventAggregator, IDirectory directory, IScriptTemplateProvider scriptTemplateProvider, ICertificatePermissionProvider certPermissionProvider, IRegistryProvider registryProvider, ISecretRekeyProvider rekeyProvider, IObjectSelectionProvider objectSelectionProvider, IDiscoveryServices discoveryServices, IAmsLicenseManager licenseManager, IApplicationUpgradeProvider appUpgradeProvider, IHttpSysConfigurationProvider certificateBindingProvider, IFirewallProvider firewallProvider)
        {
            this.logger                     = logger;
            this.pathProvider               = pathProvider;
            this.OriginalModel              = model;
            this.certProvider               = certProvider;
            this.dialogCoordinator          = dialogCoordinator;
            this.windowsServiceProvider     = windowsServiceProvider;
            this.shellExecuteProvider       = shellExecuteProvider;
            this.eventAggregator            = eventAggregator;
            this.Validator                  = validator;
            this.directory                  = directory;
            this.scriptTemplateProvider     = scriptTemplateProvider;
            this.certPermissionProvider     = certPermissionProvider;
            this.registryProvider           = registryProvider;
            this.rekeyProvider              = rekeyProvider;
            this.objectSelectionProvider    = objectSelectionProvider;
            this.discoveryServices          = discoveryServices;
            this.licenseManager             = licenseManager;
            this.appUpgradeProvider         = appUpgradeProvider;
            this.certificateBindingProvider = certificateBindingProvider;
            this.firewallProvider           = firewallProvider;

            this.WorkingModel        = this.CloneModel(model);
            this.Certificate         = this.certificateBindingProvider.GetCertificate();
            this.OriginalCertificate = this.Certificate;
            this.ServiceAccount      = this.windowsServiceProvider.GetServiceAccountSid();
            this.ServiceStatus       = this.windowsServiceProvider.Status.ToString();
            this.DisplayName         = "Web hosting";

            this.licenseManager.OnLicenseDataChanged += delegate
            {
                this.NotifyOfPropertyChange(nameof(this.IsEnterpriseEdition));
                this.NotifyOfPropertyChange(nameof(this.IsStandardEdition));
            };

            eventPublisher.Register(this);
        }