Skip to content

Commit

Permalink
Merge pull request #20 from manu-d/master
Browse files Browse the repository at this point in the history
Find tenant from app_id and app_key
  • Loading branch information
BrunoChauvet authored Nov 7, 2017
2 parents 82d44de + b94788b commit 29643b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/maestrano.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def self.auto_configure(config_file_path = nil)
raise "Error while fetching dynamic configuration: #{e}. Backtrace: #{e.backtrace}"
end

def self.find_by_app_id_and_app_key(app_id, app_key)
Maestrano.configs.find { |_,v| v.param('api.id') == app_id && v.param('api.key') == app_key }.first rescue nil
end

class Configuration
attr_accessor :environment, :app, :sso, :api, :webhook, :connec

Expand Down
2 changes: 1 addition & 1 deletion maestrano.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ Gem::Specification.new do |s|
s.add_development_dependency('rake', '~> 10')

s.add_runtime_dependency("uuid", ["~> 2.3"])
s.add_runtime_dependency("nokogiri", [">= 1.7.2"])
s.add_runtime_dependency("nokogiri", [">= 1.8.1"])
end

0 comments on commit 29643b3

Please sign in to comment.