[deploy] Feature:Add Video States Encoder Key to SiteConfig (#10818)
This commit is contained in:
parent
ea969748e9
commit
7ce3b8abd2
5 changed files with 20 additions and 0 deletions
|
|
@ -62,6 +62,7 @@ module Admin
|
|||
spam_trigger_terms
|
||||
recaptcha_site_key
|
||||
recaptcha_secret_key
|
||||
video_encoder_key
|
||||
]
|
||||
|
||||
allowed_params = allowed_params |
|
||||
|
|
|
|||
|
|
@ -295,6 +295,10 @@ module Constants
|
|||
twitter_secret: {
|
||||
description: "The \"API secret key\" portion of consumer keys in the Twitter developer portal.",
|
||||
placeholder: ""
|
||||
},
|
||||
video_encoder_key: {
|
||||
description: "Secret key used to allow AWS video encoding through the VideoStatesController",
|
||||
placeholder: ""
|
||||
}
|
||||
# Dynamic values ommitted: configurable_rate_limits and social_media_handles
|
||||
}.freeze
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class SiteConfig < RailsSettings::Base
|
|||
|
||||
# API Tokens
|
||||
field :health_check_token, type: :string
|
||||
field :video_encoder_key, type: :string
|
||||
|
||||
# Authentication
|
||||
field :allow_email_password_registration, type: :boolean, default: false
|
||||
|
|
|
|||
|
|
@ -104,6 +104,14 @@
|
|||
placeholder: Constants::SiteConfig::DETAILS[:health_check_token][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:health_check_token][:description] %></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= admin_config_label :video_encoder_key %>
|
||||
<%= f.text_field :video_encoder_key,
|
||||
class: "form-control",
|
||||
value: SiteConfig.video_encoder_key,
|
||||
placeholder: Constants::SiteConfig::DETAILS[:video_encoder_key][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:video_encoder_key][:description] %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,12 @@ RSpec.describe "/admin/config", type: :request do
|
|||
confirmation: confirmation_message }
|
||||
expect(SiteConfig.health_check_token).to eq token
|
||||
end
|
||||
|
||||
it "sets video_encoder_key" do
|
||||
post "/admin/config", params: { site_config: { video_encoder_key: "123abc" },
|
||||
confirmation: confirmation_message }
|
||||
expect(SiteConfig.video_encoder_key).to eq("123abc")
|
||||
end
|
||||
end
|
||||
|
||||
describe "Authentication" do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue