Class: CF::UAA::StubUAA

Inherits:
Stub::Server show all
Defined in:
lib/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.



539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
# File 'lib/stub/uaa.rb', line 539

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.



537
538
539
# File 'lib/stub/uaa.rb', line 537

def auto_groups
  @auto_groups
end

#reply_badlyObject

Returns the value of attribute reply_badly.



536
537
538
# File 'lib/stub/uaa.rb', line 536

def reply_badly
  @reply_badly
end

#scimObject (readonly)

Returns the value of attribute scim.



537
538
539
# File 'lib/stub/uaa.rb', line 537

def scim
  @scim
end