Module: VIISP::Auth

Defined in:
lib/viisp/auth.rb,
lib/viisp/auth/client.rb,
lib/viisp/auth/errors.rb,
lib/viisp/auth/signing.rb,
lib/viisp/auth/version.rb,
lib/viisp/auth/identity.rb,
lib/viisp/auth/configuration.rb,
lib/viisp/auth/requests/soap.rb,
lib/viisp/auth/requests/ticket.rb,
lib/viisp/auth/requests/identity.rb,
lib/viisp/auth/requests/signature.rb

Defined Under Namespace

Modules: Requests, Signing Classes: Client, Configuration, ConfigurationError, Error, Identity, RequestError, SignatureError

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.clientObject



25
26
27
# File 'lib/viisp/auth.rb', line 25

def client
  @client ||= Client.new
end

.configurationObject



21
22
23
# File 'lib/viisp/auth.rb', line 21

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



17
18
19
# File 'lib/viisp/auth.rb', line 17

def configure
  yield(configuration)
end

.identity(options = {}) ⇒ Object



41
42
43
44
45
46
47
48
# File 'lib/viisp/auth.rb', line 41

def identity(options = {})
  request = Requests::Identity.new(**options).build

  doc = client.post(request)
  doc.remove_namespaces!

  Identity.new(doc).to_hash
end

.portal_endpointObject



29
30
31
# File 'lib/viisp/auth.rb', line 29

def portal_endpoint
  configuration.portal_endpoint
end

.ticket(options = {}) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/viisp/auth.rb', line 33

def ticket(options = {})
  request = Requests::Ticket.new(**options).build

  doc = client.post(request)
  doc.remove_namespaces!
  doc.at('ticket')&.text
end