Example #1
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="mediator"><see cref="IMediator"/>.</param>
 /// <param name="authorizedUserProvider"><see cref="IAuthorizedUserProvider"/>.</param>
 public SearchController(
     IMediator mediator,
     IAuthorizedUserProvider authorizedUserProvider)
 {
     this.mediator = mediator;
     this.authorizedUserProvider = authorizedUserProvider;
 }
Example #2
0
        /// <summary>Initializes a new instance of the <see cref="AzureFunctionsCustomBindingSample.Binding.Authorization.AuthorizationValueProvider"/> class.</summary>
        /// <param name="httpRequest">An object that represents the incoming side of an individual HTTP request.</param>
        /// <param name="cancellationToken">An object that propagates notification that operations should be canceled.</param>
        /// <param name="authorizedUserProvider">An object that provides a simple API to get an authorized user.</param>
        /// <param name="type">A value that represents a parameter type.</param>
        public AuthorizationValueProvider(HttpRequest httpRequest, CancellationToken cancellationToken, IAuthorizedUserProvider authorizedUserProvider, Type type)
        {
            _httpRequest            = httpRequest ?? throw new ArgumentNullException(nameof(httpRequest));
            _cancellationToken      = cancellationToken;
            _authorizedUserProvider = authorizedUserProvider ?? throw new ArgumentNullException(nameof(authorizedUserProvider));

            Type = type ?? throw new ArgumentNullException(nameof(type));
        }
Example #3
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="logger">Логгер.</param>
 /// <param name="authorizedUserProvider"><see cref="IAuthorizedUserProvider"/>.</param>
 /// <param name="jobStorageService">Сервис для работы <see cref="JobStorage"/>.</param>
 public NotificationHub(
     ILogger <NotificationHub> logger,
     IAuthorizedUserProvider authorizedUserProvider,
     IJobStorageService jobStorageService)
 {
     this.logger = logger;
     this.authorizedUserProvider = authorizedUserProvider;
     this.jobStorageService      = jobStorageService;
 }
Example #4
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="distributionsRepository"><see cref="IReadOnlyRepository{DistributionReadModel}"/>.</param>
 /// <param name="mapper">Маппер типов.</param>
 /// <param name="authorizedUserProvider">.</param>
 /// <param name="mediator"><see cref="IMediator"/>.</param>
 /// <param name="distributionCommandMapper"><see cref="IDistributionCommandMapper"/>.</param>
 public DistributionsController(
     IReadOnlyRepository <DistributionReadModel> distributionsRepository,
     IMapper mapper,
     IAuthorizedUserProvider authorizedUserProvider,
     IMediator mediator,
     IDistributionCommandMapper distributionCommandMapper)
 {
     this.distributionsRepository = distributionsRepository;
     this.mapper = mapper;
     this.authorizedUserProvider = authorizedUserProvider;
     this.mediator = mediator;
     this.distributionCommandMapper = distributionCommandMapper;
 }
Example #5
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="buildMatchPatternRepository"><see cref="IReadOnlyRepository{BuildMatchPatternReadModel}"/>.</param>
 /// <param name="lighthouseServiceApi"><see cref="ILighthouseServiceApi"/>.</param>
 /// <param name="transferRules"><see cref="IEnumerable{IBuildStateTransferRule}"/>.</param>
 /// <param name="authorizedUserProvider"><see cref="IAuthorizedUserProvider"/>.</param>
 /// <param name="mapper">Маппер.</param>
 public DistributionCommandMapper(
     IReadOnlyRepository <BuildMatchPatternReadModel> buildMatchPatternRepository,
     ILighthouseServiceApi lighthouseServiceApi,
     IEnumerable <IBuildStateTransferRule> transferRules,
     IAuthorizedUserProvider authorizedUserProvider,
     IMapper mapper)
 {
     this.buildMatchPatternRepository = buildMatchPatternRepository;
     this.lighthouseServiceApi        = lighthouseServiceApi;
     this.transferRules          = transferRules;
     this.authorizedUserProvider = authorizedUserProvider;
     this.mapper = mapper;
 }
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="mapper">Маппер типов.</param>
 /// <param name="mediator"><see cref="IMediator"/>.</param>
 /// <param name="buildSyncService">Сервис BuildSync.</param>
 /// <param name="authorizedUserProvider">Провайдер для доступа к текущему пользователю.</param>
 /// <param name="buildMatchPatternReadOnlyRepository">a.</param>
 /// <param name="buildReadOnlyRepository">Репозиторий сборок.</param>
 /// <param name="distributionReadOnlyRepository">.</param>
 public BuildsController(
     IMapper mapper,
     IMediator mediator,
     IBuildSyncService buildSyncService,
     IAuthorizedUserProvider authorizedUserProvider,
     IReadOnlyRepository <BuildMatchPatternReadModel> buildMatchPatternReadOnlyRepository,
     IReadOnlyRepository <BuildReadModel> buildReadOnlyRepository,
     IReadOnlyRepository <DistributionReadModel> distributionReadOnlyRepository
     )
 {
     this.mapper                 = mapper;
     this.mediator               = mediator;
     this.buildSyncService       = buildSyncService;
     this.authorizedUserProvider = authorizedUserProvider;
     this.buildMatchPatternReadOnlyRepository = buildMatchPatternReadOnlyRepository;
     this.buildReadOnlyRepository             = buildReadOnlyRepository;
     this.distributionReadOnlyRepository      = distributionReadOnlyRepository;
 }
 /// <summary>Initializes a new instance of the <see cref="AzureFunctionsCustomBindingSample.Binding.Authorization.AuthorizationBinding"/> class.</summary>
 /// <param name="authorizedUserProvider">An object that provides a simple API to get an authorized user.</param>
 /// <param name="parameterType">A value that represents a type of a binded parameter.</param>
 public AuthorizationBinding(IAuthorizedUserProvider authorizedUserProvider, Type parameterType)
 {
     _authorizedUserProvider = authorizedUserProvider ?? throw new ArgumentNullException(nameof(authorizedUserProvider));
     _parameterType          = parameterType ?? throw new ArgumentNullException(nameof(parameterType));
 }
Example #8
0
 /// <summary>Initializes a new instance of the <see cref="AzureFunctionsCustomBindingSample.Binding.Authorization.AuthorizationBindingProvider"/> class.</summary>
 /// <param name="authorizedUserProvider">An object that provides a simple API to get an authorized user.</param>
 public AuthorizationBindingProvider(IAuthorizedUserProvider authorizedUserProvider)
 => _authorizedUserProvider = authorizedUserProvider ?? throw new ArgumentNullException(nameof(authorizedUserProvider));
Example #9
0
 /// <summary>Initializes a new instance of the <see cref="AzureFunctionsCustomBindingSample.Binding.Authorization.AuthorizationExtensionConfigProvider"/> class.</summary>
 /// <param name="authorizedUserProvider">An object that provides a simple API to get an authorized user.</param>
 public AuthorizationExtensionConfigProvider(IAuthorizedUserProvider authorizedUserProvider)
 => _authorizedUserProvider = authorizedUserProvider ?? throw new ArgumentNullException(nameof(authorizedUserProvider));