Class: Resque::Mcp::Configuration
- Inherits:
-
Object
- Object
- Resque::Mcp::Configuration
- Defined in:
- lib/resque/mcp/configuration.rb
Instance Attribute Summary collapse
- #allowed_hosts ⇒ Object
- #allowed_origins ⇒ Object
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#default_allowed_hosts ⇒ Object
Internal seam: a callable returning the host's config.hosts, read lazily (the engine wires it) so post-boot changes are never missed.
-
#default_filter_parameters ⇒ Object
Internal seam: a callable returning the host's filter list, read lazily so late additions to Rails' list (or other engines' after_initialize hooks) are never missed.
-
#filter_parameters ⇒ Object
nil = inherit the host default (the engine wires Rails' filter_parameters as a lazy source); an explicit list replaces it ([] disables filtering).
- #mcp_transport_options ⇒ Object
Instance Method Summary collapse
-
#param_filter ⇒ Object
Memoized against the effective list, so both reassignment and in-place mutation (config.filter_parameters << :iban) take effect.
Instance Attribute Details
#allowed_hosts ⇒ Object
24 25 26 27 |
# File 'lib/resque/mcp/configuration.rb', line 24 def allowed_hosts list = (defined?(@allowed_hosts) && @allowed_hosts) ? @allowed_hosts : default_allowed_hosts&.call Array(list).select { |h| h.is_a?(String) && !h.start_with?(".") } end |
#allowed_origins ⇒ Object
29 30 31 |
# File 'lib/resque/mcp/configuration.rb', line 29 def allowed_origins @allowed_origins || [] end |
#auth_token ⇒ Object
Returns the value of attribute auth_token.
6 7 8 |
# File 'lib/resque/mcp/configuration.rb', line 6 def auth_token @auth_token end |
#default_allowed_hosts ⇒ Object
Internal seam: a callable returning the host's config.hosts, read lazily (the engine wires it) so post-boot changes are never missed.
22 23 24 |
# File 'lib/resque/mcp/configuration.rb', line 22 def default_allowed_hosts @default_allowed_hosts end |
#default_filter_parameters ⇒ Object
Internal seam: a callable returning the host's filter list, read lazily so late additions to Rails' list (or other engines' after_initialize hooks) are never missed.
51 52 53 |
# File 'lib/resque/mcp/configuration.rb', line 51 def default_filter_parameters @default_filter_parameters end |
#filter_parameters ⇒ Object
nil = inherit the host default (the engine wires Rails' filter_parameters as a lazy source); an explicit list replaces it ([] disables filtering).
47 48 49 |
# File 'lib/resque/mcp/configuration.rb', line 47 def filter_parameters @filter_parameters end |
#mcp_transport_options ⇒ Object
40 41 42 |
# File 'lib/resque/mcp/configuration.rb', line 40 def @mcp_transport_options || {} end |
Instance Method Details
#param_filter ⇒ Object
Memoized against the effective list, so both reassignment and in-place mutation (config.filter_parameters << :iban) take effect.
55 56 57 58 59 60 61 62 |
# File 'lib/resque/mcp/configuration.rb', line 55 def param_filter list = filter_parameters || default_filter_parameters&.call || [] unless defined?(@param_filter) && @param_filter_list == list @param_filter_list = list.dup @param_filter = ActiveSupport::ParameterFilter.new(list) end @param_filter end |