Module: ApiKeys::Controller

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
lib/api_keys/controller.rb

Overview

Unified controller concern that bundles common ApiKeys functionality for easy inclusion in controllers.

Includes:

- ApiKeys::Authentication (provides authenticate_api_key!, current_api_key, etc.)
- ApiKeys::TenantResolution (provides current_api_tenant)

Usage

class Api::BaseController < ActionController::API
  include ApiKeys::Controller

  before_action :authenticate_api_key!

  def show
    # Access helpers provided by the included concerns
    key = current_api_key
    owner = current_api_owner
    tenant = current_api_tenant
    # ...
  end
end