Class: Varanus

Inherits:
Object
  • Object
show all
Defined in:
lib/varanus.rb,
lib/varanus/version.rb

Overview

Interface for Sectigo’s (formerly Comodo CA) API.

Defined Under Namespace

Classes: DCV, Domain, Error, Organization, Reports, RestResource, SSL

Constant Summary collapse

VERSION =
'0.8.1'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(customer_uri, username, password) ⇒ Varanus

Returns a new instance of Varanus.

Parameters:

  • customer_uri (String)

    (see README)

  • username (String)
  • password (String)


11
12
13
14
15
# File 'lib/varanus.rb', line 11

def initialize customer_uri, username, password
  @customer_uri = customer_uri
  @username = username
  @password = password
end

Instance Attribute Details

#customer_uriObject (readonly)

Returns the value of attribute customer_uri.



5
6
7
# File 'lib/varanus.rb', line 5

def customer_uri
  @customer_uri
end

#passwordObject (readonly)

Returns the value of attribute password.



5
6
7
# File 'lib/varanus.rb', line 5

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



5
6
7
# File 'lib/varanus.rb', line 5

def username
  @username
end

Instance Method Details

#connectionObject

:nodoc:



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/varanus.rb', line 18

def connection
  @connection ||= Faraday.new(url: 'https://cert-manager.com/api',
                              request: { timeout: 300 }) do |conn|
    conn.request :json
    conn.response :json, content_type: /\bjson$/

    conn.headers['login'] = @username
    conn.headers['password'] = @password
    conn.headers['customerUri'] = @customer_uri

    conn.adapter Faraday.default_adapter
  end
end

#dcvVaranus::DCV

Retrive DCV instance

Returns:



34
35
36
# File 'lib/varanus.rb', line 34

def dcv
  @dcv ||= DCV.new(self)
end

#domainVaranus::Domain

Retrieve Domain instance

Returns:



40
41
42
# File 'lib/varanus.rb', line 40

def domain
  @domain ||= Domain.new(self)
end

#organizationVaranus::Organization

Retrieve Organization instance



46
47
48
# File 'lib/varanus.rb', line 46

def organization
  @organization ||= Organization.new(self)
end

#reportsObject

DEPRECATED



51
52
53
# File 'lib/varanus.rb', line 51

def reports
  @reports ||= Reports.new(self)
end

#sslVaranus::SSL

Retrive SSL instance

Returns:



57
58
59
# File 'lib/varanus.rb', line 57

def ssl
  @ssl ||= SSL.new(self)
end