コード例 #1
0
 /// <summary>
 /// Construct a <see cref="HomeController"/>
 /// </summary>
 /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param>
 /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param>
 /// <param name="tokenFactory">The value of <see cref="tokenFactory"/></param>
 /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param>
 /// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/></param>
 /// <param name="assemblyInformationProvider">The value of <see cref="assemblyInformationProvider"/></param>
 /// <param name="identityCache">The value of <see cref="identityCache"/></param>
 /// <param name="oAuthProviders">The value of <see cref="oAuthProviders"/>.</param>
 /// <param name="platformIdentifier">The value of <see cref="platformIdentifier"/>.</param>
 /// <param name="browserResolver">The value of <see cref="browserResolver"/></param>
 /// <param name="swarmService">The value of <see cref="swarmService"/>.</param>
 /// <param name="serverControl">The value of <see cref="serverControl"/>.</param>
 /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/>.</param>
 /// <param name="controlPanelConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="controlPanelConfiguration"/></param>
 /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param>
 public HomeController(
     IDatabaseContext databaseContext,
     IAuthenticationContextFactory authenticationContextFactory,
     ITokenFactory tokenFactory,
     ISystemIdentityFactory systemIdentityFactory,
     ICryptographySuite cryptographySuite,
     IAssemblyInformationProvider assemblyInformationProvider,
     IIdentityCache identityCache,
     IOAuthProviders oAuthProviders,
     IPlatformIdentifier platformIdentifier,
     IBrowserResolver browserResolver,
     ISwarmService swarmService,
     IServerControl serverControl,
     IOptions <GeneralConfiguration> generalConfigurationOptions,
     IOptions <ControlPanelConfiguration> controlPanelConfigurationOptions,
     ILogger <HomeController> logger)
     : base(
         databaseContext,
         authenticationContextFactory,
         logger,
         false)
 {
     this.tokenFactory                = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory));
     this.systemIdentityFactory       = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory));
     this.cryptographySuite           = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite));
     this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider));
     this.identityCache               = identityCache ?? throw new ArgumentNullException(nameof(identityCache));
     this.platformIdentifier          = platformIdentifier ?? throw new ArgumentNullException(nameof(platformIdentifier));
     this.oAuthProviders              = oAuthProviders ?? throw new ArgumentNullException(nameof(oAuthProviders));
     this.browserResolver             = browserResolver ?? throw new ArgumentNullException(nameof(browserResolver));
     this.swarmService                = swarmService ?? throw new ArgumentNullException(nameof(swarmService));
     this.serverControl               = serverControl ?? throw new ArgumentNullException(nameof(serverControl));
     generalConfiguration             = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions));
     controlPanelConfiguration        = controlPanelConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(controlPanelConfigurationOptions));
 }
コード例 #2
0
 /// <summary>
 /// Construct a <see cref="HomeController"/>
 /// </summary>
 /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param>
 /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param>
 /// <param name="tokenFactory">The value of <see cref="tokenFactory"/></param>
 /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param>
 /// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/></param>
 /// <param name="application">The value of <see cref="application"/></param>
 /// <param name="identityCache">The value of <see cref="identityCache"/></param>
 /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param>
 public HomeController(IDatabaseContext databaseContext, IAuthenticationContextFactory authenticationContextFactory, ITokenFactory tokenFactory, ISystemIdentityFactory systemIdentityFactory, ICryptographySuite cryptographySuite, IApplication application, IIdentityCache identityCache, ILogger <HomeController> logger) : base(databaseContext, authenticationContextFactory, logger, false)
 {
     this.tokenFactory          = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory));
     this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory));
     this.cryptographySuite     = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite));
     this.application           = application ?? throw new ArgumentNullException(nameof(application));
     this.identityCache         = identityCache ?? throw new ArgumentNullException(nameof(identityCache));
 }
コード例 #3
0
 /// <summary>
 /// Construct an <see cref="AuthenticationContextFactory"/>
 /// </summary>
 /// <param name="databaseContext">The value of <see cref="databaseContext"/></param>
 /// <param name="identityCache">The value of <see cref="identityCache"/></param>
 /// <param name="logger">The value of <see cref="logger"/>.</param>
 public AuthenticationContextFactory(
     IDatabaseContext databaseContext,
     IIdentityCache identityCache,
     ILogger <AuthenticationContextFactory> logger)
 {
     this.databaseContext = databaseContext ?? throw new ArgumentNullException(nameof(databaseContext));
     this.identityCache   = identityCache ?? throw new ArgumentNullException(nameof(identityCache));
     this.logger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #4
0
 /// <summary>
 /// Construct a <see cref="HomeController"/>
 /// </summary>
 /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param>
 /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param>
 /// <param name="tokenFactory">The value of <see cref="tokenFactory"/></param>
 /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param>
 /// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/></param>
 /// <param name="application">The value of <see cref="application"/></param>
 /// <param name="identityCache">The value of <see cref="identityCache"/></param>
 /// <param name="browserResolver">The value of <see cref="browserResolver"/></param>
 /// <param name="controlPanelConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="controlPanelConfiguration"/></param>
 /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param>
 public HomeController(IDatabaseContext databaseContext, IAuthenticationContextFactory authenticationContextFactory, ITokenFactory tokenFactory, ISystemIdentityFactory systemIdentityFactory, ICryptographySuite cryptographySuite, IApplication application, IIdentityCache identityCache, IBrowserResolver browserResolver, IOptions <ControlPanelConfiguration> controlPanelConfigurationOptions, ILogger <HomeController> logger) : base(databaseContext, authenticationContextFactory, logger, false, false)
 {
     this.tokenFactory          = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory));
     this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory));
     this.cryptographySuite     = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite));
     this.application           = application ?? throw new ArgumentNullException(nameof(application));
     this.identityCache         = identityCache ?? throw new ArgumentNullException(nameof(identityCache));
     this.browserResolver       = browserResolver ?? throw new ArgumentNullException(nameof(browserResolver));
     controlPanelConfiguration  = controlPanelConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(controlPanelConfigurationOptions));
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthenticationContextFactory"/> class.
 /// </summary>
 /// <param name="databaseContext">The value of <see cref="databaseContext"/>.</param>
 /// <param name="identityCache">The value of <see cref="identityCache"/>.</param>
 /// <param name="swarmConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="swarmConfiguration"/>.</param>
 /// <param name="logger">The value of <see cref="logger"/>.</param>
 public AuthenticationContextFactory(
     IDatabaseContext databaseContext,
     IIdentityCache identityCache,
     IOptions <SwarmConfiguration> swarmConfigurationOptions,
     ILogger <AuthenticationContextFactory> logger)
 {
     this.databaseContext = databaseContext ?? throw new ArgumentNullException(nameof(databaseContext));
     this.identityCache   = identityCache ?? throw new ArgumentNullException(nameof(identityCache));
     swarmConfiguration   = swarmConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(swarmConfigurationOptions));
     this.logger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #6
0
 /// <summary>
 /// Construct a <see cref="HomeController"/>
 /// </summary>
 /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param>
 /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param>
 /// <param name="tokenFactory">The value of <see cref="tokenFactory"/></param>
 /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param>
 /// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/></param>
 /// <param name="assemblyInformationProvider">The value of <see cref="assemblyInformationProvider"/></param>
 /// <param name="identityCache">The value of <see cref="identityCache"/></param>
 /// <param name="browserResolver">The value of <see cref="browserResolver"/></param>
 /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/>.</param>
 /// <param name="controlPanelConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="controlPanelConfiguration"/></param>
 /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param>
 public HomeController(
     IDatabaseContext databaseContext,
     IAuthenticationContextFactory authenticationContextFactory,
     ITokenFactory tokenFactory,
     ISystemIdentityFactory systemIdentityFactory,
     ICryptographySuite cryptographySuite,
     IAssemblyInformationProvider assemblyInformationProvider,
     IIdentityCache identityCache,
     IBrowserResolver browserResolver,
     IOptions <GeneralConfiguration> generalConfigurationOptions,
     IOptions <ControlPanelConfiguration> controlPanelConfigurationOptions,
     ILogger <HomeController> logger)
     : base(
         databaseContext,
         authenticationContextFactory,
         logger,
         (browserResolver ?? throw new ArgumentNullException(nameof(browserResolver))).Browser.Type != BrowserType.Generic &&
コード例 #7
0
 /// <summary>
 /// Construct an <see cref="AuthenticationContextFactory"/>
 /// </summary>
 /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param>
 /// <param name="databaseContext">The value of <see cref="databaseContext"/></param>
 /// <param name="identityCache">The value of <see cref="identityCache"/></param>
 public AuthenticationContextFactory(ISystemIdentityFactory systemIdentityFactory, IDatabaseContext databaseContext, IIdentityCache identityCache)
 {
     this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory));
     this.databaseContext       = databaseContext ?? throw new ArgumentNullException(nameof(databaseContext));
     this.identityCache         = identityCache ?? throw new ArgumentNullException(nameof(identityCache));
 }