Skip to content

Make the demux signal transmission header names configurable #23

Open
@rreinhardt9

Description

@rreinhardt9

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions