Module: ForemanRhCloud::CertAuth

Instance Method Summary collapse

Methods included from InsightsCloud::CandlepinCache

#candlepin_id_cert, #cp_owner_id, #upstream_owner

Instance Method Details

#cert_auth_available?(organization) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/services/foreman_rh_cloud/cert_auth.rb', line 8

def cert_auth_available?(organization)
  !!candlepin_id_cert(organization)
end

#execute_cloud_request(params) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'app/services/foreman_rh_cloud/cert_auth.rb', line 12

def execute_cloud_request(params)
  certs = candlepin_id_cert(params.delete(:organization))
  final_params = {
    ssl_client_cert: OpenSSL::X509::Certificate.new(certs[:cert]),
    ssl_client_key: OpenSSL::PKey.read(certs[:key]),
  }.deep_merge(params)

  super(final_params)
end