Esempio n. 1
0
        public Startup(IConfiguration config)
        {
            // For unit tests.
            if (config == null)
            {
                return;
            }

            _config          = config;
            _rTokenConfig    = new JwtConfig(config.GetSection("jwtRefreshToken"));
            _sTokenConfig    = new JwtConfig(config.GetSection("jwtShortToken"));
            _rTokenKeyConfig = new SymmetricKeyConfig(config.GetSection("jwtRefreshTokenSigningKey"));
            _sTokenKeyConfig = new SymmetricKeyConfig(config.GetSection("jwtShortTokenSigningKey"));
            _redisConfigs    = new RedisConfigs(config.GetSection("redis"));
            _rabbitmqConfigs = new RabbitMqConfigs(config.GetSection("rabbitMq"));
            _rabbitmqRevokedTokenExchangeConfigs = new RabbitMqExchangeConfigs(config.GetSection("rabbitMq").GetSection("revokedTokenExchange"));

            _mongoDbLogConfigs        = new MongoDbConfigs(config.GetSection("mongoLogDb"));
            _infoLogCollectionConfig  = new MongoCollectionConfig(config.GetSection("mongoLogDb").GetSection("infoLogCollection"));
            _errorLogCollectionConfig = new MongoCollectionConfig(config.GetSection("mongoLogDb").GetSection("errorLogCollection"));

            _mongoDbConfigs = new MongoDbConfigs(config.GetSection("mongoDb"));
            _accountRTokensCollectionConfig = new MongoCollectionConfig(config.GetSection("mongoDb").GetSection("accountRTokenCollection"));
        }
 public SymmetricKeyProvider(SymmetricKeyConfig symmetricKeyConfig)
 {
     _symmetricKeyConfig = symmetricKeyConfig ?? throw new ArgumentNullException("symmetricKeyConfig");
 }