Class: CF::UAA::StubUAA
- Inherits:
-
Stub::Server
- Object
- Stub::Server
- CF::UAA::StubUAA
- Defined in:
- lib/stub/uaa.rb
Instance Attribute Summary collapse
-
#auto_groups ⇒ Object
readonly
Returns the value of attribute auto_groups.
-
#reply_badly ⇒ Object
Returns the value of attribute reply_badly.
-
#scim ⇒ Object
readonly
Returns the value of attribute scim.
Attributes inherited from Stub::Server
#host, #info, #logger, #port, #root, #status
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ StubUAA
constructor
A new instance of StubUAA.
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.
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 |
# File 'lib/stub/uaa.rb', line 483 def initialize( = {}) client = [:boot_client] || "admin" secret = [: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' => "vmc", '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, .merge(info: info, logger: [:logger] || Util.default_logger)) end |
Instance Attribute Details
#auto_groups ⇒ Object (readonly)
Returns the value of attribute auto_groups.
481 482 483 |
# File 'lib/stub/uaa.rb', line 481 def auto_groups @auto_groups end |
#reply_badly ⇒ Object
Returns the value of attribute reply_badly.
480 481 482 |
# File 'lib/stub/uaa.rb', line 480 def reply_badly @reply_badly end |
#scim ⇒ Object (readonly)
Returns the value of attribute scim.
481 482 483 |
# File 'lib/stub/uaa.rb', line 481 def scim @scim end |