Class: StandardId::Api::WellKnown::JwksController

Inherits:
ActionController::API
  • Object
show all
Includes:
ControllerPolicy
Defined in:
app/controllers/standard_id/api/well_known/jwks_controller.rb

Overview

Inherits from ActionController::API (not Api::BaseController) to avoid content-type validation and no-store cache headers — JWKS is a public, cacheable endpoint. Includes ControllerPolicy directly as a result.

Instance Method Summary collapse

Methods included from ControllerPolicy

all_controllers, authenticated_controllers, public_controllers, register, registry_snapshot, reset_registry!

Instance Method Details

#showObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/standard_id/api/well_known/jwks_controller.rb', line 13

def show
  jwks = StandardId::JwtService.jwks

  if jwks.nil?
    render json: { error: "JWKS not available" }, status: :not_found
    return
  end

  response.headers["Cache-Control"] = "public, max-age=3600"
  render json: jwks
end