Class: RosettAi::DBus::ManagerInterface
- Inherits:
-
DBus::Object
- Object
- DBus::Object
- RosettAi::DBus::ManagerInterface
- Defined in:
- lib/rosett_ai/dbus/manager_interface.rb
Overview
D-Bus interface for Rosett-AI management operations.
Interface: be.neatnerds.rosettai.Manager Methods: Compile(engine: s) -> s Run compilation for specified engine SwitchContext(name: s) Switch to named context GetStatus() -> asv Return service status dictionary Properties: Version: s (read) Service version string Signals: ContextChanged(name: s) Emitted after context switch
Security:
- Rate limiting (10 req/s, burst 20) prevents DoS via rapid method calls
- Compile operations have stricter limits (2 req/s, burst 5)
Constant Summary collapse
- INTERFACE =
'be.neatnerds.rosettai.Manager'- RATE_LIMITS =
Rate limit configurations per operation type
{ default: { rate: 10, burst: 20 }, compile: { rate: 2, burst: 5 }, # Compile is expensive config: { rate: 5, burst: 10 } # Config changes need moderation }.freeze
- SETCONFIG_ALLOWED_KEYS =
Keys allowed via D-Bus SetConfig — prevents arbitrary config mutation
[ 'default_engine', 'cache.enabled', 'cache.ttl_hours', 'detect.on_init' ].freeze
Instance Attribute Summary collapse
-
#service ⇒ Object
writeonly
Sets the attribute service.
Instance Method Summary collapse
-
#initialize(path) ⇒ ManagerInterface
constructor
A new instance of ManagerInterface.
-
#version ⇒ String
Version property.
Constructor Details
#initialize(path) ⇒ ManagerInterface
Returns a new instance of ManagerInterface.
75 76 77 78 79 80 |
# File 'lib/rosett_ai/dbus/manager_interface.rb', line 75 def initialize(path) super @current_context = 'default' @service = nil @rate_limiters = build_rate_limiters end |
Instance Attribute Details
#service=(value) ⇒ Object (writeonly)
Sets the attribute service
73 74 75 |
# File 'lib/rosett_ai/dbus/manager_interface.rb', line 73 def service=(value) @service = value end |