Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* register instfs plugin * add instfs data to consul closes CNVS-38588 test plan: none Change-Id: Iaabcea702b001be75532b24ced3e8eeee574e424 Reviewed-on: https://gerrit.instructure.com/123199 Reviewed-by: Jacob Fugal <jacob@instructure.com> Tested-by: Jenkins Product-Review: Xander Moffatt <xmoffatt@instructure.com> QA-Review: Xander Moffatt <xmoffatt@instructure.com>
- Loading branch information
1 parent
9dd3ec1
commit 92a4f9e
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<% | ||
# Copyright (C) 2016 - present Instructure, Inc. | ||
# | ||
# This file is part of Canvas. | ||
# | ||
# Canvas is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU Affero General Public License as published by the Free | ||
# Software Foundation, version 3 of the License. | ||
# | ||
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY | ||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License along | ||
# with this program. If not, see <http://www.gnu.org/licenses/>. | ||
%> | ||
<%= fields_for :settings, OpenObject.new(settings) do |f| %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# Copyright (C) 2016 - present Instructure, Inc. | ||
# | ||
# This file is part of Canvas. | ||
# | ||
# Canvas is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU Affero General Public License as published by the Free | ||
# Software Foundation, version 3 of the License. | ||
# | ||
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY | ||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License along | ||
# with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
module InstFS | ||
class << self | ||
def enabled? | ||
Canvas::Plugin.find('inst_fs').enabled? | ||
end | ||
|
||
def app_host | ||
setting("app-host") | ||
end | ||
|
||
def jwt_secret | ||
setting("secret") | ||
end | ||
|
||
private | ||
def setting(key) | ||
settings = Canvas::DynamicSettings.from_cache("inst-fs", expires_in: 5.minutes, use_env: false) | ||
settings[key] | ||
rescue Imperium::TimeoutError => e | ||
Canvas::Errors.capture_exception(:inst_fs, e) | ||
nil | ||
end | ||
end | ||
end |