@itentialopensource/adapter-microsoft_graph 1.4.7 → 1.5.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/.eslintrc.js +1 -0
- package/AUTH.md +4 -4
- package/BROKER.md +4 -4
- package/CALLS.md +9 -9
- package/ENHANCE.md +3 -3
- package/PROPERTIES.md +24 -9
- package/README.md +24 -23
- package/SUMMARY.md +2 -2
- package/SYSTEMINFO.md +1 -1
- package/TAB1.md +2 -2
- package/TAB2.md +17 -11
- package/TROUBLESHOOT.md +10 -1
- package/UTILITIES.md +473 -0
- package/adapter.js +5 -5
- package/adapterBase.js +52 -16
- package/package.json +24 -28
- package/pronghorn.json +15 -13
- package/propertiesSchema.json +68 -7
- package/report/adapterInfo.json +7 -7
- package/report/auto-adapter-openapi.json +8063 -0
- package/report/updateReport1748551976792.json +120 -0
- package/sampleProperties.json +4 -0
- package/test/integration/adapterTestBasicGet.js +88 -54
- package/test/integration/adapterTestConnectivity.js +15 -16
- package/test/integration/adapterTestIntegration.js +1 -38
- package/test/unit/adapterBaseTestUnit.js +641 -39
- package/test/unit/adapterTestUnit.js +17 -54
- package/utils/adapterInfo.js +114 -164
- package/utils/argParser.js +44 -0
- package/utils/checkMigrate.js +77 -38
- package/utils/entitiesToDB.js +53 -42
- package/utils/logger.js +26 -0
- package/utils/modify.js +56 -55
- package/utils/mongoDbConnection.js +79 -0
- package/utils/mongoUtils.js +162 -0
- package/utils/taskMover.js +31 -32
- package/utils/tbScript.js +36 -172
- package/utils/tbUtils.js +84 -226
- package/utils/troubleshootingAdapter.js +68 -84
- package/utils/updateAdapterConfig.js +158 -0
- package/utils/addAuth.js +0 -94
- package/utils/artifactize.js +0 -146
- package/utils/basicGet.js +0 -50
- package/utils/packModificationScript.js +0 -35
- package/utils/patches2bundledDeps.js +0 -90
package/.eslintrc.js
CHANGED
package/AUTH.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Authenticating Microsoft Graph Adapter
|
2
2
|
|
3
|
-
This document will go through the steps for authenticating the Microsoft Graph adapter with OAuth Authentication. Properly configuring the properties for an adapter in
|
3
|
+
This document will go through the steps for authenticating the Microsoft Graph adapter with OAuth Authentication. Properly configuring the properties for an adapter in Itential Platform 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
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
6
|
|
@@ -11,7 +11,7 @@ You will need to register an application with the <a href="https://learn.microso
|
|
11
11
|
|
12
12
|
STEPS
|
13
13
|
1. Ensure you have access to a Microsoft Graph server and that it is running
|
14
|
-
2. Follow the steps in the README.md to import the adapter into
|
14
|
+
2. Follow the steps in the README.md to import the adapter into Itential Platform if you have not already done so
|
15
15
|
3. Use the properties below for the ```properties.authentication``` field. Note that the token_URI_path has a variable which should be replaced with a valid tenant value
|
16
16
|
```json
|
17
17
|
"authentication": {
|
@@ -47,8 +47,8 @@ STEPS
|
|
47
47
|
|
48
48
|
### Troubleshooting
|
49
49
|
- Make sure you copied over the correct client_id and client_secret.
|
50
|
-
- Turn on debug level logs for the adapter in
|
51
|
-
- Turn on auth_logging for the adapter in
|
50
|
+
- Turn on debug level logs for the adapter in Itential Platform Admin Essentials.
|
51
|
+
- Turn on auth_logging for the adapter in Itential Platform Admin Essentials (adapter properties).
|
52
52
|
- Investigate the logs - in particular:
|
53
53
|
- The FULL REQUEST log to make sure the proper headers are being sent with the request.
|
54
54
|
- The FULL BODY log to make sure the payload is accurate.
|
package/BROKER.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
## Integrating Microsoft_graph Adapter with
|
1
|
+
## Integrating Microsoft_graph Adapter with Itential Platform Device Broker
|
2
2
|
|
3
|
-
This document will go through the steps for integrating the Microsoft_graph adapter with
|
3
|
+
This document will go through the steps for integrating the Microsoft_graph adapter with Itential Platform's Device Broker. Itential Platform Device Broker integration allows for easier interation into several of Itential Platform's applications (e.g. Configuration Manager). Properly configuring the properties for the adapter in Itential Platform is critical for getting the device broker integration to work. Their is additional information in the configuration section of the adapter readme. This document will go through each of the calls that are utilized by the Device Broker.
|
4
4
|
|
5
5
|
### getDevicesFiltered
|
6
6
|
getDevicesFiltered(options, callback) → This call returns all of the devices within Microsoft_graph that match the provided filter.
|
@@ -13,7 +13,7 @@ options {object}: defines the options for the search. At current filter is the m
|
|
13
13
|
|
14
14
|
An Object containing the total number of matching devices and a list containing an array of the details for each device. For example, { total: 2, list: [ { name: ‘abc’, ostype: ‘type’, port: 80, ipaddress: ‘10.10.10.10’ }, { name: ‘def’, ostype: ‘type2’, port: 443, ipaddress: ‘10.10.10.15’ }] }
|
15
15
|
|
16
|
-
The fields name and ostype are required by the broker and should be mapped through properties to data from the other system. In addition, ipaddress and port should also be mapped as it is utilized by some north bound
|
16
|
+
The fields name and ostype are required by the broker and should be mapped through properties to data from the other system. In addition, ipaddress and port should also be mapped as it is utilized by some north bound Itential Platform applications (e.g. Config Manager). There are other fields that can be set as well but consider these the minimal fields.
|
17
17
|
|
18
18
|
Below is an example of how you may set up the properties for this call.
|
19
19
|
|
@@ -69,7 +69,7 @@ Below is an example of how you may set up the properties for this call.
|
|
69
69
|
|
70
70
|
Notice with the path, there is a variable in it ({org}). This variable must be provided in the data available to the call. For getDevicesFiltered this means the requestFields as a static value. In other calls, it may also come from the result of the getDevicesFiltered call.
|
71
71
|
|
72
|
-
Notice with the responseFields, it wants the
|
72
|
+
Notice with the responseFields, it wants the Itential Platform data key as the key and where it is supposed to find the data in the response as the value. You can use nested fields in the response object using standard object notation. You can also add static data as shown in the port field. Finally, you can append data to the response from the requestInformation using its key (e.g. org). The ostypePrefix is a special field that allows you to add static data to the ostype to help define the system you are getting the device from.
|
73
73
|
|
74
74
|
Notice here that you can also have multiple calls that make up the results provided to the Device Broker. In this example we are making calls to two different organizations and returning the results from both.
|
75
75
|
|
package/CALLS.md
CHANGED
@@ -4,7 +4,7 @@ The `adapter.js` file contains the calls the adapter makes available to the rest
|
|
4
4
|
|
5
5
|
### Generic Adapter Calls
|
6
6
|
|
7
|
-
These are adapter methods that
|
7
|
+
These are adapter methods that Itential Platform or you might use. There are some other methods not shown here that might be used for internal adapter functionality.
|
8
8
|
|
9
9
|
<table border="1" class="bordered-table">
|
10
10
|
<tr>
|
@@ -14,7 +14,7 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
14
14
|
</tr>
|
15
15
|
<tr>
|
16
16
|
<td style="padding:15px">connect()</td>
|
17
|
-
<td style="padding:15px">This call is run when the Adapter is first loaded by
|
17
|
+
<td style="padding:15px">This call is run when the Adapter is first loaded by the Itential Platform. It validates the properties have been provided correctly.</td>
|
18
18
|
<td style="padding:15px">No</td>
|
19
19
|
</tr>
|
20
20
|
<tr>
|
@@ -34,7 +34,7 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
34
34
|
</tr>
|
35
35
|
<tr>
|
36
36
|
<td style="padding:15px">iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, callback)</td>
|
37
|
-
<td style="padding:15px">This call provides the ability to update the adapter configuration from
|
37
|
+
<td style="padding:15px">This call provides the ability to update the adapter configuration from Itential Platform - includes actions, schema, mockdata and other configurations.</td>
|
38
38
|
<td style="padding:15px">Yes</td>
|
39
39
|
</tr>
|
40
40
|
<tr>
|
@@ -58,7 +58,7 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
58
58
|
<td style="padding:15px">Yes</td>
|
59
59
|
</tr>
|
60
60
|
<tr>
|
61
|
-
<td style="padding:15px">iapTroubleshootAdapter(props,
|
61
|
+
<td style="padding:15px">iapTroubleshootAdapter(props, adapter, callback)</td>
|
62
62
|
<td style="padding:15px">This call can be used to check on the performance of the adapter - it checks connectivity, healthcheck and basic get calls.</td>
|
63
63
|
<td style="padding:15px">Yes</td>
|
64
64
|
</tr>
|
@@ -73,13 +73,13 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
73
73
|
<td style="padding:15px">Yes</td>
|
74
74
|
</tr>
|
75
75
|
<tr>
|
76
|
-
<td style="padding:15px">iapRunAdapterBasicGet(callback)</td>
|
77
|
-
<td style="padding:15px">This call will return the results of running basic get API calls.</td>
|
76
|
+
<td style="padding:15px">iapRunAdapterBasicGet(maxCalls, callback)</td>
|
77
|
+
<td style="padding:15px">This call will return the results of running basic get API calls. By default 5 get calls without parameters will be run. You can ask for more or less by setting maxCalls.</td>
|
78
78
|
<td style="padding:15px">Yes</td>
|
79
79
|
</tr>
|
80
80
|
<tr>
|
81
81
|
<td style="padding:15px">iapMoveAdapterEntitiesToDB(callback)</td>
|
82
|
-
<td style="padding:15px">This call will push the adapter configuration from the entities directory into the Adapter or
|
82
|
+
<td style="padding:15px">This call will push the adapter configuration from the entities directory into the Adapter or Itential Platform Database.</td>
|
83
83
|
<td style="padding:15px">Yes</td>
|
84
84
|
</tr>
|
85
85
|
<tr>
|
@@ -150,7 +150,7 @@ These are adapter methods that are used for adapter caching. If configured, the
|
|
150
150
|
|
151
151
|
### Adapter Broker Calls
|
152
152
|
|
153
|
-
These are adapter methods that are used to integrate to
|
153
|
+
These are adapter methods that are used to integrate to Itential Platform Brokers. This adapter currently supports the following broker calls.
|
154
154
|
|
155
155
|
<table border="1" class="bordered-table">
|
156
156
|
<tr>
|
@@ -160,7 +160,7 @@ These are adapter methods that are used to integrate to IAP Brokers. This adapte
|
|
160
160
|
</tr>
|
161
161
|
<tr>
|
162
162
|
<td style="padding:15px">hasEntities(entityType, entityList, callback)</td>
|
163
|
-
<td style="padding:15px">This call is utilized by the
|
163
|
+
<td style="padding:15px">This call is utilized by the Itential Platform Device Broker to determine if the adapter has a specific entity and item of the entity.</td>
|
164
164
|
<td style="padding:15px">No</td>
|
165
165
|
</tr>
|
166
166
|
<tr>
|
package/ENHANCE.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
### Adding a Second Instance of an Adapter
|
4
4
|
|
5
|
-
You can add a second instance of this adapter without adding new code on the file system. To do this go into the
|
5
|
+
You can add a second instance of this adapter without adding new code on the file system. To do this go into the Itential Platform Admin Essentials and add a new service config for this adapter. The two instances of the adapter should have unique ids. In addition, they should point to different instances (unique host and port) of the other system.
|
6
6
|
|
7
7
|
### Adding Adapter Calls
|
8
8
|
|
@@ -18,7 +18,7 @@ npm run adapter:update
|
|
18
18
|
|
19
19
|
If you do not have a Swagger or OpenAPI document, you can use a Postman Collection and convert that to an OpenAPI document using APIMatic and then follow the first process.
|
20
20
|
|
21
|
-
If you want to manually update the adapter that can also be done the key thing is to make sure you update all of the right files. Within the entities directory you will find 1 or more entities. You can create a new entity or add to an existing entity. Each entity has an action.json file, any new call will need to be put in the action.json file. It will also need to be added to the enum for the ph_request_type in the appropriate schema files. Once this configuration is complete you will need to add the call to the adapter.js file and, in order to make it available as a workflow task in
|
21
|
+
If you want to manually update the adapter that can also be done the key thing is to make sure you update all of the right files. Within the entities directory you will find 1 or more entities. You can create a new entity or add to an existing entity. Each entity has an action.json file, any new call will need to be put in the action.json file. It will also need to be added to the enum for the ph_request_type in the appropriate schema files. Once this configuration is complete you will need to add the call to the adapter.js file and, in order to make it available as a workflow task in Itential Platform, it should also be added to the pronghorn.json file. You can optionally add it to the unit and integration test files. There is more information on how to work on each of these files in the <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a> on our Documentation Site.
|
22
22
|
|
23
23
|
```text
|
24
24
|
Files to update
|
@@ -32,7 +32,7 @@ Files to update
|
|
32
32
|
|
33
33
|
### Adding Adapter Properties
|
34
34
|
|
35
|
-
While changing adapter properties is done in the service instance configuration section of
|
35
|
+
While changing adapter properties is done in the service instance configuration section of Itential Platform, adding properties has to be done in the adapter. To add a property you should edit the propertiesSchema.json with the proper information for the property. In addition, you should modify the sampleProperties to have the new property in it.
|
36
36
|
|
37
37
|
```text
|
38
38
|
Files to update
|
package/PROPERTIES.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Configuration
|
2
2
|
|
3
|
-
This section defines **all** the properties that are available for the adapter, including detailed information on what each property is for. If you are not using certain capabilities with this adapter, you do not need to define all of the properties. An example of how the properties for this adapter can be used with tests or
|
3
|
+
This section defines **all** the properties that are available for the adapter, including detailed information on what each property is for. If you are not using certain capabilities with this adapter, you do not need to define all of the properties. An example of how the properties for this adapter can be used with tests or Itential Platform are provided in the sampleProperties.
|
4
4
|
|
5
5
|
```json
|
6
6
|
{
|
@@ -82,12 +82,15 @@ This section defines **all** the properties that are available for the adapter,
|
|
82
82
|
"password": "",
|
83
83
|
},
|
84
84
|
"mongo": {
|
85
|
+
"url": "",
|
85
86
|
"host": "",
|
86
87
|
"port": 0,
|
87
88
|
"database": "",
|
89
|
+
"dbAuth": false,
|
88
90
|
"username": "",
|
89
91
|
"password": "",
|
90
92
|
"replSet": "",
|
93
|
+
"addSrv": false,
|
91
94
|
"db_ssl": {
|
92
95
|
"enabled": false,
|
93
96
|
"accept_invalid_cert": false,
|
@@ -215,7 +218,7 @@ These base properties are used to connect to Microsoft_graph upon the adapter in
|
|
215
218
|
</table>
|
216
219
|
<br>
|
217
220
|
|
218
|
-
A connectivity check tells
|
221
|
+
A connectivity check tells Itential Platform the adapter has loaded successfully.
|
219
222
|
|
220
223
|
### Authentication Properties
|
221
224
|
|
@@ -343,7 +346,7 @@ The request section defines properties to help handle requests.
|
|
343
346
|
</tr>
|
344
347
|
<tr>
|
345
348
|
<td style="padding:15px">failover_codes</td>
|
346
|
-
<td style="padding:15px">An array of error codes for which the adapter will send back a failover flag to
|
349
|
+
<td style="padding:15px">An array of error codes for which the adapter will send back a failover flag to Itential Platform so that the Platform can attempt the action in another adapter.</td>
|
347
350
|
</tr>
|
348
351
|
<tr>
|
349
352
|
<td style="padding:15px">attempt_timeout</td>
|
@@ -375,7 +378,7 @@ The request section defines properties to help handle requests.
|
|
375
378
|
</tr>
|
376
379
|
<tr>
|
377
380
|
<td style="padding:15px">return_raw</td>
|
378
|
-
<td style="padding:15px">Optional. Tells the adapter whether the raw response should be returned as well as the
|
381
|
+
<td style="padding:15px">Optional. Tells the adapter whether the raw response should be returned as well as the Itential Platform response. This is helpful when running integration tests to save mock data. It does add overhead to the response object so it is not ideal from production.</td>
|
379
382
|
</tr>
|
380
383
|
<tr>
|
381
384
|
<td style="padding:15px">archiving</td>
|
@@ -521,29 +524,41 @@ The mongo section defines the properties used to connect to a Mongo database. Mo
|
|
521
524
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
|
522
525
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
523
526
|
</tr>
|
527
|
+
<tr>
|
528
|
+
<td style="padding:15px">url</td>
|
529
|
+
<td style="padding:15px">Optional. Mongo's complete connection URL. This property overrides host, port, database, username, password and replSet settings.</td>
|
530
|
+
</tr>
|
524
531
|
<tr>
|
525
532
|
<td style="padding:15px">host</td>
|
526
|
-
<td style="padding:15px">Optional. Host information for the
|
533
|
+
<td style="padding:15px">Optional. Host information for the Mongo server.</td>
|
527
534
|
</tr>
|
528
535
|
<tr>
|
529
536
|
<td style="padding:15px">port</td>
|
530
|
-
<td style="padding:15px">Optional. Port information for the
|
537
|
+
<td style="padding:15px">Optional. Port information for the Mongo server.</td>
|
531
538
|
</tr>
|
532
539
|
<tr>
|
533
540
|
<td style="padding:15px">database</td>
|
534
541
|
<td style="padding:15px">Optional. The database for the adapter to use for its data.</td>
|
535
542
|
</tr>
|
543
|
+
<tr>
|
544
|
+
<td style="padding:15px">dbAuth</td>
|
545
|
+
<td style="padding:15px">Optional. Whether to use authentication for MongoDB connection. Default is false.</td>
|
546
|
+
</tr>
|
536
547
|
<tr>
|
537
548
|
<td style="padding:15px">username</td>
|
538
|
-
<td style="padding:15px">Optional. If credentials are required to access
|
549
|
+
<td style="padding:15px">Optional. If credentials are required to access Mongo, this is the user to login as.</td>
|
539
550
|
</tr>
|
540
551
|
<tr>
|
541
552
|
<td style="padding:15px">password</td>
|
542
|
-
<td style="padding:15px">Optional. If credentials are required to access
|
553
|
+
<td style="padding:15px">Optional. If credentials are required to access Mongo, this is the password to login with.</td>
|
543
554
|
</tr>
|
544
555
|
<tr>
|
545
556
|
<td style="padding:15px">replSet</td>
|
546
|
-
<td style="padding:15px">Optional. If the database is set up to use replica sets, define it here so it can be added to the database connection
|
557
|
+
<td style="padding:15px">Optional. If the database is set up to use replica sets, define it here so it can be added to the database connection. Not used when using mongodb+srv:// protocol</td>
|
558
|
+
</tr>
|
559
|
+
<tr>
|
560
|
+
<td style="padding:15px">addSrv</td>
|
561
|
+
<td style="padding:15px">Optional. Whether the connection requires the mongodb+srv:// protocol. If true, uses mongodb+srv:// protocol. Note: mongodb+srv:// can also be used for non-Atlas deployments that support DNS SRV records</td>
|
547
562
|
</tr>
|
548
563
|
<tr>
|
549
564
|
<td style="padding:15px">db_ssl</td>
|
package/README.md
CHANGED
@@ -12,13 +12,14 @@ Some of the page links in this document and links to other GitLab files do not w
|
|
12
12
|
- [Generic Adapter Information](#generic-adapter-information)
|
13
13
|
- [Overview](./SUMMARY.md)
|
14
14
|
- [Versioning](#versioning)
|
15
|
-
- [Supported
|
15
|
+
- [Supported Platform Versions](#supported-platform-versions)
|
16
16
|
- [Getting Started](#getting-started)
|
17
17
|
- [Helpful Background Information](#helpful-background-information)
|
18
18
|
- [Prerequisites](#prerequisites)
|
19
19
|
- [How to Install](#how-to-install)
|
20
20
|
- [Testing](#testing)
|
21
21
|
- [Configuration](./PROPERTIES.md)
|
22
|
+
- [Utilities](./UTILITIES.md)
|
22
23
|
- [Additional Information](#additional-information)
|
23
24
|
- [Enhancements](./ENHANCE.md)
|
24
25
|
- [Contributing](./CONTRIBUTING.md)
|
@@ -48,19 +49,19 @@ Some of the page links in this document and links to other GitLab files do not w
|
|
48
49
|
|
49
50
|
### Versioning
|
50
51
|
|
51
|
-
Itential Product and opensource adapters utilize SemVer for versioning. The current version of the adapter can be found in the `package.json` file or viewed in the
|
52
|
+
Itential Product and opensource adapters utilize SemVer for versioning. The current version of the adapter can be found in the `package.json` file or viewed in the Platform GUI on the System page. All Itential opensource adapters can be found in the <a href="https://gitlab.com/itentialopensource/adapters" target="_blank">Itential OpenSource Repository</a>.
|
52
53
|
|
53
54
|
Any release prior to 1.0.0 is a pre-release. Initial builds of adapters are generally set up as pre-releases as there is often work that needs to be done to configure the adapter and make sure the authentication process to Microsoft_graph works appropriately.
|
54
55
|
|
55
56
|
Release notes can be viewed in CHANGELOG.md.
|
56
57
|
|
57
|
-
### Supported
|
58
|
+
### Supported Platform Versions
|
58
59
|
|
59
|
-
Itential Product adapters are built for particular versions of
|
60
|
+
Itential Product adapters are built for particular versions of Platform and packaged with the versions they work with.
|
60
61
|
|
61
|
-
Itential opensource adapter as well as custom adapters built with the Itential Adapter Builder work acoss many releases of
|
62
|
+
Itential opensource adapter as well as custom adapters built with the Itential Adapter Builder work acoss many releases of Platform. As a result, it is not often necessary to modify an adapter when upgrading Platform. If Platform has changes that impact the pronghorn.json, like adding a new required section, this will most likely require changes to all adapters when upgrading Platform.
|
62
63
|
|
63
|
-
Many of the scripts that come with all adapters built using the Itential Adapter Builder do have some dependencies on
|
64
|
+
Many of the scripts that come with all adapters built using the Itential Adapter Builder do have some dependencies on Platform or the Platform database schema and so it is possible these scripts could stop working in different versions of Platform. If you notify Itential of any issues, the Adapter Team will attempt to fix the scripts for newer releases of Platform.
|
64
65
|
|
65
66
|
### Getting Started
|
66
67
|
|
@@ -72,7 +73,7 @@ There is <a href="https://docs.itential.com/opensource/docs/adapters" target="_b
|
|
72
73
|
|
73
74
|
```text
|
74
75
|
Authentication
|
75
|
-
|
76
|
+
Platform Service Instance Configuration
|
76
77
|
Code Files
|
77
78
|
Endpoint Configuration (Action & Schema)
|
78
79
|
Mock Data
|
@@ -120,10 +121,6 @@ The following list of packages are required for Itential opensource adapters or
|
|
120
121
|
<td style="padding:15px">commander</td>
|
121
122
|
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
122
123
|
</tr>
|
123
|
-
<tr>
|
124
|
-
<td style="padding:15px">dns-lookup-promise</td>
|
125
|
-
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
126
|
-
</tr>
|
127
124
|
<tr>
|
128
125
|
<td style="padding:15px">fs-extra</td>
|
129
126
|
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
@@ -176,18 +173,24 @@ testdouble
|
|
176
173
|
|
177
174
|
#### How to Install
|
178
175
|
|
179
|
-
|
176
|
+
1a. If you are working on Itential Platform 2023.2 or earlier versions, set up the name space location in your Itential Platform node_modules.
|
180
177
|
|
181
178
|
```bash
|
182
179
|
cd /opt/pronghorn/current/node_modules (* could be in a different place)
|
183
180
|
if the @itentialopensource directory does not exist, create it:
|
184
181
|
mkdir @itentialopensource
|
182
|
+
cd @itentialopensource
|
185
183
|
```
|
186
184
|
|
187
|
-
|
185
|
+
1b. If you are working on Platform 6, you need to install the adapter in the services directory.
|
186
|
+
|
187
|
+
```bash
|
188
|
+
cd /opt/itential/platform/services (* you may have configured it to be in a different place)
|
189
|
+
```
|
190
|
+
|
191
|
+
2. Clone/unzip/tar the adapter into your Platform environment.
|
188
192
|
|
189
193
|
```bash
|
190
|
-
cd @itentialopensource
|
191
194
|
git clone git@gitlab.com:@itentialopensource/adapters/adapter-microsoft_graph
|
192
195
|
or
|
193
196
|
unzip adapter-microsoft_graph.zip
|
@@ -195,7 +198,7 @@ or
|
|
195
198
|
tar -xvf adapter-microsoft_graph.tar
|
196
199
|
```
|
197
200
|
|
198
|
-
3.
|
201
|
+
3. install the adapter dependencies.
|
199
202
|
|
200
203
|
```bash
|
201
204
|
cd adapter-microsoft_graph
|
@@ -204,17 +207,17 @@ npm run lint:errors
|
|
204
207
|
npm run test
|
205
208
|
```
|
206
209
|
|
207
|
-
4. Restart
|
210
|
+
4. Restart Platform
|
208
211
|
|
209
212
|
```bash
|
210
213
|
systemctl restart pronghorn
|
211
214
|
```
|
212
215
|
|
213
|
-
5. Create an adapter service instance configuration in
|
216
|
+
5. Create an adapter service instance configuration in Platform Admin Essentials GUI
|
214
217
|
|
215
218
|
6. Copy the properties from the sampleProperties.json and paste them into the service instance configuration in the inner/second properties field.
|
216
219
|
|
217
|
-
7. Change the adapter service instance configuration (host, port, credentials, etc) in
|
220
|
+
7. Change the adapter service instance configuration (host, port, credentials, etc) in Platform Admin Essentials GUI
|
218
221
|
|
219
222
|
#### Testing
|
220
223
|
|
@@ -266,6 +269,8 @@ Test should also be written to clean up after themselves. However, it is importa
|
|
266
269
|
|
267
270
|
### [Configuration](./PROPERTIES.md)
|
268
271
|
|
272
|
+
### [Utilities](./UTILITIES.md)
|
273
|
+
|
269
274
|
### Additional Information
|
270
275
|
|
271
276
|
#### [Enhancements](./ENHANCE.md)
|
@@ -278,17 +283,13 @@ Test should also be written to clean up after themselves. However, it is importa
|
|
278
283
|
|
279
284
|
#### Node Scripts
|
280
285
|
|
281
|
-
There are several node scripts that now accompany the adapter. These scripts are provided to make several activities easier. Many of these scripts can have issues with different versions of
|
286
|
+
There are several node scripts that now accompany the adapter. These scripts are provided to make several activities easier. Many of these scripts can have issues with different versions of Platform as they have dependencies on Platform and Mongo. If you have issues with the scripts please report them to the Itential Adapter Team. Each of these scripts are described below.
|
282
287
|
|
283
288
|
<table border="1" class="bordered-table">
|
284
289
|
<tr>
|
285
290
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Run</span></th>
|
286
291
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
287
292
|
</tr>
|
288
|
-
<tr>
|
289
|
-
<td style="padding:15px">npm run adapter:install</td>
|
290
|
-
<td style="padding:15px">Provides an easier way to install the adapter.</td>
|
291
|
-
</tr>
|
292
293
|
<tr>
|
293
294
|
<td style="padding:15px">npm run adapter:checkMigrate</td>
|
294
295
|
<td style="padding:15px">Checks whether your adapter can and should be migrated to the latest foundation.</td>
|
package/SUMMARY.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
## Overview
|
2
2
|
|
3
|
-
This adapter is used to integrate the Itential
|
3
|
+
This adapter is used to integrate the Itential Platform with the Microsoft_graph System. The API that was used to build the adapter for Microsoft_graph is usually available in the report directory of this adapter. The adapter utilizes the Microsoft_graph API to provide the integrations that are deemed pertinent to Itential Platform. The ReadMe file is intended to provide information on this adapter it is generated from various other Markdown files.
|
4
4
|
|
5
5
|
>**Note**: It is possible that some integrations will be supported through the Microsoft_graph adapter while other integrations will not. If you need additional API calls, you can use the Update capabilities provided by the Adapter Builder or request Itential to add them if the Adapter is an Itential opensourced adapter.
|
6
6
|
|
7
7
|
Itential provides information on all of its product adapters in the Customer Knowledge Base. Information in the <a href="https://itential.atlassian.net/servicedesk/customer/portals" target="_blank">Customer Knowledge Base</a> is consistently maintained and goes through documentation reviews. As a result, it should be the first place to go for information.
|
8
8
|
|
9
|
-
For opensourced and custom built adapters, the ReadMe is a starting point to understand what you have built, provide the information for you to be able to update the adapter, and assist you with deploying the adapter into
|
9
|
+
For opensourced and custom built adapters, the ReadMe is a starting point to understand what you have built, provide the information for you to be able to update the adapter, and assist you with deploying the adapter into Itential Platform.
|
package/SYSTEMINFO.md
CHANGED
@@ -13,7 +13,7 @@ We classify Microsoft Graph into the Cloud domain as Microsoft Graph serves as a
|
|
13
13
|
"It provides a unified programmability model that you can use to access the tremendous amount of data in Microsoft 365, Windows, and Enterprise Mobility + Security."
|
14
14
|
|
15
15
|
## Why Integrate
|
16
|
-
The Microsoft Graph adapter from Itential is used to integrate the Itential
|
16
|
+
The Microsoft Graph adapter from Itential is used to integrate the Itential Platform with Microsoft Graph. With this adapter you have the ability to perform operations such as:
|
17
17
|
|
18
18
|
- Build apps for organizations and consumers.
|
19
19
|
- AzureAD
|
package/TAB1.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Overview
|
2
2
|
|
3
|
-
This adapter is used to integrate the Itential
|
3
|
+
This adapter is used to integrate the Itential Platform with the Microsoft_graph System. The API that was used to build the adapter for Microsoft_graph is usually available in the report directory of this adapter. The adapter utilizes the Microsoft_graph API to provide the integrations that are deemed pertinent to Itential Platform. The ReadMe file is intended to provide information on this adapter it is generated from various other Markdown files.
|
4
4
|
|
5
5
|
## Details
|
6
|
-
The Microsoft Graph adapter from Itential is used to integrate the Itential
|
6
|
+
The Microsoft Graph adapter from Itential is used to integrate the Itential Platform with Microsoft Graph. With this adapter you have the ability to perform operations such as:
|
7
7
|
|
8
8
|
- Build apps for organizations and consumers.
|
9
9
|
- AzureAD
|
package/TAB2.md
CHANGED
@@ -11,16 +11,18 @@
|
|
11
11
|
## Specific Adapter Information
|
12
12
|
### Authentication
|
13
13
|
|
14
|
-
This document will go through the steps for authenticating the Microsoft Graph adapter with OAuth Authentication. Properly configuring the properties for an adapter in
|
14
|
+
This document will go through the steps for authenticating the Microsoft Graph adapter with OAuth Authentication. Properly configuring the properties for an adapter in Itential Platform 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
15
|
|
16
16
|
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.
|
17
17
|
|
18
18
|
#### OAuth Authentication
|
19
19
|
The Microsoft Graph adapter requires OAuth Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
|
20
20
|
|
21
|
+
You will need to register an application with the <a href="https://learn.microsoft.com/en-us/graph/auth-register-app-v2" target="_blank">Microsoft identity platform</a>. After registering the application, you will be given an Application (client) ID and a Directory (tenant) ID. Then you need to click "add cert or secret" to create the client secret. This information will then be inserted into the adapter service instance configuration.
|
22
|
+
|
21
23
|
STEPS
|
22
24
|
1. Ensure you have access to a Microsoft Graph server and that it is running
|
23
|
-
2. Follow the steps in the README.md to import the adapter into
|
25
|
+
2. Follow the steps in the README.md to import the adapter into Itential Platform if you have not already done so
|
24
26
|
3. Use the properties below for the ```properties.authentication``` field. Note that the token_URI_path has a variable which should be replaced with a valid tenant value
|
25
27
|
```json
|
26
28
|
"authentication": {
|
@@ -56,8 +58,8 @@ STEPS
|
|
56
58
|
|
57
59
|
#### Troubleshooting
|
58
60
|
- Make sure you copied over the correct client_id and client_secret.
|
59
|
-
- Turn on debug level logs for the adapter in
|
60
|
-
- Turn on auth_logging for the adapter in
|
61
|
+
- Turn on debug level logs for the adapter in Itential Platform Admin Essentials.
|
62
|
+
- Turn on auth_logging for the adapter in Itential Platform Admin Essentials (adapter properties).
|
61
63
|
- Investigate the logs - in particular:
|
62
64
|
- The FULL REQUEST log to make sure the proper headers are being sent with the request.
|
63
65
|
- The FULL BODY log to make sure the payload is accurate.
|
@@ -67,11 +69,11 @@ STEPS
|
|
67
69
|
|
68
70
|
### Sample Properties
|
69
71
|
|
70
|
-
Sample Properties can be used to help you configure the adapter in the Itential
|
72
|
+
Sample Properties can be used to help you configure the adapter in the Itential Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
|
71
73
|
|
72
74
|
```json
|
73
75
|
"properties": {
|
74
|
-
"host": "
|
76
|
+
"host": "graph.microsoft.com",
|
75
77
|
"port": 443,
|
76
78
|
"base_path": "/",
|
77
79
|
"choosepath": "",
|
@@ -94,14 +96,14 @@ Sample Properties can be used to help you configure the adapter in the Itential
|
|
94
96
|
"auth_field": "header.headers.Authorization",
|
95
97
|
"auth_field_format": "Bearer {token}",
|
96
98
|
"auth_logging": false,
|
97
|
-
"client_id": "",
|
98
|
-
"client_secret": "",
|
99
|
+
"client_id": "clientid",
|
100
|
+
"client_secret": "clientsecret",
|
99
101
|
"grant_type": "client_credentials",
|
100
102
|
"sensitive": [],
|
101
103
|
"sso": {
|
102
|
-
"protocol": "",
|
103
|
-
"host": "",
|
104
|
-
"port":
|
104
|
+
"protocol": "https",
|
105
|
+
"host": "login.microsoftonline.com",
|
106
|
+
"port": 443
|
105
107
|
},
|
106
108
|
"multiStepAuthCalls": [
|
107
109
|
{
|
@@ -167,18 +169,22 @@ Sample Properties can be used to help you configure the adapter in the Itential
|
|
167
169
|
"enabled": false,
|
168
170
|
"accept_invalid_cert": false,
|
169
171
|
"ca_file": "",
|
172
|
+
"ca_file_content": "",
|
170
173
|
"key_file": "",
|
171
174
|
"cert_file": "",
|
172
175
|
"secure_protocol": "",
|
173
176
|
"ciphers": ""
|
174
177
|
},
|
175
178
|
"mongo": {
|
179
|
+
"url": "",
|
176
180
|
"host": "",
|
177
181
|
"port": 0,
|
178
182
|
"database": "",
|
183
|
+
"dbAuth": false,
|
179
184
|
"username": "",
|
180
185
|
"password": "",
|
181
186
|
"replSet": "",
|
187
|
+
"addSrv": false,
|
182
188
|
"db_ssl": {
|
183
189
|
"enabled": false,
|
184
190
|
"accept_invalid_cert": false,
|
package/TROUBLESHOOT.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Troubleshoot
|
2
2
|
|
3
|
-
Run `npm run troubleshoot` to start the interactive troubleshooting process. The command allows you to verify and update connection, authentication as well as healthcheck configuration. After that it will test these properties by sending HTTP request to the endpoint. If the tests pass, it will persist these changes into
|
3
|
+
Run `npm run troubleshoot` to start the interactive troubleshooting process. The command allows you to verify and update connection, authentication as well as healthcheck configuration. After that it will test these properties by sending HTTP request to the endpoint. If the tests pass, it will persist these changes into Itential Platform.
|
4
4
|
|
5
5
|
You also have the option to run individual commands to perform specific test:
|
6
6
|
|
@@ -45,3 +45,12 @@ Go into the Itential Platform GUI and verify/update the properties
|
|
45
45
|
### Functional Issues
|
46
46
|
|
47
47
|
Adapter logs are located in `/var/log/pronghorn`. In older releases of the Itential Platform, there is a `pronghorn.log` file which contains logs for all of the Itential Platform. In newer versions, adapters can be configured to log into their own files.
|
48
|
+
|
49
|
+
### Adapter Results
|
50
|
+
|
51
|
+
The majority of the http response codes from the adapter come directly from the downstream system. There are some exceptions to this:
|
52
|
+
|
53
|
+
1. Timeout (-2): There is an attempt timeout property that defines how long the adapter should wait to receive a response before giving up. If that time expires before a resonse is received the adapter will respond with a code of -2. The message will say "The Adapter has run out of time for the request" and it will recommend that you "Increase your adapter request.attempt_timeout property".
|
54
|
+
2. Econnreset (-1): When the downstream system or something within the network drops the connection, the adapter will receive and forward an ECONNRESET error with a -1 code. The message will say "The connection was terminated by the network or external system" and the recommendation will be for you to "Check connectivity to the external system and that the system is up".
|
55
|
+
|
56
|
+
The adapter will also have various errors if it is unable to build the request. All of these errors come with messages and recommendations to help you understand what you need to do to resolve the issue.
|