public SecretManagerConfigurationSource(SecretManagerConfigurationOptions options, ServiceClientHelper clientHelper = null)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _options      = options;
            _clientHelper = clientHelper ?? new ServiceClientHelper();
        }
コード例 #2
0
        public static IConfigurationBuilder AddGcpSecretManager(this IConfigurationBuilder configuration, Action <SecretManagerConfigurationOptions> options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            var configurationOptions = new SecretManagerConfigurationOptions();

            options(configurationOptions);

            if (string.IsNullOrEmpty(configurationOptions.ProjectId))
            {
                throw new ArgumentNullException(nameof(configurationOptions.ProjectId));
            }

            configuration.Add(new SecretManagerConfigurationSource(configurationOptions));

            return(configuration);
        }