Class: Soar::Authentication::Identity::Test::OrchestrationProvider::Staff
- Inherits:
-
Object
- Object
- Soar::Authentication::Identity::Test::OrchestrationProvider::Staff
- Defined in:
- lib/soar/authentication/identity/test/orchestration_provider/staff.rb
Instance Method Summary collapse
- #given_authenticated_identifier ⇒ Nil
- #given_existing_identity ⇒ Nil
-
#initialize ⇒ Staff
constructor
A new instance of Staff.
- #request_uuid ⇒ Nil
- #role? ⇒ Boolean
- #uuid? ⇒ Boolean
Constructor Details
#initialize ⇒ Staff
Returns a new instance of Staff.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 11 def initialize @directory_configurations = { staff: YAML.load_file("config/#{ENV['CONFIG_FILE']}"), customer: {}, domain: {} } @entry = { dn: "cn=John Smith,#{@directory_configurations[:staff]["config"]["base"]}", attributes: { cn: "John Smith", mail: "[email protected]", objectclass: ["inetOrgPerson", "top"], sn: "Smith" } } @identity = Soar::Authentication::Identity::Factory.create({ authenticated_identifier: @entry[:attributes][:mail], directory_configurations: @directory_configurations }) end |
Instance Method Details
#given_authenticated_identifier ⇒ Nil
46 47 48 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 46 def given_authenticated_identifier @entry[:attributes][:mail] end |
#given_existing_identity ⇒ Nil
38 39 40 41 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 38 def given_existing_identity @identity.directory.provider.delete(@entry[:dn]) @identity.directory.put(@entry) end |
#request_uuid ⇒ Nil
53 54 55 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 53 def request_uuid @identity.uuid end |
#role? ⇒ Boolean
68 69 70 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 68 def role? @identity.role == 'staff' end |
#uuid? ⇒ Boolean
60 61 62 63 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 60 def uuid? entry = @identity.directory.search("mail", @entry[:attributes][:mail]) entry[0][@identity.directory.index[0]] == @identity.uuid end |