class CF::UAA::StubUAA

Attributes

auto_groups[R]
reply_badly[RW]
scim[R]

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method Stub::Server::new
# 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