Module: EY::GateKeeper::Client

Defined in:
lib/ey_gatekeeper/client.rb,
lib/ey_gatekeeper/client/consumer.rb,
lib/ey_gatekeeper/client/server_response.rb,
lib/ey_gatekeeper/client/middlewares/authentication.rb,
lib/ey_gatekeeper/client/middlewares/service_token_authentication.rb

Defined Under Namespace

Modules: Middleware Classes: Consumer, ServerResponse

Class Method Summary collapse

Class Method Details

.master_keyObject



7
8
9
# File 'lib/ey_gatekeeper/client.rb', line 7

def self.master_key
  '77zxcvbnm77'
end

.master_secretObject



11
12
13
# File 'lib/ey_gatekeeper/client.rb', line 11

def self.master_secret
  '77zxcvbnm77'
end

.master_userObject



15
16
17
# File 'lib/ey_gatekeeper/client.rb', line 15

def self.master_user
  'xcloud'
end

.mock(key = self.master_key, secret = self.master_secret, options = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/ey_gatekeeper/client.rb', line 23

def self.mock(key = self.master_key, secret = self.master_secret, options = {})
  mock_options = {
    :endpoint => 'http://gatekeeper.local/',
    :app      => mock_app(master_key, master_secret, master_user)
  }

  new(key, secret, mock_options.merge(options))
end

.mock_app(master_key = self.master_key, master_secret = self.master_secret, master_user = self.master_user) ⇒ Object



32
33
34
35
36
# File 'lib/ey_gatekeeper/client.rb', line 32

def self.mock_app(master_key = self.master_key, master_secret = self.master_secret, master_user = self.master_user)
  Rack::Builder.app do |builder|
    builder.run EY::GateKeeper::Server.app(:master_key => master_key, :master_secret => master_secret, :master_user => master_user)
  end
end

.new(*a) ⇒ Object



19
20
21
# File 'lib/ey_gatekeeper/client.rb', line 19

def self.new(*a)
  EY::GateKeeper::Client::Consumer.new(*a)
end