Skip to content

Commit

Permalink
Add the /api/product_info route with product and branding info
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jul 30, 2018
1 parent 1633476 commit e4dc9f6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions app/controllers/api/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ def index
render_resource :entrypoint, res
end

def product_info
res = {
:product_info => product_info,
:branding_info => branding_info
}

render_resource :product_info, res
end

private

def entrypoint_versions
Expand All @@ -46,6 +55,14 @@ def auth_identity
}
end

def branding_info
{
:custom_brand => Settings.server.custom_brand,
:custom_logo => Settings.server.custom_logo,
:custom_login_logo => Settings.server.custom_login_logo
}
end

def entrypoint_collections
collection_config.collections_with_description.sort.collect do |collection_name, description|
{
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BaseController < ActionController::API
include ActionController::HttpAuthentication::Basic::ControllerMethods

before_action :log_request_initiated
before_action :require_api_user_or_token, :except => [:options]
before_action :require_api_user_or_token, :except => [:options, :product_info]
before_action :set_gettext_locale, :set_access_control_headers, :parse_api_request, :log_api_request,
:validate_api_request
before_action :validate_api_action, :except => [:options]
Expand Down

0 comments on commit e4dc9f6

Please sign in to comment.