1.17.8 (latest) 1.17.7 1.16.2 1.15.1 1.14.0 1.13.1 1.12.2 Reference documentation and code samples for the googleauth class Google::Auth::IDTokens::HttpKeySource.

A base key source that downloads keys from a URI. Subclasses should
override [#interpret_json](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-IDTokens-HttpKeySource.md.txt#Google__Auth__IDTokens__HttpKeySource_interpret_json_instance_ "Google::Auth::IDTokens::HttpKeySource#interpret_json (method)") to parse the response.

## Inherits

- Object

## Methods

### #current_keys

```ruby
def current_keys() -> Array<KeyInfo>
```
Return the current keys, without attempting to re-download.
**Returns**

- (Array\<[KeyInfo](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-IDTokens-KeyInfo.md.txt)\>)

### #initialize

```ruby
def initialize(uri, retry_interval: nil) -> HttpKeySource
```
Create an HTTP key source.
**Parameters**

- **uri** (String, URI) --- The URI from which to download keys.
- **retry_interval** (Integer, nil) *(defaults to: nil)* --- Override the retry interval in seconds. This is the minimum time between retries of failed key downloads.
**Returns**

- ([HttpKeySource](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-IDTokens-HttpKeySource.md.txt)) --- a new instance of HttpKeySource

### #refresh_keys

```ruby
def refresh_keys() -> Array<KeyInfo>
```
Attempt to re-download keys (if the retry interval has expired) and
return the new keys.
**Returns**

- (Array\<[KeyInfo](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-IDTokens-KeyInfo.md.txt)\>)
**Raises**

- ([Google::Auth::IDTokens::KeySourceError](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-IDTokens-KeySourceError.md.txt)) --- If key retrieval fails, JSON parsing fails, or the data cannot be interpreted as keys

### #uri

```ruby
def uri() -> Array<KeyInfo>
```
The URI from which to download keys.
**Returns**

- (Array\<[KeyInfo](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-IDTokens-KeyInfo.md.txt)\>)

## Constants

### DEFAULT_RETRY_INTERVAL

**value:** 3600  
The default interval between retries in seconds (3600s = 1hr).