@itentialopensource/adapter-digicert_pki 0.1.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/.eslintignore +0 -1
  2. package/.jshintrc +3 -0
  3. package/CALLS.md +957 -3
  4. package/CHANGELOG.md +16 -1
  5. package/CONTRIBUTING.md +1 -160
  6. package/ENHANCE.md +2 -2
  7. package/README.md +31 -22
  8. package/adapter.js +13682 -334
  9. package/adapterBase.js +538 -873
  10. package/changelogs/changelog.md +16 -0
  11. package/entities/ACME/action.json +166 -0
  12. package/entities/ACME/mockdatafiles/createAcmeAuthentication-default.json +21 -0
  13. package/entities/ACME/mockdatafiles/getAcmeAuthentication-default.json +21 -0
  14. package/entities/ACME/mockdatafiles/listAcmeAuthentication-default.json +41 -0
  15. package/entities/ACME/mockdatafiles/updateAcmeAuthentication-default.json +21 -0
  16. package/entities/ACME/schema.json +125 -0
  17. package/entities/AuthenticationCACertificates/action.json +107 -0
  18. package/entities/AuthenticationCACertificates/schema.json +155 -0
  19. package/entities/AuthenticationCATemplates/action.json +187 -0
  20. package/entities/AuthenticationCATemplates/mockdatafiles/createAuthenticationCATemplate-default.json +33 -0
  21. package/entities/AuthenticationCATemplates/mockdatafiles/getAuthenticationCATemplate-default.json +33 -0
  22. package/entities/AuthenticationCATemplates/mockdatafiles/updateAuthenticationCATemplate-default.json +33 -0
  23. package/entities/AuthenticationCATemplates/schema.json +137 -0
  24. package/entities/AuthenticationCertificates/action.json +166 -0
  25. package/entities/AuthenticationCertificates/mockdatafiles/addAuthenticationCertificate-default.json +48 -0
  26. package/entities/AuthenticationCertificates/mockdatafiles/getAuthenticationCertificateDetails-default.json +49 -0
  27. package/entities/AuthenticationCertificates/mockdatafiles/listAuthenticationCertificates-default.json +93 -0
  28. package/entities/AuthenticationCertificates/mockdatafiles/updateAuthenticationCertificate-default.json +48 -0
  29. package/entities/AuthenticationCertificates/schema.json +202 -0
  30. package/entities/BatchCertificateEnrollment/action.json +268 -0
  31. package/entities/BatchCertificateEnrollment/mockdatafiles/batchCSREnroll-default.json +22 -0
  32. package/entities/BatchCertificateEnrollment/mockdatafiles/batchEnrollWithKeyGen-default.json +22 -0
  33. package/entities/BatchCertificateEnrollment/mockdatafiles/batchEnrollWithKeyGenMac-default.json +22 -0
  34. package/entities/BatchCertificateEnrollment/mockdatafiles/downloadCertificates-default.json +18 -0
  35. package/entities/BatchCertificateEnrollment/mockdatafiles/getBatchJobSettings-default.json +22 -0
  36. package/entities/BatchCertificateEnrollment/mockdatafiles/regenerateBatchJobPasscode-default.json +22 -0
  37. package/entities/BatchCertificateEnrollment/mockdatafiles/updateBatchJobSettings-default.json +22 -0
  38. package/entities/BatchCertificateEnrollment/schema.json +284 -0
  39. package/entities/CertificateProfiles/action.json +206 -0
  40. package/entities/CertificateProfiles/mockdatafiles/listCertificateProfiles-default.json +219 -0
  41. package/entities/CertificateProfiles/schema.json +116 -0
  42. package/entities/CertificateRequests/action.json +25 -0
  43. package/entities/CertificateRequests/mockdatafiles/getRequestStatus-default.json +5 -0
  44. package/entities/CertificateRequests/schema.json +30 -0
  45. package/entities/CertificateTemplates/action.json +186 -0
  46. package/entities/CertificateTemplates/schema.json +104 -0
  47. package/entities/Certificates/action.json +312 -0
  48. package/entities/Certificates/mockdatafiles/downloadApprovedCertificate-default.json +47 -0
  49. package/entities/Certificates/mockdatafiles/renewBySerial-default.json +23 -0
  50. package/entities/Certificates/mockdatafiles/renewCertificate-default.json +31 -0
  51. package/entities/Certificates/schema.json +462 -0
  52. package/entities/DeviceProfiles/action.json +126 -0
  53. package/entities/DeviceProfiles/mockdatafiles/createDeviceProfile-default.json +28 -0
  54. package/entities/DeviceProfiles/mockdatafiles/getDeviceProfile-default.json +28 -0
  55. package/entities/DeviceProfiles/mockdatafiles/listdeviceprofiles-default.json +53 -0
  56. package/entities/DeviceProfiles/mockdatafiles/updateDeviceProfile-default.json +28 -0
  57. package/entities/DeviceProfiles/schema.json +57 -0
  58. package/entities/Devices/action.json +166 -0
  59. package/entities/Devices/mockdatafiles/archiveDevice-default.json +33 -0
  60. package/entities/Devices/mockdatafiles/disableDevice-default.json +33 -0
  61. package/entities/Devices/mockdatafiles/enableDevice-default.json +33 -0
  62. package/entities/Devices/mockdatafiles/restoreDevice-default.json +33 -0
  63. package/entities/Devices/schema.json +103 -0
  64. package/entities/DevicesV2/action.json +186 -0
  65. package/entities/DevicesV2/mockdatafiles/archiveDeviceV2-default.json +33 -0
  66. package/entities/DevicesV2/mockdatafiles/disableDeviceV2-default.json +33 -0
  67. package/entities/DevicesV2/mockdatafiles/enableDeviceV2-default.json +33 -0
  68. package/entities/DevicesV2/mockdatafiles/restoreDeviceV2-default.json +33 -0
  69. package/entities/DevicesV2/schema.json +115 -0
  70. package/entities/Divisions/action.json +288 -0
  71. package/entities/Divisions/schema.json +164 -0
  72. package/entities/EnrollmentProfilePasscodes/action.json +186 -0
  73. package/entities/EnrollmentProfilePasscodes/schema.json +181 -0
  74. package/entities/EnrollmentProfiles/action.json +191 -0
  75. package/entities/EnrollmentProfiles/mockdatafiles/getEnrollmentProfile-default.json +153 -0
  76. package/entities/EnrollmentProfiles/mockdatafiles/getEnrollmentProfileSpecification-default.json +125 -0
  77. package/entities/EnrollmentProfiles/mockdatafiles/updateEnrollmentProfile-default.json +117 -0
  78. package/entities/EnrollmentProfiles/schema.json +148 -0
  79. package/entities/ExternalBatchCertificateEnrollment/action.json +150 -0
  80. package/entities/ExternalBatchCertificateEnrollment/mockdatafiles/batchEnrollExternal-default.json +16 -0
  81. package/entities/ExternalBatchCertificateEnrollment/mockdatafiles/downloadByCertificateValue-default.json +154 -0
  82. package/entities/ExternalBatchCertificateEnrollment/mockdatafiles/downloadByCommonName-default.json +150 -0
  83. package/entities/ExternalBatchCertificateEnrollment/mockdatafiles/downloadByJobIdAndCertificateValue-default.json +36 -0
  84. package/entities/ExternalBatchCertificateEnrollment/mockdatafiles/downloadByJobIdAndCommonName-default.json +130 -0
  85. package/entities/ExternalBatchCertificateEnrollment/mockdatafiles/downloadByJobIdAndUniqueId-default.json +42 -0
  86. package/entities/ExternalBatchCertificateEnrollment/schema.json +102 -0
  87. package/entities/Gateways/action.json +187 -0
  88. package/entities/Gateways/schema.json +126 -0
  89. package/entities/ICAs/action.json +46 -0
  90. package/entities/ICAs/schema.json +163 -0
  91. package/entities/OCSPGroups/action.json +167 -0
  92. package/entities/OCSPGroups/schema.json +466 -0
  93. package/metadata.json +49 -0
  94. package/package.json +22 -25
  95. package/pronghorn.json +23155 -266
  96. package/propertiesSchema.json +455 -42
  97. package/refs?service=git-upload-pack +0 -0
  98. package/report/adapter-openapi.json +3224 -0
  99. package/report/adapter-openapi.yaml +2185 -0
  100. package/report/adapterInfo.json +8 -8
  101. package/report/updateReport1691508686598.json +120 -0
  102. package/report/updateReport1692203137726.json +120 -0
  103. package/report/updateReport1694467869659.json +120 -0
  104. package/report/updateReport1698422457936.json +120 -0
  105. package/sampleProperties.json +67 -6
  106. package/test/integration/adapterTestBasicGet.js +1 -1
  107. package/test/integration/adapterTestConnectivity.js +91 -42
  108. package/test/integration/adapterTestIntegration.js +4704 -32
  109. package/test/unit/adapterBaseTestUnit.js +388 -313
  110. package/test/unit/adapterTestUnit.js +5211 -148
  111. package/utils/adapterInfo.js +1 -1
  112. package/utils/addAuth.js +1 -1
  113. package/utils/artifactize.js +1 -1
  114. package/utils/checkMigrate.js +1 -1
  115. package/utils/entitiesToDB.js +1 -0
  116. package/utils/findPath.js +1 -1
  117. package/utils/methodDocumentor.js +71 -23
  118. package/utils/modify.js +13 -15
  119. package/utils/packModificationScript.js +1 -1
  120. package/utils/taskMover.js +309 -0
  121. package/utils/tbScript.js +3 -10
  122. package/utils/tbUtils.js +2 -3
  123. package/utils/testRunner.js +1 -1
  124. package/utils/troubleshootingAdapter.js +1 -3
  125. package/workflows/README.md +0 -3
@@ -3,9 +3,12 @@
3
3
  /* global describe it context before after */
4
4
  /* eslint no-unused-vars: warn */
5
5
 
6
- const mocha = require('mocha');
7
6
  const assert = require('assert');
8
- const diagnostics = require('network-diagnostics');
7
+ const http = require('http');
8
+ const https = require('https');
9
+ const mocha = require('mocha');
10
+ const ping = require('ping');
11
+ const dnsLookup = require('dns-lookup-promise');
9
12
 
10
13
  let host;
11
14
  process.argv.forEach((val) => {
@@ -16,78 +19,124 @@ process.argv.forEach((val) => {
16
19
 
17
20
  describe('[integration] Adapter Test', () => {
18
21
  context(`Testing network connection on ${host}`, () => {
19
- before(() => {
20
- diagnostics.setTestURL(host);
21
- });
22
-
23
22
  after((done) => {
24
23
  done();
25
24
  });
26
25
 
27
26
  it('DNS resolve', (done) => {
28
- diagnostics.haveDNS((result) => {
29
- try {
30
- assert.equal(result, true);
31
- done();
32
- } catch (error) {
33
- done(error);
34
- }
35
- });
27
+ dnsLookup(host)
28
+ .then((addresses) => {
29
+ try {
30
+ assert.ok(addresses.length > 0);
31
+ done();
32
+ } catch (error) {
33
+ done(error);
34
+ }
35
+ })
36
+ .catch((err) => {
37
+ done(err);
38
+ });
36
39
  });
37
40
 
38
41
  it('Responds to ping', (done) => {
39
- diagnostics.havePing((result) => {
40
- try {
41
- assert.equal(result, true);
42
- done();
43
- } catch (error) {
44
- done(error);
45
- }
46
- });
42
+ ping.promise.probe(host)
43
+ .then((result) => {
44
+ try {
45
+ assert.ok(result.alive);
46
+ done();
47
+ } catch (error) {
48
+ done(error);
49
+ }
50
+ })
51
+ .catch((err) => {
52
+ done(err);
53
+ });
47
54
  });
48
55
 
49
56
  it('Support HTTP on port 80', (done) => {
50
- diagnostics.haveHTTP((result) => {
57
+ const requestOptions = {
58
+ host,
59
+ port: 80,
60
+ method: 'HEAD'
61
+ };
62
+
63
+ const req = http.request(requestOptions, (res) => {
51
64
  try {
52
- assert.equal(result, true);
65
+ assert.ok(res.statusCode >= 200 && res.statusCode < 400);
53
66
  done();
54
67
  } catch (error) {
55
68
  done(error);
56
69
  }
57
70
  });
71
+
72
+ req.on('error', (err) => {
73
+ done(err);
74
+ });
75
+
76
+ req.end();
58
77
  });
59
78
 
60
79
  it('Support HTTPS on port 443', (done) => {
61
- diagnostics.haveHTTPS((result) => {
80
+ const requestOptions = {
81
+ host,
82
+ port: 443,
83
+ method: 'HEAD'
84
+ };
85
+
86
+ const req = https.request(requestOptions, (res) => {
62
87
  try {
63
- assert.equal(result, true);
88
+ assert.ok(res.statusCode >= 200 && res.statusCode < 400);
64
89
  done();
65
90
  } catch (error) {
66
91
  done(error);
67
92
  }
68
93
  });
94
+
95
+ req.on('error', (err) => {
96
+ done(err);
97
+ });
98
+
99
+ req.end();
69
100
  });
70
101
 
71
102
  it('Support IPv4', (done) => {
72
- diagnostics.haveIPv4Async((result) => {
73
- try {
74
- assert.equal(result, true);
75
- done();
76
- } catch (error) {
77
- done(error);
78
- }
79
- });
103
+ const options = {
104
+ family: 4,
105
+ hints: dnsLookup.ADDRCONFIG
106
+ };
107
+
108
+ dnsLookup.lookup(host, options)
109
+ .then((address, family) => {
110
+ try {
111
+ assert.ok(address !== null && family === 4);
112
+ done();
113
+ } catch (error) {
114
+ done(error);
115
+ }
116
+ })
117
+ .catch((err) => {
118
+ done(err);
119
+ });
80
120
  });
81
121
 
82
122
  it('Support IPv6', (done) => {
83
- diagnostics.haveIPv6Async((result) => {
84
- try {
85
- assert.equal(result, true);
86
- done();
87
- } catch (error) {
88
- done(error);
89
- }
90
- });
123
+ const options = {
124
+ family: 6,
125
+ hints: dnsLookup.ADDRCONFIG
126
+ };
127
+
128
+ dnsLookup.lookup(host, options)
129
+ .then((address, family) => {
130
+ try {
131
+ assert.ok(address !== null && family === 6);
132
+ done();
133
+ } catch (error) {
134
+ done(error);
135
+ }
136
+ })
137
+ .catch((err) => {
138
+ done(err);
139
+ });
91
140
  });
92
141
  });
93
142
  });