Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(IAM Identity): Add support for IAM enterprise #216

Merged
merged 5 commits into from
Sep 5, 2023

Conversation

michaelbeck
Copy link
Contributor

@michaelbeck michaelbeck commented Jul 31, 2023

PR summary

Added support for IAM enterprise feature. Enterprise admins can create templates for account settings and trusted profiles and assign them to accounts and account groups in the enterprise.

PR Checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Current vs new behavior

SDK adopters will be able to work with IAM enterprise feature.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

API definition: Staging

Test information:

Unit tests:

 npm run test-unit

> @ibm-cloud/[email protected] test-unit
> npm run build && jest test/unit/


> @ibm-cloud/[email protected] build
> tsc && cp package.json dist/

PASS test/unit/iam-policy-management.v1.test.js (12.74 s)
PASS test/unit/catalog-management.v1.test.js (13.133 s)
PASS test/unit/context-based-restrictions.v1.test.js
PASS test/unit/global-catalog.v1.test.js
PASS test/unit/global-tagging.v1.test.js
PASS test/unit/open-service-broker.v1.test.js
PASS test/unit/resource-manager.v2.test.js
PASS test/unit/global-search.v2.test.js
PASS test/unit/usage-metering.v4.test.js
PASS test/unit/iam-identity.v1.test.js (15.446 s)
PASS test/unit/ibm-cloud-shell.v1.test.js
PASS test/unit/common.test.js
PASS test/unit/enterprise-usage-reports.v1.test.js (17.479 s)
PASS test/unit/user-management.v1.test.js (17.499 s)
PASS test/unit/case-management.v1.test.js (17.506 s)
PASS test/unit/enterprise-billing-units.v1.test.js (17.587 s)
PASS test/unit/iam-access-groups.v2.test.js (17.669 s)
PASS test/unit/usage-reports.v4.test.js (17.717 s)
PASS test/unit/enterprise-management.v1.test.js (17.798 s)
PASS test/unit/resource-controller.v2.test.js (18.308 s)
----------------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------
File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------
All files                   |   98.61 |    88.15 |     100 |   98.58 |
 case-management            |    98.8 |    88.46 |     100 |   98.78 |
  v1.ts                     |    98.8 |    88.46 |     100 |   98.78 | 129,1246,1269
 catalog-management         |     100 |       98 |     100 |     100 |
  v1.ts                     |     100 |       98 |     100 |     100 | 86,4576
 context-based-restrictions |   98.42 |    88.09 |     100 |   98.42 |
  v1.ts                     |   98.42 |    88.09 |     100 |   98.42 | 142,499,580
 enterprise-billing-units   |    96.4 |    79.06 |     100 |   96.15 |
  v1.ts                     |    96.4 |    79.06 |     100 |   96.15 | 185,594,617,676,699
 enterprise-management      |   96.97 |     79.1 |     100 |   96.84 |
  v1.ts                     |   96.97 |     79.1 |     100 |   96.84 | 209,548,854,1473,1496,1555,1578,1637,1660
 enterprise-usage-reports   |   95.89 |    78.57 |     100 |   95.58 |
  v1.ts                     |   95.89 |    78.57 |     100 |   95.58 | 147,388,411
 global-catalog             |     100 |    94.28 |     100 |     100 |
  v1.ts                     |     100 |    94.28 |     100 |     100 | 88,1166
 global-search              |   98.18 |     87.5 |     100 |   98.14 |
  v2.ts                     |   98.18 |     87.5 |     100 |   98.14 | 180
 global-tagging             |   98.54 |    92.15 |     100 |   98.52 |
  v1.ts                     |   98.54 |    92.15 |     100 |   98.52 | 162,309
 iam-access-groups          |   98.74 |    86.66 |     100 |    98.7 |
  v2.ts                     |   98.74 |    86.66 |     100 |    98.7 | 2113,2136,2194,2217
 iam-identity               |   99.05 |    93.52 |     100 |   99.05 |
  v1.ts                     |   99.05 |    93.52 |     100 |   99.05 | 147,284,612,2485,2799,2859,3541,3855,3924
 iam-policy-management      |   99.61 |    95.52 |     100 |   99.61 |
  v1.ts                     |   99.61 |    95.52 |     100 |   99.61 | 651
 ibm-cloud-shell            |     100 |     92.3 |     100 |     100 |
  v1.ts                     |     100 |     92.3 |     100 |     100 | 83
 lib                        |     100 |      100 |     100 |     100 |
  common.ts                 |     100 |      100 |     100 |     100 |
 open-service-broker        |     100 |    94.44 |     100 |     100 |
  v1.ts                     |     100 |    94.44 |     100 |     100 | 83
 resource-controller        |   96.79 |    79.41 |     100 |   96.62 |
  v2.ts                     |   96.79 |    79.41 |     100 |   96.62 | 155,787,1092,1405,1757,2746,2769,2828,2851,2910,2933,2992,3015,3074,3097,3156,3179,3238,3261
 resource-manager           |     100 |    93.33 |     100 |     100 |
  v2.ts                     |     100 |    93.33 |     100 |     100 | 85
 usage-metering             |     100 |    91.66 |     100 |     100 |
  v4.ts                     |     100 |    91.66 |     100 |     100 | 87
 usage-reports              |    97.2 |    82.25 |     100 |   97.02 |
  v4.ts                     |    97.2 |    82.25 |     100 |   97.02 | 1187,1210,1271,1294,1352,1375
 user-management            |    98.2 |    82.85 |     100 |   98.14 |
  v1.ts                     |    98.2 |    82.85 |     100 |   98.14 | 483,1003,1026
----------------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------

Test Suites: 20 passed, 20 total
Tests:       1305 passed, 1305 total
Snapshots:   0 total
Time:        20.694 s
Ran all test suites matching /test\\unit\\/i.

Integration Tests:

--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                                                                                                                                                                                                                                        
--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
All files     |   92.42 |    55.29 |     100 |   92.41 |                                                                                                                                                                                                                                                                                                          
 iam-identity |   92.34 |    55.29 |     100 |   92.33 |                                                                                                                                                                                                                                                                                                          
  v1.ts       |   92.34 |    55.29 |     100 |   92.33 | 69,89,147,227,284,339,403,460,503,546,612,685,744,812,872,915,959,1007,1077,1134,1195,1252,1312,1373,1422,1496,1560,1606,1662,1711,1761,1803,1859,1937,2001,2057,2108,2225,2297,2353,2409,2485,2549,2606,2663,2721,2799,2859,2916,2973,3033,3105,3168,3243,3307,3355,3408,3465,3541,3605,3662,3719,3777,3855,3924,3982,4039,4099,4174,4238,4316,4381,4429
 lib          |     100 |      100 |     100 |     100 |                                                                                                                                                                                                                                                                                                          
  common.ts   |     100 |      100 |     100 |     100 |                                                                                                                                                                                                                                                                                                          
--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Test Suites: 1 passed, 1 total
Tests:       63 passed, 63 total
Snapshots:   0 total
Time:        408.768 s
Ran all test suites matching /test\\integration\\iam-identity.v1.test.js/i.

Examples:

--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                                                                                                                                                                                                                                      
--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
All files     |   92.42 |    55.29 |     100 |   92.41 |                                                                                                                                                                                                                                                                                                        
 iam-identity |   92.34 |    55.29 |     100 |   92.33 |                                                                                                                                                                                                                                                                                                        
  v1.ts       |   92.34 |    55.29 |     100 |   92.33 | 69,89,147,227,284,339,403,460,503,546,612,685,744,812,872,915,959,1007,1077,1134,1195,1252,1312,1373,1422,1496,1560,1606,1662,1711,1761,1803,1859,1937,2001,2057,2108,2225,2297,2353,2409,2485,2549,2606,2663,2721,2799,2859,2916,2973,3033,3105,3168,3243,3307,3355,3408,3465,3541,3605,3662,3719,3777,3855,3924,3982,4039,4099,4174,4238,4316,4381,4429
 lib          |     100 |      100 |     100 |     100 |                                                                                                                                                                                                                                                                                                        
  common.ts   |     100 |      100 |     100 |     100 |                                                                                                                                                                                                                                                                                                        
--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Test Suites: 1 passed, 1 total
Tests:       43 passed, 43 total
Snapshots:   0 total
Time:        391.548 s
Ran all test suites matching /examples\\iam-identity.v1.test.js/i.

@CLAassistant
Copy link

CLAassistant commented Jul 31, 2023

CLA assistant check
All committers have signed the CLA.

@michaelbeck michaelbeck force-pushed the issue-6829 branch 2 times, most recently from 3dae663 to fda4384 Compare August 2, 2023 13:17
@padamstx
Copy link
Member

padamstx commented Aug 2, 2023

Looks like the Travis build for your PR failed due to linter errors.
To automatically fix linter errors, run npm run lint-fix.

Be sure to run npm run all to unit test and lint-check the project (similar to what the Travis build does).

@padamstx padamstx self-assigned this Aug 2, 2023
@michaelbeck
Copy link
Contributor Author

@padamstx
npm run all only showed 2 warnings which I ignored as these are expected since the assertions are inside the called methods:

  1593:3  warning  Test has no assertions  jest/expect-expect
  1863:3  warning  Test has no assertions  jest/expect-expect

Or do I need to add dummy assertions just to calm down the linter?

@michaelbeck
Copy link
Contributor Author

Had to regenerate the SDK to pull in latest changes from the API docs.

Here the new test results:
Integration Tests:

--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                                                                                                                                                                                                                                          
--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
All files     |   92.42 |    55.29 |     100 |   92.41 |                                                                                                                                                                                                                                                                                                            
 iam-identity |   92.34 |    55.29 |     100 |   92.33 |                                                                                                                                                                                                                                                                                                            
  v1.ts       |   92.34 |    55.29 |     100 |   92.33 | 69,89,147,227,284,339,403,460,503,546,612,685,744,812,872,915,959,1007,1077,1134,1195,1252,1312,1373,1422,1496,1560,1606,1662,1711,1761,1803,1859,1937,2001,2057,2108,2227,2299,2355,2411,2487,2551,2608,2666,2724,2802,2864,2921,2979,3039,3113,3176,3253,3317,3365,3418,3475,3551,3615,3672,3729,3787,3865,3937,3995,4053,4113,4191,4255,4336,4402,4450
 lib          |     100 |      100 |     100 |     100 |                                                                                                                                                                                                                                                                                                            
  common.ts   |     100 |      100 |     100 |     100 |                                                                                                                                                                                                                                                                                                            
--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Test Suites: 1 passed, 1 total
Tests:       63 passed, 63 total
Snapshots:   0 total
Time:        431.116 s

Examples:

--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                                                                                                                                                                                                                                            
--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
All files     |   92.42 |    55.29 |     100 |   92.41 |                                                                                                                                                                                                                                                                                                              
 iam-identity |   92.34 |    55.29 |     100 |   92.33 |                                                                                                                                                                                                                                                                                                              
  v1.ts       |   92.34 |    55.29 |     100 |   92.33 | 69,89,147,227,284,339,403,460,503,546,612,685,744,812,872,915,959,1007,1077,1134,1195,1252,1312,1373,1422,1496,1560,1606,1662,1711,1761,1803,1859,1937,2001,2057,2108,2227,2299,2355,2411,2487,2551,2608,2666,2724,2802,2864,2921,2979,3039,3113,3176,3253,3317,3365,3418,3475,3551,3615,3672,3729,3787,3865,3937,3995,4053,4113,4191,4255,4336,4402,4450
 lib          |     100 |      100 |     100 |     100 |                                                                                                                                                                                                                                                                                                              
  common.ts   |     100 |      100 |     100 |     100 |                                                                                                                                                                                                                                                                                                              
--------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Test Suites: 1 passed, 1 total
Tests:       43 passed, 43 total
Snapshots:   0 total
Time:        423.649 s
Ran all test suites matching /examples\\iam-identity.v1.test.js/i.

@michaelbeck
Copy link
Contributor Author

With the latest push I also fixed the warnings:

npm run all

> @ibm-cloud/[email protected] all
> npm run test-unit && npm run lint


> @ibm-cloud/[email protected] test-unit
> npm run build && jest test/unit/


> @ibm-cloud/[email protected] build
> tsc && cp package.json dist/

PASS test/unit/iam-policy-management.v1.test.js
PASS test/unit/iam-identity.v1.test.js
PASS test/unit/catalog-management.v1.test.js
PASS test/unit/context-based-restrictions.v1.test.js
PASS test/unit/global-catalog.v1.test.js
PASS test/unit/open-service-broker.v1.test.js
PASS test/unit/resource-manager.v2.test.js
PASS test/unit/global-tagging.v1.test.js
PASS test/unit/ibm-cloud-shell.v1.test.js
PASS test/unit/usage-metering.v4.test.js
PASS test/unit/common.test.js
PASS test/unit/global-search.v2.test.js
PASS test/unit/enterprise-usage-reports.v1.test.js (7.359 s)
PASS test/unit/user-management.v1.test.js (7.406 s)
PASS test/unit/enterprise-billing-units.v1.test.js (7.507 s)
PASS test/unit/case-management.v1.test.js (7.481 s)
PASS test/unit/iam-access-groups.v2.test.js (7.55 s)
PASS test/unit/usage-reports.v4.test.js (7.679 s)
PASS test/unit/enterprise-management.v1.test.js (7.734 s)
PASS test/unit/resource-controller.v2.test.js (8.235 s)
----------------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------
File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------
All files                   |   98.61 |    88.15 |     100 |   98.58 |
 case-management            |    98.8 |    88.46 |     100 |   98.78 |
  v1.ts                     |    98.8 |    88.46 |     100 |   98.78 | 129,1246,1269
 catalog-management         |     100 |       98 |     100 |     100 |
  v1.ts                     |     100 |       98 |     100 |     100 | 86,4576
 context-based-restrictions |   98.42 |    88.09 |     100 |   98.42 |
  v1.ts                     |   98.42 |    88.09 |     100 |   98.42 | 142,499,580
 enterprise-billing-units   |    96.4 |    79.06 |     100 |   96.15 |
  v1.ts                     |    96.4 |    79.06 |     100 |   96.15 | 185,594,617,676,699
 enterprise-management      |   96.97 |     79.1 |     100 |   96.84 |
  v1.ts                     |   96.97 |     79.1 |     100 |   96.84 | 209,548,854,1473,1496,1555,1578,1637,1660
 enterprise-usage-reports   |   95.89 |    78.57 |     100 |   95.58 |
  v1.ts                     |   95.89 |    78.57 |     100 |   95.58 | 147,388,411
 global-catalog             |     100 |    94.28 |     100 |     100 |
  v1.ts                     |     100 |    94.28 |     100 |     100 | 88,1166
 global-search              |   98.18 |     87.5 |     100 |   98.14 |
  v2.ts                     |   98.18 |     87.5 |     100 |   98.14 | 180
 global-tagging             |   98.54 |    92.15 |     100 |   98.52 |
  v1.ts                     |   98.54 |    92.15 |     100 |   98.52 | 162,309
 iam-access-groups          |   98.74 |    86.66 |     100 |    98.7 |
  v2.ts                     |   98.74 |    86.66 |     100 |    98.7 | 2113,2136,2194,2217
 iam-identity               |   99.05 |    93.52 |     100 |   99.05 |
  v1.ts                     |   99.05 |    93.52 |     100 |   99.05 | 147,284,612,2487,2802,2864,3551,3865,3937
 iam-policy-management      |   99.61 |    95.52 |     100 |   99.61 |
  v1.ts                     |   99.61 |    95.52 |     100 |   99.61 | 651
 ibm-cloud-shell            |     100 |     92.3 |     100 |     100 |
  v1.ts                     |     100 |     92.3 |     100 |     100 | 83
 lib                        |     100 |      100 |     100 |     100 |
  common.ts                 |     100 |      100 |     100 |     100 |
 open-service-broker        |     100 |    94.44 |     100 |     100 |
  v1.ts                     |     100 |    94.44 |     100 |     100 | 83
 resource-controller        |   96.79 |    79.41 |     100 |   96.62 |
  v2.ts                     |   96.79 |    79.41 |     100 |   96.62 | 155,787,1092,1405,1757,2746,2769,2828,2851,2910,2933,2992,3015,3074,3097,3156,3179,3238,3261
 resource-manager           |     100 |    93.33 |     100 |     100 |
  v2.ts                     |     100 |    93.33 |     100 |     100 | 85
 usage-metering             |     100 |    91.66 |     100 |     100 |
  v4.ts                     |     100 |    91.66 |     100 |     100 | 87
 usage-reports              |    97.2 |    82.25 |     100 |   97.02 |
  v4.ts                     |    97.2 |    82.25 |     100 |   97.02 | 1187,1210,1271,1294,1352,1375
 user-management            |    98.2 |    82.85 |     100 |   98.14 |
  v1.ts                     |    98.2 |    82.85 |     100 |   98.14 | 483,1003,1026
----------------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------

Test Suites: 20 passed, 20 total
Tests:       1305 passed, 1305 total
Snapshots:   0 total
Time:        9.595 s, estimated 18 s
Ran all test suites matching /test\\unit\\/i.

> @ibm-cloud/[email protected] lint
> npm run eslint:check


> @ibm-cloud/[email protected] eslint:check
> eslint . --cache

Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@padamstx padamstx merged commit 9fe5fb9 into IBM:main Sep 5, 2023
ibm-devx-sdk pushed a commit that referenced this pull request Sep 5, 2023
# [0.40.0](v0.39.1...v0.40.0) (2023-09-05)

### Features

* **IAM Identity:** add support for IAM enterprise ([#216](#216)) ([9fe5fb9](9fe5fb9))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 0.40.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants