@itentialopensource/adapter-oracle_cloud 0.3.2 → 0.4.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.
package/TAB2.md ADDED
@@ -0,0 +1,349 @@
1
+ # Oracle Cloud
2
+
3
+ ## Table of Contents
4
+
5
+ - [Specific Adapter Information](#specific-adapter-information)
6
+ - [Authentication](#authentication)
7
+ - [Sample Properties](#sample-properties)
8
+ - [Swagger](#swagger)
9
+ - [Generic Adapter Information](#generic-adapter-information)
10
+
11
+ ## Specific Adapter Information
12
+ ### Authentication
13
+
14
+ This document will go through the steps for authenticating the Oracle Cloud adapter with OAuth Authentication and Basic Authentication. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
15
+
16
+ #### OAuth Two Step Token Authentication
17
+ The Oracle Cloud adapter requires OAuth Two Step Token Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
18
+
19
+ Oracle Cloud requires Basic Authentication on the token request along with a grant type of "client_credentials".
20
+
21
+ STEPS
22
+ 1. Ensure you have access to a Oracle Cloud server and that it is running
23
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
24
+ 3. Use the properties below for the ```properties.authentication``` field
25
+ ```json
26
+ "authentication": {
27
+ "auth_method": "request_token",
28
+ "username": "clientID",
29
+ "password": "clientSecret",
30
+ "token_timeout": 1800000,
31
+ "token_cache": "local",
32
+ "invalid_token_error": 401,
33
+ "auth_field": "header.headers.Authorization",
34
+ "auth_field_format": "Bearer {token}",
35
+ "grant_type": "client_credentials",
36
+ "scope": "scopeString",
37
+ "sso": {
38
+ "protocol": "https",
39
+ "host": "idcs_tenantname",
40
+ "port": 443
41
+ }
42
+ }
43
+ ```
44
+ 4. Restart the adapter. If your properties were set correctly, the adapter should go online.
45
+
46
+
47
+ #### Basic Authentication
48
+ The Oracle Cloud adapter can also authenticate using Basic Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
49
+
50
+ STEPS
51
+ 1. Ensure you have access to a Oracle Cloud server and that it is running
52
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
53
+ 3. Use the properties below for the ```properties.authentication``` field
54
+ ```json
55
+ "authentication": {
56
+ "auth_method": "basic user_password",
57
+ "username": "<username>",
58
+ "password": "<password>",
59
+ "token_timeout": 1800000,
60
+ "token_cache": "local",
61
+ "invalid_token_error": 401,
62
+ "auth_field": "header.headers.Authorization",
63
+ "auth_field_format": "Basic {b64}{username}:{password}{/b64}",
64
+ "auth_logging": false,
65
+ }
66
+ ```
67
+ 4. Restart the adapter. If your properties were set correctly, the adapter should go online.
68
+
69
+ #### Troubleshooting
70
+ - Make sure you copied over the correct username and password.
71
+ - Turn on debug level logs for the adapter in IAP Admin Essentials.
72
+ - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
73
+ - Investigate the logs - in particular:
74
+ - The FULL REQUEST log to make sure the proper headers are being sent with the request.
75
+ - The FULL BODY log to make sure the payload is accurate.
76
+ - The CALL RETURN log to see what the other system is telling us.
77
+ - Credentials should be ** masked ** by the adapter so make sure you verify the username and password - including that there are erroneous spaces at the front or end.
78
+ - Remember when you are done to turn auth_logging off as you do not want to log credentials.
79
+ ### Sample Properties
80
+
81
+ Sample Properties can be used to help you configure the adapter in the Itential Automation Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
82
+
83
+ ```json
84
+ "properties": {
85
+ "host": "localhost",
86
+ "port": 443,
87
+ "choosepath": "",
88
+ "base_path": "/",
89
+ "version": "",
90
+ "cache_location": "none",
91
+ "encode_pathvars": true,
92
+ "encode_queryvars": true,
93
+ "save_metric": false,
94
+ "stub": true,
95
+ "protocol": "https",
96
+ "authentication": {
97
+ "auth_method": "request_token",
98
+ "username": "clientId",
99
+ "password": "clientSecret",
100
+ "token": "token",
101
+ "token_timeout": 1800000,
102
+ "token_cache": "local",
103
+ "invalid_token_error": 401,
104
+ "auth_field": "header.headers.Authorization",
105
+ "auth_field_format": "Bearer {token}",
106
+ "auth_logging": false,
107
+ "client_id": "",
108
+ "client_secret": "",
109
+ "grant_type": "client_credentials",
110
+ "scope": "scopeString",
111
+ "sensitive": [],
112
+ "sso": {
113
+ "protocol": "https",
114
+ "host": "idcs_tenantname",
115
+ "port": 443
116
+ },
117
+ "multiStepAuthCalls": [
118
+ {
119
+ "name": "",
120
+ "requestFields": {},
121
+ "responseFields": {},
122
+ "successfullResponseCode": 200
123
+ }
124
+ ]
125
+ },
126
+ "healthcheck": {
127
+ "type": "none",
128
+ "frequency": 60000,
129
+ "query_object": {},
130
+ "addlHeaders": {}
131
+ },
132
+ "throttle": {
133
+ "throttle_enabled": false,
134
+ "number_pronghorns": 1,
135
+ "sync_async": "sync",
136
+ "max_in_queue": 1000,
137
+ "concurrent_max": 1,
138
+ "expire_timeout": 0,
139
+ "avg_runtime": 200,
140
+ "priorities": [
141
+ {
142
+ "value": 0,
143
+ "percent": 100
144
+ }
145
+ ]
146
+ },
147
+ "request": {
148
+ "number_redirects": 0,
149
+ "number_retries": 3,
150
+ "limit_retry_error": [
151
+ 0
152
+ ],
153
+ "failover_codes": [],
154
+ "attempt_timeout": 5000,
155
+ "global_request": {
156
+ "payload": {},
157
+ "uriOptions": {},
158
+ "addlHeaders": {},
159
+ "authData": {}
160
+ },
161
+ "healthcheck_on_timeout": true,
162
+ "return_raw": false,
163
+ "archiving": false,
164
+ "return_request": false
165
+ },
166
+ "proxy": {
167
+ "enabled": false,
168
+ "host": "",
169
+ "port": 1,
170
+ "protocol": "http",
171
+ "username": "",
172
+ "password": ""
173
+ },
174
+ "ssl": {
175
+ "ecdhCurve": "",
176
+ "enabled": false,
177
+ "accept_invalid_cert": false,
178
+ "ca_file": "",
179
+ "key_file": "",
180
+ "cert_file": "",
181
+ "secure_protocol": "",
182
+ "ciphers": ""
183
+ },
184
+ "mongo": {
185
+ "host": "",
186
+ "port": 0,
187
+ "database": "",
188
+ "username": "",
189
+ "password": "",
190
+ "replSet": "",
191
+ "db_ssl": {
192
+ "enabled": false,
193
+ "accept_invalid_cert": false,
194
+ "ca_file": "",
195
+ "key_file": "",
196
+ "cert_file": ""
197
+ }
198
+ },
199
+ "devicebroker": {
200
+ "enabled": false,
201
+ "getDevice": [
202
+ {
203
+ "path": "/not/mapped",
204
+ "method": "GET",
205
+ "query": {},
206
+ "body": {},
207
+ "headers": {},
208
+ "handleFailure": "ignore",
209
+ "requestFields": {
210
+ "insample": "{port}"
211
+ },
212
+ "responseDatakey": "",
213
+ "responseFields": {
214
+ "name": "{this}{||}{that}",
215
+ "ostype": "{osfield}",
216
+ "ostypePrefix": "meraki-",
217
+ "port": "{port}",
218
+ "ipaddress": "{ip_addr}",
219
+ "serial": "{serial}"
220
+ }
221
+ }
222
+ ],
223
+ "getDevicesFiltered": [
224
+ {
225
+ "path": "/not/mapped",
226
+ "method": "GET",
227
+ "pagination": {
228
+ "offsetVar": "",
229
+ "limitVar": "",
230
+ "incrementBy": "limit",
231
+ "requestLocation": "query"
232
+ },
233
+ "query": {},
234
+ "body": {},
235
+ "headers": {},
236
+ "handleFailure": "ignore",
237
+ "requestFields": {},
238
+ "responseDatakey": "",
239
+ "responseFields": {
240
+ "name": "{this}{||}{that}",
241
+ "ostype": "{osfield}",
242
+ "ostypePrefix": "meraki-",
243
+ "port": "{port}",
244
+ "ipaddress": "{ip_addr}",
245
+ "serial": "{serial}",
246
+ "id": "{myid}"
247
+ }
248
+ }
249
+ ],
250
+ "isAlive": [
251
+ {
252
+ "path": "/not/mapped/{devID}",
253
+ "method": "GET",
254
+ "query": {},
255
+ "body": {},
256
+ "headers": {},
257
+ "handleFailure": "ignore",
258
+ "requestFields": {
259
+ "devID": "{id}"
260
+ },
261
+ "responseDatakey": "",
262
+ "responseFields": {
263
+ "status": "return2xx",
264
+ "statusValue": "AD.200"
265
+ }
266
+ }
267
+ ],
268
+ "getConfig": [
269
+ {
270
+ "path": "/not/mapped/{devID}",
271
+ "method": "GET",
272
+ "query": {},
273
+ "body": {},
274
+ "headers": {},
275
+ "handleFailure": "ignore",
276
+ "requestFields": {
277
+ "devID": "{id}"
278
+ },
279
+ "responseDatakey": "",
280
+ "responseFields": {}
281
+ }
282
+ ],
283
+ "getCount": [
284
+ {
285
+ "path": "/not/mapped",
286
+ "method": "GET",
287
+ "query": {},
288
+ "body": {},
289
+ "headers": {},
290
+ "handleFailure": "ignore",
291
+ "requestFields": {},
292
+ "responseDatakey": "",
293
+ "responseFields": {}
294
+ }
295
+ ]
296
+ },
297
+ "cache": {
298
+ "enabled": false,
299
+ "entities": [
300
+ {
301
+ "entityType": "device",
302
+ "frequency": 3600,
303
+ "flushOnFail": false,
304
+ "limit": 10000,
305
+ "retryAttempts": 5,
306
+ "sort": true,
307
+ "populate": [
308
+ {
309
+ "path": "/not/mapped",
310
+ "method": "GET",
311
+ "pagination": {
312
+ "offsetVar": "",
313
+ "limitVar": "",
314
+ "incrementBy": "limit",
315
+ "requestLocation": "query"
316
+ },
317
+ "query": {},
318
+ "body": {},
319
+ "headers": {},
320
+ "handleFailure": "ignore",
321
+ "requestFields": {},
322
+ "responseDatakey": "",
323
+ "responseFields": {
324
+ "name": "{this}{||}{that}",
325
+ "ostype": "{osfield}",
326
+ "ostypePrefix": "meraki-",
327
+ "port": "{port}",
328
+ "ipaddress": "{ip_addr}",
329
+ "serial": "{serial}",
330
+ "id": "{myid}"
331
+ }
332
+ }
333
+ ],
334
+ "cachedTasks": [
335
+ {
336
+ "name": "",
337
+ "filterField": "",
338
+ "filterLoc": ""
339
+ }
340
+ ]
341
+ }
342
+ ]
343
+ }
344
+ }
345
+ ```
346
+ ### [Swagger](https://gitlab.com/itentialopensource/adapters/cloud/adapter-oracle_cloud/-/blob/master/report/adapter-openapi.json)
347
+
348
+ ## [Generic Adapter Information](https://gitlab.com/itentialopensource/adapters/cloud/adapter-oracle_cloud/-/blob/master/README.md)
349
+
@@ -4,14 +4,16 @@
4
4
  "name": "getToken",
5
5
  "protocol": "REST",
6
6
  "method": "POST",
7
- "entitypath": "{base_path}/{version}/login",
7
+ "entitypath": "{base_path}/{version}/oauth2/v1/token",
8
8
  "requestSchema": "schemaTokenReq.json",
9
9
  "responseSchema": "schemaTokenResp.json",
10
10
  "timeout": 0,
11
11
  "sendEmpty": false,
12
- "requestDatatype": "",
13
- "responseDatatype": "",
14
- "headers": {},
12
+ "requestDatatype": "URLENCODE",
13
+ "responseDatatype": "JSON",
14
+ "headers": {
15
+ "Authorization": "Basic {b64}{username}:{password}{/b64}"
16
+ },
15
17
  "sso": {
16
18
  "protocol": "",
17
19
  "host": "",
@@ -1,3 +1,3 @@
1
1
  {
2
- "token": "garbagetoken"
2
+ "access_token": "garbagetoken"
3
3
  }
@@ -36,6 +36,50 @@
36
36
  },
37
37
  "external_name": "password"
38
38
  },
39
+ "client_id": {
40
+ "type": "string",
41
+ "description": "client id to log in with",
42
+ "parse": false,
43
+ "encode": false,
44
+ "encrypt": {
45
+ "type": "AES",
46
+ "key": ""
47
+ },
48
+ "external_name": "client_id"
49
+ },
50
+ "client_secret": {
51
+ "type": "string",
52
+ "description": "client secret to log in with",
53
+ "parse": false,
54
+ "encode": false,
55
+ "encrypt": {
56
+ "type": "AES",
57
+ "key": ""
58
+ },
59
+ "external_name": "client_secret"
60
+ },
61
+ "scope": {
62
+ "type": "string",
63
+ "description": "scope",
64
+ "parse": false,
65
+ "encode": false,
66
+ "encrypt": {
67
+ "type": "AES",
68
+ "key": ""
69
+ },
70
+ "external_name": "scope"
71
+ },
72
+ "grant_type": {
73
+ "type": "string",
74
+ "description": "grant type to log in with",
75
+ "parse": false,
76
+ "encode": false,
77
+ "encrypt": {
78
+ "type": "AES",
79
+ "key": ""
80
+ },
81
+ "external_name": "grant_type"
82
+ },
39
83
  "token": {
40
84
  "type": "string",
41
85
  "description": "token returned by system",
@@ -46,7 +46,7 @@
46
46
  "type": "AES",
47
47
  "key": ""
48
48
  },
49
- "external_name": "token"
49
+ "external_name": "access_token"
50
50
  }
51
51
  },
52
52
  "definitions": {}
package/metadata.json CHANGED
@@ -42,20 +42,41 @@
42
42
  "isDeprecated": false
43
43
  },
44
44
  "brokerSince": "",
45
+ "authMethods": [
46
+ {
47
+ "type": "OAuth",
48
+ "primary": true
49
+ },
50
+ {
51
+ "type": "Basic Auth",
52
+ "primary": false
53
+ }
54
+ ],
45
55
  "documentation": {
46
56
  "storeLink": "",
47
57
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-oracle_cloud",
48
- "repoLink": "https://gitlab.com/itentialopensource/adapters/cloud/adapter-oracle_cloud",
58
+ "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-oracle_cloud",
49
59
  "docLink": "https://docs.itential.com/opensource/docs/oracle-cloud",
50
60
  "demoLinks": [],
51
- "trainingLinks": [],
61
+ "trainingLinks": [
62
+ {
63
+ "title": "Itential Academy",
64
+ "link": "https://www.itential.com/itential-academy/"
65
+ }
66
+ ],
52
67
  "faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
53
68
  "contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
54
69
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
55
70
  "webLink": "",
56
71
  "vendorLink": "https://www.oracle.com/",
57
- "productLink": "",
58
- "apiLinks": []
72
+ "productLink": "https://www.oracle.com/cloud/",
73
+ "apiLinks": [
74
+ {
75
+ "link": "https://docs.oracle.com/en/cloud/paas/content-cloud/rest-api-documents/rest-endpoints.html",
76
+ "title": "Oracle Cloud Content Management REST API",
77
+ "public": true
78
+ }
79
+ ]
59
80
  },
60
81
  "assets": [],
61
82
  "relatedItems": {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-oracle_cloud",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "This adapter integrates with system described as: restApiForDocuments.",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
7
- "engineVersion": "1.67.12",
7
+ "engineVersion": "1.67.20",
8
8
  "adapterType": "http",
9
9
  "scripts": {
10
10
  "artifactize": "npm i && node utils/packModificationScript.js",
@@ -15,7 +15,6 @@
15
15
  "test:baseunit": "mocha test/unit/adapterBaseTestUnit.js --LOG=error",
16
16
  "test:unit": "mocha test/unit/adapterTestUnit.js --LOG=error",
17
17
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
18
- "test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
19
18
  "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
20
19
  "adapter:install": "npm i && node utils/tbScript.js install",
21
20
  "adapter:checkMigrate": "node utils/checkMigrate.js",
@@ -43,20 +42,20 @@
43
42
  ],
44
43
  "license": "Apache-2.0",
45
44
  "engines": {
46
- "node": ">= 8.0.0",
45
+ "node": ">= 14.0.0",
47
46
  "npm": ">= 6.0.0"
48
47
  },
49
48
  "repository": {
50
49
  "type": "git",
51
- "url": "git@gitlab.com:itentialopensource/adapters/cloud/adapter-oracle_cloud.git"
50
+ "url": "git@gitlab.com:itentialopensource/adapters/adapter-oracle_cloud.git"
52
51
  },
53
52
  "author": "Itential",
54
- "homepage": "https://gitlab.com/itentialopensource/adapters/cloud/adapter-oracle_cloud#readme",
53
+ "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-oracle_cloud#readme",
55
54
  "dependencies": {
56
- "@itentialopensource/adapter-utils": "^5.3.8",
55
+ "@itentialopensource/adapter-utils": "^5.5.0",
57
56
  "acorn": "^8.10.0",
58
57
  "ajv": "^8.12.0",
59
- "axios": "^1.6.7",
58
+ "axios": "^1.6.8",
60
59
  "commander": "^11.0.0",
61
60
  "dns-lookup-promise": "^1.0.4",
62
61
  "fs-extra": "^11.1.1",
@@ -64,7 +63,6 @@
64
63
  "mocha": "^10.3.0",
65
64
  "mocha-param": "^2.0.1",
66
65
  "mongodb": "^4.16.0",
67
- "nyc": "^15.1.0",
68
66
  "ping": "^0.4.4",
69
67
  "prompts": "^2.4.2",
70
68
  "readline-sync": "^1.4.10",
@@ -945,6 +945,11 @@
945
945
  "devicebroker": {
946
946
  "type": "object",
947
947
  "properties": {
948
+ "enabled": {
949
+ "type": "boolean",
950
+ "description": "Whether or not the device broker calls have been mapped",
951
+ "default": false
952
+ },
948
953
  "getDevice": {
949
954
  "type": "array",
950
955
  "description": "Broker call(s) to getDevice",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.2.0",
3
- "configLines": 12789,
2
+ "version": "0.3.3",
3
+ "configLines": 12794,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 12805,
6
- "testLines": 10701,
6
+ "testLines": 10700,
7
7
  "testCases": 535,
8
- "totalCodeLines": 25289,
8
+ "totalCodeLines": 25288,
9
9
  "wfTasks": 140
10
10
  }