@itentialopensource/adapter-terraform_enterprise 0.2.0 → 0.3.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 (45) hide show
  1. package/AUTH.md +11 -14
  2. package/CALLS.md +575 -22
  3. package/CHANGELOG.md +16 -0
  4. package/CONTRIBUTING.md +1 -160
  5. package/ENHANCE.md +2 -2
  6. package/README.md +32 -23
  7. package/SUMMARY.md +1 -1
  8. package/SYSTEMINFO.md +15 -6
  9. package/adapter.js +157 -329
  10. package/adapterBase.js +549 -879
  11. package/changelogs/CHANGELOG.md +52 -0
  12. package/metadata.json +61 -0
  13. package/package.json +24 -24
  14. package/pronghorn.json +470 -138
  15. package/propertiesSchema.json +431 -31
  16. package/refs?service=git-upload-pack +0 -0
  17. package/report/adapter-openapi.json +3984 -0
  18. package/report/adapter-openapi.yaml +2861 -0
  19. package/report/adapterInfo.json +8 -8
  20. package/report/updateReport1691507498223.json +120 -0
  21. package/report/updateReport1692202520108.json +120 -0
  22. package/report/updateReport1694461356284.json +120 -0
  23. package/report/updateReport1698420765161.json +120 -0
  24. package/sampleProperties.json +63 -2
  25. package/test/integration/adapterTestBasicGet.js +2 -4
  26. package/test/integration/adapterTestConnectivity.js +91 -42
  27. package/test/integration/adapterTestIntegration.js +130 -2
  28. package/test/unit/adapterBaseTestUnit.js +388 -313
  29. package/test/unit/adapterTestUnit.js +338 -112
  30. package/utils/adapterInfo.js +1 -1
  31. package/utils/addAuth.js +1 -1
  32. package/utils/artifactize.js +1 -1
  33. package/utils/checkMigrate.js +1 -1
  34. package/utils/entitiesToDB.js +2 -2
  35. package/utils/findPath.js +1 -1
  36. package/utils/methodDocumentor.js +273 -0
  37. package/utils/modify.js +13 -15
  38. package/utils/packModificationScript.js +1 -1
  39. package/utils/pre-commit.sh +2 -0
  40. package/utils/taskMover.js +309 -0
  41. package/utils/tbScript.js +89 -34
  42. package/utils/tbUtils.js +41 -21
  43. package/utils/testRunner.js +1 -1
  44. package/utils/troubleshootingAdapter.js +9 -6
  45. package/workflows/README.md +0 -3
package/AUTH.md CHANGED
@@ -1,31 +1,27 @@
1
1
  ## Authenticating TerraformEnterprise Adapter
2
2
 
3
- This document will go through the steps for authenticating the TerraformEnterprise 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://www.itential.com/automation-platform/integrations/adapters-resources/authentication/" target="_blank">HERE</a>.
3
+ This document will go through the steps for authenticating the Terraform Enterprise adapter with the authentication methods we have worked with in the past. 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 TerraformEnterprise adapter requires Basic Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
5
+ ### Static Token
6
+ The Terraform Enterprise adapter authenticates with a static token. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
7
7
 
8
8
  STEPS
9
- 1. Ensure you have access to a TerraformEnterprise server and that it is running
9
+ 1. Ensure you have access to a Terraform Enterprise server and that it is running
10
10
  2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
11
11
  3. Use the properties below for the ```properties.authentication``` field
12
12
  ```json
13
13
  "authentication": {
14
- "auth_method": "basic user_password",
15
- "username": "<username>",
16
- "password": "<password>",
17
- "token": "",
18
- "token_timeout": 1800000,
14
+ "auth_method": "static_token",
15
+ "token": "token",
16
+ "token_timeout": 0,
19
17
  "token_cache": "local",
20
- "invalid_token_error": 401,
21
18
  "auth_field": "header.headers.Authorization",
22
- "auth_field_format": "Basic {b64}{username}:{password}{/b64}",
19
+ "auth_field_format": "Bearer {token}",
23
20
  "auth_logging": false,
24
- "client_id": "",
25
- "client_secret": "",
26
- "grant_type": ""
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.
24
+
29
25
  4. Restart the adapter. If your properties were set correctly, the adapter should go online.
30
26
 
31
27
  ### Troubleshooting
@@ -36,4 +32,5 @@ STEPS
36
32
  - The FULL REQUEST log to make sure the proper headers are being sent with the request.
37
33
  - The FULL BODY log to make sure the payload is accurate.
38
34
  - The CALL RETURN log to see what the other system is telling us.
35
+ - 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.
39
36
  - Remember when you are done to turn auth_logging off as you do not want to log credentials.