Пример #1
0
 public GetFacturaeSignedActivity(IKeyVaultService keyvaultService,
                                  XadesService xadesService,
                                  IConfiguration configuration)
 {
     this.keyvaultService = keyvaultService;
     this.xadesService    = xadesService;
     this.configuration   = configuration;
 }
Пример #2
0
 public TagAndAnalyzeService(IKeyVaultService keyVaultService,
                             IUploadToAzureStorageService uploadToAzureStorageService,
                             IHandwrittenRecognitionService handwrittenRecognitionService)
 {
     _keyVaultService               = keyVaultService;
     _uploadToAzureStorageService   = uploadToAzureStorageService;
     _handwrittenRecognitionService = handwrittenRecognitionService;
 }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DocumentDbService"/> class.
        /// </summary>
        /// <param name="keyVaultService">Key Vault Service</param>
        /// <param name="config">Config</param>
        public DocumentDbService(IKeyVaultService keyVaultService, IOptions <DocumentDbConfig> config)
        {
            Contract.Requires(config != null, nameof(config));
            Contract.Requires(keyVaultService != null, nameof(keyVaultService));

            this.config          = config.Value;
            this.keyVaultService = keyVaultService;
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StorageService"/> class.
        /// </summary>
        /// <param name="keyVaultService">Key Vault Service</param>
        /// <param name="config">Config</param>
        public StorageService(IKeyVaultService keyVaultService, IOptions <AzureStorageConfig> config)
        {
            Contract.Requires(config != null, nameof(config));
            Contract.Requires(keyVaultService != null, nameof(keyVaultService));

            this.config          = config.Value;
            this.keyVaultService = keyVaultService;
        }
Пример #5
0
 public VsixSignService(IKeyVaultService keyVaultService,
                        ILogger <VsixSignService> logger,
                        ITelemetryLogger telemetryLogger)
 {
     this.keyVaultService = keyVaultService;
     this.logger          = logger;
     this.telemetryLogger = telemetryLogger;
 }
 public AzureSignToolSignService(ILogger <AzureSignToolSignService> logger,
                                 IKeyVaultService keyVaultService,
                                 ITelemetryLogger telemetryLogger)
 {
     this.logger          = logger;
     this.keyVaultService = keyVaultService;
     this.telemetryLogger = telemetryLogger;
     signToolName         = nameof(AzureSignToolSignService);
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackupBlobService"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="sasTokenProvider">The sas token provider</param>
 /// <param name="keyVaultService">The key vault service</param>
 public BackupBlobService(ILogger <IBackupBlobService> logger, ISasTokenProvider sasTokenProvider, IKeyVaultService keyVaultService)
 {
     _logger          = logger;
     _keyVaultService = keyVaultService;
     _accountKey      = Environment.GetEnvironmentVariable("AccountKey");
     _blobEndpoint    = Environment.GetEnvironmentVariable("BlobEndpoint");
     _environment     = Environment.GetEnvironmentVariable("Environment");
     _accountName     = _environment.Equals("dev") ? "devstoreaccount1" : _accountName;
 }
Пример #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BatchService"/> class.
        /// </summary>
        /// <param name="keyVaultService">Key Vault Service</param>
        /// <param name="config">Config</param>
        /// <param name="logger">Logger</param>
        public BatchService(IKeyVaultService keyVaultService, IOptions <AzureBatchConfig> config, ILogger <BatchService> logger)
        {
            Contract.Requires(config != null, nameof(config));
            Contract.Requires(keyVaultService != null, nameof(keyVaultService));

            this.config          = config.Value;
            this.keyVaultService = keyVaultService;
            this.logger          = logger;
        }
Пример #9
0
 public AppxFileFactory(ILogger <AppxFileFactory> logger,
                        IOptionsSnapshot <WindowsSdkFiles> windowSdkFiles,
                        IKeyVaultService keyVaultService,
                        IDirectoryUtility directoryUtility)
 {
     this.logger           = logger;
     this.keyVaultService  = keyVaultService;
     this.directoryUtility = directoryUtility;
     makeappxPath          = windowSdkFiles.Value.MakeAppxPath;
 }
Пример #10
0
 public NuGetSignService(IKeyVaultService keyVaultService,
                         ILogger <NuGetSignService> logger,
                         ITelemetryLogger telemetryLogger)
 {
     this.keyVaultService = keyVaultService;
     this.logger          = logger;
     this.telemetryLogger = telemetryLogger;
     signToolName         = nameof(NuGetSignService);
     signCommand          = new SignCommand(logger);
 }
Пример #11
0
 public NuGetSignService(IKeyVaultService keyVaultService,
                         IHostingEnvironment hostingEnvironment,
                         ILogger <NuGetSignService> logger,
                         ITelemetryLogger telemetryLogger)
 {
     this.keyVaultService = keyVaultService;
     this.logger          = logger;
     this.telemetryLogger = telemetryLogger;
     signtoolPath         = Path.Combine(hostingEnvironment.ContentRootPath, "tools\\NuGetKeyVaultSignTool\\NuGetKeyVaultSignTool.exe");
     signToolName         = Path.GetFileName(signtoolPath);
 }
Пример #12
0
 public AzureSignToolCodeSignService(ILogger <AzureSignToolCodeSignService> logger,
                                     IAppxFileFactory appxFileFactory,
                                     IKeyVaultService keyVaultService,
                                     IHostingEnvironment hostingEnvironment,
                                     ITelemetryLogger telemetryLogger)
 {
     this.logger          = logger;
     this.appxFileFactory = appxFileFactory;
     this.keyVaultService = keyVaultService;
     this.telemetryLogger = telemetryLogger;
     keyVaultSignToolPath = Path.Combine(hostingEnvironment.ContentRootPath, "tools\\AzureSignTool\\AzureSignTool.exe");
     signToolName         = Path.GetFileName(keyVaultSignToolPath);
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AccessTokenProvider"/> class.
 /// </summary>
 /// <param name="keyVaultService">The key vault service.</param>
 /// <param name="accessTokenGenerator">The access token generator.</param>
 /// <param name="accessTokenSettings">The access token settings.</param>
 /// <param name="keyVaultSettings">The key vault settings.</param>
 /// <param name="platformSettings">The platform settings.</param>
 public AccessTokenProvider(
     IKeyVaultService keyVaultService,
     IAccessTokenGenerator accessTokenGenerator,
     IOptions <AccessTokenSettings> accessTokenSettings,
     IOptions <KeyVaultSettings> keyVaultSettings,
     IOptions <PlatformSettings> platformSettings)
 {
     _keyVaultService      = keyVaultService;
     _accessTokenGenerator = accessTokenGenerator;
     _platformSettings     = platformSettings.Value;
     _accessTokenSettings  = accessTokenSettings.Value;
     _keyVaultSettings     = keyVaultSettings.Value;
 }
Пример #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphService"/> class.
        /// </summary>
        /// <param name="httpContextAccessor">Http Context</param>
        /// <param name="keyVaultService">Key Vault Service</param>
        /// <param name="config">Config</param>
        /// <param name="cache">Cache</param>
        /// <param name="dataProtectionProvider">Data Protection Provider</param>
        public GraphService(IHttpContextAccessor httpContextAccessor, IKeyVaultService keyVaultService, IOptions <AzureAdConfig> config, IDistributedCache cache, IDataProtectionProvider dataProtectionProvider)
        {
            Contract.Requires(httpContextAccessor != null, nameof(httpContextAccessor));
            Contract.Requires(config != null, nameof(config));
            Contract.Requires(keyVaultService != null, nameof(keyVaultService));
            Contract.Requires(cache != null, nameof(cache));
            Contract.Requires(dataProtectionProvider != null, nameof(dataProtectionProvider));

            this.httpContextAccessor = httpContextAccessor;
            this.config                 = config.Value;
            this.keyVaultService        = keyVaultService;
            this.cache                  = cache;
            this.dataProtectionProvider = dataProtectionProvider;
        }
 public MageSignService(IOptionsMonitor <AzureADOptions> aadOptions,
                        IHostingEnvironment hostingEnvironment,
                        IKeyVaultService keyVaultService,
                        IServiceProvider serviceProvider,
                        ILogger <MageSignService> logger,
                        ITelemetryLogger telemetryLogger)
 {
     this.aadOptions      = aadOptions.Get(AzureADDefaults.AuthenticationScheme);
     this.keyVaultService = keyVaultService;
     this.logger          = logger;
     this.telemetryLogger = telemetryLogger;
     magetoolPath         = Path.Combine(hostingEnvironment.ContentRootPath, "tools\\SDK\\mage.exe");
     signToolName         = nameof(MageSignService);
     // Need to delay this as it'd create a dependency loop if directly in the ctor
     signToolAggregate = new Lazy <ISigningToolAggregate>(() => serviceProvider.GetService <ISigningToolAggregate>());
 }
Пример #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValidateSubscriptionService"/> class.
 /// </summary>
 public ValidateSubscriptionService(
     HttpClient httpClient,
     IAccessTokenGenerator accessTokenGenerator,
     IKeyVaultService keyVaultService,
     IOptions <PlatformSettings> eventsConfig,
     IOptions <KeyVaultSettings> keyVaultSettings,
     ILogger <IPushEventsService> logger)
 {
     _platformSettings      = eventsConfig.Value;
     _keyVaultSettings      = keyVaultSettings.Value;
     httpClient.BaseAddress = new Uri(_platformSettings.ApiEventsEndpoint);
     _client = httpClient;
     _accessTokenGenerator = accessTokenGenerator;
     _keyVaultService      = keyVaultService;
     _logger = logger;
 }
Пример #17
0
        public override void Execute()
        {
            var vaultConfig = ConfigurationManager.GetVaultConfig(Vault);

            if (vaultConfig == null)
            {
                WriteError($"Unknown vault '{Vault}'");
                return;
            }

            var authConfig = ConfigurationManager.GetAuthConfig(vaultConfig);

            if (authConfig == null)
            {
                WriteError($"No authentication methods have been configured for vault '{Vault}'; see `kv auth`");
                return;
            }

            IKeyVaultService kvService = CreateVaultService(authConfig);

            SecretBundle secret;

            try
            {
                secret = kvService.GetSecret(vaultConfig.GetVaultUri($"secrets/{Secret}"));
            }
            catch (Exception ex)
            {
                WriteError($"Failed to get secret '{Secret}' from vault '{Vault}'", ex);
                return;
            }

            if (!Force)
            {
                secret.Value = "********";
                WriteInfo("Secret value is masked; '--force' option is not present");
            }

            if (Verbose)
            {
                Console.Out.WriteJson(secret);
            }
            else
            {
                Console.Out.WriteLine(secret.Value);
            }
        }
Пример #18
0
        public override void Execute()
        {
            var vaultConfig = ConfigurationManager.GetVaultConfig(Vault);

            if (vaultConfig == null)
            {
                WriteError($"Unknown vault '{Vault}'");
                return;
            }

            if (!Force)
            {
                WriteError("'--force' option is required");
                return;
            }

            var authConfig = ConfigurationManager.GetAuthConfig(vaultConfig);

            if (authConfig == null)
            {
                WriteError($"No authentication methods have been configured for vault '{Vault}'; see `kv auth`");
                return;
            }

            IKeyVaultService kvService = CreateVaultService(authConfig);

            SecretBundle deletedSecret;

            try
            {
                deletedSecret = kvService.DeleteSecret(vaultConfig.GetVaultUri(), Secret);
            }
            catch (Exception ex)
            {
                WriteError($"Failed to delete secret '{Secret}' in vault '{Vault}'", ex);
                return;
            }

            WriteInfo($"Secret '{Secret}' was deleted successfully");

            if (Verbose)
            {
                WriteVerbose("Deleted secret:");
                Console.Out.WriteJson(deletedSecret);
            }
        }
Пример #19
0
        public override void Execute()
        {
            var vaultConfig = ConfigurationManager.GetVaultConfig(Vault);

            if (vaultConfig == null)
            {
                WriteError($"Unknown vault '{Vault}'");
                return;
            }

            var authConfig = ConfigurationManager.GetAuthConfig(vaultConfig);

            if (authConfig == null)
            {
                WriteError($"No authentication methods have been configured for vault '{Vault}'; see `kv auth`");
                return;
            }

            IKeyVaultService kvService = CreateVaultService(authConfig);

            IEnumerable <SecretItem> secrets;

            try
            {
                secrets = kvService.GetSecrets(new Uri(vaultConfig.Url));
            }
            catch (Exception ex)
            {
                WriteError($"Failed to list secrets in vault '{Vault}'", ex);
                return;
            }

            foreach (var secret in secrets)
            {
                if (Verbose)
                {
                    Console.Out.WriteJson(secret);
                }
                else
                {
                    Console.Out.WriteLine(secret.Identifier.Name);
                }
            }
        }
Пример #20
0
        public override void Execute()
        {
            var vaultConfig = ConfigurationManager.GetVaultConfig(Vault);

            if (vaultConfig == null)
            {
                WriteError($"Unknown vault '{Vault}'");
                return;
            }

            var authConfig = ConfigurationManager.GetAuthConfig(vaultConfig);

            if (authConfig == null)
            {
                WriteError($"No authentication methods have been configured for vault '{Vault}'; see `kv auth`");
                return;
            }

            IKeyVaultService kvService = CreateVaultService(authConfig);

            SecretBundle newSecret;

            try
            {
                newSecret = kvService.SetSecret(vaultConfig.GetVaultUri(), Secret, Value);
            }
            catch (Exception ex)
            {
                WriteError($"Failed to set secret '{Secret}' in vault '{Vault}'", ex);
                return;
            }

            if (Verbose)
            {
                Console.Out.WriteJson(newSecret);
            }
            else
            {
                WriteInfo($"Secret '{Secret}' was set successfully");
            }
        }
Пример #21
0
 public BotService(IStorageService storageService, IKeyVaultService keyVaultService)
 {
     _storageService  = storageService;
     _keyVaultService = keyVaultService;
 }
Пример #22
0
 public KeyVaultSource(List <string> keyVaultKeys, IKeyVaultService keyVaultService)
 {
     this.keyVaultKeys    = keyVaultKeys ?? throw new ArgumentNullException(nameof(keyVaultKeys));
     this.keyVaultService = keyVaultService;
 }
 public SecretModel(IKeyVaultService service)
 {
     _service = service;
 }
Пример #24
0
 public JWTHelper(IKeyVaultService keyVault, IConfiguration config)
 {
     _kvService = keyVault;
     _config    = config;
 }
Пример #25
0
 public RotatorWorker(IKeyVaultService keyVaultService, IApplicationService applicationService)
 {
     _keyVaultService    = keyVaultService;
     _applicationService = applicationService;
 }
Пример #26
0
 public CheckHealth(IConfiguration config, IKeyVaultService keyVaultService, DataContext dbContext)
 {
     _config          = config;
     _keyVaultService = keyVaultService;
     _dbContext       = dbContext;
 }
Пример #27
0
 public APIController(ILogger <APIController> logger, IKeyVaultService keyVaultService)
 {
     this.logger          = logger;
     this.keyVaultService = keyVaultService;
 }
 public OpticalCharacterRecognitionService(IKeyVaultService keyVaultService)
 {
     _keyVaultService = keyVaultService;
 }
Пример #29
0
 public KeyVaultApi(IKeyVaultService keyVaultService)
 {
     _keyVaultService = keyVaultService;
 }
Пример #30
0
 public SignModel(IKeyVaultService service)
 {
     _service = service;
 }