public TestController(
     IARMCertCache aRMCertCache,
     IOptions <ARMAuthOptions> armAuth
     )
 {
     _armAuth      = armAuth.Value ?? throw new ArgumentNullException();
     _armCertCache = aRMCertCache ?? throw new ArgumentNullException(nameof(aRMCertCache));
 }
Exemple #2
0
        public ARMCertCache(
            HttpClient httpClient,
            IOptions <ARMAuthOptions> armAuthOptions,
            ILogger <ARMCertCache> logger)
        {
            _logger         = logger ?? throw new ArgumentNullException(nameof(logger));
            _httpClient     = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
            _armAuthOptions = armAuthOptions.Value ?? throw new ArgumentNullException(nameof(armAuthOptions));

            // Set default value according to the spec, 1 hour is recommended: https://armwiki.azurewebsites.net/authorization/AuthenticateBetweenARMandRP.html
            _timer = new Timer(TimerCallback, state: null, dueTime: 0, period: (int)TimeSpan.FromHours(1).TotalMilliseconds);
        }