Class: SoarSc::IdrClient
- Inherits:
-
SoarIdm::IdmApi
- Object
- SoarIdm::IdmApi
- SoarSc::IdrClient
- Defined in:
- lib/idr_client.rb
Overview
SOAR Idr Client Simplifies communication with Hetzner identity registries.
Defined Under Namespace
Classes: CommunicationError, MissingRequiredAttributeError, UnsupportedResponseError
Instance Attribute Summary collapse
-
#attributes_uri ⇒ Nil
writeonly
Set remote uri used by get_attributes method.
-
#roles_uri ⇒ Nil
writeonly
Set remote uri used by get_roles method.
Instance Method Summary collapse
-
#get_attributes(subject_identifier, role = nil) ⇒ Hash
Get attributes optionally filtered by role.
-
#get_roles(subject_identifier) ⇒ Array
Get roles.
-
#initialize(http = Net::HTTP) ⇒ Object
constructor
Creates an instance of IdrClient.
Constructor Details
#initialize(http = Net::HTTP) ⇒ Object
Creates an instance of IdrClient
44 45 46 |
# File 'lib/idr_client.rb', line 44 def initialize(http=Net::HTTP) @http = http end |
Instance Attribute Details
#attributes_uri=(attributes_uri) ⇒ Nil (writeonly)
Set remote uri used by get_attributes method
38 39 40 |
# File 'lib/idr_client.rb', line 38 def attributes_uri=(value) @attributes_uri = value end |
#roles_uri=(roles_uri) ⇒ Nil (writeonly)
Set remote uri used by get_roles method
35 36 37 |
# File 'lib/idr_client.rb', line 35 def roles_uri=(value) @roles_uri = value end |
Instance Method Details
#get_attributes(subject_identifier, role = nil) ⇒ Hash
Get attributes optionally filtered by role
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/idr_client.rb', line 75 def get_attributes(subject_identifier, role = nil) begin super(subject_identifier, role) rescue MissingRequiredAttributeError => error raise error rescue JSON::ParserError => error raise UnsupportedResponseError, error. rescue StandardError => error raise CommunicationError, error. end end |
#get_roles(subject_identifier) ⇒ Array
Get roles
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/idr_client.rb', line 55 def get_roles(subject_identifier) begin super(subject_identifier) rescue MissingRequiredAttributeError => error raise error rescue JSON::ParserError => error raise UnsupportedResponseError, error. rescue StandardError => error raise CommunicationError, error. end end |