Rename the update auth switch to application_token_source and drop its ENV default
This commit is contained in:
@@ -13,9 +13,8 @@ Rails.application.config.to_prepare do
|
||||
# :env — a fenti shared secret érvényes (default)
|
||||
# :database — csak DB-tárolt WarpEngine::ApplicationToken érvényes
|
||||
# ("update" scope-pal); a shared secret ilyenkor NEM működik.
|
||||
# Default: ENV["UPDATE_SECRET_SOURCE"] (beállítatlanul :env).
|
||||
# A :database módhoz kötelező a tokenek tulajdonos-osztálya is:
|
||||
# c.update_secret_source = :database
|
||||
# c.application_token_source = :database
|
||||
# c.application_token_owner_class = "AdminUser"
|
||||
|
||||
# Ha a host modelljei is hivatkoznak katalógus-képekre, regisztráld őket,
|
||||
|
||||
@@ -4,7 +4,7 @@ module WarpEngine
|
||||
# label: String
|
||||
# image_ids: -> { Array<Integer> } — az owner által használt image id-k
|
||||
# usage_label: ->(image) { String vagy nil } — megjelenítendő címke, ha használja
|
||||
# update_secret_source: a /update endpoint hitelesítési forrása, kizárólagos.
|
||||
# application_token_source: a /update endpoint hitelesítési forrása, kizárólagos.
|
||||
# :env — a shared secret (update_secret) érvényes, a DB-tokenek nem
|
||||
# :database — csak WarpEngine::ApplicationToken érvényes, a shared secret nem
|
||||
# application_token_owner_class: a tokenek kötelező tulajdonosának osztályneve
|
||||
@@ -12,7 +12,7 @@ module WarpEngine
|
||||
attr_accessor :file_container_path,
|
||||
:image_container_path,
|
||||
:update_secret,
|
||||
:update_secret_source,
|
||||
:application_token_source,
|
||||
:application_token_owner_class,
|
||||
:image_owners
|
||||
|
||||
@@ -20,7 +20,7 @@ module WarpEngine
|
||||
@file_container_path = ENV.fetch("FILE_CONTAINER_PATH", "/softwares")
|
||||
@image_container_path = ENV.fetch("IMAGE_CONTAINER_PATH", "/images")
|
||||
@update_secret = ENV["UPDATE_SECRET"]
|
||||
@update_secret_source = ENV.fetch("UPDATE_SECRET_SOURCE", "env").to_sym
|
||||
@application_token_source = :env
|
||||
@application_token_owner_class = nil
|
||||
@image_owners = []
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user