<commit_before>module Certcenter

  class Api
    
    def initialize(common_name, organization, country, state_name, locality, domain_list, oauth_token, product_code)
      @common_name  = common_name
      @csr          = csr
      @product_code = product_code
      @oauth_token  = oauth_token
      @key, @csr    = Certcenter::Pki.generate_csr(common_name, organization, country, state_name, locality, domain_list)
      @crt          = nil
      @intermediate = nil
    end
    
    def csr
      @csr
    end
    
    def key
      @csr
    end
    
    def valid?
      h = { "CommonName" => @common_name }
      r = Certcenter.server(@oauth_token).post("ValidateName", h)
      r["IsQualified"] == true
    rescue ResponseException => e
      return e
    end
    
    def dns_data
      h = { "ProductCode" => @product_code, "CSR" => @csr }
      r = Certcenter.server(@oauth_token).post("DNSData", h)
      [ r["DNSAuthDetails"]["DNSEntry"], r["DNSAuthDetails"]["DNSValue"] ]
    rescue ResponseException => e
      return e
    end
    
    def order
      h = { "OrderParameters" => { "ProductCode" => @product_code, "CSR" => @csr, "ValidityPeriod" => 365 } }
      r = Certcenter.server(@oauth_token).post("Order", h)
      puts r.inspect
      @intermediate = r["OrderParameters"]["Fulfillment"]["Intermediate"]
      @crt = r["OrderParameters"]["Fulfillment"]["Certificate"]
      true
    rescue ResponseException => e
      return e
    end
    
    def intermediate
      @intermediate
    end
    
    def crt
      @crt
    end
    
  end
  
end
<commit_msg>no SAN support for AlwaysOnSSL certs<commit_after>module Certcenter

  class Api
    
    def initialize(common_name, organization, country, state_name, locality, domain_list, oauth_token, product_code)
      domain_list   = nil if product_code.include?("AlwaysOnSSL") # no support for san for the moment
      @common_name  = common_name
      @csr          = csr
      @product_code = product_code
      @oauth_token  = oauth_token
      @key, @csr    = Certcenter::Pki.generate_csr(common_name, organization, country, state_name, locality, domain_list)
      @crt          = nil
      @intermediate = nil
    end
    
    def csr
      @csr
    end
    
    def key
      @csr
    end
    
    def valid?
      h = { "CommonName" => @common_name }
      r = Certcenter.server(@oauth_token).post("ValidateName", h)
      r["IsQualified"] == true
    rescue ResponseException => e
      return e
    end
    
    def dns_data
      h = { "ProductCode" => @product_code, "CSR" => @csr }
      r = Certcenter.server(@oauth_token).post("DNSData", h)
      [ r["DNSAuthDetails"]["DNSEntry"], r["DNSAuthDetails"]["DNSValue"] ]
    rescue ResponseException => e
      return e
    end
    
    def order
      h = { "OrderParameters" => { "ProductCode" => @product_code, "CSR" => @csr, "ValidityPeriod" => 365 } }
      r = Certcenter.server(@oauth_token).post("Order", h)
      puts r.inspect
      @intermediate = r["OrderParameters"]["Fulfillment"]["Intermediate"]
      @crt = r["OrderParameters"]["Fulfillment"]["Certificate"]
      true
    rescue ResponseException => e
      return e
    end
    
    def intermediate
      @intermediate
    end
    
    def crt
      @crt
    end
    
  end
  
end

{'fraction_non_alphanumeric': 0.11398963730569948, 'fraction_numerical': 0.001828710758914965, 'mean_word_length': 2.433054393305439, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5177882', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1084, 'n_words': 240}