Class: Keypairs::PublicKeysController

Inherits:
ActionController::API
  • Object
show all
Defined in:
lib/keypairs/public_keys_controller.rb

Overview

Endpoint to fetch the current valid keypairs.

Examples:

{
  "keys": [
    {
      "kty": "RSA",
      "n": "wmi......1Gw",
      "e": "AQAB",
      "kid": "d8d1d4265d6c34acadce8a42fbbec167db1beaeb6ebbbf7fd555f6eb00bda76e",
      "alg": "RS256",
      "use": "sig"
    }
  ]
}

Instance Method Summary collapse

Instance Method Details

#indexObject



20
21
22
23
24
# File 'lib/keypairs/public_keys_controller.rb', line 20

def index
  # Always cache for 1 week, our rotation interval is much more than a week
  expires_in 1.week, public: true
  render json: Keypair.cached_keyset
end