{"id":21878279,"url":"https://github.com/pepabo/global_sign","last_synced_at":"2025-04-15T03:04:04.801Z","repository":{"id":12629282,"uuid":"69424082","full_name":"pepabo/global_sign","owner":"pepabo","description":"A Ruby interface to the GlobalSign API.","archived":false,"fork":false,"pushed_at":"2024-05-21T04:21:36.000Z","size":149,"stargazers_count":23,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T14:43:16.059Z","etag":null,"topics":["client","gem","globalsign","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pepabo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-28T04:02:41.000Z","updated_at":"2025-01-16T13:32:51.000Z","dependencies_parsed_at":"2024-11-28T10:17:23.857Z","dependency_job_id":null,"html_url":"https://github.com/pepabo/global_sign","commit_stats":{"total_commits":158,"total_committers":9,"mean_commits":"17.555555555555557","dds":0.4620253164556962,"last_synced_commit":"1664bf4a8682e0195aeb325cd4c12f58573d46d1"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fglobal_sign","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fglobal_sign/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fglobal_sign/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fglobal_sign/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepabo","download_url":"https://codeload.github.com/pepabo/global_sign/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248680071,"owners_count":21144604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","gem","globalsign","ruby"],"created_at":"2024-11-28T08:12:09.565Z","updated_at":"2025-04-15T03:04:04.773Z","avatar_url":"https://github.com/pepabo.png","language":"Ruby","readme":"# GlobalSign\n\n[![Gem Version](https://badge.fury.io/rb/global_sign.svg)](https://badge.fury.io/rb/global_sign)\n![CI](https://github.com/pepabo/global_sign/workflows/CI/badge.svg?branch=master)\n\nA Ruby interface to the [GlobalSign](https://www.globalsign.com/) API.\n\nFor more information and detailed documentation about the API visit [this page](https://www.globalsign.com/en/resources/apis/api-documentation/) .\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'global_sign'\n```\n\nAnd then execute:\n\n```\n$ bundle\n```\n\nOr install it yourself as:\n\n```\n$ gem install global_sign\n```\n\n## Usage\n\n### Configuration\n\nAn example initializer would look something like this:\n\n```ruby\nGlobalSign.configure do |configuration|\n  configuration.user_name = 'PAR12345_taro'\n  configuration.password  = 'password'\n  configuration.endpoint  = 'https://test-gcc.globalsign.com/kb/ws/v1'\nend\n```\n\n### URL Verification\n\n```ruby\nrequire 'global_sign'\n\nclient = GlobalSign::Client.new\n\n# Prepare CSR beforehand\ncsr = \u003c\u003c-EOS\n-----BEGIN CERTIFICATE REQUEST-----\n...\n-----END CERTIFICATE REQUEST-----\nEOS\n\ncontract = GlobalSign::Contract.new(\n  first_name:   'Pepabo',\n  last_name:    'Taro',\n  phone_number: '090-1234-5678',\n  email:        'pepabo.taro@example.com',\n)\n\nrequest = GlobalSign::UrlVerification::Request.new(\n  product_code:           'DV_LOW_URL',   # 'DV_HIGH_URL' or 'DV_LOW_URL'\n  order_kind:             'new',   # If you request a new certificate\n  validity_period_months: 6,\n  csr:                    csr,\n  contract_info:          contract,\n)\n\nresponse = client.process(request)\n\nif response.success?\n  puts \"Successfully URL Verification\"\n  puts response.params # =\u003e { meta_tag: \"xxxxx\", ... }\nelse\n  raise StandardError, \"#{response.error_code}: #{response.error_message}\"\nend\n```\n\nIt's also possible to set contract within your configure block.\n\n```ruby\nGlobalSign.set_contract do |contract|\n  contract.first_name   = 'Pepabo'\n  contract.last_name    = 'Taro'\n  contract.phone_number = '090-1234-5678'\n  contract.email        = 'pepabo.taro@example.com'\nend\n\n# Not need to give the argument 'contract_info'\nrequest = GlobalSign::UrlVerification::Request.new(\n  product_code:           'DV_LOW_URL',\n  order_kind:             'new',\n  validity_period_months: 6,\n  csr:                    csr,\n)\n```\n\nIf you request a renewal certificate, you should set `renewal` to the value of argument `order_kind`.  \nAnd you should give the argument `renewal_target_order_id` .\n\n```ruby\nrequest = GlobalSign::UrlVerification::Request.new(\n  product_code:            'DV_LOW_URL',\n  order_kind:              'renewal',\n  validity_period_months:  6,\n  csr:                     csr,\n  renewal_target_order_id: 'xxxx123456789',\n  contract_info:           contract,\n)\n```\n\n### DNS Verification\n\nVerification flow is the same as URL Verification. Request class use the following:\n\n```ruby\nclient = GlobalSign::Client.new\n\nrequest = GlobalSign::DnsVerification::Request.new(\n  product_code:           'DV_LOW_DNS',\n  order_kind:             'new',\n  validity_period_months: 6,\n  csr:                    csr,\n  contract_info:          contract,\n)\n\nresponse = client.process(request)\n\nif response.success?\n  puts \"Successfully DNS Verification\"\n  puts response.params # =\u003e { dns_txt: \"xxxxx\", verification_fqdn_list: ['example.com', 'www.example.com'], ... }\nelse\n  raise StandardError, \"#{response.error_code}: #{response.error_message}\"\nend\n```\n\n### URL Verification for Issue\n\n```ruby\nclient = GlobalSign::Client.new\n\n# You can use ApproverURL value such as:\n# - http://example.com\n# - https://example.com\n# - http://www.example.com\n# - https://www.example.com\n\nrequest = GlobalSign::UrlVerificationForIssue::Request.new(\n  order_id:     'xxxx123456789',\n  approver_url: 'http://example.com',\n)\n\nresponse = client.process(request)\n\nif response.success?\n  puts \"Successfully URL Verification for Issue\"\n  puts response.params # =\u003e { fulfillment: { ca_certificates: [{ ca_cert: \"xxxxx\" }, ...]}, ... }\nelse\n  raise StandardError, \"#{response.error_code}: #{response.error_message}\"\nend\n```\n\n### DNS Verification for Issue\n\n```ruby\nclient = GlobalSign::Client.new\n\n# You can use ApproverFQDN value such as:\n# - www.example.com\n# - example.com\n\nrequest = GlobalSign::UrlVerificationForIssue::Request.new(\n  order_id:      'xxxx123456789',\n  approver_fqdn: 'www.example.com',\n)\n\nresponse = client.process(request)\n\nif response.success?\n  puts \"Successfully DNS Verification for Issue\"\n  puts response.params # =\u003e { fulfillment: { ca_certificates: [{ ca_cert: \"xxxxx\" }, ...]}, ... }\nelse\n  raise StandardError, \"#{response.error_code}: #{response.error_message}\"\nend\n```\n\n### Get Order by OrderID\n\n```ruby\nrequest = GlobalSign::OrderGetterByOrderId::Request.new(\n  order_id: 'xxxx123456789'\n)\nresponse = client.process(request)\n\nputs response.params # =\u003e { order_id: \"xxxx123456789\", order_status: \"2\", ... }\n\n# You can get order_status explanation\nputs response.order_status_text  # =\u003e \"phishing_checking\"\n```\n\nYou can specify request options.\n\n```ruby\n# certificate_info option\nrequest = GlobalSign::OrderGetterByOrderId::Request.new(\n  order_id: 'xxxx123456789',\n  options:  { certificate_info: true }\n)\nresponse = client.process(request)\n\nputs response.params[:certificate_info] # =\u003e { certificate_status: '4', start_date: '2016-10-06T14:53:23.000+09:00', ... }\n\n# fulfillment option\nrequest = GlobalSign::OrderGetterByOrderId::Request.new(\n  order_id: 'xxxx123456789',\n  options:  { fulfillment: true }\n)\nresponse = client.process(request)\n\nputs response.params[:fulfillment] # =\u003e { ca_certificates: [{ ca_cert: \"xxxxx\" }, ...]}\n```\n\n### Decode CSR\n\n```ruby\nrequest = GlobalSign::CsrDecoder::Request.new(\n  product_type: 'DV_LOW',\n  csr:          csr\n)\nresponse = client.process(request)\n\nputs response.params # =\u003e { common_name: \"www.example.com\", ... }\n```\n\n### Client options\n\n`GlobalSign::Client` allows `options` argument in order to specify its behavior.  \nFor now, it supports `timeout` which specifies number of seconds to wait for request.\n\n```ruby\nclient = GlobalSign::Client.new(options: { timeout: 120 })\n```\n\n## Contributing\n\n1. Create your feature branch (git checkout -b my-new-feature)\n2. Commit your changes (git commit -am 'Add some feature')\n3. Push to the branch (git push origin my-new-feature)\n4. Create a new Pull Request\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016- GMO Pepabo, Inc.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Fglobal_sign","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepabo%2Fglobal_sign","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Fglobal_sign/lists"}