public AdminController(WebScriptHostManager scriptHostManager, WebHostSettings webHostSettings, TraceWriter traceWriter, ILoggerFactory loggerFactory)
 {
     _scriptHostManager = scriptHostManager;
     _webHostSettings   = webHostSettings;
     _traceWriter       = traceWriter.WithSource($"{ScriptConstants.TraceSourceHostAdmin}.Api");
     _logger            = loggerFactory?.CreateLogger(ScriptConstants.LogCategoryAdminController);
 }
 public SwaggerController(ISwaggerDocumentManager swaggerDocumentManager, WebScriptHostManager scriptHostManager, TraceWriter traceWriter, ILoggerFactory loggerFactory)
 {
     _swaggerDocumentManager = swaggerDocumentManager;
     _scriptHostManager      = scriptHostManager;
     _traceWriter            = traceWriter.WithSource($"{ScriptConstants.TraceSourceSwagger}.Api");
     _logger = loggerFactory?.CreateLogger(ScriptConstants.LogCategorySwaggerController);
 }
 public KeysController(WebScriptHostManager scriptHostManager, ISecretManager secretManager, TraceWriter traceWriter, ILoggerFactory loggerFactory)
 {
     _scriptHostManager = scriptHostManager;
     _secretManager     = secretManager;
     _traceWriter       = traceWriter.WithSource($"{ScriptConstants.TraceSourceSecretManagement}.Api");
     _logger            = loggerFactory?.CreateLogger(ScriptConstants.LogCategoryKeysController);
 }
Exemplo n.º 4
0
        public AutoRecoveringFileSystemWatcher(string path, string filter = "*.*",
                                               bool includeSubdirectories = true, WatcherChangeTypes changeTypes = WatcherChangeTypes.All, TraceWriter traceWriter = null)
        {
            _path                    = path;
            _filter                  = filter;
            _changeTypes             = changeTypes;
            _includeSubdirectories   = includeSubdirectories;
            _cancellationTokenSource = new CancellationTokenSource();
            _cancellationToken       = _cancellationTokenSource.Token;
            _handleFileError         = new Action <ErrorEventArgs>(OnFileWatcherError).Debounce();

            if (traceWriter != null)
            {
                _traceWriter = traceWriter.WithSource(ScriptConstants.TraceSourceFileWatcher);
            }

            InitializeWatcher();
        }
Exemplo n.º 5
0
        public SecretManager(string secretsPath, IKeyValueConverterFactory keyValueConverterFactory, TraceWriter traceWriter, bool createHostSecretsIfMissing = false)
        {
            _traceWriter              = traceWriter.WithSource(ScriptConstants.TraceSourceSecretManagement);
            _secretsPath              = secretsPath;
            _hostSecretsPath          = Path.Combine(_secretsPath, ScriptConstants.HostMetadataFileName);
            _keyValueConverterFactory = keyValueConverterFactory;

            Directory.CreateDirectory(_secretsPath);

            _fileWatcher = new AutoRecoveringFileSystemWatcher(_secretsPath, "*.json");

            _fileWatcher.Changed += OnChanged;

            if (createHostSecretsIfMissing)
            {
                // The SecretManager implementation of GetHostSecrets will
                // create a host secret if one is not present.
                GetHostSecrets();
            }
        }
Exemplo n.º 6
0
 public SwaggerController(ISwaggerDocumentManager swaggerDocumentManager, WebScriptHostManager scriptHostManager, TraceWriter traceWriter)
 {
     _swaggerDocumentManager = swaggerDocumentManager;
     _scriptHostManager      = scriptHostManager;
     _traceWriter            = traceWriter.WithSource($"{ScriptConstants.TraceSourceSwagger}.Api");
 }
Exemplo n.º 7
0
 public AdminController(WebScriptHostManager scriptHostManager, WebHostSettings webHostSettings, TraceWriter traceWriter)
 {
     _scriptHostManager = scriptHostManager;
     _webHostSettings   = webHostSettings;
     _traceWriter       = traceWriter.WithSource($"{ScriptConstants.TraceSourceHostAdmin}.Api");
 }
 public KeysController(WebScriptHostManager scriptHostManager, ISecretManager secretManager, TraceWriter traceWriter)
 {
     _scriptHostManager = scriptHostManager;
     _secretManager     = secretManager;
     _traceWriter       = traceWriter.WithSource($"{ScriptConstants.TraceSourceSecretManagement}.Api");
 }