Description
Problem
Currently, each signal transmission that an app receives contains (among others) the following headers:
"user-agent"=>"Demux"
"x-demux-signal"=>"a_signal_name"
"x-demux-signature" => "arstarst34pqw4qwfg"
Since this library is used to add functionality to a core app that is then presented to those building integrations outside of the core app, it could be confusing to see the name "demux".
It would be really cool in this case to be able to customize these for specific applications, and make the current hard coded names the defaults. If we did this, we could customize the names in the case of the Lessonly app to be something like:
"user-agent"=>"LessonlyApps"
"x-lessonly-signal"=>"a_signal_name"
"x-lessonly-signature" => "arstarst34pqw4qwfg"
Configuration
We could add to our configuration object so that these custom names could be set in an initializer. For example, in order to get the headers in the last example we could set the following in our initializer:
Demux.configure do |config|
config.user_agent = "LessonlyApps"
config.header_prefix = "x-lessonly"
end
These options could be added to our configuration object here
The defaults could be set in that configuration object to the current hard-coded values. Defaults could be set using fetch
similar to how default_demuxer
does this.
Application
We could then modify the code in Transmission
to use the values from the configuration instead of hard coded values here