public EnvironmentDeployedGetter(
     ITfsClient tfsClient,
     IConfigurationRetriever configurationRetriever)
 {
     _tfsClient = tfsClient;
     _configurationRetriever = configurationRetriever;
 }
Esempio n. 2
0
 public RouteDefinitionMatcher(IConfigurationRetriever configurationRetriever,
                               IOptions <GatewayOptions> gatewayOptions)
 {
     _configurationRetriever = configurationRetriever;
     _gatewayOptions         = gatewayOptions.Value;
     _asyncLock = new AsyncLock();
 }
Esempio n. 3
0
 public RestDbManager(IConfigurationRetriever configurationRetriever,
                      IOptions <RestDbOptions> restDbOptions)
 {
     _configurationRetriever = configurationRetriever;
     _restDbOptions          = restDbOptions.Value;
     _connections            = new ConcurrentDictionary <string, RestDbConnection>();
 }
 public GoogleDriveServerSyncProvider(IConfigurationRetriever configurationRetriever, IGoogleDriveService googleDriveService, ILogManager logManager, IHttpClient httpClient)
 {
     _configurationRetriever = configurationRetriever;
     _googleDriveService = googleDriveService;
     _httpClient = httpClient;
     _logger = logManager.GetLogger("GoogleDrive");
 }
 public GoogleDriveServerSyncProvider(IConfigurationRetriever configurationRetriever, IGoogleDriveService googleDriveService, ILogManager logManager, IHttpClient httpClient)
 {
     _configurationRetriever = configurationRetriever;
     _googleDriveService     = googleDriveService;
     _httpClient             = httpClient;
     _logger = logManager.GetLogger("GoogleDrive");
 }
 public DropboxServerSyncProvider(IConfigurationRetriever configurationRetriever, IDropboxApi dropboxApi, IDropboxContentApi dropboxContentApi, ILogManager logManager)
 {
     _configurationRetriever = configurationRetriever;
     _dropboxApi = dropboxApi;
     _dropboxContentApi = dropboxContentApi;
     _logger = logManager.GetLogger("Dropbox");
 }
 public ReleaseEnvironmentsGetter(
     ITfsClient tfsClient,
     IConfigurationRetriever configurationRetriever)
 {
     _tfsClient = tfsClient;
     _configurationRetriever = configurationRetriever;
 }
Esempio n. 8
0
 public DropboxServerSyncProvider(IConfigurationRetriever configurationRetriever, IDropboxApi dropboxApi, IDropboxContentApi dropboxContentApi, ILogManager logManager)
 {
     _configurationRetriever = configurationRetriever;
     _dropboxApi             = dropboxApi;
     _dropboxContentApi      = dropboxContentApi;
     _logger = logManager.GetLogger("Dropbox");
 }
        public OpenIdConnectCachingSecurityTokenProvider(string metadataEndpoint, IConfigurationRetriever <OpenIdConnectConfiguration> retriever)
        {
            _metadataEndpoint = metadataEndpoint;
            _configManager    = new ConfigurationManager <OpenIdConnectConfiguration>(metadataEndpoint, new OpenIdConnectConfigurationRetriever());

            RetrieveMetadata();
        }
Esempio n. 10
0
 public OneDriveServerSyncProvider(IConfigurationRetriever configurationRetriever, IOneDriveApi oneDriveApi, ILiveAuthenticationApi liveAuthenticationApi, IHttpClient httpClient, ILogManager logManager)
 {
     _configurationRetriever = configurationRetriever;
     _oneDriveApi            = oneDriveApi;
     _liveAuthenticationApi  = liveAuthenticationApi;
     _httpClient             = httpClient;
     _logger = logManager.GetLogger("OneDrive");
 }
 public OneDriveServerSyncProvider(IConfigurationRetriever configurationRetriever, IOneDriveApi oneDriveApi, ILiveAuthenticationApi liveAuthenticationApi, IHttpClient httpClient, ILogManager logManager)
 {
     _configurationRetriever = configurationRetriever;
     _oneDriveApi = oneDriveApi;
     _liveAuthenticationApi = liveAuthenticationApi;
     _httpClient = httpClient;
     _logger = logManager.GetLogger("OneDrive");
 }
        public OneDriveCredentials(IConfigurationRetriever configurationRetriever, ILiveAuthenticationApi liveAuthenticationApi, SyncTarget target)
        {
            _configurationRetriever = configurationRetriever;
            _liveAuthenticationApi = liveAuthenticationApi;
            _syncAccountId = target.Id;

            var syncAccount = configurationRetriever.GetSyncAccount(target.Id);
            _accessToken = syncAccount.AccessToken;
        }
Esempio n. 13
0
 public HealthCheckPerformer(
     ITfsClient tfsClient,
     IConfigurationRetriever configurationRetriever,
     IMemoryCache memoryCache)
 {
     _tfsClient = tfsClient;
     _configurationRetriever = configurationRetriever;
     _memoryCache            = memoryCache;
 }
        public void Initialize()
        {
            _configurationRetriever = A.Fake <IConfigurationRetriever>();
            var options = Options.Create(new GatewayOptions
            {
                RouteDefinitionsUri = "./test.json"
            });

            _routeDefinitionMatcher = new RouteDefinitionMatcher(_configurationRetriever, options);
        }
Esempio n. 15
0
        public OneDriveCredentials(IConfigurationRetriever configurationRetriever, ILiveAuthenticationApi liveAuthenticationApi, SyncTarget target)
        {
            _configurationRetriever = configurationRetriever;
            _liveAuthenticationApi  = liveAuthenticationApi;
            _syncAccountId          = target.Id;

            var syncAccount = configurationRetriever.GetSyncAccount(target.Id);

            _accessToken = syncAccount.AccessToken;
        }
        /// <summary>
        /// Instantiates a new <see cref="ConfigurationManager{T}"/> with cinfiguration validator that manages automatic and controls refreshing on configuration data.
        /// </summary>
        /// <param name="metadataAddress">The address to obtain configuration.</param>
        /// <param name="configRetriever">The <see cref="IConfigurationRetriever{T}"/></param>
        /// <param name="docRetriever">The <see cref="IDocumentRetriever"/> that reaches out to obtain the configuration.</param>
        /// <param name="configValidator">The <see cref="IConfigurationValidator{T}"/></param>
        /// <exception cref="ArgumentNullException">If 'configValidator' is null.</exception>
        public ConfigurationManager(string metadataAddress, IConfigurationRetriever <T> configRetriever, IDocumentRetriever docRetriever, IConfigurationValidator <T> configValidator)
            : this(metadataAddress, configRetriever, docRetriever)
        {
            if (configValidator == null)
            {
                throw LogHelper.LogArgumentNullException(nameof(configValidator));
            }

            _configValidator = configValidator;
        }
Esempio n. 17
0
 public MockerMiddleware(IConfigurationRetriever configurationRetriever,
                         IHistoryRepository historyRepository,
                         IOptions <MockerOptions> mockerOptions,
                         RequestDelegate next)
 {
     _configurationRetriever = configurationRetriever;
     _historyRepository      = historyRepository;
     _mockerOptions          = mockerOptions.Value;
     _next = next;
 }
 public ReleaseInfoCoordinator(
     IReleaseEnvironmentsGetter releaseEnvironmentsGetter,
     IEnvironmentDeployedGetter environmentDeployedGetter,
     IConfigurationRetriever configurationRetriever)
 {
     _releaseEnvironmentsGetter = releaseEnvironmentsGetter;
     _environmentDeployedGetter = environmentDeployedGetter;
     _configurationRetriever    = configurationRetriever;
     _targetSystems             = new List <TargetSystem>();
 }
Esempio n. 19
0
        public void Initialize()
        {
            _configurationRetriever = A.Fake <IConfigurationRetriever>();
            _historyRepository      = A.Fake <IHistoryRepository>();
            var options = Options.Create(new MockerOptions
            {
                RouteDefinitionsUri = "http://test-host/mocker.json"
            });

            _next             = A.Fake <RequestDelegate>();
            _mockerMiddleware = new MockerMiddleware(_configurationRetriever, _historyRepository, options, _next);
        }
Esempio n. 20
0
        /// <summary>
        /// Initializes the traversing with the XmlSchema.
        /// </summary>
        /// <param name="sourceFile">The schema file to traverse.</param>
        /// <returns>An <c>IVisitableComponent</c> containing all the visitable nodes.</returns>
        public IVisitableComponent Traverse(string sourceFile)
        {
            try
            {
                Validator val = new Validator();
                using (FileStream fs = new FileStream(sourceFile, FileMode.Open))
                    _context = System.Xml.Schema.XmlSchema.Read(fs, new ValidationEventHandler(val.OnValidation));
                if (val.HasErrors)
                {
                    throw new ArgumentException("There were errors in the schema "
                                                + sourceFile + Environment.NewLine + val.Errors);
                }
            }
            catch (Exception ex)
            {
                throw new ArgumentException("The schema couldn't be loaded: "
                                            + sourceFile + Environment.NewLine + ex.Message, ex);
            }

            // Retrieve the current configuration from the Host.
            IConfigurationRetriever retriever =
                (IConfigurationRetriever)Host.GetService(typeof(IConfigurationRetriever));

            if (retriever == null)
            {
                GeneratorHost.ThrowInvalidHostResponse(typeof(IConfigurationRetriever));
            }

            _config = retriever.GetConfig("generator") as GeneratorSection;
            if (_config == null)
            {
                GeneratorHost.ThrowInvalidHostResponse("No <generator> section retrieved.");
            }

            if (!_context.IsCompiled)
            {
                _context.Compile(null);
            }
            XmlDocument doc = new XmlDocument();

            doc.Load(sourceFile);
            VisitableSchemaRoot result = new VisitableSchemaRoot(_context, doc, _context.Id);

            foreach (XmlSchemaObject item in _context.Items)
            {
                if (item is XmlSchemaElement)
                {
                    result.Add(Build(item as XmlSchemaElement, result));
                }
            }

            return(result);
        }
Esempio n. 21
0
        private async Task <ClaimsIdentity> RunTestCase(IConfigurationRetriever <IDictionary <string, HashSet <string> > > configRetriever, string[] requiredEndorsements = null)
        {
            var tokenExtractor = new JwtTokenExtractor(
                emptyClient,
                EmulatorValidation.ToBotFromEmulatorTokenValidationParameters,
                AuthenticationConstants.ToBotFromEmulatorOpenIdMetadataUrl,
                AuthenticationConstants.AllowedSigningAlgorithms,
                new ConfigurationManager <IDictionary <string, HashSet <string> > >("http://test", configRetriever));

            string header = $"Bearer {await new MicrosoftAppCredentials(EnvironmentConfig.TestAppId(), EnvironmentConfig.TestAppPassword()).GetTokenAsync()}";

            return(await tokenExtractor.GetIdentityAsync(header, "testChannel", requiredEndorsements));
        }
Esempio n. 22
0
        public ConfigurationManager(IRelyingPartyContextBuilder relyingPartyContextBuilder, IConfigurationRetriever <T> configRetriever)
        {
            if (relyingPartyContextBuilder == null)
            {
                throw new ArgumentNullException("context");
            }

            if (configRetriever == null)
            {
                throw new ArgumentNullException("configRetriever");
            }

            this._relyingPartyContextBuilder = relyingPartyContextBuilder;
            this._configRetriever            = configRetriever;
            this._refreshLock = new SemaphoreSlim(1);
        }
Esempio n. 23
0
        /// <summary>
        /// Instantiaties a new <see cref="ConfigurationManager{T}"/> that manages automatic and controls refreshing on configuration data.
        /// </summary>
        /// <param name="metadataAddress">The address to obtain configuration.</param>
        /// <param name="configRetriever">The <see cref="IConfigurationRetriever{T}"/></param>
        /// <param name="docRetriever">The <see cref="IDocumentRetriever"/> that reaches out to obtain the configuration.</param>
        /// <exception cref="ArgumentNullException">If 'metadataAddress' is null or empty.</exception>
        /// <exception cref="ArgumentNullException">If 'configRetriever' is null.</exception>
        /// <exception cref="ArgumentNullException">If 'docRetriever' is null.</exception>
        public ConfigurationManager(string metadataAddress, IConfigurationRetriever <T> configRetriever, IDocumentRetriever docRetriever)
        {
            if (string.IsNullOrWhiteSpace(metadataAddress))
            {
                throw LogHelper.LogArgumentNullException(nameof(metadataAddress));
            }

            if (configRetriever == null)
            {
                throw LogHelper.LogArgumentNullException(nameof(configRetriever));
            }

            if (docRetriever == null)
            {
                throw LogHelper.LogArgumentNullException(nameof(docRetriever));
            }

            _metadataAddress = metadataAddress;
            _docRetriever    = docRetriever;
            _configRetriever = configRetriever;
            _refreshLock     = new SemaphoreSlim(1);
        }
        /// <summary>
        /// Instantiaties a new <see cref="ConfigurationManager{T}"/> that manages automatic and controls refreshing on configuration data.
        /// </summary>
        /// <param name="metadataAddress">the address to obtain configuration.</param>
        /// <param name="docRetriever">the <see cref="IDocumentRetriever"/> that reaches out to obtain the configuration.</param>
        public ConfigurationManager(string metadataAddress, IDocumentRetriever docRetriever)
        {
            if (!typeof(T).Equals(typeof(WsFederationConfiguration)) && (!typeof(T).Equals(typeof(OpenIdConnectConfiguration))))
            {
                throw new NotImplementedException(typeof(T).FullName);
            }

            if (string.IsNullOrWhiteSpace(metadataAddress))
            {
                throw new ArgumentNullException("metadataAddress");
            }

            if (docRetriever == null)
            {
                throw new ArgumentNullException("retriever");
            }

            _metadataAddress = metadataAddress;
            _docRetriever    = docRetriever;
            _configRetriever = GetConfigurationRetriever();
            _refreshLock     = new SemaphoreSlim(1);
        }
 public UnitOfWorkFactory(IConfigurationRetriever configurationRetriever)
 {
     this._configRetriever = configurationRetriever;
 }
 public OneDriveRestfulService(IConfigurationRetriever configurationRetriever, ILiveAuthenticationApi liveAuthenticationApi)
 {
     _configurationRetriever = configurationRetriever;
     _liveAuthenticationApi = liveAuthenticationApi;
 }
Esempio n. 27
0
 public FederationConfigurationManager(IAssertionPartyContextBuilder federationPartyContextBuilder, IConfigurationRetriever <MetadataBase> configRetriever)
     : base(federationPartyContextBuilder, configRetriever)
 {
 }
Esempio n. 28
0
 public GoogleDriveRestfulService2(IConfigurationRetriever configurationRetriever, IGoogleAuthService googleAuthService, IGoogleDriveService googleDriveService)
 {
     _configurationRetriever = configurationRetriever;
     _googleAuthService      = googleAuthService;
     _googleDriveService     = googleDriveService;
 }
 public GoogleDriveRestfulService2(IConfigurationRetriever configurationRetriever, IGoogleAuthService googleAuthService, IGoogleDriveService googleDriveService)
 {
     _configurationRetriever = configurationRetriever;
     _googleAuthService = googleAuthService;
     _googleDriveService = googleDriveService;
 }
 public DropboxRestfulService(IConfigurationRetriever configurationRetriever, IDropboxApi dropboxApi)
 {
     _configurationRetriever = configurationRetriever;
     _dropboxApi = dropboxApi;
 }
Esempio n. 31
0
 public DataRetriever(IConfigurationRetriever configRetriever)
 {
     _configRetriever = configRetriever;
 }
 public DropboxRestfulService(IConfigurationRetriever configurationRetriever, IDropboxApi dropboxApi)
 {
     _configurationRetriever = configurationRetriever;
     _dropboxApi             = dropboxApi;
 }
Esempio n. 33
0
 /// <summary>
 /// Instantiaties a new <see cref="ConfigurationManager{T}"/> that manages automatic and controls refreshing on configuration data.
 /// </summary>
 /// <param name="metadataAddress">The address to obtain configuration.</param>
 /// <param name="configRetriever">The <see cref="IConfigurationRetriever{T}"/></param>
 /// <param name="httpClient">The client to use when obtaining configuration.</param>
 public ConfigurationManager(string metadataAddress, IConfigurationRetriever <T> configRetriever, HttpClient httpClient)
     : this(metadataAddress, configRetriever, new HttpDocumentRetriever(httpClient))
 {
 }
 public TfsClient(IConfigurationRetriever configurationRetriever)
 {
     _configurationRetriever = configurationRetriever;
 }
Esempio n. 35
0
 /// <summary>
 /// Initializes a new instance of <see cref="ConfigurationManagerStub" />
 /// </summary>
 /// <param name="metadataAddress">The address to obtain configuration.</param>
 /// <param name="configRetriever">The <see cref="IConfigurationRetriever{OpenIdConnectConfiguration}" /></param>
 /// <param name="docRetriever">The <see cref="IDocumentRetriever" /> that reaches out to obtain the configuration.</param>
 public ConfigurationManagerStub(
     string metadataAddress,
     IConfigurationRetriever <OpenIdConnectConfiguration> configRetriever,
     IDocumentRetriever docRetriever)
 {
 }
 public OneDriveRestfulService(IConfigurationRetriever configurationRetriever, ILiveAuthenticationApi liveAuthenticationApi)
 {
     _configurationRetriever = configurationRetriever;
     _liveAuthenticationApi  = liveAuthenticationApi;
 }