@itentialopensource/adapter-zero_networks 0.1.2 → 0.2.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 (60) hide show
  1. package/.eslintignore +0 -1
  2. package/.jshintrc +3 -0
  3. package/AUTH.md +14 -18
  4. package/BROKER.md +31 -19
  5. package/CALLS.md +1175 -23
  6. package/CHANGELOG.md +8 -0
  7. package/PROPERTIES.md +5 -0
  8. package/README.md +60 -63
  9. package/SYSTEMINFO.md +14 -6
  10. package/TAB1.md +8 -0
  11. package/TAB2.md +83 -6564
  12. package/adapter.js +16661 -39
  13. package/entities/Asset/action.json +872 -0
  14. package/entities/Asset/schema.json +43 -1
  15. package/entities/AssetOTIoT/action.json +851 -0
  16. package/entities/AssetOTIoT/schema.json +42 -1
  17. package/entities/Assets/action.json +83 -0
  18. package/entities/Assets/schema.json +5 -1
  19. package/entities/Download/action.json +88 -0
  20. package/entities/Download/schema.json +22 -0
  21. package/entities/Group/action.json +518 -0
  22. package/entities/Group/schema.json +26 -1
  23. package/entities/Groups/action.json +354 -0
  24. package/entities/Groups/schema.json +18 -1
  25. package/entities/GroupsCustom/action.json +20 -0
  26. package/entities/GroupsCustom/schema.json +2 -1
  27. package/entities/GroupsTag/action.json +45 -0
  28. package/entities/GroupsTag/schema.json +20 -0
  29. package/entities/MFAIdentity/action.json +295 -0
  30. package/entities/MFAIdentity/schema.json +32 -0
  31. package/entities/MFAInbound/action.json +21 -0
  32. package/entities/MFAInbound/schema.json +2 -1
  33. package/entities/MFAOutbound/action.json +21 -0
  34. package/entities/MFAOutbound/schema.json +2 -1
  35. package/entities/Rules/action.json +40 -0
  36. package/entities/Rules/schema.json +3 -1
  37. package/entities/RulesInbound/action.json +293 -0
  38. package/entities/RulesInbound/schema.json +32 -0
  39. package/entities/RulesOutboundAllow/action.json +21 -0
  40. package/entities/RulesOutboundAllow/schema.json +2 -1
  41. package/entities/SettingsInactiveAssets/action.json +45 -0
  42. package/entities/SettingsInactiveAssets/schema.json +20 -0
  43. package/entities/SettingsLicenses/action.json +25 -0
  44. package/entities/SettingsLicenses/schema.json +19 -0
  45. package/entities/User/action.json +291 -0
  46. package/entities/User/schema.json +15 -1
  47. package/entities/Users/action.json +21 -0
  48. package/entities/Users/schema.json +2 -1
  49. package/metadata.json +14 -3
  50. package/package.json +5 -7
  51. package/pronghorn.json +12801 -490
  52. package/propertiesSchema.json +133 -36
  53. package/refs?service=git-upload-pack +0 -0
  54. package/report/adapter-openapi.json +115977 -0
  55. package/report/adapterInfo.json +7 -7
  56. package/report/updateReport1715609939167.json +120 -0
  57. package/sampleProperties.json +43 -31
  58. package/test/integration/adapterTestIntegration.js +4700 -0
  59. package/test/unit/adapterTestUnit.js +8580 -3
  60. package/utils/artifactize.js +0 -0
package/.eslintignore CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  .nyc_output/*
3
2
  backup/*
4
3
  coverage/*
package/.jshintrc CHANGED
@@ -0,0 +1,3 @@
1
+ {
2
+ "esversion": 6
3
+ }
package/AUTH.md CHANGED
@@ -1,39 +1,35 @@
1
- ## Authenticating Zero_networks Adapter
1
+ ## Authenticating Zero Networks Adapter
2
2
 
3
- This document will go through the steps for authenticating the Zero_networks adapter with 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>.
3
+ This document will go through the steps for authenticating the Zero Networks adapter with API Key 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>.
4
4
 
5
- ### Basic Authentication
6
- The Zero_networks adapter requires Basic Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
5
+ Companies periodically change authentication methods to provide better security. As this happens this section should be updated and contributed/merge back into the adapter repository.
6
+
7
+ ### API Key Authentication
8
+ The Zero Networks adapter authenticates using an API Key.
7
9
 
8
10
  STEPS
9
- 1. Ensure you have access to a Zero_networks server and that it is running
11
+ 1. Ensure you have access to a Zero Networks server and that it is running
10
12
  2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
11
13
  3. Use the properties below for the ```properties.authentication``` field
12
14
  ```json
13
15
  "authentication": {
14
- "auth_method": "basic user_password",
15
- "username": "<username>",
16
- "password": "<password>",
17
- "token": "",
18
- "token_timeout": 1800000,
19
- "token_cache": "local",
20
- "invalid_token_error": 401,
16
+ "auth_method": "static_token",
17
+ "token": "<your_token>",
21
18
  "auth_field": "header.headers.Authorization",
22
- "auth_field_format": "Basic {b64}{username}:{password}{/b64}",
23
- "auth_logging": false,
24
- "client_id": "",
25
- "client_secret": "",
26
- "grant_type": ""
19
+ "auth_field_format": "{token}",
20
+ "auth_logging": false
27
21
  }
28
22
  ```
23
+ you can leave all of the other properties in the authentication section, they will not be used when the auth_method is static_token.
29
24
  4. Restart the adapter. If your properties were set correctly, the adapter should go online.
30
25
 
31
26
  ### Troubleshooting
32
- - Make sure you copied over the correct username and password.
27
+ - Make sure you copied over the correct token.
33
28
  - Turn on debug level logs for the adapter in IAP Admin Essentials.
34
29
  - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
35
30
  - Investigate the logs - in particular:
36
31
  - The FULL REQUEST log to make sure the proper headers are being sent with the request.
37
32
  - The FULL BODY log to make sure the payload is accurate.
38
33
  - The CALL RETURN log to see what the other system is telling us.
34
+ - Credentials should be ** masked ** by the adapter so make sure you verify token
39
35
  - Remember when you are done to turn auth_logging off as you do not want to log credentials.
package/BROKER.md CHANGED
@@ -22,18 +22,25 @@ Below is an example of how you may set up the properties for this call.
22
22
  {
23
23
  "path": "/{org}/get/devices",
24
24
  "method": "GET",
25
+ "pagination": {
26
+ "offsetVar": "",
27
+ "limitVar": "",
28
+ "incrementBy": "limit",
29
+ "requestLocation": "query"
30
+ },
25
31
  "query": {},
26
32
  "body": {},
27
33
  "headers": {},
28
34
  "handleFailure": "ignore",
35
+ "responseDataKey": "",
29
36
  "requestFields": {
30
37
  "org": "555"
31
38
  },
32
39
  "responseFields": {
33
- "name": "host",
34
- "ostype": "os",
40
+ "name": "{hostField}",
41
+ "ostype": "{osField}",
35
42
  "ostypePrefix": "system-",
36
- "ipaddress": "attributes.ipaddr",
43
+ "ipaddress": "{attributes.ipaddr}",
37
44
  "port": "443"
38
45
  }
39
46
  },
@@ -44,16 +51,17 @@ Below is an example of how you may set up the properties for this call.
44
51
  "body": {},
45
52
  "headers": {},
46
53
  "handleFailure": "ignore",
54
+ "responseDataKey": "",
47
55
  "requestFields": {
48
56
  "org": "777"
49
57
  },
50
58
  "responseFields": {
51
- "name": "host",
52
- "ostype": "os",
59
+ "name": "{hostField}",
60
+ "ostype": "{osField}",
53
61
  "ostypePrefix": "system-",
54
- "ipaddress": "attributes.ipaddr",
62
+ "ipaddress": "{attributes.ipaddr}",
55
63
  "port": "443",
56
- "myorg": "org"
64
+ "myorg": "{orgField}"
57
65
  }
58
66
  }
59
67
  ]
@@ -88,12 +96,13 @@ Below is an example of how you may set up the properties for this call.
88
96
  "headers": {},
89
97
  "handleFailure": "ignore",
90
98
  "statusValue": "online",
99
+ "responseDataKey": "",
91
100
  "requestFields": {
92
- "org": "myorg",
93
- "id": "name"
101
+ "org": "{myorg}",
102
+ "id": "{name}"
94
103
  },
95
104
  "responseFields": {
96
- "status": "status"
105
+ "status": "{status}"
97
106
  }
98
107
  }
99
108
  ]
@@ -129,9 +138,10 @@ Below is an example of how you may set up the properties for this call.
129
138
  "body": {},
130
139
  "headers": {},
131
140
  "handleFailure": "ignore",
141
+ "responseDataKey": "",
132
142
  "requestFields": {
133
- "org": "myorg",
134
- "id": "name"
143
+ "org": "{myorg}",
144
+ "id": "{name}"
135
145
  }
136
146
  "responseFields": {}
137
147
  },
@@ -142,8 +152,9 @@ Below is an example of how you may set up the properties for this call.
142
152
  "body": {},
143
153
  "headers": {},
144
154
  "handleFailure": "ignore",
155
+ "responseDataKey": "",
145
156
  "requestFields": {
146
- "org": "myorg"
157
+ "org": "{myorg}"
147
158
  }
148
159
  "responseFields": {}
149
160
  }
@@ -178,17 +189,18 @@ Below is an example of how you may set up the properties for this call.
178
189
  "body": {},
179
190
  "headers": {},
180
191
  "handleFailure": "ignore",
192
+ "responseDataKey": "",
181
193
  "requestFields": {
182
- "org": "myorg",
183
- "id": "name"
194
+ "org": "{myorg}",
195
+ "id": "{name}"
184
196
  },
185
197
  "responseFields": {
186
- "name": "host",
187
- "ostype": "os",
198
+ "name": "{hostField}",
199
+ "ostype": "{osField}",
188
200
  "ostypePrefix": "system-",
189
- "ipaddress": "attributes.ipaddr",
201
+ "ipaddress": "{attributes.ipaddr}",
190
202
  "port": "443",
191
- "myorg": "org"
203
+ "myorg": "{orgField}"
192
204
  }
193
205
  }
194
206
  ]