class WarpEngine::Configuration::AdminApiDSL
The admin_api do ... end block of WarpEngine::Configuration::DSL; every method writes one WarpEngine::AdminApi::Configuration setting.
Public Class Methods
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 7 def initialize(settings) @settings = settings end
Creates a DSL writing into the WarpEngine::AdminApi::Configuration settings.
Public Instance Methods
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 42 def authenticator(value) = @settings.authenticator = value
Sets the authenticator: :application_token, or a callable taking the request and returning a WarpEngine::AdminApi::Principal or nil.
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 21 def docs_ui(value = true) = @settings.docs_ui = value
Serves the Redoc documentation page when true.
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 12 def enable(value = true) = @settings.enabled = value
Turns the admin API on (or off with false).
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 35 def exclude_from_mcp(*names) = @settings.mcp_exclude = names.flatten.map(&:to_sym)
Names the resources the MCP endpoint leaves out.
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 48 def max_page_size(value) = @settings.max_page_size = value
Sets the largest list page size a caller may ask for.
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 15 def mcp(value = true) = @settings.mcp = value
Turns the MCP endpoint on (or off with false).
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 45 def page_size(value) = @settings.page_size = value
Sets the default list page size.
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 24 def public_openapi(value = true) = @settings.openapi_requires_auth = !value
Serves the OpenAPI document without authentication when true.
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 27 def rate_limit(to, per:) = @settings.rate_limit = { to: to, within: per }
Limits each caller to to requests within per seconds.
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 18 def read_only(value = true) = @settings.read_only = value
Refuses every write with 405 when true.
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 30 def resources(*names) @settings.resources = names == [ :all ] ? :all : names.flatten.map(&:to_sym) end
Names the resources the admin API exposes, or :all.
Source
# File lib/warp_engine/configuration/admin_api_dsl.rb, line 38 def token_owner(class_name) = @settings.token_owner_class = class_name.to_s
Sets the class name of the owner admin tokens belong to.