digicert 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.hound.yml +3 -0
  4. data/.rspec +0 -1
  5. data/.rubocop.yml +629 -0
  6. data/.sample.env +4 -0
  7. data/.sample.pryrc +3 -0
  8. data/.travis.yml +5 -2
  9. data/LICENSE.txt +21 -0
  10. data/README.md +812 -9
  11. data/bin/console +2 -5
  12. data/bin/rspec +17 -0
  13. data/digicert.gemspec +7 -14
  14. data/lib/digicert.rb +40 -2
  15. data/lib/digicert/actions.rb +9 -0
  16. data/lib/digicert/actions/all.rb +27 -0
  17. data/lib/digicert/actions/base.rb +11 -0
  18. data/lib/digicert/actions/create.rb +25 -0
  19. data/lib/digicert/actions/fetch.rb +21 -0
  20. data/lib/digicert/actions/update.rb +25 -0
  21. data/lib/digicert/base.rb +35 -0
  22. data/lib/digicert/base_order.rb +39 -0
  23. data/lib/digicert/certificate.rb +43 -0
  24. data/lib/digicert/certificate_downloader.rb +137 -0
  25. data/lib/digicert/certificate_request.rb +19 -0
  26. data/lib/digicert/client_certificate/base.rb +17 -0
  27. data/lib/digicert/client_certificate/digital_signature_plus.rb +13 -0
  28. data/lib/digicert/client_certificate/email_security_plus.rb +13 -0
  29. data/lib/digicert/client_certificate/premium.rb +17 -0
  30. data/lib/digicert/config.rb +21 -0
  31. data/lib/digicert/configuration.rb +26 -0
  32. data/lib/digicert/container.rb +35 -0
  33. data/lib/digicert/container_template.rb +32 -0
  34. data/lib/digicert/csr_generator.rb +43 -0
  35. data/lib/digicert/debugger.rb +34 -0
  36. data/lib/digicert/domain.rb +59 -0
  37. data/lib/digicert/duplicate_certificate.rb +21 -0
  38. data/lib/digicert/duplicate_certificate_finder.rb +42 -0
  39. data/lib/digicert/email_validation.rb +35 -0
  40. data/lib/digicert/errors.rb +30 -0
  41. data/lib/digicert/errors/forbidden.rb +9 -0
  42. data/lib/digicert/errors/request_error.rb +37 -0
  43. data/lib/digicert/errors/server_error.rb +9 -0
  44. data/lib/digicert/errors/unauthorized.rb +9 -0
  45. data/lib/digicert/expiring_order.rb +21 -0
  46. data/lib/digicert/findable.rb +33 -0
  47. data/lib/digicert/order.rb +81 -0
  48. data/lib/digicert/order_cancellation.rb +25 -0
  49. data/lib/digicert/order_duplicator.rb +11 -0
  50. data/lib/digicert/order_manager.rb +39 -0
  51. data/lib/digicert/order_reissuer.rb +11 -0
  52. data/lib/digicert/organization.rb +43 -0
  53. data/lib/digicert/product.rb +14 -0
  54. data/lib/digicert/request.rb +123 -0
  55. data/lib/digicert/response.rb +30 -0
  56. data/lib/digicert/ssl_certificate/base.rb +9 -0
  57. data/lib/digicert/ssl_certificate/ssl_ev_plus.rb +13 -0
  58. data/lib/digicert/ssl_certificate/ssl_plus.rb +13 -0
  59. data/lib/digicert/ssl_certificate/ssl_wildcard.rb +13 -0
  60. data/lib/digicert/version.rb +23 -1
  61. data/spec/acceptance/certificate_download_spec.rb +68 -0
  62. data/spec/acceptance/duplicating_certificate_spec.rb +86 -0
  63. data/spec/acceptance/reissuing_certificate_spec.rb +104 -0
  64. data/spec/digicert/actions/all_spec.rb +26 -0
  65. data/spec/digicert/actions/create_spec.rb +47 -0
  66. data/spec/digicert/actions/fetch_spec.rb +28 -0
  67. data/spec/digicert/actions/update_spec.rb +39 -0
  68. data/spec/digicert/certificate_downloader_spec.rb +89 -0
  69. data/spec/digicert/certificate_request_spec.rb +49 -0
  70. data/spec/digicert/certificate_spec.rb +93 -0
  71. data/spec/digicert/client_certificate/digital_signature_plus_spec.rb +32 -0
  72. data/spec/digicert/client_certificate/email_security_plus_spec.rb +36 -0
  73. data/spec/digicert/client_certificate/premium_spec.rb +34 -0
  74. data/spec/digicert/config_spec.rb +39 -0
  75. data/spec/digicert/container_spec.rb +44 -0
  76. data/spec/digicert/container_template_spec.rb +32 -0
  77. data/spec/digicert/csr_generator_spec.rb +31 -0
  78. data/spec/digicert/domain_spec.rb +89 -0
  79. data/spec/digicert/duplicate_certificate_finder_spec.rb +27 -0
  80. data/spec/digicert/duplicate_certificate_spec.rb +15 -0
  81. data/spec/digicert/email_validation_spec.rb +26 -0
  82. data/spec/digicert/expiring_order_spec.rb +16 -0
  83. data/spec/digicert/findable_spec.rb +19 -0
  84. data/spec/digicert/order_cancellation_spec.rb +24 -0
  85. data/spec/digicert/order_duplicator_spec.rb +35 -0
  86. data/spec/digicert/order_reissuer_spec.rb +35 -0
  87. data/spec/digicert/order_spec.rb +134 -0
  88. data/spec/digicert/organization_spec.rb +61 -0
  89. data/spec/digicert/product_spec.rb +28 -0
  90. data/spec/digicert/request_spec.rb +47 -0
  91. data/spec/digicert/ssl_certificate/ssl_ev_plus_spec.rb +35 -0
  92. data/spec/digicert/ssl_certificate/ssl_plus_spec.rb +36 -0
  93. data/spec/digicert/ssl_certificate/ssl_wildcard_spec.rb +35 -0
  94. data/spec/fixtures/certificate.pem +79 -0
  95. data/spec/fixtures/certificate.zip +0 -0
  96. data/spec/fixtures/certificate_request.json +116 -0
  97. data/spec/fixtures/certificate_requests.json +59 -0
  98. data/spec/fixtures/certificate_revoked.json +13 -0
  99. data/spec/fixtures/container.json +15 -0
  100. data/spec/fixtures/container_created.json +3 -0
  101. data/spec/fixtures/container_template.json +15 -0
  102. data/spec/fixtures/container_templates.json +14 -0
  103. data/spec/fixtures/containers.json +14 -0
  104. data/spec/fixtures/domain.json +71 -0
  105. data/spec/fixtures/domain_created.json +3 -0
  106. data/spec/fixtures/domains.json +49 -0
  107. data/spec/fixtures/email_validations.json +17 -0
  108. data/spec/fixtures/empty.json +0 -0
  109. data/spec/fixtures/errors.json +6 -0
  110. data/spec/fixtures/expiring_orders.json +20 -0
  111. data/spec/fixtures/order.json +107 -0
  112. data/spec/fixtures/order_created.json +9 -0
  113. data/spec/fixtures/order_duplicated.json +8 -0
  114. data/spec/fixtures/order_duplications.json +57 -0
  115. data/spec/fixtures/order_reissued.json +8 -0
  116. data/spec/fixtures/orders.json +93 -0
  117. data/spec/fixtures/organization.json +35 -0
  118. data/spec/fixtures/organization_created.json +3 -0
  119. data/spec/fixtures/organizations.json +84 -0
  120. data/spec/fixtures/ping.json +3 -0
  121. data/spec/fixtures/product.json +71 -0
  122. data/spec/fixtures/products.json +100 -0
  123. data/spec/fixtures/rsa4096.key +51 -0
  124. data/spec/requests/certificate_duplication_spec.rb +41 -0
  125. data/spec/requests/certificate_generation_spec.rb +93 -0
  126. data/spec/requests/certificate_reissuing_spec.rb +38 -0
  127. data/spec/requests/container_management_spec.rb +36 -0
  128. data/spec/requests/domain_management_spec.rb +64 -0
  129. data/spec/requests/order_client_email_security_plus_spec.rb +38 -0
  130. data/spec/requests/order_management_spec.rb +24 -0
  131. data/spec/requests/order_ssl_ev_plus_spec.rb +57 -0
  132. data/spec/requests/order_ssl_wildcard_spec.rb +57 -0
  133. data/spec/requests/organization_management_spec.rb +22 -0
  134. data/spec/requests/product_management_spec.rb +24 -0
  135. data/spec/requests/request_management_spec.rb +24 -0
  136. data/spec/spec_helper.rb +35 -0
  137. data/spec/support/fake_digicert_api.rb +324 -0
  138. metadata +162 -5
@@ -0,0 +1,57 @@
1
+ {
2
+ "certificates": [
3
+ {
4
+ "id": 1,
5
+ "thumbprint": "B71DCBAF5586D6D95FC0B7EA1C74ADEF4A99F960",
6
+ "serial_number": "0AE71279E5213729026AFE4BB58DE1AB",
7
+ "common_name": "*.digicert.com",
8
+ "dns_names": [
9
+ "*.digicert.com",
10
+ "digicert.com"
11
+ ],
12
+ "status": "approved",
13
+ "date_created": "2014-08-19T18:16:07+00:00",
14
+ "valid_from": "2014-08-19",
15
+ "valid_till": "2015-08-24",
16
+ "csr": "------ [CSR HERE] ------",
17
+ "server_platform": {
18
+ "id": 45,
19
+ "name": "Barracuda",
20
+ "install_url": "www.install.com",
21
+ "csr_url": "www.csr.com"
22
+ },
23
+ "signature_hash": "sha256",
24
+ "key_size": 2048,
25
+ "ca_cert_id": "B71DCBAF5586D6D95FC0B7EA1C74ADEF4A99F960",
26
+ "sub_id": "001",
27
+ "public_id": "F7QIRX5P462QUYGQGRF26RSTL"
28
+ },
29
+ {
30
+ "id": 2,
31
+ "thumbprint": "B71DCBAF5586D6D95FC0B7EA1C74ADEF4A99F960",
32
+ "serial_number": "0AE71279E5213729026AFE4BB58DE1AB",
33
+ "common_name": "*.digicert.com",
34
+ "dns_names": [
35
+ "*.digicert.com",
36
+ "digicert.com",
37
+ "subdomain.digicert.com"
38
+ ],
39
+ "status": "approved",
40
+ "date_created": "2014-12-04T20:32:59+00:00",
41
+ "valid_from": "2014-08-19",
42
+ "valid_till": "2015-08-24",
43
+ "csr": "------ [CSR HERE] ------",
44
+ "server_platform": {
45
+ "id": 45,
46
+ "name": "Barracuda",
47
+ "install_url": "www.install.com",
48
+ "csr_url": "www.csr.com"
49
+ },
50
+ "signature_hash": "sha256",
51
+ "key_size": 2048,
52
+ "ca_cert_id": "B71DCBAF5586D6D95FC0B7EA1C74ADEF4A99F960",
53
+ "sub_id": "002",
54
+ "public_id": "F7QIRX5P462QUYGQGRF26VLK"
55
+ }
56
+ ]
57
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "id": 542757,
3
+ "requests": [
4
+ {
5
+ "id": 1
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "orders": [
3
+ {
4
+ "id": 556729,
5
+ "certificate": {
6
+ "common_name": "digicert.com",
7
+ "dns_names": [
8
+ "digicert.com",
9
+ "www.digicert.com"
10
+ ],
11
+ "valid_till": "2017-08-19",
12
+ "signature_hash": "sha256"
13
+ },
14
+ "status": "issued",
15
+ "date_created": "2014-08-19T18:16:07+00:00",
16
+ "organization": {
17
+ "id": 117483,
18
+ "name": "DigiCert, Inc."
19
+ },
20
+ "validity_years": 3,
21
+ "container": {
22
+ "id": 5,
23
+ "name": "College of Science"
24
+ },
25
+ "product": {
26
+ "name_id": "ssl_plus",
27
+ "name": "SSL Plus",
28
+ "type": "ssl_certificate"
29
+ },
30
+ "price": 293
31
+ },
32
+ {
33
+ "id": 556730,
34
+ "certificate": {
35
+ "common_name": "digicert.com",
36
+ "dns_names": [
37
+ "digicert.com",
38
+ "www.digicert.com"
39
+ ],
40
+ "valid_till": "2017-08-19",
41
+ "signature_hash": "sha256"
42
+ },
43
+ "status": "needs_approval",
44
+ "date_created": "2014-08-20T17:20:59+00:00",
45
+ "organization": {
46
+ "id": 117483,
47
+ "name": "DigiCert, Inc."
48
+ },
49
+ "validity_years": 3,
50
+ "container": {
51
+ "id": 5,
52
+ "name": "College of Science"
53
+ },
54
+ "product": {
55
+ "name_id": "ssl_plus",
56
+ "name": "SSL Plus",
57
+ "type": "ssl_certificate"
58
+ }
59
+ },
60
+ {
61
+ "id": 556731,
62
+ "certificate": {
63
+ "common_name": "digicert.com",
64
+ "dns_names": [
65
+ "digicert.com",
66
+ "www.digicert.com"
67
+ ],
68
+ "signature_hash": "SHA256"
69
+ },
70
+ "status": "needs_approval",
71
+ "date_created": "2014-08-20T17:20:59+00:00",
72
+ "organization": {
73
+ "id": 117483,
74
+ "name": "DigiCert, Inc."
75
+ },
76
+ "validity_years": 3,
77
+ "container": {
78
+ "id": 5,
79
+ "name": "College of Science"
80
+ },
81
+ "product": {
82
+ "name_id": "ssl_plus",
83
+ "name": "SSL Plus",
84
+ "type": "ssl_certificate"
85
+ }
86
+ }
87
+ ],
88
+ "page": {
89
+ "total": 1,
90
+ "limit": 1000,
91
+ "offset": 0
92
+ }
93
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "id": 117483,
3
+ "status": "approved",
4
+ "name": "DigiCert, Inc.",
5
+ "assumed_name": "DigiCert",
6
+ "display_name": "DigiCert",
7
+ "is_active": true,
8
+ "address": "333 S 520 W",
9
+ "address2": "Suite 500",
10
+ "zip": "84042",
11
+ "city": "Lindon",
12
+ "state": "Utah",
13
+ "country": "US",
14
+ "telephone": "801-555-0246",
15
+ "container": {
16
+ "id": 1,
17
+ "name": "Parent Company",
18
+ "is_active": true
19
+ },
20
+ "organization_contact": {
21
+ "id": 376032,
22
+ "first_name": "Some",
23
+ "last_name": "Guy",
24
+ "email": "someguy@digicert.com",
25
+ "telephone": "8017050481",
26
+ "telephone_extension": "5"
27
+ },
28
+ "ev_approvers": [
29
+ {
30
+ "id": 1500432,
31
+ "first_name": "John",
32
+ "last_name": "Smith"
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "id": 143567
3
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "organizations": [
3
+ {
4
+ "id": 117483,
5
+ "status": "approved",
6
+ "name": "DigiCert, Inc.",
7
+ "assumed_name": "DigiCert",
8
+ "display_name": "DigiCert, Inc. (DigiCert)",
9
+ "is_active": true,
10
+ "address": "333 S 520 W",
11
+ "address2": "Suite 500",
12
+ "zip": "84042",
13
+ "city": "Lindon",
14
+ "state": "Utah",
15
+ "country": "US",
16
+ "telephone": "801-555-0453",
17
+ "container": {
18
+ "id": 1,
19
+ "name": "My Company",
20
+ "is_active": true
21
+ },
22
+ "validations": [
23
+ {
24
+ "type": "ov",
25
+ "name": "OV",
26
+ "description": "Normal Organization Validation",
27
+ "date_created": "2015-08-09T17:04:59+00:00",
28
+ "validated_until": "2016-08-09T17:04:45+00:00",
29
+ "status": "active"
30
+ },
31
+ {
32
+ "type": "ev",
33
+ "name": "EV",
34
+ "description": "Extended Organization Validation (EV)",
35
+ "status": "pending",
36
+ "verified_users": [
37
+ {
38
+ "id": 1,
39
+ "first_name": "John",
40
+ "last_name": "Harrison"
41
+ }
42
+ ]
43
+ },
44
+ {
45
+ "type": "cs",
46
+ "name": "CS",
47
+ "description": "Code Signing Validation",
48
+ "date_created": "2014-08-09T17:04:59+00:00",
49
+ "validated_until": "2015-08-09T17:04:45+00:00",
50
+ "status": "expired",
51
+ "verified_users": [
52
+ {
53
+ "id": 1,
54
+ "first_name": "John",
55
+ "last_name": "Harrison"
56
+ }
57
+ ]
58
+ }
59
+ ],
60
+ "ev_approvers": [
61
+ {
62
+ "id": 4321,
63
+ "first_name": "Bro",
64
+ "last_name": "Jackson"
65
+ }
66
+ ]
67
+ },
68
+ {
69
+ "id": 117483,
70
+ "status": "approved",
71
+ "name": "Testing, Inc.",
72
+ "address": "123 Testing Way",
73
+ "zip": "84043",
74
+ "city": "Lehi",
75
+ "state": "Utah",
76
+ "country": "US",
77
+ "container": {
78
+ "id": 1,
79
+ "name": "My Company",
80
+ "is_active": true
81
+ }
82
+ }
83
+ ]
84
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "data": "Pong!"
3
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "group_name": "ssl_certificate",
3
+ "name_id": "ssl_plus",
4
+ "name": "SSL Plus",
5
+ "type": "ssl_certificate",
6
+ "duplicates_allowed": false,
7
+ "allowed_validity_years": [
8
+ 1,
9
+ 2,
10
+ 3
11
+ ],
12
+ "signature_hash_types": {
13
+ "allowed_hash_types": [
14
+ {
15
+ "id": "sha1",
16
+ "name": "SHA"
17
+ },
18
+ {
19
+ "id": "sha256",
20
+ "name": "SHA-256"
21
+ },
22
+ {
23
+ "id": "sha384",
24
+ "name": "SHA-384"
25
+ },
26
+ {
27
+ "id": "sha512",
28
+ "name": "SHA-512"
29
+ }
30
+ ],
31
+ "default_hash_type_id": "sha256"
32
+ },
33
+ "additional_dns_names_allowed": false,
34
+ "increased_compatibility_allowed": true,
35
+ "custom_expiration_date_allowed": true,
36
+ "csr_required": true,
37
+ "allow_auto_renew": true,
38
+ "server_platforms": [
39
+ {
40
+ "id": 2,
41
+ "name": "Apache",
42
+ "install_url": "http:\/\/www.digicert.com\/ssl-certificate-installation-apache.htm",
43
+ "csr_url": "http:\/\/www.digicert.com\/csr-creation-apache.htm"
44
+ },
45
+ {
46
+ "id": 14,
47
+ "name": "Microsoft IIS 5 or 6",
48
+ "install_url": "http:\/\/www.digicert.com\/ssl-certificate-installation-apache.htm",
49
+ "csr_url": "http:\/\/www.digicert.com\/csr-creation-apache.htm"
50
+ },
51
+ {
52
+ "id": 40,
53
+ "name": "Microsoft IIS 7",
54
+ "install_url": "http:\/\/www.digicert.com\/ssl-certificate-installation-apache.htm",
55
+ "csr_url": "http:\/\/www.digicert.com\/csr-creation-apache.htm"
56
+ },
57
+ {
58
+ "id": 67,
59
+ "name": "Microsoft IIS 8",
60
+ "install_url": "http:\/\/www.digicert.com\/ssl-certificate-installation-apache.htm",
61
+ "csr_url": "http:\/\/www.digicert.com\/csr-creation-apache.htm"
62
+ },
63
+ {
64
+ "id": 68,
65
+ "name": "Microsoft Exchange Server 2013",
66
+ "install_url": "http:\/\/www.digicert.com\/ssl-certificate-installation-apache.htm",
67
+ "csr_url": "http:\/\/www.digicert.com\/csr-creation-apache.htm"
68
+ }
69
+ ],
70
+ "license_agreement": "CERTIFICATE SUBSCRIBER AGREEMENT"
71
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "products": [
3
+ {
4
+ "group_name": "ssl_certificate",
5
+ "name_id": "ssl_plus",
6
+ "name": "SSL Plus",
7
+ "type": "ssl_certificate"
8
+ },
9
+ {
10
+ "group_name": "ssl_certificate",
11
+ "name_id": "ssl_wildcard",
12
+ "name": "WildCard Plus",
13
+ "type": "ssl_certificate"
14
+ },
15
+ {
16
+ "group_name": "ssl_certificate",
17
+ "name_id": "ssl_multi_domain",
18
+ "name": "Multi-Domain SSL",
19
+ "type": "ssl_certificate"
20
+ },
21
+ {
22
+ "group_name": "ssl_certificate",
23
+ "name_id": "ssl_ev_plus",
24
+ "name": "EV SSL Plus",
25
+ "type": "ssl_certificate"
26
+ },
27
+ {
28
+ "group_name": "client_certificate",
29
+ "name_id": "client_premium",
30
+ "name": "Premium",
31
+ "type": "client_certificate"
32
+ },
33
+ {
34
+ "group_name": "client_certificate",
35
+ "name_id": "client_email_security_plus",
36
+ "name": "Email Security Plus",
37
+ "type": "client_certificate"
38
+ },
39
+ {
40
+ "group_name": "client_certificate",
41
+ "name_id": "client_digital_signature_plus",
42
+ "name": "Digital Signature Plus",
43
+ "type": "client_certificate"
44
+ },
45
+ {
46
+ "group_name": "code_signing_certificate",
47
+ "name_id": "code_signing",
48
+ "name": "Code Signing",
49
+ "type": "code_signing_certificate"
50
+ },
51
+ {
52
+ "group_name": "grid_certificate",
53
+ "name_id": "client_grid_private_premium",
54
+ "name": "Grid SMIME and Client Authentication",
55
+ "type": "client_certificate"
56
+ },
57
+ {
58
+ "group_name": "ssl_certificate",
59
+ "name_id": "ssl_ev_multi_domain",
60
+ "name": "EV Multi-Domain",
61
+ "type": "ssl_certificate"
62
+ },
63
+ {
64
+ "group_name": "code_signing",
65
+ "name_id": "code_signing_ev",
66
+ "name": "EV Code Signing",
67
+ "type": "code_signing_certificate"
68
+ },
69
+ {
70
+ "group_name": "private_ssl_certificate",
71
+ "name_id": "private_ssl_plus",
72
+ "name": "Private SSL",
73
+ "type": "ssl_certificate"
74
+ },
75
+ {
76
+ "group_name": "grid_certificate",
77
+ "name_id": "grid_host_ssl",
78
+ "name": "Public Grid Host SSL",
79
+ "type": "ssl_certificate"
80
+ },
81
+ {
82
+ "group_name": "grid_certificate",
83
+ "name_id": "grid_robot_ssl",
84
+ "name": "Public Grid Robot SSL",
85
+ "type": "ssl_certificate"
86
+ },
87
+ {
88
+ "group_name": "grid_certificate",
89
+ "name_id": "grid_host_ssl_multi_domain",
90
+ "name": "Public Grid Host Multi-Domain",
91
+ "type": "ssl_certificate"
92
+ },
93
+ {
94
+ "group_name": "grid_certificate",
95
+ "name_id": "grid_robot_ssl_multi_domain",
96
+ "name": "Public Grid Robot Multi-Domain",
97
+ "type": "ssl_certificate"
98
+ }
99
+ ]
100
+ }