Class: CF::UAA::StubUAA

Inherits:
Stub::Server show all
Defined in:
lib/uaa/stub/uaa.rb

Instance Attribute Summary collapse

Attributes inherited from Stub::Server

#host, #info, #logger, #port, #root, #status

Instance Method Summary collapse

Methods inherited from Stub::Server

#delete_connection, #run, #run_on_thread, #start, #stop, #trace, #url

Constructor Details

#initialize(options = {}) ⇒ StubUAA

Returns a new instance of StubUAA.



581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
# File 'lib/uaa/stub/uaa.rb', line 581

def initialize(options = {})
  client = options[:boot_client] || 'admin'
  secret = options[:boot_secret] || 'adminsecret'
  @scim = StubScim.new
  @auto_groups = ['password.write', 'openid']
      .each_with_object([]) { |g, o| o << @scim.add(:group, 'displayname' => g) }
  ['scim.read', 'scim.write', 'scim.me', 'uaa.resource']
      .each { |g| @scim.add(:group, 'displayname' => g) }
  gids = ['clients.write', 'clients.read', 'clients.secret', 'uaa.admin']
      .each_with_object([]) { |s, o| o << @scim.add(:group, 'displayname' => s) }
  @scim.add(:client, 'client_id' => client, 'client_secret' => secret,
      'authorized_grant_types' => ['client_credentials'], 'authorities' => gids,
      'access_token_validity' => 60 * 60 * 24 * 7)
  @scim.add(:client, 'client_id' => 'cf', 'authorized_grant_types' => ['implicit'],
      'scope' => [@scim.id('openid', :group), @scim.id('password.write', :group)],
      'access_token_validity' => 5 * 60 )
  info = { commit_id: 'not implemented',
      app: {name: 'Stub UAA', version: CLI_VERSION,
          description: 'User Account and Authentication Service, test server'},
      prompts: {username: ['text', 'Username'], password: ['password', 'Password']} }
  super(StubUAAConn, options.merge(info: info, logger: options[:logger] || Util.default_logger))
end

Instance Attribute Details

#auto_groupsObject (readonly)

Returns the value of attribute auto_groups.



579
580
581
# File 'lib/uaa/stub/uaa.rb', line 579

def auto_groups
  @auto_groups
end

#reply_badlyObject

Returns the value of attribute reply_badly.



578
579
580
# File 'lib/uaa/stub/uaa.rb', line 578

def reply_badly
  @reply_badly
end

#scimObject (readonly)

Returns the value of attribute scim.



579
580
581
# File 'lib/uaa/stub/uaa.rb', line 579

def scim
  @scim
end