Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the demux signal transmission header names configurable #23

Open
rreinhardt9 opened this issue Sep 22, 2020 · 0 comments
Open

Make the demux signal transmission header names configurable #23

rreinhardt9 opened this issue Sep 22, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rreinhardt9
Copy link
Contributor

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

@rreinhardt9 rreinhardt9 added enhancement New feature or request good first issue Good for newcomers labels Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant